# ----------------------------------- # LAYER INFO # ----------------------------------- layerinfo type = "layout"; layerinfo name = "Flexible Squares"; layerinfo lang = "en"; layerinfo author_name = "Yati Mansor"; layerinfo redist_uniq = "flexiblesquares/layout"; # ----------------------------------- # PROPGROUPS # ----------------------------------- ### PRESENTATION propgroup presentation = "Presentation"; propgroup presentation { property use page_recent_items; property use page_friends_items; property use view_entry_disabled; property bool show_entry_userpic { des = "Show user picture icons with each of your entries?"; } property string userpic_position { des = "Set the user picture position for each entry"; values = "left|Left|right|Right"; } property bool use_friends_colours { des = "Use friends colours when viewing friends list?"; } set show_entry_userpic = true; set userpic_position = "left"; set use_friends_colours = true; property use use_shared_pic; property string page_alignment { des = "Set page alignment"; values= "right|Right|center|Center|left|Left"; } set page_alignment = "center"; property int journal_width { des = "Journal width"; note = "Journal width can be set in either percentage of the browser window or in pixels (see next option)"; min = 1; } property string journal_width_unit { des = "Unit of journal width"; note = "Journal width can be set either in percentage of the browser window or in pixels"; values = "%|%|px|px"; } set journal_width = 80; set journal_width_unit = "%"; } ### SIDEBAR propgroup sidebar = "Sidebar"; propgroup sidebar { property bool show_sidebar { des = "Show the sidebar?"; } set show_sidebar = true; property string sidebar_position { des="Set sidebar position"; values="left|Left|right|Right"; } set sidebar_position="right"; property bool show_default_userpic { des = "Show the default user picture on the sidebar?"; } set show_default_userpic = true; property bool show_blurb { des = "Show the blurb/free text in the sidebar?"; } property string text_sidebar_blurb { des = "Title of the blurb sidebar box"; } property string sidebar_blurb { des = "Text to be added to the sidebar"; note = "Appears in the sidebar 'Blurb'"; rows = 10; cols = 25; } set show_blurb = true; set text_sidebar_blurb = "Blurb"; property bool show_linklist { des = "Show the link list in the sidebar?"; } property string text_sidebar_links { des = "Title of the links sidebar box"; } set show_linklist = true; set text_sidebar_links = "Links"; property bool show_calendar { des = "Show the calendar in the sidebar?"; } set show_calendar = true; property int sidebar_width { des = "Set sidebar width, in pixels"; min = 0; } set sidebar_width = 160; property string sidebar_order_1 { des = "First box in the sidebar"; values = "userpic|Default Userpic|blurb|Blurb|linklist|Link List|calendar|Calendar"; } property string sidebar_order_2 { des = "Second box in the sidebar"; values = "userpic|Default Userpic|blurb|Blurb|linklist|Link List|calendar|Calendar"; } property string sidebar_order_3 { des = "Third box in the sidebar"; values = "userpic|Default Userpic|blurb|Blurb|linklist|Link List|calendar|Calendar"; } property string sidebar_order_4 { des = "Fourth box in the sidebar"; values = "userpic|Default Userpic|blurb|Blurb|linklist|Link List|calendar|Calendar"; } set sidebar_order_1 = "userpic"; set sidebar_order_2 = "blurb"; set sidebar_order_3 = "linklist"; set sidebar_order_4 = "calendar"; } ### BACKGROUND propgroup background = "Background"; propgroup background { property string page_background_image { des = "Background image"; note = "URL to an image to be used for the page background (leave blank for none)."; } property string page_background_repeat { des = "Background image repeat"; values = "repeat|Repeat|no-repeat|Don't repeat|repeat-x|Repeat across only|repeat-y|Repeat down only"; } property string page_background_position { des = "Background image position"; note = "Does not apply if background image is repeating in both directions."; values = "center|Center|center left|Center-left|center right|Center-right|top|Top|top left|Top-left|top right|Top-right|bottom|Bottom|bottom left|Bottom-left|bottom right|Bottom-right|left|Left|right|Right"; } property string page_background_scrolling { des = "Background image scrolling"; note = "Not supported in all browsers, but allows for the background image to be in a fixed position when scrolling."; values = "scroll|Scroll|fixed|Fixed"; } set page_background_image = ""; set page_background_repeat = "repeat"; set page_background_position = "center"; set page_background_scrolling = "scroll"; } ### FONTS propgroup fonts = "Fonts"; propgroup fonts { property string font_unit { des = "Font unit"; values = "pt|Points|px|Pixels|em|Em"; } set font_unit = "px"; property string main_font { des = "Preferred/base font"; maxlength = 25; size = 10; example = "Tahoma"; note = "Leave blank for your browser's default font"; } property string main_font_fallback { des = "Alternative font style"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; note = "This general style will serve as a fallback if your preferred font is unavailable."; } property int main_font_size { des = "Base font size"; } set main_font = "Verdana"; set main_font_fallback = "sans-serif"; set main_font_size= 11; property string content_font { des = "Font for the entry/date/entry subject"; maxlength = 25; size = 10; example = "Verdana"; note = "Leave blank for your browser's default font"; } property string content_font_fallback { des = "Alternative font style"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; note = "This general style will serve as a fallback if your preferred font is unavailable."; } property int content_font_size { des = "Entry/date/subject font size"; } property int date_font_size { des = "Date font size"; } property int subject_font_size { des = "Subject font size"; } set content_font = "Verdana"; set content_font_fallback = "sans-serif"; set content_font_size= 11; set date_font_size= 11; set subject_font_size= 11; property string sidebar_font { des = "Font for the sidebar"; maxlength = 25; size = 10; example = "Verdana"; note = "Leave blank for your browser's default font"; } property string sidebar_font_fallback { des = "Alternative font style"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; note = "This general style will serve as a fallback if your preferred font is unavailable."; } property int sidebar_font_size { des = "Sidebar font size"; } set sidebar_font = "Verdana"; set sidebar_font_fallback = "sans-serif"; set sidebar_font_size= 11; property string header_footer_font { des = "Font for the header and footer"; maxlength = 25; size = 10; example = "Verdana"; note = "Leave blank for your browser's default font"; } property string header_footer_font_fallback { des = "Alternative font style"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; note = "This general style will serve as a fallback if your preferred font is unavailable."; } property int header_footer_font_size { des = "Header and footer font size"; } set header_footer_font = "Verdana"; set header_footer_font_fallback = "sans-serif"; set header_footer_font_size= 11; property string title_font { des = "Font for the title and subtitle"; maxlength = 25; size = 10; example = "Verdana"; note = "Leave blank for your browser's default font"; } property string title_font_fallback { des = "Alternative font style"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; note = "This general style will serve as a fallback if your preferred font is unavailable."; } property int title_font_size { des = "Title font size"; } property int subtitle_font_size { des = "Subtitle font size"; } set title_font = "Verdana"; set title_font_fallback = "sans-serif"; set title_font_size= 11; set subtitle_font_size= 11; } ### COLOURS propgroup colors = "Colours"; propgroup colors { property Color page_bgcolor { des = "Background color for the page"; } property Color page_fgcolor { des = "Text color for the page"; } property Color content_bgcolor { des = "Background color for box containing the main contents of the page"; } property Color outer_table_bgcolor { des = "Background color of the outer table"; } property Color entry_bgcolor { des = "Background color of the entries"; } property Color entry_fgcolor { des = "Text color of the entries"; } property Color border_color { des = "Border color of the content and header/footer boxes"; } property Color entrytitle_bgcolor { des = "Background color of the subject, date and comment links"; } property Color sidebar_header_bgcolor { des = "Background color for the headers in the sidebar"; } property Color sidebar_fgcolor { des = "Text color for the sidebar"; } property Color header_footer_bgcolor { des = "Background color of the header and footer"; } property Color header_footer_fgcolor { des = "Text color for the header and footer"; } property Color subject_fgcolor { des = "Text color for the subject of the entries"; } property Color date_fgcolor { des = "Text color for the date of the entries"; } set page_bgcolor = "#99AECE"; set page_fgcolor = "#000000"; set content_bgcolor = "#C2CDE0"; set entry_bgcolor = "#D4DCE8"; set entry_fgcolor = "#000000"; set border_color = "#999999"; set entrytitle_bgcolor = "#919BAD"; set outer_table_bgcolor = "#A9B3C4"; set sidebar_fgcolor = "#000000"; set sidebar_header_bgcolor = "#919BAD"; set header_footer_bgcolor = "#D4DCE8"; set header_footer_fgcolor = "#000000"; set subject_fgcolor = "#000000"; set date_fgcolor = "#000000"; property Color link_color { des = "Link color for both visited and unvisited links"; } property Color link_hover_color { des = "Link color on hover"; } property Color comments_link_color { des = "Link color for visited and unvisited comment links"; } property Color comments_link_hover { des = "Link color for comment links on hover"; } property Color sidebar_link_color { des = "Link color for visited and unvisited sidebar links"; } property Color sidebar_link_hover { des = "Link color for sidebar links on hover"; } property Color header_footer_link_color { des = "Link color for visited and unvisited links for the header and footer"; } property Color header_footer_link_hover { des = "Link color for comment links on hover for the header and footer"; } set link_color = "#5674B9"; set link_hover_color = "#7AA1F8"; set comments_link_color = "#FFFFFF"; set comments_link_hover = "#B0B9C8"; set sidebar_link_color = "#5674B9"; set sidebar_link_hover = "#7AA1F8"; set header_footer_link_color = "#5674B9"; set header_footer_link_hover = "#7AA1F8"; } ### TEXT propgroup text = "Text"; propgroup text { property use text_meta_music; property use text_meta_mood; 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_website_default_name; property use text_view_recent; property use text_view_friends; property use text_view_userinfo; property use text_view_archive; set text_view_archive = "Archive"; set text_view_friends = "Friends"; set text_view_recent = "Recent Entries"; set text_view_userinfo = "User Info"; set text_website_default_name = "Website"; property use text_nosubject; property string text_edit { des = "Text for an entry's edit link"; } property string text_memories { des = "Text to add an entry to the memories"; } property string text_previous_entry { des = "Text to link to the previous entry"; } property string text_next_entry { des = "Text to link to the next entry"; } set text_nosubject = "(no subject)"; set text_permalink = "Link"; set text_edit = "Edit"; set text_memories = "Mem"; set text_next_entry = "Next"; set text_previous_entry = "Previous"; property use text_skiplinks_back; property use text_skiplinks_forward; set text_skiplinks_back = "go earlier"; set text_skiplinks_forward = "go later"; } ### STYLESHEET OPTIONS propgroup stylesheet = "Stylesheet"; propgroup stylesheet { property bool external_stylesheet { des = "Use linked stylesheet"; } property string external_stylesheet_url { des="External stylesheet URL"; } set external_stylesheet = true; } # ----------------------------------- # STYLESHEET # ----------------------------------- function css_font_family(string base, string fallback) : string { var string return; if ($base != "" or $fallback != "none") { $return = $return + "font-family: "; if ($base != "") { $return = $return + "\"$base\""; if ($fallback != "none") { $return = $return + ", "; } } if ($fallback != "none") { $return = $return + $fallback; } } return $return; } function print_stylesheet () { var string body_font_family = css_font_family($*main_font, $*main_font_fallback); var string content_font_family = css_font_family($*content_font, $*content_font_fallback); var string sidebar_font_family = css_font_family($*sidebar_font, $*sidebar_font_fallback); var string header_footer_font_family = css_font_family($*header_footer_font, $*header_footer_font_fallback); var string title_font_family = css_font_family($*title_font, $*title_font_fallback); var string body_background = ""; if ($*page_background_image != "") { $body_background = """ background-image: url("$*page_background_image"); background-repeat: $*page_background_repeat; background-position: $*page_background_position; background-attachment: $*page_background_scrolling; """; } var string page_align = ""; var string body_align = ""; if ($*page_alignment == "left") { $page_align = "margin-left: 20px; margin-right: auto"; } if ($*page_alignment == "right") { $page_align = "margin-left: auto; margin-right: 20px"; $body_align = "text-align: right"; } if ($*page_alignment == "center") { $page_align = "margin-left: auto; margin-right: auto"; $body_align = "text-align: center"; } var string maincontent_prop = ""; var string sidebar_prop = ""; var int float_margin = $*sidebar_width + 20; if ($*show_sidebar and $*sidebar_position == "right") { $maincontent_prop = "margin-right: ${float_margin}px;"; $sidebar_prop = "float: right;"; } if ($*show_sidebar and $*sidebar_position == "left") { $maincontent_prop = "margin-left: ${float_margin}px;"; $sidebar_prop = "float: left;"; } if (not $*show_sidebar) { $maincontent_prop = ""; } var string sidebar_pos = ""; if ($*sidebar_position == "left") { $sidebar_pos = "clear: right"; } if ($*sidebar_position == "right") { $sidebar_pos = "clear: left"; } print """ body { background-color: $*page_bgcolor; $body_background $body_align; color: $*page_fgcolor; $body_font_family; font-size: $*main_font_size$*font_unit; margin: 20px 0 20px 0; } a, a:link, a:visited { color: $*link_color; text-decoration: none; } a:hover { color: $*link_hover_color; text-decoration: underline; } p, td, blockquote { font-size: $*content_font_size$*font_unit; } code, kbd, pre, tt { font-family: monospace; } #content { width: $*journal_width$*journal_width_unit; $page_align; background-color: $*outer_table_bgcolor; border-width: 1px; border-style: solid; border-color: $*border_color; padding: 15px; } #maincontent { margin-top: 15px; $content_font_family; font-size: $*content_font_size$*font_unit; background-color: $*content_bgcolor; color: $*page_fgcolor; border-style: solid; border-color: $*border_color; border-width: 1px; $maincontent_prop text-align: left; } #sidebar { padding-top: 15px; margin-top: 15px; background-color: $*content_bgcolor; border-color: $*border_color; border-width: 1px; border-style: solid; font-size: $*sidebar_font_size$*font_unit; $sidebar_font_family; color: $*sidebar_fgcolor; width: ${*sidebar_width}px; $sidebar_prop text-align: left; } #header { width: 100%; padding: 10px 0px 20px 0px; margin: 0px; text-align: center; $header_footer_font_family; font-size: $*header_footer_font_size$*font_unit; font-weight: bold; letter-spacing: 2px; border-style: solid; border-color: $*border_color; border-width: 1px; background-color: $*header_footer_bgcolor; color: $*header_footer_fgcolor; } #footer { width: 100%; text-align: center; $header_footer_font_family; font-size: $*header_footer_font_size$*font_unit; font-weight: bold; letter-spacing: 1px; background-color: $*header_footer_bgcolor; color: $*header_footer_fgcolor; border-color: $*border_color; border-width: 1px; border-style: solid; z-index: 100; clear: both; } /* header -- links to views; title of journal; subtitle of journal */ div#header a, div#header a:link, div#header a:visited, div#footer a, div#footer a:link, div#footer a:visited { color: $*header_footer_link_color; } div#header a:hover, div#footer a:hover { color: $*header_footer_link_hover; text-decoration: none; } ul.navheader { padding: 0px; margin: 0px; } ul.navheader li { display: inline; padding: 0 3px 0 3px; } .title { $title_font_family; font-size: $*title_font_size$*font_unit; font-weight: normal; line-height: 200%; top: 10px; } .subtitle{ $title_font_family; font-size: $*subtitle_font_size$*font_unit; font-weight: normal; top: 10px; } /* sidebar */ div#sidebar a, div#sidebar a:link, div#sidebar a:visited{ color: $*sidebar_link_color; } div#sidebar a:hover { color: $*sidebar_link_hover; text-decoration: none; } .defaultuserpic { text-align: center; } .sbarheader { padding: 0px 5px 0px 5px; } .sbarbody { padding: 0px 5px 0px 5px; } .sbarbody2 { padding: 0 15px 0 15px; } table.calendar { margin-right: auto; margin-left: auto; } .sbarcalendar { border-color: $*page_fgcolor; border-width: 1px; border-style: solid; text-align: center; $sidebar_font_family; font-size: $*sidebar_font_size$*font_unit; } .sbarcalendarposts { border-color: $*page_fgcolor; border-width: 1px; border-style: solid; background-color: $*entry_bgcolor; text-align: center; $sidebar_font_family; font-size: $*sidebar_font_size$*font_unit; } ul.sbarlist { padding-left: 0px; margin-left: 0px; list-style: none; } li.sbaritem { padding-left: 15px; list-style: none; } li.sbartitle { padding-left: 15px; list-style: none; border-style: solid; border-width: 1px; border-color: $*border_color; background-color: $*sidebar_header_bgcolor; margin-bottom: 10px; margin-top: 10px; } /* maincontent */ .subcontent { } .entry { margin: 0px 10px 10px 30px; padding: 10px; background-color: $*entry_bgcolor; color: $*entry_fgcolor; $content_font_family; font-size: $*content_font_size$*font_unit; text-align: left; border-width: 1px; border-color: $*entrytitle_bgcolor; border-style: solid; } .entry ul li { padding-left: 5px; margin-left: 15px; } .entry ol li { padding-left: 5px; margin-left: 15px; } .userpic { position: relative; float: $*userpic_position; background-color: $*entry_bgcolor; padding: 5px; margin: 10px; z-index: 15; border-width: 1px; border-color: $*entrytitle_bgcolor; border-style: solid; } .userpicfriends { position: relative; float: $*userpic_position; padding: 5px; margin: 10px; text-align: center; border-style: solid; border-width: 1px; border-color: $*entrytitle_bgcolor; $content_font_family; font-size: $*content_font_size$*font_unit; z-index: 15; } .date { line-height: 200%; top: 5px; color: $*date_fgcolor; $content_font_family; font-size: $*date_font_size$*font_unit; } .subject { font-weight: bold; padding: 10px; color: $*subject_fgcolor; $content_font_family; font-size: $*subject_font_size$*font_unit; } .subject a, .subject a:link, .subject a:visited { color: $*comments_link_color; } .subject a:hover { color: $*comments_link_hover; } .datesubject { background-color: $*entrytitle_bgcolor; padding: 5px; } .currents, .currentmood, .currentmusic { $content_font_family; font-size: $*content_font_size$*font_unit; } .comments { $content_font_family; font-size: $*content_font_size$*font_unit; text-align: right; background-color: $*entrytitle_bgcolor; padding: 0px 5px 0px 5px; position: relative; top: 15px; } div.comments a, div.comments a:link, div.comments a:visited{ color: $*comments_link_color; } div.comments a:hover { color: $*comments_link_hover; text-decoration: none; } /* maincontent -- entry, reply pages */ .datesubjectcomment { background-color: $*entrytitle_bgcolor; padding: 5px; margin-top: 20px; } .userpiccomment { position: relative; border-width: 5px; border-style: solid; border-color: $*entry_bgcolor; background-color: $*entry_bgcolor; top: -30px; left: 0px; padding: 5px; margin: 10px 10px -20px 10px; z-index: 15; float: $*userpic_position; border-width: 1px; border-color: $*entrytitle_bgcolor; border-style: solid; } .box { border-style: solid; border-width: 1px 0px 0px 0px; border-color: $*border_color; padding: 10px; $sidebar_pos; } input, textarea { background-color: $*entry_bgcolor; color: $*entry_fgcolor; } textarea.textbox { width: 100% !important; } .reply { position: relative; margin: 20px 30px 10px 30px; padding: 25px 10px 10px 10px; text-align: left; $content_font_family; font-size: $*content_font_size$*font_unit; line-height: 125%; background-color: $*entry_bgcolor; color: $*entry_fgcolor; } .replytosubject { font-weight: bold; } .commentreply { position: relative; margin: 10px; font-size: $*content_font_size$*font_unit; $content_font_family; color: $*entry_fgcolor; } .commentbox { border-color: $*border_color; border-width: 1px; border-style: solid; padding: 10px; margin: 10px; background-color: $*entry_bgcolor; } .datesubjectcomment a:link, .datesubjectcomment a:visited { color: $*comments_link_color; } .datesubjectcomment a:hover { color: $*comments_link_hover; } .commentboxpartial { border-color: $*border_color; border-width: 1px; border-style: solid; padding: 10px; margin: 10px; background-color: $*entry_bgcolor; } .commentinfo { background-color: $*entry_bgcolor; margin-top: 10px; width: 100%; } /* maincontent -- year/achive pages */ ul.year { text-align: center; padding-bottom: 40px; } ul.year li { display: inline; } table.yeartable { margin-left: auto; margin-right: auto; } table.yeartable td.yeardate, table.yeartable td.yearday { border-width: 1px; border-style: solid; border-color: $*border_color; } table.yeartable td.yearday { background-color: $*entry_bgcolor; text-align: center; } td.yearmonth { border-style: none; } /* footer */ ul.navfooter{ padding: 0px; margin: 0px; } ul.navfooter li { display: inline; margin: 0 5px 0 5px; } .clearfoot { clear: both; } /* misc */ .clear { height: 15px; } .skiplinks { text-align: center; } .headerimage { /* for formatting header image */ } .separator{ /* for formatting separators between entries */ height: 35px; } """; } function print_custom_stylesheet() { # override } # ----------------------------------- # SIDEBAR # ----------------------------------- function print_sidebar_box(string title, string body) { print safe """
"""; } function print_userpic () { var Page p= get_page(); var Image up_img = $p.journal.default_pic; if (defined $up_img) { """
$p.journal.name
"""; } } function print_sidebar_calendar() { var string calendar; var Page p = get_page(); var YearMonth m = $p->get_latest_month(); var string month = $m->month_format(); if($m.has_entries) { $calendar = """
"""; var YearWeek[] theWeeks = $m.weeks; foreach var YearWeek w ($theWeeks) { $calendar = $calendar + ""; var YearDay[] theDays = $w.days; var int pre = $w.pre_empty; if($pre > 0) { $calendar = $calendar + """"""; } foreach var YearDay d ($theDays) { if ($d.num_entries) { $calendar = $calendar + """"""; } else { $calendar = $calendar + """"""; } } $calendar = $calendar + "\n"; } $calendar = $calendar + "
 $d.day$d.day
"; } $month = """
"""; if ($calendar != "") { print $month; print $calendar; } } function print_sidebar_blurb () { var string blurb_title = ""; if ($*text_sidebar_blurb == "") { $blurb_title = ""; } else { $blurb_title = """
"""; } var string blurb = ""; $blurb = """
$*sidebar_blurb
"""; if ($*show_blurb and ($*sidebar_blurb != "")) { print $blurb_title; print $blurb; } } function print_sidebar_linklist() { var Page p = get_page(); if (size $p.linklist <= 0) { return; } elseif (not $*linklist_support) { return; } var string list = ""; foreach var UserLink l ($p.linklist) { if ($l.title) { if ($l.is_heading) { $list = $list + """
  • $l.title
  • """; } else { $list = $list + """
  • $l.title
  • """; } } else { $list = $list; } } var string list_title = ""; if ($*text_sidebar_links != "") { $list_title = """
  • $*text_sidebar_links
  • """; } else { $list_title = ""; } print_sidebar_box($list_title, $list); } function sidebar_order(string order) { if ($order == "userpic" and $*show_default_userpic) { print_userpic(); } if ($order == "blurb" and $*show_blurb) { print_sidebar_blurb(); } if ($order == "linklist" and $*show_linklist) { print_sidebar_linklist(); } if ($order == "calendar" and $*show_calendar) { print_sidebar_calendar(); } } function print_sidebar() { sidebar_order($*sidebar_order_1); sidebar_order($*sidebar_order_2); sidebar_order($*sidebar_order_3); sidebar_order($*sidebar_order_4); } # ----------------------------------- # PAGE # ----------------------------------- # Header function Page::lay_print_header() "Prints header" { var Page page = get_page(); var string title = $this->title(); print """ """; } # Footer function Page::lay_print_footer() { """
     
    """; } function Page::print () { var Page page = get_page(); var string title = $this->title(); """ $title"""; $this->print_head(); if ($*external_stylesheet and $*external_stylesheet_url !="") { println """"""; } elseif ($*external_stylesheet) { println """"""; } else { println """"; } $this->print_custom_head(); """
    """; $this->lay_print_header(); if ($*show_sidebar) { """ """; } """
    """; $this->print_body(); "
    "; $this->lay_print_footer(); "
    "; } function Entry::print_linkbar() { # Links (memories, edit, prev, next) var Page p = get_page(); var Link prev; var Link edit; var Link mem; var Link next; if ($p.view == "entry" or $p.view == "reply") { $prev = $this->get_link("nav_prev"); $edit = $this->get_link("edit_entry"); $mem = $this->get_link("mem_add"); $next = $this->get_link("nav_next"); """
     
     
    """; } } function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor) { $e->print_linkbar(); # Userpic var string userpic = ""; if ($*show_entry_userpic) { if ($p.view == "friends" or $p.view == "entry") { if (defined $e.userpic) { $userpic = $userpic + """$e.poster.name"; } } elseif ($p.journal_type == "C" and $p.view == "recent") { if (defined $e.userpic) { $userpic = $userpic + """$e.poster.name"""; } } else { if (defined $e.userpic) { $userpic = $userpic + """
    $e.poster.name
    """; } } } print """
    """; if (($p.view == "recent" and $p.journal_type != "C" ) or $p.view == "day") { print """$userpic"""; } else { if ($p.view == "recent" and $p.journal_type == "C" ) { """
    """; } else { """
    """; } print """$userpic"""; # Poster if ($p.view == "friends" or $p.view == "entry") { var UserLite linkto; $linkto = $e.poster; #print "$e.poster.username"; """
    base_url() + "\">"; "$linkto.username"; } elseif ($p.journal_type == "C" and $p.view == "recent") { var UserLite linkto; $linkto = $e.poster; #print "$e.poster.username"; """
    base_url() + "\">"; "$linkto.username"; } if (($p.view == "friends" or $p.view == "entry") and $e.poster.username != $e.journal.username) { var UserLite linkto; $linkto = $e.journal; """
    [base_url() + "\">"; "$linkto.username]"; } if ($p.view == "recent" and $p.journal_type == "C") { print "
    "; } if ($p.view != "recent" and $p.view != "day") { print """
    """; } } # Date, time, subject var string time = ""; $time = $time + """ @ """; $time = $time + $e.time->time_format("short"); var string date = ""; $date = $date + $e.time->date_format("long_day"); """
    """; print $e.time->date_format("%%dd%% %%month%% %%yyyy%%"); "$time
    "; """
    """; if ($e.security != "") { $e.security_icon->print(); } """ $e.subject  
    """; """
    $e.text
    """; # Currents var string currents =""; $e->print_metadata(); # Comments """
     
    """; if ($p.view != "entry" or $p.view != "reply") { $e.comments->print(); } elseif ($e.comments.enabled) { $e.comments->print_postlink(); } else { " "; } """
     
    """; } function Page::print_entry(Entry e) { print_entry($this, $e, null Color, null Color); } function FriendsPage::print_entry (Entry e) { if ($*use_friends_colours) { var Friend f = $.friends{$e.journal.username}; print_entry($this, $e, $f.bgcolor, $f.fgcolor); } else { print_entry($this, $e, $*entry_bgcolor, $*entry_fgcolor); } } function EntryPage::print_entry(Entry e) { print_entry($this, $e, $*entry_bgcolor, $*entry_fgcolor); } function Entry::print_metadata() { if (size $.metadata) { print """
     
     
    """; var string currents; foreach var string k ($.metadata) { var string text = $k; var string val = $.metadata{$k}; if ($k == "mood") { $text = $*text_meta_mood; } elseif ($k == "music") { $text = $*text_meta_music; } if ($k == "mood" and defined $.mood_icon) { var Image i = $.mood_icon; $val = " $val"; } $currents = $currents + """
    $text: $val
    """; } $currents = $currents + "
    "; println "$currents"; } } function RecentPage::lay_print_footer() { var string range = "most recent entries"; var string sep; var string back; var string forward; if ($.nav.skip > 0) { $range = "$.nav.skip entries back"; } if ($.nav.forward_url != "" or $.nav.backward_url != "") { if ($.nav.backward_url != "") { $back = """
  • $*text_skiplinks_back
  • """; } if ($.nav.forward_url != "") { $forward = """
  • $*text_skiplinks_forward
  • """; } } """
     
     
    """; } function RecentPage::print_body { foreach var Entry e ($.entries) { $this->print_entry($e); } } function EntryPage::print_body() { $this->print_entry($.entry); if ($.multiform_on and $.entry.comments.enabled and $.comment_pages.total_subitems > 0) { $this->print_multiform_start(); } if ($.entry.comments.enabled) { """
    """; $.comment_pages->print(); """ ( Post a new comment )
    """; $this->print_comments($.comments); """
    """; } if ($this.multiform_on and $.entry.comments.enabled and $.entry.comments.count > 0) { """
    """; $this->print_multiform_actionline(); $this->print_multiform_end(); """
    ( Post a new comment )"""; $.comment_pages->print(); """
    """; } } # ----------------------------------- # ENTRY # ----------------------------------- function EntryPage::print_comments( Comment[] comments ) { if ( size $comments == 0 ) { return; } foreach var Comment c ( $comments ) { var int indent = ($c.depth - 1) * 30; var string partialcomment = $c.full ? "" : "partial"; var string margin = ""; if ($*userpic_position == "left") { $margin = "right"; } else { $margin = "left"; } """"""; """
    \n"""; if ( $c.full ) { $this->print_comment( $c ); } else { $this->print_comment_partial( $c ); } "
    "; $this->print_comments( $c.replies ); } } function EntryPage::print_comment (Comment comment) { var string subject = $comment.subject ? $comment.subject : $*text_nosubject; var string date = $comment.time->date_format(); var string poster = isnull $comment.poster ? $*text_poster_anonymous : $comment.poster->as_string(); #Comment Userpic if (defined $comment.userpic and $*show_entry_userpic) { var int w = $comment.userpic.width; var int h = $comment.userpic.height; var string alt = $comment.metadata{"picture_keyword"}; if ($*comment_userpic_style == "small") { $w = $w / 2; $h = $h / 2; } if ($alt != "") { $alt = ": " + $alt; } """
    $comment.poster.name$alt"""; print """$poster on """; print $comment.time->date_format("long") + " - " + $comment.time->time_format(); } else { print """
    $poster on """; print $comment.time->date_format("long") + " - " + $comment.time->time_format(); } if (defined $comment.subject_icon or $comment.subject != "") { print "
    $comment.subject_icon $comment.subject" + "
    "; } if ($comment.metadata{"poster_ip"}) { print "
    " + $*text_comment_ipaddr + "(" + $comment.metadata{"poster_ip"} + ")" + "
    "; } "
    "; print """
    $comment.text
    \n"""; var string alignlinks = ""; if ($*userpic_position == "left") { $alignlinks = "right"; } else { $alignlinks = "left"; } "
    "; if ($comment.frozen) { "($*text_comment_frozen)"; } else { "($*text_comment_reply) "; } if ($comment.parent_url != "") { "($*text_comment_parent) "; } if ($comment.thread_url != "") { """($*text_comment_thread) """; } "($*text_permalink)"; """
    """; if ($this.multiform_on) { """"""; $comment->print_multiform_check(); } $comment->print_linkbar(); "
    \n"; } function EntryPage::print_comment_partial( Comment c ) { var string subject = $c.subject ? $c.subject : $*text_nosubject; var string date = $c.time->date_format("long") + " - " + $c.time->time_format(); var string poster = isnull $c.poster ? $*text_poster_anonymous : $c.poster->as_string(); """$subject - $poster on $date"""; } # ----------------------------------- # DAY # ----------------------------------- function DayPage::print_body() { """
     
     
    """; if ($.has_entries) { foreach var Entry e ($.entries) { $this->print_entry($e); } } else { """

    $*text_noentries_day

    """; } """
     
     
    """; } function CommentInfo::print() { if (not $.enabled) { return; } if ($.count > 0 or $.screened) { $this->print_readlink(); " | "; } $this->print_postlink(); } # ----------------------------------- # REPLY # ----------------------------------- function ReplyPage::print_body { if (not $.entry.comments.enabled) { print "

    $*text_reply_nocomments_header

    $*text_reply_nocomments

    "; return; } $.entry->print_linkbar(); """
    """; if (defined $.replyto.userpic) { print """
    $.replyto.userpic
    """; } var string poster = isnull $.replyto.poster ? $*text_poster_anonymous : $.replyto.poster->as_string(); var Page p; print """
    """; print $.replyto.poster.name + " ("; print $poster + ") "; print "wrote"; if ($.journal_type == "C") { print " in "; print $.replyto.journal; print " "; } print " "+lang_at_datetime($.replyto.time); print """
    $.replyto.subject
    $.replyto.text
     
    ( Read comments )
    Post a comment in response:
    """; $.form->print(); "
    "; } # ----------------------------------- # MONTH # ----------------------------------- function MonthPage::print_body { "

    "; $.redir->print_hiddens(); if ($.prev_url != "") { "[<<<]\n"; } if (size $.months > 1) { "\n"; } if ($.next_url != "") { "\n[>>>]\n"; } """
    \n

    """; foreach var MonthDay d ($.days) { if ($d.has_entries) { "
    "; print lang_ordinal($d.day); "
    \n
    "; $d->print_subjectlist(); "
    \n"; } } "
    "; } # ----------------------------------- # YEAR # ----------------------------------- function YearPage::print_body { $this->print_year_links(); foreach var YearMonth m ($.months) { $this->print_month($m); } } function YearPage::print_year_links() { """\n"""; } function YearPage::print_month(YearMonth m) { if (not $m.has_entries) { return; } """\n \n"""; foreach var int d (weekdays()) { """\n"; } "\n"; foreach var YearWeek w ($m.weeks) { $w->print(); } "
    """; print $m->month_format(); """ $*text_view_month
    """+$*lang_dayname_short[$d]+"



    "; } function YearWeek::print() { """\n"""; if ($.pre_empty > 0) { """ \n"""; } foreach var YearDay d ($.days) { """\n"""; """
    $d.day
    \n"""; if ($d.num_entries > 0) { """
    $d.num_entries
    \n"""; } else { """
     
    """; } """\n"""; } if ($.post_empty > 0) { """ \n"""; } ""; }