layerinfo type = "layout"; layerinfo name = "Bloggish"; layerinfo redist_uniq = "sixhtml/layout"; layerinfo previews = "sixhtml/layout.jpg"; layerinfo des = "SixApart's standard HTML structure for blogs, to be styled with CSS."; propgroup presentation { # This property is now set in a theme layer, but default is still Powell Street property string base_theme { des = "Base Theme"; noui = 1; } set base_theme = "powell-street"; # The colors for the default theme set theme_bgcolor = "#e7e7ec"; set theme_fgcolor = "#333333"; set theme_bordercolor = "#bbbbbb"; set theme_linkcolor = "#598a92"; property string layout_type { des = "Layout Type"; values = "1C|One column|2CL|Two column (Sidebar on Left)|2CR|Two column (Sidebar on Right)|3C|Three column"; } set layout_type = "2CR"; property string{} theme_stylesheet { noui = 1; } set theme_stylesheet = { # Bloggish themes "april" => "http://www.insanejournal.com/stc/sixhtml/themes/classic/theme-april.css", "baby" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-baby.css", "beckett" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-beckett.css", "bluecrush" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-bluecrush.css", "bonjour" => "http://www.insanejournal.com/stc/sixhtml/themes/classic/theme-bonjour.css", "bryant" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-bryant.css", "cityblend" => "http://www.insanejournal.com/stc/sixhtml/themes/shea/theme-cityblend.css", "classy" => "http://www.insanejournal.com/stc/sixhtml/themes/classic/theme-classy.css", "earth" => "http://www.insanejournal.com/stc/sixhtml/themes/classic/theme-earth.css", "folio" => "http://www.insanejournal.com/stc/sixhtml/themes/shea/theme-folio.css", "forestgreen" => "http://www.insanejournal.com/stc/sixhtml/themes/shea/theme-forestgreen.css", "green" => "http://www.insanejournal.com/stc/sixhtml/themes/classic/theme-green.css", "knitting" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-knitting.css", "masala" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-masala.css", "minimalist" => "http://www.insanejournal.com/stc/sixhtml/themes/classic/theme-minimalist.css", "porpoise" => "http://www.insanejournal.com/stc/sixhtml/themes/shea/theme-porpoise.css", "powell-street" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-powell-street.css", "purplecrush" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-purplecrush.css", "stevenson" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-stevenson.css", "stitch" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-stitch.css", "subtle" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-subtle.css", "sunburned" => "http://www.insanejournal.com/stc/sixhtml/themes/shea/theme-sunburned.css", "tickle" => "http://www.insanejournal.com/stc/sixhtml/themes/shea/theme-tickle.css", "travel" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-travel.css", "wedding" => "http://www.insanejournal.com/stc/sixhtml/themes/lilia/theme-wedding.css", # Style Contest themes "bamboo_dream" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/bamboo_dream/bamboodream.css", "cartoon" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/cartoon/style.css", "clean_cut" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/clean_cut/stylesheet.css", "cleanstyle_black_and_white" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/cleanstyle_black_and_white/theme-clean_style_bw.css", "cleanstyle_blue_and_yellow" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/cleanstyle_blue_and_yellow/theme-clean_style_by.css", "espresso_at_midnight" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/espresso_at_midnight/style.css", "feminism" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/feminism/feminism.css", "fleur" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/fleur/fleur.css", "frankenblog" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/frankenblog/frankenblog.css", "freshly_baked_bread" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/freshly_baked_bread/theme-fbbread.css", "garden_state" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/garden_state/gardenstate.css", "gothic" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/gothic/styles.css", "hot_springs" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/hot_springs/style.css", "kinda_canoe" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/kinda_canoe/boat6.css", "kubrick" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/kubrick/theme-kubrick.css", "magic_paper" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/magic_paper/magic-book.css", "make_my_way" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/make_my_way/makemyway.css", "makeup" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/makeup/styles-site.css", "mango" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/mango/theme-mango.css", "miniml" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/miniml/miniml.css", "modernist_citron" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/modernist_citron/modernist-citron.css", "modernist_lounge" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/modernist_lounge/modernist-lounge.css", "my_news" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/my_news/styles-site.css", "newsline" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/newsline/newsline.css", "note_taking" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/note_taking/theme-notes.css", "painterly" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/painterly/painterly.css", "scarf" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/scarf/scarf.css", "shadow_dancers" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/shadow_dancers/style.css", "shlyapa" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/shlyapa/shlyapa.css", "summer_love" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/summer_love/theme-summerlove.css", "swimmingly" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/swimmingly/theme-swimmingly.css", "the_great_outdoors" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/the_great_outdoors/greatoutdoors.css", "the_late_show" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/the_late_show/thelateshow.css", "the_road_to_october" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/the_road_to_october/roadtooctober.css", "top_secret" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/top_secret/style.css", "utopia" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/utopia/stylesheet.css", "zen_and_the_art_of_movable_type" => "http://www.insanejournal.com/stc/sixhtml/themes/stylecontest/zen_and_the_art_of_movable_type/theme-zataomt.css", }; property use page_recent_items; property use page_friends_items; property use page_day_sortorder; property use page_year_sortorder; property use view_entry_disabled; property use use_shared_pic; property bool opt_datehead { des = "Show Heading for New Day"; } set opt_datehead = true; property bool opt_showtime { des = "Show Posting Time on Entries"; note = "This is recommended if you regularly post more than one entry per day."; } set opt_showtime = true; property bool opt_userpic_main { des = "Show Userpics on Entries"; } property bool opt_userpic_friends { des = "Show Userpics on Entries on your Friends Page"; } property bool opt_userpic_entrypage { des = "Show Userpic on the Entry page"; } property bool opt_userpic_comments { des = "Show Userpics on Comments"; } set opt_userpic_main = true; set opt_userpic_friends = true; set opt_userpic_entrypage = true; set opt_userpic_comments = true; property string[][] sidebar_primary { des = "Primary sidebar members"; noui = 1; } property string[][] sidebar_secondary { des = "Secondary sidebar members"; noui = 1; } set sidebar_primary = []; # Set in prop_init() set sidebar_secondary = []; # Set in prop_init() set external_stylesheet = true; property use linklist_support; property use custom_control_strip_colors; } propgroup colors { property use control_strip_bgcolor; property use control_strip_fgcolor; property use control_strip_bordercolor; property use control_strip_linkcolor; } propgroup text { property use text_post_comment; property use text_read_comments; property use text_post_comment_friends; property use text_read_comments_friends; property use text_view_recent; property use text_view_archive; property use text_view_friends; property use text_view_userinfo; property use lang_fmt_date_med; property use lang_fmt_time_short; # i18n props. Not in the interface. property string text_comments { des = "Text for the heading above the comments on the entry page"; noui = 1; } set text_comments = "Comments"; } propgroup customcss { property bool use_6a_base { des = "Use layout's \"Base Weblog\" stylesheet"; note = "Disable this only if you want to re-style this layout completely from scratch using a custom stylesheet and if you selected \"(None)\" as your theme."; } set use_6a_base = true; property string linked_stylesheet { des = "Custom external stylesheet URL"; note = "If you selected \"(None)\" as your theme and have a custom external stylesheet that you'd like to use instead, or if you'd just like to use a custom external stylesheet in addition to your theme's stylesheet, enter its URL here."; } set linked_stylesheet = ""; property string custom_css { des = "Custom stylesheet"; note = "If you selected \"(None)\" as your theme and have custom CSS that you'd like to use instead, or if you'd just like to add custom CSS in addition to your theme's stylesheet, enter it here."; cols = 80; rows = 20; string_mode = "css"; } set custom_css = ""; } function prop_init() { # Did the user specify custom sidebars? If so, we don't want to change them. var bool custom_primary = (size $*sidebar_primary > 0) ? true : false; var bool custom_secondary = (size $*sidebar_secondary > 0) ? true : false; # These themes don't support the 3C layout var string[] no_3C_themes = [ "clean_cut", "frankenblog", "freshly_baked_bread", "gothic", "kinda_canoe", "miniml", "note_taking", "painterly", "shlyapa", "summer_love", "the_road_to_october", ]; # Don't let users use 3C if they're using one of the themes that doesn't support it if ($*layout_type == "3C") { foreach var string theme ($no_3C_themes) { if ($theme == $*base_theme) { $*layout_type = "2CL"; } } } # Users who see eboxes cannot use the 3 column layout because the ebox won't always fit if (viewer_sees_ebox() and $*layout_type == "3C") { $*layout_type = "2CL"; } if (viewer_sees_vbox()) { # Users who see ads cannot use the 1 column layout if ($*layout_type == "1C") { $*layout_type = "2CR"; } if (not $custom_primary) { if ($*layout_type == "3C") { $*sidebar_primary = [ [ "userprofile", "", "0", "1" ], [ "viewlinks", "" ], [ "calendar" ], [ "links", "Links" ], [ "syndicate", "Syndicate" ], [ "poweredby" ], ]; } else { $*sidebar_primary = [ [ "userprofile", "", "0", "1" ], [ "viewlinks", "" ], [ "calendar" ], [ "ads", "" ], [ "links", "Links" ], [ "tags", "Tags" ], [ "pagesummary", "Page Summary" ], [ "syndicate", "Syndicate" ], [ "poweredby" ], ]; } } if (not $custom_secondary) { $*sidebar_secondary = [ [ "ads", "" ], [ "tags", "Tags" ], [ "pagesummary", "Page Summary" ], ]; } } else { if (not $custom_primary) { if ($*layout_type == "3C") { $*sidebar_primary = [ [ "userprofile", "", "0", "1" ], [ "viewlinks", "" ], [ "calendar" ], [ "links", "Links" ], [ "syndicate", "Syndicate" ], [ "poweredby" ], ]; } else { $*sidebar_primary = [ [ "userprofile", "", "0", "1" ], [ "viewlinks", "" ], [ "calendar" ], [ "links", "Links" ], [ "tags", "Tags" ], [ "pagesummary", "Page Summary" ], [ "syndicate", "Syndicate" ], [ "poweredby" ], ]; } } if (not $custom_secondary) { $*sidebar_secondary = [ [ "tags", "Tags" ], [ "pagesummary", "Page Summary" ], ]; } } # Set the control strip colors if ($*control_strip_bgcolor.as_string == "") { $*control_strip_bgcolor = $*theme_bgcolor; } if ($*control_strip_fgcolor.as_string == "") { $*control_strip_fgcolor = $*theme_fgcolor; } if ($*control_strip_bordercolor.as_string == "") { $*control_strip_bordercolor = $*theme_bordercolor; } if ($*control_strip_linkcolor.as_string == "") { $*control_strip_linkcolor = $*theme_linkcolor; } } function print_custom_stylesheet() {} function print_stylesheet () { print_custom_control_strip_css(); """ /* user css */ """; print_custom_stylesheet(); } function container_open (string name) { print safe "
\n"; } function container_close () { "
\n"; } function print_banner(Page p) { container_open("banner"); print safe "

$p.global_title

"; print safe ""; container_close(); } function open_module(string intname, string title, string headlink_url, bool nocontent) { print safe """
"""; if ($title != "") { """

"""; if ($headlink_url != "") { print safe """"""; } print safe $title; if ($headlink_url != "") { """"""; } "

\n"; } if (not $nocontent) { println """
"""; } } function close_module(bool nocontent) { println "
"; if (not $nocontent) { println "
"; } } function open_module(string intname, string title, string headlink_url) { open_module($intname, $title, $headlink_url, false); } function close_module() { close_module(false); } function print_module_list(string[] list) { println """"""; } function print_module_userprofile(string title, bool show_profile, bool show_userpic) { var Page p = get_page(); if ($show_userpic and not $show_profile) { if (defined $p.journal.default_pic) { open_module("photo", $title, $p.journal.userpic_listing_url); println ""+$p.journal.default_pic; close_module(); } return; } if (not $show_profile and not $show_userpic) { open_module("about", $title, $p.view_url{"userinfo"}, true); close_module(true); return; } open_module("about", $title, $p.view_url{"userinfo"}); println "
"+$p.journal.default_pic+"
"; println "

"+$p.journal.name+"

"; # TODO: Display more stuff such as website link close_module(); } function print_module_viewlinks(string title) { var Page p = get_page(); open_module("viewlinks", $title, ""); var string[] links = []; foreach var string k ($p.views_order) { $links[size $links] = """"""+lang_viewname($k)+""""""; } print_module_list($links); close_module(); } function print_module_poweredby(string title) { var Page p = get_page(); open_module("powered", $title, ""); println """Powered by $*SITENAME"""; close_module(); } function print_module_pagesummary(string title) { var Page p = get_page(); var string[] links = []; if ($p isa RecentPage) { var RecentPage cp = $p as RecentPage; var string subject; foreach var Entry e ($cp.entries) { $subject = ($e.subject != "" ? striphtml($e.subject) : "$*text_nosubject"); $links[size $links] = """$subject"""; } } if (size($links) < 1) { return; } open_module("pagesummary", $title, ""); print_module_list($links); close_module(); } function print_module_tags(string title) { var Page p = get_page(); var TagDetail[] tags = $p->visible_tag_list(); if (size($tags) < 1) { return; } open_module("categories", $title, ""); # TODO: Link to the TagsPage? var string[] links = []; foreach var TagDetail tag ($tags) { $links[size $links] = """$tag.name"""; } print_module_list($links); close_module(); } function print_module_calendar() { var Page p = get_page(); var YearMonth mon = $p->get_latest_month(); open_module("calendar", $mon->month_format(), ""); println """"""; println ""; foreach var int d (weekdays()) { "\n"; } println ""; foreach var YearWeek week ($mon.weeks) { println ""; foreach var int i (1 .. $week.pre_empty) { print ""; } foreach var YearDay day ($week.days) { print ""; } foreach var int i (1 .. $week.post_empty) { print ""; } println ""; } println """
"+$*lang_dayname_shorter[$d]+"
 "; if ($day.num_entries > 0) { print """"""; } print $day.day; if ($day.num_entries > 0) { print """"""; } print " 
"""; close_module(); } function print_module_syndicate(string title) { var Page p = get_page(); if ((size $p.data_links_order) < 1) { return; } open_module("syndicate", $title, ""); foreach var string k ($p.data_links_order) { print " $p.data_link{$k} "; } close_module(); } function print_module_customtext(string title, string text, string titlelink_url) { var Page p = get_page(); open_module("customtext", $title, $titlelink_url); print safe $text; close_module(); } function print_module_links(string title) { var Page p = get_page(); var UserLink[] links = $p.linklist; if (size($links) < 1 or not $*linklist_support) { return; } var bool box_open = false; if (not $links[0].is_heading) { open_module("typelist", $title, ""); $box_open = true; } var string[] items = []; foreach var UserLink link ($links) { if ($link.is_heading) { if ($box_open) { print_module_list($items); close_module(); $items = []; } open_module("typelist", $link.title, ""); $box_open = true; } if (not $link.is_heading and $link.title != "") { $items[size $items] = """$link.title"""; } } if ($box_open) { print_module_list($items); close_module(); } } function print_module_ads(string title) { var Page p = get_page(); open_module("ads", $title, ""); $p->print_vbox(); close_module(); } function handle_sidebar_array(string[][] list) { foreach var string[] item ($list) { var string module = $item[0]; var string title = $item[1]; if ($module == "userprofile") { var bool show_profile = (int($item[2]) != 0 ? true : false); var bool show_userpic = (int($item[3]) != 0 ? true : false); print_module_userprofile($title, $show_profile, $show_userpic); } elseif ($module == "viewlinks") { print_module_viewlinks($title); } elseif ($module == "poweredby") { print_module_poweredby($title); } elseif ($module == "pagesummary") { print_module_pagesummary($title); } elseif ($module == "tags") { print_module_tags($title); } elseif ($module == "calendar") { print_module_calendar(); } elseif ($module == "syndicate") { print_module_syndicate($title); } elseif ($module == "customtext") { var string text = $item[2]; var string titlelink_url = $item[3]; print_module_customtext($title, $text, $titlelink_url); } elseif ($module == "links") { print_module_links($title); } elseif ($module == "ads") { print_module_ads($title); } } } function Page::lay_sidebar_primary() { handle_sidebar_array($*sidebar_primary); } function Page::lay_sidebar_secondary() { handle_sidebar_array($*sidebar_secondary); } function render_layout (Page p, string lay) { if ($lay == "1C") { container_open("alpha"); $p->print_body(); container_close(); return; } if ($lay == "2CL") { container_open("alpha"); $p->lay_sidebar_primary(); container_close(); container_open("beta"); $p->print_body(); container_close(); return; } if ($lay == "2CR") { container_open("alpha"); $p->print_body(); container_close(); container_open("beta"); $p->lay_sidebar_primary(); container_close(); return; } if ($lay == "3C") { container_open("alpha"); $p->lay_sidebar_primary(); container_close(); container_open("beta"); $p->print_body(); container_close(); container_open("gamma"); $p->lay_sidebar_secondary(); container_close(); return; } } function get_layout () : string { var Page p = get_page(); var string lay = $*layout_type; if ($lay == "1C" or $lay == "2CR" or $lay == "2CL" or $lay == "3C") { return $lay; } return "2CR"; } function body_class (string lay) : string { var string{} map = { "1C" => "layout-one-column", "2CL" => "layout-two-column-left", "2CR" => "layout-two-column-right", "3C" => "layout-three-column", }; return $map{$lay}; } function Page::print_stylesheets() { if ($*use_6a_base) { println safe """\n"""; } if ($*base_theme != "__none") { println safe """\n"""; } if ($*linked_stylesheet != "") { println safe """\n"""; } # Some themes are too thin for eboxes, so we need extra CSS to stretch them if (viewer_sees_ebox()) { var string[] eboxextras = [ "classy", "earth", "the_road_to_october", ]; foreach var string theme ($eboxextras) { if ($*base_theme == $theme) { println safe """\n"""; } } } if ($*use_6a_base) { println safe """\n"""; } if ($*custom_css != "") { println """"""; } if ($*external_stylesheet) { println safe """\n"""; } else { println """"""; } } function Page::print () { var string lay = get_layout(); var string body_layout_class = body_class($lay); var string[] wide_themes = ["bonjour", "green", "porpoise"]; # These are the wide themes, which look better when the hbox_top is below the banner var bool print_below_banner = false; foreach var string theme ($wide_themes) { if ($theme == $*base_theme) { $print_below_banner = true; } } """ """; $this->print_head(); $this->print_stylesheets(); print safe """""" + $this->title() + """\n"""; """ """; $this->print_control_strip(); if (viewer_sees_hbox_top()) { if ($print_below_banner) { container_open("container"); print_banner($this); container_open("ad-leaderboard"); $this->print_hbox_top(); container_close(); } else { container_open("ad-leaderboard"); $this->print_hbox_top(); container_close(); container_open("container"); print_banner($this); } } else { container_open("container"); print_banner($this); } container_open("pagebody"); render_layout($this, $lay); container_close(); container_close(); if (viewer_sees_hbox_bottom()) { container_open("ad-5linkunit"); $this->print_hbox_bottom(); container_close(); } ""; } function RecentPage::print_body() { if ($.nav.backward_url != "" or $.nav.forward_url != "") { println """

"""; if ($.nav.backward_url != "") { println """"""+get_plural_phrase($.nav.backward_count, "text_skiplinks_back")+""; } if ($.nav.backward_url != "" and $.nav.forward_url != "") { print " | "; } if ($.nav.forward_url != "") { println """"""+get_plural_phrase($.nav.forward_count, "text_skiplinks_forward")+""; } println """

"""; } foreach var Entry e ($.entries) { if ($*opt_datehead and $e.new_day) { print """

"""+$e.time->date_format("med")+"""

"""; } # Print the entry $this->print_entry($e); if ($e->viewer_sees_ebox()) { """
"""; $e->print_ebox(); "
"; } } if ($.nav.backward_url != "" or $.nav.forward_url != "") { println """

"""; if ($.nav.backward_url != "") { println """"""+get_plural_phrase($.nav.backward_count, "text_skiplinks_back")+""; } if ($.nav.backward_url != "" and $.nav.forward_url != "") { print " | "; } if ($.nav.forward_url != "") { println """"""+get_plural_phrase($.nav.forward_count, "text_skiplinks_forward")+""; } println """

"""; } } function EntryPage::print_body() { $this->print_entry($.entry); """

$*text_comments

"""; if(not $.comment_pages.all_subitems_displayed) { $.comment_pages->print(); } foreach var Comment c ($.comments) { $this->print_comment($c); } if(not $.comment_pages.all_subitems_displayed) { $.comment_pages->print(); } """
"""; } function DayPage::print_body() { if ($.has_entries) { "
\n

"; print $.date->date_format("long"); "

\n"; foreach var Entry e ($.entries) { $this->print_entry($e); if ($e->viewer_sees_ebox()) { """
"""; $e->print_ebox(); "
"; } } "
"; } else { "

$*text_noentries_day

"; } "
\n"; "$*text_day_prev | "; "$*text_day_next\n
"; } function lang_posted_by(UserLite poster, UserLite journal, Page p) : string { var string posted = (defined $poster ? ""+$poster : "$*text_poster_anonymous"); if (not $poster->equals($journal) and not ($p.view == "recent" and $p.journal_type == "C")) { $posted = $posted + " in " + $journal; } return "$posted"; } function lang_posted_by(UserLite poster, UserLite journal) : string { return lang_posted_by($poster, $journal, new Page); } function lang_posted_date_and_time(EntryLite e, DateTime dt, bool showdate, bool showtime) : string { var string posted = "Posted"; $posted = $posted + ($showdate ? " on " : " at "); if ($showdate and $showtime) { if ($e.depth > 0) { # If $e is a comment return $posted + $e->time_display("med", ""); } else { return $posted + $dt->date_format("med") + " at " + $dt->time_format(); } } if ($showdate and not $showtime) { return $posted + $dt->date_format("med"); } if (not $showdate and $showtime) { return $posted + $dt->time_format(); } return ""; } function lang_posted_by_date_and_time(UserLite poster, DateTime dt, bool showposter, bool showdate, bool showtime) : string { return lang_posted_date_and_time(new EntryLite, $dt, $showdate, $showtime); } function lang_posted_by_date_and_time(EntryLite e, UserLite poster, UserLite journal, DateTime dt, bool showposter, bool showdate, bool showtime) : string { return lang_posted_date_and_time($e, $dt, $showdate, $showtime); } function Comment::print_linkbar() { var Link link; var string sep = "|"; var string url = ""; var string text = ""; foreach var string link_key ($.link_keyseq) { $link = $this->get_link($link_key); $url = $link.url; $text = $link.caption; if (defined $link) { """ $sep $text"""; } } } function EntryPage::print_comment(Comment e) { if (not $e.full) { # Collapsed mode "
\n"; ""; if (size($e.replies) > 0) { println "
"; foreach var Comment c ($e.replies) { $this->print_comment($c); } println "
"; } "
"; return; } "
\n"; "
"; if ($*opt_userpic_comments and defined $e.userpic) { "$e.userpic
"; } print safe "

"+lang_posted_by($e.poster, $e.poster)+"

"; "
"; if ($e.subject != "") { "

$e.subject

\n"; } "
"; var string ip = $e.metadata{"poster_ip"}; if ($ip != "") { var string text = $*text_comment_ipaddr; ""; } if (defined $e.subject_icon) { """
$e.subject_icon
"""; } $e->print_text(); "
"; ""; if (size($e.replies) > 0) { println "
"; foreach var Comment c ($e.replies) { $this->print_comment($c); } println "
"; } "
"; } function Entry::print_linkbar() { var Link link; var string sep = "|"; var string url = ""; var string text = ""; foreach var string link_key ($.link_keyseq) { $link = $this->get_link($link_key); $url = $link.url; $text = $link.caption; if (defined $link) { """ $sep $text"""; } } } function Page::print_entry(Entry e) { "
\n"; var bool showtime = $*opt_showtime; var bool showdate = not $*opt_datehead; var bool showposter = false; var bool showuserpic = $*opt_userpic_main; if ($.view == "friends") { $showtime = true; $showposter = true; $showuserpic = $*opt_userpic_friends; } if ($.view == "day") { $showdate = false; } if ($.view == "entry" or $.view == "reply") { $showdate = true; } if ($.view == "entry") { $showuserpic = $*opt_userpic_entrypage; } if (not $e.poster->equals($e.journal)) { $showposter = true; } if (($showuserpic and defined $e.userpic) or $showposter) { "
"; if ($showuserpic and defined $e.userpic) { "$e.userpic"; } if (($showuserpic and defined $e.userpic) and $showposter) { "
"; } if ($showposter) { print safe "

"+lang_posted_by($e.poster, $e.journal, $this)+"

"; } "
"; } "

"; if (defined $e.security_icon) { print "$e.security_icon "; } "$e.subject

\n"; "
\n"; "
\n"; $e->print_metadata(); $e->print_text(); "
\n"; var string sep = "|"; ""; "
\n"; "
\n"; } function print_theme_preview() { "\"$*base_theme"; }