";
}
println "";
}
function Page::print() {
var string title = $this->title();
"""\n\n""";
if ($*external_stylesheet) {
println """""";
} else {
println """";
}
$this->print_head();
""+$this->title()+"";
"""
""";
if ($*opt_navbar_pos == "left") {
$this->lay_navbar();
}
"
\n";
$this->print_body();
"
\n";
if ($*opt_navbar_pos == "right") {
$this->lay_navbar();
}
"
";
$this->lay_page_nav();
"
";
"""
""";
}
function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor) {
var string datetime;
if ($p.view != "day") {
$datetime = $e.time->date_format("med_day")+", "+$e.time->time_format();
} else {
$datetime = $e.time->time_format();
}
if (not (defined $bgcolor) or not $*opt_friends_colors) {
$bgcolor = $*clr_boxhead_back;
}
if (not (defined $fgcolor) or not $*opt_friends_colors) {
$fgcolor = $*clr_boxhead_text;
}
"""
$datetime """;
if ($e.security != "") {
print """""";
}
if ($p.view == "friends" or
$e.subject != "" or
$e.poster.username != $p.journal.username) {
print " ";
if ($p.view == "friends" or $e.poster.username != $p.journal.username) {
$p->print_entry_poster($e);
print ": ";
}
print $e.subject;
}
"
\n
\n";
if (defined $e.userpic and (
$*opt_always_userpic
or ($e.poster.username != $p.journal.username and $e.userpic.url != $p.journal.default_pic.url)
or $p.view == "friends"
or $p.view == "entry")) {
"""\n""";
}
"$e.text";
$e->print_metadata();
"""
";
}
function Page::print_entry(Entry e) {
print_entry($this, $e, null Color, null Color);
}
function FriendsPage::print_entry(Entry e) {
var Friend f = $.friends{$e.journal.username};
print_entry($this, $e, $f.bgcolor, $f.fgcolor);
}
function colored_ljuser(UserLite u, Color fg, Color bg) : string {
var Image uiimg = userinfoicon($u);
var string dir = $u.journal_type == "C" ? "community" : "users";
return """$u.username""";
}
function FriendsPage::print_entry_poster(Entry e) {
var Friend f = $.friends{$e.journal.username};
var Color fg; var Color bg;
if ($*opt_friends_colors) {
$fg = $f.fgcolor;
$bg = $f.bgcolor;
} else {
$fg = $*clr_boxhead_text;
$bg = $*clr_boxhead_back;
}
print colored_ljuser($e.poster, $fg, $bg);
if ($e.poster.username != $e.journal.username) {
" posting in ";
print colored_ljuser($e.journal, $fg, $bg);
}
}
function RecentPage::print_body() {
foreach var Entry e ($.entries) {
$this->print_entry($e);
}
}
function CommentInfo::print() {
if ($.enabled) {
$this->print_postlink();
if ($.count > 0 or $.screened) {
" | ";
$this->print_readlink();
}
}
}
function DayPage::print_body() {
println """
"""+$.date->date_format("long")+"
";
if (not $.has_entries) {
print "
$*text_noentries_day
";
return;
}
foreach var Entry e ($.entries) {
$this->print_entry($e);
}
}
function EntryPage::print_body() {
$this->print_entry($.entry);
if ($this.multiform_on) {
$this->print_multiform_start();
}
if ($.entry.comments.enabled) {
$this->print_comments($.comments);
}
if ($this.multiform_on) {
"
Mass Action on Selected Comments:
";
"
"; $this->print_multiform_actionline(); "
";
"
";
$this->print_multiform_end();
}
}
function EntryPage::print_comments(Comment[] cs) {
if (size $cs == 0) { return; }
print "
";
foreach var Comment c ($cs) {
var int indent = ($c.depth - 1) * 25;
if ($c.full) {
$this->print_comment($c);
} else {
$this->print_comment_partial($c);
}
}
print "
";
}
function EntryPage::print_comment(Comment c) {
var string datetime;
$datetime = $c.time->date_format("med_day")+", "+$c.time->time_format();
"""
""";
if ($c.metadata{"poster_ip"}) { print """
(""" +
$c.metadata{"poster_ip"} +
""")
"""; }
print $datetime;
if (defined $c.subject_icon) {
print """""";
}
var string poster = defined $c.poster ? $c.poster->as_string() : "(Anonymous)";
print " "+$poster;
if ($c.subject != "") {
print ": "+$c.subject;
}
"
\n
\n";
if (defined $c.userpic and $*comment_userpic_style != "off") {
"""\n""";
}
"$c.text
""";
$this->print_comments($c.replies);
}
function ReplyPage::print_body() {
var EntryLite c = $.replyto;
var string datetime;
$datetime = $c.time->date_format("med_day")+", "+$c.time->time_format();
"""
$datetime """;
var string poster = defined $c.poster ? $c.poster->as_string() : "(Anonymous)";
print " "+$poster;
if ($c.subject != "") {
print ": "+$c.subject;
}
"
\n
\n";
if (defined $c.userpic and $*comment_userpic_style != "off") {
"""\n""";
}
"$c.text
";
if (defined $c.userpic and $*comment_userpic_style != "off") {
""" """;
}
"
";
"""
\n""";
$.form->print();
"
\n";
}
function YearPage::print_body {
foreach var YearMonth m ($.months) {
$this->print_month($m);
}
}
function YearPage::print_month(YearMonth m) {
if (not $m.has_entries) { return; }
"""
\n
""";
print $m->month_format();
"""
\n""";
foreach var int d (weekdays()) {
"
"+$*lang_dayname_short[$d]+"
\n";
}
"\n";
foreach var YearWeek w ($m.weeks) {
$w->print();
}
"""