in response to
daffidoll's
s2haven post.
set tags_aware = true;
set text_meta_mood = "Current Mood:";
set text_meta_music = "Current Music:";
function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor, bool viewing_thread) {
var string entry = "";
var string link_sep = " | ";
var string knock_entry = "Knock Entry";
var string unknock_entry = "Unknock Entry";
var string mark_entry = "Mark Entry";
var string tags_header = "Current Tags";
var string tags_joiner = ":";
var string loc_header = "Current Location:";
var Link edit_tags = $e->get_link("edit_tags");
var string id = "$e.journal.username$e.itemid";
var string skipped = $p.args{"skip"};
var string args = "?skip=$skipped&.skip=$skipped";
var string current_entry = "h_$id";
var string{} hideLink = $p.args;
var bool hidden = ($hideLink{$current_entry} == "y");
if($hidden) {
$hideLink{$current_entry} = "";
} else {
$args = $args + "&.$current_entry=y";
}
var string argvalue;
foreach var string arg ($hideLink) {
$argvalue = ($arg == "skip") ? "" : $hideLink{$arg};
if($argvalue != "") {
$args = $args + "&.$arg=$argvalue";
}
}
if($hidden) {
$hideLink{$current_entry} = "y";
}
var string hide_link_url = "$args#$id";
# Named anchor to link from page summary
$entry = $entry + """
""";
$entry = $entry + """
""";
var string subject = $e.subject != "" ? $e.subject : $*text_nosubject;
var string time = $e.time->time_format();
$entry = $entry + """
$e.security_icon $subject @ $time
""";
$entry = $entry + """
""";
if (($p.view == "friends" or
$e.poster.username != $e.journal.username or
($*show_entry_userpic and defined $e.userpic))) {
if ($p.view == "friends") {
if (defined $e.userpic) {
$entry = $entry + """
""";
}
if ($e.poster.username != $e.journal.username) {
$entry = $entry + $e.poster->as_string() + ", posting in ";
}
$entry = $entry + $e.journal->as_string() + ":
";
} elseif ($e.poster.username != $e.journal.username) {
if (defined $e.userpic) {
$entry = $entry + """
""";
}
$entry = $entry + $e.poster->as_string() + ":
";
} elseif (defined $e.userpic) {
$entry = $entry + """
""";
}
}
if(not $hidden) {
if ((size $e.metadata > 0) or ((size $e.tags > 0) and ($*tags_aware))){
$entry = $entry + """
""";
foreach var string k ($e.metadata) {
var string text = $k;
var string val = $e.metadata{$k};
if ($k == "mood") {
$text = $*text_meta_mood;
} elseif ($k == "music") {
$text = $*text_meta_music;
} elseif ($k == "location") {
$text = $loc_header;
}
if ($k == "mood" and defined $e.mood_icon) {
var Image i = $e.mood_icon;
$val = "
$val";
}
$entry = $entry + """
$text $val""";
}
if ((size $e.tags > 0) and $*tags_aware) {
if($edit_tags.url != "") {
$tags_header = """
$tags_header""";
}
$tags_header = "$tags_header$tags_joiner";
var int tcount = 0;
$entry = $entry + """
$tags_header """;
foreach var Tag t ($e.tags) {
$tcount++;
$entry = $entry + """
$t.name""";
if($tcount < size($e.tags)) {
$entry = $entry + ", ";
}
}
$entry = $entry + "
";
}
$entry = $entry + "
";
}
print $entry;
if (not $viewing_thread) {
$e->print_text();
}
$entry = "";
$entry = $entry + """
""";
}
$entry = $entry + "
";
# Comments
$entry = $entry + """
$*text_permalink""";
var Link l = new Link;
foreach var string ls ($e.link_keyseq) {
$l = $e->get_link($ls);
if (defined $l) {
$entry = $entry + $link_sep;
$entry = $entry + """
$l.caption """;
}
}
if($hidden) {
$entry = $entry + """
$link_sep
$unknock_entry""";
} else {
$entry = $entry + """
$link_sep
$knock_entry""";
}
$entry = $entry + """
$link_sep
$mark_entry""";
if ($e.comments.enabled and $p.view != "entry") {
if ($e.comments.count > 0 or $e.comments.screened) {
$entry = $entry + $link_sep;
$entry = $entry + """
""" +
get_plural_phrase($e.comments.count, "text_read_comments" + ($p.view == "friends" ? "_friends" : "")) +
"";
}
$entry = $entry + $link_sep;
$entry = $entry + """
""" +
get_plural_phrase(0, "text_post_comment" + ($p.view == "friends" ? "_friends" : "")) +
"";
}
$entry = $entry + "
";
$entry = $entry + """
""";
print $entry;
}
function RecentPage::lay_sidebar_view_summary() : string {
var string return;
foreach var Entry e ($.entries) {
var string subject = $e.subject != "" ? $e.subject : $*text_nosubject;
$return = $return + "→";
if ($e.security) { $return = $return + " $e.security_icon"; }
$return = $e.poster.username != $.journal.username ?
$return + """ $e.poster:
$subject""" :
$return + """
$subject""";
}
return $return;
}
function FriendsPage::lay_sidebar_view_summary() : string {
var string return;
foreach var Entry e ($.entries) {
var string poster = $e.poster.username != $e.journal.username ? $e.poster->as_string() + ", posting in " + $e.journal->as_string() : $e.journal->as_string();
var string subject = $e.subject != "" ? $e.subject : $*text_nosubject;
$return = $return + "→";
if ($e.security) { $return = $return + " $e.security_icon"; }
$return = $return + """ $poster:
$subject""";
}
return $return;
}