<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. https://www.livejournal.com/bots/  -->
<rss version='2.0'  xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>S2 Layouts on LiveJournal.com</title>
  <link>https://s2ljdotcom.livejournal.com/</link>
  <description>S2 Layouts on LiveJournal.com - LiveJournal.com</description>
  <lastBuildDate>Wed, 17 Aug 2005 20:18:44 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>s2ljdotcom</lj:journal>
  <lj:journalid>7618127</lj:journalid>
  <lj:journaltype>community</lj:journaltype>
  <copyright>NOINDEX</copyright>
  <item>
  <guid isPermaLink='true'>https://s2ljdotcom.livejournal.com/1255.html</guid>
  <pubDate>Wed, 17 Aug 2005 20:18:44 GMT</pubDate>
  <title>a moony kunundrum</title>
  <author>kunzite1</author>
  <link>https://s2ljdotcom.livejournal.com/1255.html</link>
  <description>changes:&lt;br /&gt;property-ified hard-coded english&lt;br /&gt;added tag support&lt;br /&gt;linkbar for all entries&lt;br /&gt;local vars in &lt;code&gt;print_entry()&lt;/code&gt; for selecting recent/friends/day/entry/reply userpics&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;&lt;hr /&gt;todo:&lt;br /&gt;ajax comments&lt;br /&gt;quick reply&lt;a name=&apos;cutid2-end&apos;&gt;&lt;/a&gt;&lt;hr /&gt;&lt;pre&gt;&lt;code&gt;# -*-s2-*-

layerinfo &quot;type&quot;            = &quot;layout&quot;;
layerinfo &quot;name&quot;            = &quot;A Moony Kunundrum&quot;;
layerinfo &quot;source_viewable&quot; = 1;
layerinfo &quot;redist_uniq&quot;     = &quot;anovelconundrum/layout&quot;;
layerinfo &quot;author_name&quot;     = &quot;taion/edited by kunzite1&quot;;

propgroup colors {
  property Color page_back {
    des = &quot;Page background&quot;;
  }
  property Color entry_text {
    des = &quot;Entry text color&quot;;
  }
  property Color text_weaker {
    des = &quot;Weaker text color&quot;;
  }
  property Color page_link {
    des = &quot;Link color&quot;;
  }
  property Color page_vlink {
    des = &quot;Visited link color&quot;;
  }
  property Color page_alink {
    des = &quot;Active link color&quot;;
  }
}

# From my last e-mail with Taion, the plan was to rasterize the leading fonts so that
# appearance issues could be avoided. However, I don&apos;t have access to many of the fonts
# that he tested with, so I&apos;ll have to put that off for later.

# You will need access to Microsoft provided fonts for most accurate rendering, but
# we are working on specifying usable alternatives that are cross platform friendly.
propgroup fonts {
  property use font_base;
  property string font_fallback {
    des = &quot;Alternative font style&quot;;
  }
  property string font_type {
    des = &quot;Body font type&quot;;
    note = &quot;General font class for body text&quot;;
  }
  property int font_size {
    des = &quot;Body font size (points)&quot;;
  }
  property int font_leading {
    des = &quot;Body font leading (points)&quot;;
  }
  property string title_letterspacing {
    des = &quot;Letterspacing in titles&quot;;
  }
  property bool title_smallcaps {
    des = &quot;Smallcaps in titles&quot;;
  }
  property bool title_underline {
    des = &quot;Underlined titles&quot;;
  }
  property string font_flourish_base {
    des = &quot;Font face for decorative flourishes&quot;;
  }
  property string font_flourish_fallback {
    des = &quot;Alternate font face for decorative flourishes&quot;;
  }
  property string font_flourish_type {
    des = &quot;Font type for decorative flourishes&quot;;
  }
  property string font_secondary_base {
    des = &quot;Font face for secondary text&quot;;
  }
  property string font_secondary_fallback {
    des = &quot;Alternate font face for secondary text&quot;;
  }
  property string font_secondary_type {
    des = &quot;Font type for secondary text&quot;;
  }
  property int font_secondary_size {
    des = &quot;Secondary font size (points)&quot;;
    note = &quot;For best results, match optical x-height with the body font&quot;;
  }
  property string flourish_rm {
    des = &quot;Right margin for flourishes&quot;;
  }
  property string dc_rm {
    des = &quot;Right margin for drop caps&quot;;
  }
}

propgroup presentation {
  property string dingbar_url { 
    des = &quot;URL to spacer image between portions of content&quot;;
    note = &quot;A default will be chosen for you if left blank.&quot;;
  }

  property use page_recent_items;
  property use page_friends_items;
  property use tags_aware;

  property string body_width {
    des = &quot;Text body width&quot;;
  }

  property int dcLen {
    des = &quot;Minimum length in characters before using drop caps&quot;;
  }

  property use view_entry_disabled;
  property use use_shared_pic;
  property use comment_userpic_style;
  property bool show_entrynav_icons {
    des = &quot;Toggle to show the next, memory, edit, etc icons on the entry view page&quot;;
  }
  property string page_background_image {
    des = &quot;URL to an image to be used for the page background&quot;;
  }
  property use external_stylesheet;
}

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_meta_music;
  property use text_meta_mood;
  property string text_seperator {
    des = &quot;Text used to seperate stuff&quot;;
  }
  property string text_years_header {
    des = &quot;Text used for Years header&quot;;
  }
  property string text_comment_screened {
    des = &quot;Text used for donoting a screened comment&quot;;
  }
  property string text_comment_commented {
    des = &quot;Text used for &apos;commented&apos;&quot;;
  }
  property string text_comment_replied {
    des = &quot;Text used for &apos;replied&apos;&quot;;
  }
  property string text_comment_on {
    des = &quot;Text used for &apos;on&apos;&quot;;
  }
  property string text_reply_reply {
    des = &quot;Text used for &apos;Reply&apos;&quot;;
  }
  property string text_reply_entry {
    des = &quot;Text used for &apos;to this entry&apos;&quot;;
  }
  property string text_reply_comment {
    des = &quot;Text used for &apos;to this comment&apos;&quot;;
  }
  property string text_dingbar_alt {
    des = &quot;Alternative text for dingbar images&quot;;
    noui = 1;
  }
}

# Set default colors
set entry_text              = &quot;#000000&quot;;
set text_weaker             = &quot;#666666&quot;;
set page_alink              = &quot;#333333&quot;;
set page_back               = &quot;#f5f5dc&quot;;
set page_link               = &quot;#000000&quot;;
set page_vlink              = &quot;#666666&quot;;

set body_width              = &quot;35em&quot;;
set dcLen                   = 200;
set show_entrynav_icons     = true;
set page_background_image   = &quot;&quot;;
set tags_aware              = true;

set dc_rm                   = &quot;0.2em&quot;;
set dingbar_url             = &quot;&quot;;
set flourish_rm             = &quot;0.093em&quot;;
set font_base               = &quot;Palatino Linotype&quot;;
set font_fallback           = &quot;Book Antiqua&quot;;
set font_flourish_base      = &quot;Edwardian Script ITC\&quot;, \&quot;Edwardian Script ITC Semi-Expanded&quot;;
set font_flourish_fallback  = &quot;Zapfino\&quot;, \&quot;Viner Hand ITC&quot;;
set font_flourish_type      = &quot;cursive&quot;;
set font_leading            = 14;
set font_secondary_base     = &quot;Frutiger Linotype&quot;;
set font_secondary_fallback = &quot;Tahoma&quot;;
set font_secondary_size     = 9;
set font_secondary_type     = &quot;sans-serif&quot;;
set font_size               = 10;
set font_type               = &quot;serif&quot;;
set title_letterspacing     = &quot;0.08em&quot;;
set title_smallcaps         = true;
set title_underline         = false;

set text_dingbar_alt        = &quot;* * *&quot;;
set text_meta_mood          = &quot;Current Mood:&quot;;
set text_meta_music         = &quot;Current Music:&quot;;
set text_poster_anonymous   = &quot;an anonymous reader&quot;;
set text_seperator          = &quot; &amp;amp;middot; &quot;;
set text_view_archive       = &quot;Archive&quot;;
set text_view_friends       = &quot;Friends&quot;;
set text_view_recent        = &quot;Entries&quot;;
set text_view_userinfo      = &quot;Profile&quot;;
set text_years_header       = &quot;Years&quot;;
set text_comment_screened   = &quot;(Screened)&quot;;
set text_comment_commented  = &quot;commented&quot;;
set text_comment_replied    = &quot;replied&quot;;
set text_comment_on         = &quot;&amp;amp;mdash;&amp;amp;thinsp;On&quot;;
set text_reply_reply        = &quot;Reply&quot;;
set text_reply_entry        = &quot;to this entry&quot;;
set text_reply_comment      = &quot;to this comment&quot;;

function prop_init() {
  var PalItem start = PalItem(0, $*entry_text);
  var PalItem end   = PalItem(13, $*page_back);
    if ($*dingbar_url == &quot;&quot;) { $*dingbar_url = palimg_gradient(&quot;anovelconundrum/dingbar.gif&quot;, $start, $end); }
}

function print_stylesheet() {
  print clean_url($*page_background_image) != &quot;&quot; ? &quot;body { background-image: url($*page_background_image); }&quot; : &quot;&quot;;
&quot;&quot;&quot;
body {
  margin-top:    1in;
  margin-bottom: 0.6in;
}

body, td, h2, .caption, h1, h3 {
&quot;&quot;&quot;;
if ($*font_base != &quot;&quot; or $*font_fallback != &quot;&quot; or $*font_type != &quot;&quot;) {
    &quot;font-family: &quot;;
    if ($*font_base != &quot;&quot;) {
        &quot;\&quot;$*font_base\&quot;&quot;;
        if ($*font_fallback != &quot;&quot; or $*font_type != &quot;&quot;) {
            &quot;, &quot;;
        }
    }
    if ($*font_fallback != &quot;&quot;) {
        &quot;\&quot;$*font_fallback\&quot;&quot;;
        if ($*font_type != &quot;&quot;) {
            &quot;, &quot;;
        }
    }
    if ($*font_type != &quot;&quot;) {
        &quot;$*font_type&quot;;
    }
    &quot;;\n&quot;;
}
&quot;&quot;&quot;
  font-size:   ${*font_size}pt;
  line-height: ${*font_leading}pt;
  font-weight: normal;
}

.caption, h1, h3 {
&quot;&quot;&quot;; if($*title_smallcaps) {&quot;&quot;&quot;
  font-variant:   small-caps;
  text-transform: lowercase;
&quot;&quot;&quot;; }
&quot;&quot;&quot;  letter-spacing: $*title_letterspacing;
}
h1 { font-size: 16pt; }
h3 { font-size: 12pt; }
h2, .noul, .ult {
  font-style: italic;
  margin:     0px;
}

.caption {
&quot;&quot;&quot;; if($*title_underline) {&quot;&quot;&quot;
  text-decoration: underline;
&quot;&quot;&quot;; }
&quot;&quot;&quot; }

.flourish, .bodyl:first-letter {
&quot;&quot;&quot;;
if ($*font_flourish_base != &quot;&quot; or $*font_flourish_fallback != &quot;&quot; or $*font_flourish_type != &quot;&quot;) {
    &quot;font-family: &quot;;
    if ($*font_flourish_base != &quot;&quot;) {
        &quot;\&quot;$*font_flourish_base\&quot;&quot;;
        if ($*font_flourish_fallback != &quot;&quot; or $*font_flourish_type != &quot;&quot;) {
            &quot;, &quot;;
        }
    }
    if ($*font_flourish_fallback != &quot;&quot;) {
        &quot;\&quot;$*font_flourish_fallback\&quot;&quot;;
        if ($*font_flourish_type != &quot;&quot;) {
            &quot;, &quot;;
        }
    }
    if ($*font_flourish_type != &quot;&quot;) {
        &quot;$*font_flourish_type&quot;;
    }
    &quot;;\n&quot;;
}
&quot;&quot;&quot;
}

.flourish {
  margin-right:   ${*flourish_rm};
  z-index:        1;
  font-size:      34pt;
  position:       relative;
  top:            0.1em;
  text-transform: uppercase;
}

.sfon, .index, .author, select, input {
&quot;&quot;&quot;;
if ($*font_secondary_base != &quot;&quot; or $*font_secondary_fallback != &quot;&quot; or $*font_secondary_type != &quot;&quot;) {
    &quot;font-family: &quot;;
    if ($*font_secondary_base != &quot;&quot;) {
        &quot;\&quot;$*font_secondary_base\&quot;&quot;;
        if ($*font_secondary_fallback != &quot;&quot; or $*font_secondary_type != &quot;&quot;) {
            &quot;, &quot;;
        }
    }
    if ($*font_secondary_fallback != &quot;&quot;) {
        &quot;\&quot;$*font_secondary_fallback\&quot;&quot;;
        if ($*font_secondary_type != &quot;&quot;) {
            &quot;, &quot;;
        }
    }
    if ($*font_secondary_type != &quot;&quot;) {
        &quot;$*font_secondary_type&quot;;
    }
    &quot;;\n&quot;;
}
&quot;&quot;&quot; font-size: ${*font_secondary_size}pt;

  line-height: ${*font_leading}pt;
}

.index {
  width:        10em;
  margin-right:  1.2em;
}

.bodybox { width: $*body_width; }

.body, .bodyl, .bodyns {
  text-align: justify;
}
.bodyl:first-letter {
  font-size:      &quot;&quot;&quot; + (2* $*font_leading) + &quot;&quot;&quot;pt;
  margin-bottom:  -&quot;&quot;&quot; + $*font_size + &quot;&quot;&quot;pt;
  margin-right:   ${*dc_rm};
  float:          left;
  border-bottom:  none;
  text-transform: uppercase;
  line-height:    &quot;&quot;&quot; + (2* $*font_leading) + &quot;&quot;&quot;pt;
}
.bodyns:first-line, .sc, small, .sct {
&quot;&quot;&quot;; if($*title_smallcaps) {&quot;&quot;&quot;
  font-variant:   small-caps;
  text-transform: lowercase;
&quot;&quot;&quot;; }
    if($*title_underline) {&quot;&quot;&quot;
  text-decoration: underline;
&quot;&quot;&quot;; }
&quot;&quot;&quot;  letter-spacing: 0.05em;
}

.sct {
  letter-spacing: $*title_letterspacing;
  text-align:     center;
}

.author {
  float:         right;
  text-align:    center;
  margin-left:   1.5em;
  margin-bottom: 0.5em;
}

.ywp {
  width:          2em;
  margin-left:  0.5em;
  margin-right: 0.5em;
}

blockquote {
  margin-top:    ${*font_leading}pt;
  margin-bottom: ${*font_leading}pt;
  margin-left:   2em;
}

tt, pre, textarea {
  font-family: &quot;Lucida Console&quot;, monospace;
  font-size:&quot;&quot;&quot;+ ((${*font_size}*4)/5) + &quot;&quot;&quot;pt;
}

a {text-decoration: none;}
.body a, .bodyl a, .bodyns a, .bodynsl a, .author a, .ult a, .uts a { border-bottom: 1px dotted; }
.ljuser a, a img, .smallbar a, .noul a { border-bottom: none; }
a:hover, .ljuser a:hover { border-bottom: 1px solid; }

p {
  text-indent: 1.5em;
  margin:        0px;
  padding:       0px;
}

blockquote + p { text-indent: 0px; }

.uts {
  font-size:     80%;
  font-style:    italic;
  text-align:    center;
  line-height:   &quot;&quot;&quot; + $*font_size + &quot;&quot;&quot;pt;
  margin-bottom: &quot;&quot;&quot; + ($*font_leading-$*font_size) + &quot;&quot;&quot;pt;
}

.smallbar {
  font-size:   80%;
  font-style:  italic;
  text-align:  center;
  line-height: &quot;&quot;&quot; + (2*$*font_leading) + &quot;&quot;&quot;pt;
  clear:       right;
}

.ljcomsel {
  position:     relative;
  top:          0.75pt;
  height:       7.5pt;
  padding-left: 1pt;
}
input#username, input#password { margin-right: 0.5em; }

.bs {
  margin-top:    &quot;&quot;&quot; + (2*$*font_leading) + &quot;&quot;&quot;pt;
  margin-bottom: &quot;&quot;&quot; + (2*$*font_leading) + &quot;&quot;&quot;pt;
  text-align:    center;
  line-height:   ${*font_leading}pt;
}

select, input, textarea {
  background-color: $*page_back;
  color:            $*entry_text;
&quot;&quot;&quot;;
if ($*font_base != &quot;&quot; or $*font_fallback != &quot;&quot; or $*font_type != &quot;&quot;) {
    &quot;font-family: &quot;;
    if ($*font_base != &quot;&quot;) {
        &quot;\&quot;$*font_base\&quot;&quot;;
        if ($*font_fallback != &quot;&quot; or $*font_type != &quot;&quot;) {
            &quot;, &quot;;
        }
    }
    if ($*font_fallback != &quot;&quot;) {
        &quot;\&quot;$*font_fallback\&quot;&quot;;
        if ($*font_type != &quot;&quot;) {
            &quot;, &quot;;
        }
    }
    if ($*font_type != &quot;&quot;) {
        &quot;$*font_type&quot;;
    }
    &quot;;\n&quot;;
}
&quot;&quot;&quot;
  font-size:   ${*font_size}pt;
  line-height: ${*font_leading}pt;
  font-weight: normal;
}
&quot;&quot;&quot;;
}

function find_lpar(string t) : int {
  foreach var int i (reverse (0 .. ($t-&amp;gt;length()-1))) {
    if($t-&amp;gt;substr($i,1)==&quot;(&quot;) { return $i; }
  }
  return -1;
}

function render_title(string t, int len) {
  foreach var int i (0 .. ($len-1)) {
    var string pc = $t-&amp;gt;substr($i-1,1);
    var string cc = $t-&amp;gt;substr($i,1);
    if($cc==&quot; &quot;) { &quot;$*text_seperator&quot;; }
      elseif( $i &amp;gt; 0 and $pc != &quot; &quot;) { &quot;$cc&quot;; }
        elseif ($cc==&quot;A&quot; or $cc==&quot;B&quot; or $cc==&quot;C&quot; or $cc==&quot;D&quot; or $cc==&quot;E&quot; or $cc==&quot;F&quot; or $cc==&quot;G&quot; or $cc==&quot;H&quot; or $cc==&quot;I&quot; or $cc==&quot;J&quot; or $cc==&quot;K&quot; or $cc==&quot;L&quot; or $cc==&quot;M&quot; or $cc==&quot;N&quot; or $cc==&quot;O&quot; or $cc==&quot;P&quot; or $cc==&quot;Q&quot; or $cc==&quot;R&quot; or $cc==&quot;S&quot; or $cc==&quot;T&quot; or $cc==&quot;U&quot; or $cc==&quot;V&quot; or $cc==&quot;W&quot; or $cc==&quot;X&quot; or $cc==&quot;Y&quot; or $cc==&quot;Z&quot;) {
          &quot;&amp;lt;span class=&apos;flourish&apos;&amp;gt;$cc&amp;lt;/span&amp;gt;&quot;;
        }
      else { &quot;$cc&quot;; }
  }
}

# if we&apos;ve got the voicepost player, print text using trusted function
# else, use render_body() to make pretty formatting
function print_text(EntryLite e) {
  if(not $e.text-&amp;gt;contains(&quot;http://stat.livejournal.com/pp_play_mp3.swf&quot;)) {
    render_body($e.text);
  } else {
    $e-&amp;gt;print_text();
  }
}

function render_body(string t) {
  var int str=0;
  var bool par=false;
  var bool pars=false;
  $str = ($t-&amp;gt;substr(0,6) == &quot;&amp;lt;br /&amp;gt;&quot; ? 6 : 0);
  if($t-&amp;gt;substr(0,3) == &quot;&amp;lt;p&amp;gt;&quot;) { $str = 3; $pars=true; }
  foreach var int i ($str .. ($t-&amp;gt;length()-1)) {
    if($t-&amp;gt;substr($i,12) == &quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&quot;) {
      $str=$i+12;
      if($par) { &quot;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&quot;; }
        else { &quot;&amp;lt;p&amp;gt;&quot;; $par=true; }
      }
      elseif($pars and $t-&amp;gt;substr($i,4) == &quot;&amp;lt;/p&amp;gt;&quot;) { $str=$i+4; $pars=false; }
      elseif($i &amp;gt;= $str) { print $t-&amp;gt;substr($i,1); }
  }
  if($par) { &quot;&amp;lt;/p&amp;gt;&quot;; }
}

function display_title(Page p) {
  var string dtitle = $p.global_title;
  var string stitle = $p-&amp;gt;view_title();
  $stitle = ($p.view == &quot;recent&quot; ? $p.global_subtitle : $stitle);
  var int lenm=$stitle-&amp;gt;length()-1;
  var int i=$dtitle-&amp;gt;length()+1;
  if ($dtitle == &quot;&quot;) {
    $dtitle = $p.journal.name;
    $i=$dtitle-&amp;gt;length()+1;
  }
  if ($p.view == &quot;friends&quot;) {
    $dtitle = $p-&amp;gt;view_title();
    $i=find_lpar($dtitle);
    if($i==-1) { $i = $lenm+2; }
  }

&quot;&quot;&quot;&amp;lt;div align=&quot;center&quot;&amp;gt;
&amp;lt;h1&amp;gt;&quot;&quot;&quot;; render_title($dtitle,$i-1); &quot;&quot;&quot;&amp;lt;/h1&amp;gt;&quot;&quot;&quot;;
if($p.view != &quot;friends&quot; and $stitle != &quot;&quot;) { &quot;&quot;&quot;&amp;lt;br /&amp;gt;&amp;lt;h3 style=&quot;margin-top:-1em;&quot;&amp;gt;$stitle&amp;lt;/h3&amp;gt;&quot;&quot;&quot;; }
elseif($p.view == &quot;friends&quot; and $i&amp;lt;$lenm) { &quot;&amp;lt;br /&amp;gt;&amp;lt;h3 style=&apos;margin-top:-1em;&apos;&amp;gt;&quot; + $dtitle-&amp;gt;substr($i+1,($lenm-$i)-1) + &quot;&amp;lt;/h3&amp;gt;&quot;; }
&quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
}

function Page::print() {
  var string title = $this-&amp;gt;title();

  var string links;
  var bool firstlink = true;
  foreach var string v ($.views_order) {
    if ($firstlink == false) {
      $links = &quot;$links$*text_seperator&quot;;
    }
      else {
      $firstlink = false;
    }
    $links = $links + (&quot;&amp;lt;a href=&apos;$.view_url{$v}&apos;&amp;gt;&quot;+lang_viewname($v)+&quot;&amp;lt;/a&amp;gt;&quot;);
  }

&quot;&quot;&quot;&amp;lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&amp;gt;\n&amp;lt;html&amp;gt;\n&amp;lt;head&amp;gt;\n&quot;&quot;&quot;;

    if ($*external_stylesheet) {
        println &quot;&quot;&quot;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;$.stylesheet_url&quot; type=&quot;text/css&quot; /&amp;gt;&quot;&quot;&quot;;
    } else {
        println &quot;&quot;&quot;&amp;lt;style type=&quot;text/css&quot;&amp;gt;&quot;&quot;&quot;; print_stylesheet(); &quot;&amp;lt;/style&amp;gt;&quot;;
    }
    $this-&amp;gt;print_head();

&quot;&quot;&quot;&amp;lt;title&amp;gt;$title&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body bgcolor=&quot;$*page_back&quot; text=&quot;$*entry_text&quot; link=&quot;$*page_link&quot; vlink=&quot;$*page_vlink&quot; alink=&quot;$*page_alink&quot;&amp;gt;&quot;&quot;&quot;;
display_title($this);
&quot;&quot;&quot;&amp;lt;div style=&quot;text-align:center; margin-bottom: ${*font_leading}pt;&quot;&amp;gt;
&amp;lt;h2&amp;gt;$links&amp;lt;/h2&amp;gt;
&amp;lt;/div&amp;gt;
&quot;&quot;&quot;;
$this-&amp;gt;print_body();
&quot;&quot;&quot;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&quot;&quot;&quot;;
}

function Entry::print_linkbar() {
  var string   link_seperator = &quot;&amp;lt;br /&amp;gt;&quot;; # seperator for links

  # initialize array/hashes
  var string[] link_keyseq    = [&quot;&quot;];
  var string{} link_url       = {&quot;&quot; =&amp;gt; &quot;&quot;};
  var string{} link_caption   = {&quot;&quot; =&amp;gt; &quot;&quot;};
  var string{} link_image     = {&quot;&quot; =&amp;gt; &quot;&quot;};

  var string print           = &quot;&quot;;                                         # var for printing
  var Page   p               = get_page();                                 # page handle to determine interentry
  var bool   show_interentry = ($p.view == &quot;entry&quot; or $p.view == &quot;reply&quot;); # if entry/reply view, show interentry
  var int    keyseq_index    = 0;                                          # set index point for new link_keyseq array

  if($show_interentry) {
    # if show interentry, put previous entry link first
    $link_keyseq[$keyseq_index++] = &quot;nav_prev&quot;;

    # get previous entry link information
    var Link prev             = $this-&amp;gt;get_link(&quot;nav_prev&quot;);
    $link_url{&quot;nav_prev&quot;}     = $prev.url;
    $link_caption{&quot;nav_prev&quot;} = $prev.caption;
    $link_image{&quot;nav_prev&quot;}   = $prev.icon.url;

    # get next entry link information
    var Link next             = $this-&amp;gt;get_link(&quot;nav_next&quot;);
    $link_url{&quot;nav_next&quot;}     = $next.url;
    $link_caption{&quot;nav_next&quot;} = $next.caption;
    $link_image{&quot;nav_next&quot;}   = $next.icon.url;
  }

  # gather current linkbar
  foreach var string link_key ($.link_keyseq) {
    var Link  link            = $this-&amp;gt;get_link($link_key);
    $link_url{$link_key}      = $link.url;
    $link_caption{$link_key}  = $link.caption;
    $link_image{$link_key}    = $link.icon.url;
    $link_keyseq[$keyseq_index++] = $link_key; # add this to new link_keyseq array
  }
  if($show_interentry) {
    # if show interentry, put next entry link last
    $link_keyseq[$keyseq_index++] = &quot;nav_next&quot;;
  }

  #################################################################################################################
  # by now, the above hashes should look something like:                                                          #
  #                                                                                                               #
  # If interentry:                                                                                                #
  #   Previous Entry:                                                                                             # 
  #    $link_url{&quot;nav_prev&quot;}     = http://www.livejournal.com/go.bml?journal=exampleusername&amp;amp;itemid=256&amp;amp;dir=prev  #
  #    $link_caption{&quot;nav_prev&quot;} = Previous Entry                                                                 #
  #    $link_image{&quot;nav_prev&quot;}   = http://stat.livejournal.com/img/btn_prev.gif                                   #
  #                                                                                                               #
  # Edit Entry:                                                                                                   # 
  #  $link_url{&quot;edit_entry&quot;}     = http://www.livejournal.com/editjournal.bml?journal=exampleusername&amp;amp;itemid=256  #
  #  $link_caption{&quot;edit_entry&quot;} = Edit Entry                                                                     #
  #  $link_image{&quot;edit_entry&quot;}   = http://stat.livejournal.com/img/btn_edit.gif                                   #
  #                                                                                                               #
  # Edit Tags:                                                                                                    # 
  #  $link_url{&quot;edit_tags&quot;}      = http://www.livejournal.com/edittags.bml?journal=exampleusername&amp;amp;itemid=256     #
  #  $link_caption{&quot;edit_tags&quot;}  = Edit Tags                                                                      #
  #  $link_image{&quot;edit_tags&quot;}    = http://stat.livejournal.com/img/btn_edittags.gif                               #
  #                                                                                                               #
  # Add to Memories:                                                                                              # 
  #  $link_url{&quot;mem_add&quot;}        = http://www.livejournal.com/tools/memadd.bml?journal=exampleusername&amp;amp;itemid=256 #
  #  $link_caption{&quot;mem_add&quot;}    = Add to Memories                                                                #
  #  $link_image{&quot;mem_add&quot;}      = http://stat.livejournal.com/img/btn_memories.gif                               #
  #                                                                                                               #
  # If interentry:                                                                                                #
  #   Next Entry:                                                                                                 #
  #    $link_url{&quot;nav_next&quot;}     = http://www.livejournal.com/go.bml?journal=exampleusername&amp;amp;itemid=256&amp;amp;dir=next  #
  #    $link_caption{&quot;nav_next&quot;} = Next Entry                                                                     #
  #    $link_image{&quot;nav_next&quot;}   = http://stat.livejournal.com/img/btn_next.gif                                   #
  #################################################################################################################

  # alter data here
  $link_image{&quot;nav_prev&quot;}   = &quot;&quot;;
  $link_image{&quot;edit_entry&quot;} = &quot;&quot;;
  $link_image{&quot;mem_add&quot;}    = &quot;&quot;;
  $link_image{&quot;edit_tags&quot;}  = &quot;&quot;;
  $link_image{&quot;nav_next&quot;}   = &quot;&quot;;

  # $link_keyseq[size($link_keyseq)] = &quot;permalink&quot;;      # add a permalink to end of linkbar
  # $link_url{&quot;permalink&quot;}           = $.permalink_url;
  # $link_caption{&quot;permalink&quot;}       = $*text_permalink;
  # $link_image{&quot;permalink&quot;}         = &quot;&quot;;

  $print = $link_seperator;

  # loop thru linkbar and add links to print var
  foreach var string link_key ($link_keyseq) {
    # if we can do performed action, url will be present
    if($link_url{$link_key} != &quot;&quot;) {
      $print = $print + &quot;&quot;&quot;&amp;lt;a href=&quot;$link_url{$link_key}&quot;&amp;gt;&quot;&quot;&quot;;
      # if image url available, use it
      if($link_image{$link_key} != &quot;&quot;) {
        $print = $print + &quot;&quot;&quot;&amp;lt;img src=&quot;$link_image{$link_key}&quot; alt=&quot;$link_caption{$link_key}&quot; title=&quot;$link_caption{$link_key}&quot; border=&quot;0&quot; /&amp;gt;&quot;&quot;&quot;;
      } else {
        # else, just use text
        $print = $print + &quot;$link_caption{$link_key}&quot;;
      }
      # add a seperator
      $print = $print + &quot;&amp;lt;/a&amp;gt;$link_seperator&quot;;
    }
  }

  # hack off last seperator
  $print = $print-&amp;gt;substr(0, $print-&amp;gt;length() - $link_seperator-&amp;gt;length());

  # we&apos;re done! let&apos;s print it!
  print $print;
}

function Entry::print_metadata() {
  var string tags_header          = &quot;Current Tags&quot;;
  var string tags_joiner          = &quot;:&quot;;
  var Link   edit_tags            = $this-&amp;gt;get_link(&quot;edit_tags&quot;);
  if ((size $.metadata &amp;gt; 0) or ((size $.tags &amp;gt; 0) and ($*tags_aware))){
    var string currents = &quot;&quot;;
    $currents = &quot;&quot;&quot;&amp;lt;div style=&quot;margin-top:${*font_leading}pt;&quot;&amp;gt;&amp;lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot;&amp;gt;&quot;&quot;&quot;;
    foreach var string k ($.metadata){
      var string text = $k;
      var string val = $.metadata{$k};
      if ($k == &quot;mood&quot;){
        $text = $*text_meta_mood;
      } 
      elseif ($k == &quot;music&quot;) {
        $text = $*text_meta_music;
      }
      if ($k == &quot;mood&quot; and defined $.mood_icon){
        var Image i = $.mood_icon;
        $val = &quot;&amp;lt;img src=&apos;$i.url&apos; width=&apos;$i.width&apos; height=&apos;$i.height&apos; align=&apos;middle&apos; alt=&apos;&apos; /&amp;gt; $val&quot;;
      }
      $currents = $currents + &quot;&quot;&quot;&amp;lt;tr&amp;gt;&amp;lt;td align=&quot;right&quot;&amp;gt;&amp;lt;div class=&quot;sc&quot; style=&quot;margin-right:1em;&quot;&amp;gt;$text&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&quot;left&quot;&amp;gt;$val&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&quot;&quot;&quot;;
    }
    if ((size $.tags &amp;gt; 0) and $*tags_aware) {
      var int    tcount               = 0;
      if($edit_tags.url != &quot;&quot;) {
        $tags_header = &quot;&quot;&quot;&amp;lt;a href=&quot;$edit_tags.url&quot;&amp;gt;$tags_header&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
      }
      $currents = $currents + &quot;&quot;&quot;&amp;lt;tr&amp;gt;&amp;lt;td align=&quot;right&quot;&amp;gt;&amp;lt;div class=&quot;sc&quot; style=&quot;margin-right:1em;&quot;&amp;gt;$tags_header$tags_joiner&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td align=&quot;left&quot;&amp;gt;&quot;&quot;&quot;;
      foreach var Tag t ($.tags) {
        $currents = $currents + &quot;&quot;&quot;&amp;lt;a rel=&quot;tag&quot; href=&quot;$t.url&quot;&amp;gt;$t.name&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        $tcount++;
        if ($tcount != size $.tags) { $currents = $currents + &quot;, &quot;; }
      }
    }
    $currents = $currents + &quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;lt;/table&amp;gt;&quot;; 
    println &quot;$currents&quot;;
  }
}

function print_entry(Page p, Entry e) {
  var bool show_recent_userpic  = ($p.view == &quot;recent&quot;)  and (true);
  var bool show_friends_userpic = ($p.view == &quot;friends&quot;) and (true);
  var bool show_day_userpic     = ($p.view == &quot;day&quot;)     and (true);
  var bool show_entry_userpic   = ($p.view == &quot;entry&quot;)   and (true);
  var bool show_reply_userpic   = ($p.view == &quot;reply&quot;)   and (true);
  var bool show_userpic         = $show_recent_userpic or $show_friends_userpic or $show_day_userpic or $show_entry_userpic or $show_reply_userpic;

  var string date=$e.time-&amp;gt;date_format(&quot;short&quot;);
  var string time=$e.time-&amp;gt;time_format();
  &quot;&quot;&quot;
&amp;lt;table cellpadding=&apos;0&apos; cellspacing=&apos;0&apos; border=&apos;0&apos; align=&apos;center&apos;&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td align=&quot;center&quot; colspan=&quot;2&quot;&amp;gt;&amp;lt;img
src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; class=&quot;bs&quot;/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;
    &amp;lt;td align=&quot;right&quot; valign=&quot;top&quot; width=&quot;100&quot;&amp;gt;&amp;lt;div class=&quot;index&quot;&amp;gt;&quot;&quot;&quot;;
&quot;&quot;&quot;        &amp;lt;a href=&quot;$e.permalink_url&quot;&amp;gt;$time&amp;lt;br /&amp;gt;
        $date&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;
    &quot;&quot;&quot;;
    $e.comments-&amp;gt;print();
    $e-&amp;gt;print_linkbar();

&quot;&quot;&quot;    &amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;td valign=&quot;top&quot;&amp;gt;
        &amp;lt;div class=&quot;bodybox&quot;&amp;gt;
        &amp;lt;div class=&quot;author&quot;&amp;gt;&quot;&quot;&quot;;

    if (defined $e.userpic and $show_userpic) {
        &quot;&quot;&quot;&amp;lt;a href=&quot;$*SITEROOT/allpics.bml?user=$e.poster.username&quot;&amp;gt;&amp;lt;img border=&quot;0&quot; src=&quot;$e.userpic.url&quot; width=&quot;$e.userpic.width&quot; height=&quot;$e.userpic.height&quot; alt=&quot;$e.poster.name&quot; title=&quot;$e.poster.name&quot; border=&quot;0&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&quot;&quot;&quot;;
    }
    if ($e.poster.username != $e.journal.username and $e.journal.journal_type ==&quot;C&quot;) {
      &quot;&quot;&quot;$e.journal&amp;lt;br /&amp;gt;&quot;&quot;&quot;;
    }
    if(($e.poster.username != $e.journal.username) or $p.view == &quot;friends&quot;) { print $e.poster; }
    if ($e.security != &quot;&quot;) {
        $e.security_icon-&amp;gt;print();
    }
        
    var string subject=$e.subject;
    if($p.view==&quot;entry&quot;) { $subject=&quot;&quot;; }
&quot;&quot;&quot;&amp;lt;/div&amp;gt;
        &amp;lt;div class=&quot;caption&quot;&amp;gt;
            $subject
        &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
    if ($subject == &quot;&quot; and $p.view!=&quot;entry&quot;) {&quot;&amp;lt;div class=&apos;bodyns&apos;&amp;gt;&quot;;}
    elseif ($e.text-&amp;gt;length() &amp;gt; $*dcLen) {&quot;&amp;lt;div class=&apos;bodyl&apos;&amp;gt;&quot;;}
    else {&quot;&amp;lt;div class=&apos;body&apos;&amp;gt;&quot;;}
    print_text($e);

    $e-&amp;gt;print_metadata();

&quot;&quot;&quot;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;&quot;&quot;&quot;;
&quot;&amp;lt;/table&amp;gt;&quot;;
} # print_entry(Page,Entry,Color,Color)

function Page::print_entry(Entry e) {
   print_entry($this, $e);
}

function FriendsPage::print_entry(Entry e) {
   print_entry($this, $e);
}

function RecentPage::print_body() {
  var string previous = get_plural_phrase($.nav.backward_count, &quot;text_skiplinks_back&quot;);
  var string next     = get_plural_phrase($.nav.forward_count, &quot;text_skiplinks_forward&quot;);
    foreach var Entry e ($.entries) {
        $this-&amp;gt;print_entry($e);
    }
&quot;&quot;&quot;
&amp;lt;div align=&quot;center&quot; class=&quot;bs&quot; style=&quot;line-height: ${*font_leading}pt;&quot;&amp;gt;&amp;lt;img
src=&quot;$*dingbar_url&quot; style=&quot;text-align:center;&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;div align=&quot;center&quot;&amp;gt;&amp;lt;h2&amp;gt;
&quot;&quot;&quot;;

    # go forward/backward if possible
    if ($.nav.forward_url != &quot;&quot; or $.nav.backward_url != &quot;&quot;) {
        var string sep;
        var string back;
        var string forward;
        if ($.nav.backward_url != &quot;&quot;) {
            $back = &quot;&quot;&quot;&amp;lt;a href=&quot;$.nav.backward_url&quot;&amp;gt;$previous&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        }
        if ($.nav.forward_url != &quot;&quot;) {
            $forward = &quot;&quot;&quot;&amp;lt;a href=&quot;$.nav.forward_url&quot;&amp;gt;$next&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        }
        if ($back != &quot;&quot; and $forward != &quot;&quot;) { $sep = &quot;$*text_seperator&quot;; }
        &quot;$back$sep$forward&quot;;
    }
    &quot;&amp;lt;/h2&amp;gt;&amp;lt;/div&amp;gt;&quot;;
}

function CommentInfo::print() {
    if (not $.enabled) { return; }
    if ($.count &amp;gt; 0 or $.screened) {
        $this-&amp;gt;print_readlink(); &quot;&amp;lt;br /&amp;gt;&quot;;
    }
    $this-&amp;gt;print_postlink();
}

function YearPage::print_year_links() {
    &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
    &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;&amp;lt;div class=&quot;sct&quot;&amp;gt;$*text_years_header&amp;lt;/div&amp;gt;&amp;lt;h2 style=&quot;text-align:center;&quot;&amp;gt;&quot;&quot;&quot;;
    
    var bool d=false;
    foreach var YearYear y ($.years) {
        if($d) { &quot;$*text_seperator&quot;; }
        else { $d=true; }
        if ($y.displayed) {
            &quot;$y.year&quot;;
        } else {
            &quot;&amp;lt;a href=\&quot;$y.url\&quot;&amp;gt;$y.year&amp;lt;/a&amp;gt;&quot;;
        }
    }
    &quot;&amp;lt;/h2&amp;gt;&quot;;
}

function YearPage::print_month(YearMonth m) {
    if (not $m.has_entries) { return; }

 &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
&amp;lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot; align=&quot;center&quot;&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;center class=&quot;noul&quot;&amp;gt;
&amp;lt;a href=&quot;$m.url&quot;&amp;gt;&quot;&quot;&quot;;
        print $m-&amp;gt;month_format();
        &quot;&quot;&quot;&amp;lt;/a&amp;gt;
&amp;lt;!-- now the headings for the week --&amp;gt;
&amp;lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot;&amp;gt;
&amp;lt;tr align=&quot;center&quot;&amp;gt;
&quot;&quot;&quot;;
    foreach var int d (weekdays()) {
        &quot;&amp;lt;td align=&apos;center&apos;&amp;gt;&quot;+$*lang_dayname_short[$d]+&quot;&amp;lt;/td&amp;gt;\n&quot;;
    }
    &quot;&amp;lt;/tr&amp;gt;&quot;;
    foreach var YearWeek w ($m.weeks) {
        $w-&amp;gt;print();
    }

    &quot;&quot;&quot;&amp;lt;/table&amp;gt;&amp;lt;/center&amp;gt;&quot;&quot;&quot;;
}

function YearWeek::print() {
    &quot;&amp;lt;tr valign=&apos;top&apos;&amp;gt;&quot;;
    if ($.pre_empty) { &quot;&amp;lt;td colspan=&apos;$.pre_empty&apos;&amp;gt;&amp;lt;/td&amp;gt;&quot;; }
    foreach var YearDay d ($.days) {
        &quot;&quot;&quot;&amp;lt;td&amp;gt;&amp;lt;div class=&quot;ywp&quot;&amp;gt;&amp;lt;div class=&quot;sfon&quot;&amp;gt;$d.day&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
        if ($d.num_entries) {
            &quot;&quot;&quot;&amp;lt;div class=&quot;uts&quot;&amp;gt;&amp;lt;a href=&quot;$d.url&quot;&amp;gt;$d.num_entries&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
        } else {
            &quot;&amp;amp;nbsp;&quot;;
        }
        &quot;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&quot;;
    }
    if ($.post_empty) { &quot;&amp;lt;td colspan=&apos;$.post_empty&apos;&amp;gt;&amp;lt;/td&amp;gt;&quot;; }
    &quot;&amp;lt;/tr&amp;gt;&quot;;
}

function DayPage::print_body() {
    if (not $.has_entries) { print &quot;&amp;lt;div class=&apos;sct&apos;&amp;gt;&quot; + ehtml($*text_noentries_day) + &quot;&amp;lt;/div&amp;gt;&quot;; }

    foreach var Entry e ($.entries) {
        $this-&amp;gt;print_entry($e);
    }

    &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
    &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
    var string tprev = ehtml($*text_day_prev);
    var string tnext = ehtml($*text_day_next);
    &quot;&quot;&quot;&amp;lt;center&amp;gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&quot;$.prev_url&quot;&amp;gt;$tprev&amp;lt;/a&amp;gt;$*text_seperator&amp;lt;a href=&quot;$.next_url&quot;&amp;gt;$tnext&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&amp;lt;/center&amp;gt;&quot;&quot;&quot;;

}

function MonthPage::print_body() {
    &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
    &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
    &quot;&amp;lt;center&amp;gt;&amp;lt;div class=&apos;bodybox&apos;&amp;gt;&amp;lt;center&amp;gt;&amp;lt;table border=&apos;0&apos; cellspacing=&apos;0&apos; cellpadding=&apos;0&apos;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;dl&amp;gt;&quot;;
    foreach var MonthDay d ($.days) {
        if ($d.has_entries) {
            &quot;&amp;lt;dt&amp;gt;&amp;lt;a href=\&quot;$d.url\&quot;&amp;gt;&amp;lt;i&amp;gt;&quot;;
            print lang_ordinal($d.day);
            &quot;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;:&amp;lt;/dt&amp;gt;\n&amp;lt;dd&amp;gt;&quot;;
            $d-&amp;gt;print_subjectlist();
            &quot;&amp;lt;/dd&amp;gt;\n&quot;;
        }
    }
    &quot;&amp;lt;/dl&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/center&amp;gt;\n&quot;;
    &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
    &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
    &quot;&amp;lt;form method=&apos;post&apos; action=&apos;$.redir.url&apos;&amp;gt;&amp;lt;center&amp;gt;&quot;;
    $.redir-&amp;gt;print_hiddens();
    if ($.prev_url != &quot;&quot;) { &quot;&amp;lt;a href=&apos;$.prev_url&apos; style=&apos;font-size:12pt;&apos;&amp;gt;&amp;amp;#9756;&amp;lt;/a&amp;gt; &quot;; }
    if (size $.months &amp;gt; 1) {
        &quot;&amp;lt;select name=&apos;redir_key&apos;&amp;gt;\n&quot;;
        foreach var MonthEntryInfo mei ($.months) {
            var string sel;
            if ($mei.date.year == $.date.year and $mei.date.month == $.date.month) {
                $sel = &quot; selected=&apos;selected&apos;&quot;;
            }
            &quot;&amp;lt;option value=&apos;$mei.redir_key&apos;$sel&amp;gt;&quot; + $mei.date-&amp;gt;date_format($*lang_fmt_month_long) + &quot;&amp;lt;/option&amp;gt;&quot;;
        }
        &quot;&amp;lt;/select&amp;gt;\n&amp;lt;input type=&apos;submit&apos; value=&apos;View&apos; /&amp;gt;&quot;;
    }
    if ($.next_url != &quot;&quot;) { &quot; &amp;lt;a href=&apos;$.next_url&apos; style=&apos;font-size:12pt;&apos;&amp;gt;&amp;amp;#9758;&amp;lt;/a&amp;gt;\n&quot;; }
    &quot;&amp;lt;/center&amp;gt;&amp;lt;/form&amp;gt;&quot;;
}

function EntryPage::print_body() {
    print_entry($this, $.entry);

    if ($.entry.comments.enabled and $.comment_pages.total_subitems &amp;gt; 0) {
        $.comment_pages-&amp;gt;print();

        $this-&amp;gt;print_multiform_start();
        &quot;&amp;lt;div style=&apos;margin-top: 7pt;&apos;&amp;gt;&amp;lt;/div&amp;gt;&quot;;
        &quot;&amp;lt;table align=&apos;center&apos; cellspacing=&apos;0&apos; border=&apos;0&apos; cellpadding=&apos;0&apos; style=&apos;display: none;&apos;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&quot;;
        $this-&amp;gt;print_comments($.comments);
        &quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&quot;;

        $.comment_pages-&amp;gt;print();

        if ($this.multiform_on) {&quot;&quot;&quot;
            &amp;lt;div class=&quot;bs&quot;&amp;gt;
            &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div style=&quot;text-align: center;&quot;&amp;gt;&quot;&quot;&quot;;
            $this-&amp;gt;print_multiform_actionline();
            $this-&amp;gt;print_multiform_end();
            &quot;&amp;lt;/div&amp;gt;&quot;;
        }
    }
}

function ItemRange::print() {
    if ($.all_subitems_displayed) { return; }
    &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
    &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
    &quot;&amp;lt;center&amp;gt;&quot;;
    &quot;&amp;lt;a name=&apos;comments&apos;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;div style=&apos;width: $*body_width; text-align:center;&apos;&amp;gt;&quot;;
    &quot;&amp;lt;h2&amp;gt;&quot; + lang_page_of_pages($.current, $.total) + &quot;&amp;lt;/h2&amp;gt;&quot;;
    var string url_prev = $this-&amp;gt;url_of($.current - 1);
    &quot;&amp;lt;table cellspacing=&apos;0&apos; cellpadding=&apos;0&apos; border=&apos;0&apos; align=&apos;center&apos;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td align=&apos;center&apos; style=&apos;font-size: 14pt&apos;&amp;gt;&quot;;
    if ($.current != 1) {
        print &quot;&amp;lt;a href=&apos;$url_prev#comments&apos;&amp;gt;&amp;amp;#9756;&amp;lt;/a&amp;gt;&quot;;
    } else {
        print &quot;&amp;amp;#9756;&quot;;
    }
    print &quot; &amp;lt;/td&amp;gt;&amp;lt;td align=&apos;center&apos;&amp;gt;&quot;;
    foreach var int i (1..$.total) {
        if ($i == $.current) { &quot;$i&quot;; }
        else {
            var string url_of = $this-&amp;gt;url_of($i);
            &quot;&amp;lt;a href=&apos;$url_of#comments&apos;&amp;gt;$i&amp;lt;/a&amp;gt;&quot;;
        }
        if ($i != $.total) { &quot;, &quot;; }
    }
    &quot;&amp;lt;/td&amp;gt;&amp;lt;td align=&apos;center&apos; style=&apos;font-size: 14pt&apos;&amp;gt; &quot;;
    var string url_next = $this-&amp;gt;url_of($.current + 1);
    if ($.current != $.total) {
        print &quot;&amp;lt;a href=&apos;$url_next#comments&apos;&amp;gt;&amp;amp;#9758;&amp;lt;/a&amp;gt;&quot;;
    } else {
        print &quot;&amp;amp;#9758;&quot;;
    }
    &quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/center&amp;gt;&quot;;
}

function EntryPage::print_comments(Comment[] cs) {
    if (size $cs == 0) { return; }
    foreach var Comment c ($cs) {
        if($c.depth==1) {
            &quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&quot;;
            &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
              &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
            &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
            &quot;&amp;lt;table align=&apos;center&apos; cellspacing=&apos;0&apos; border=&apos;0&apos; cellpadding=&apos;0&apos;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&quot;;
        }
        var int indent = ($c.depth - 1) * 21;
        &quot;&amp;lt;div style=&apos;margin-left: ${indent}pt;&apos;&amp;gt;\n&quot;;
        if ($c.full) {
            $this-&amp;gt;print_comment($c);
        } else {
            $this-&amp;gt;print_comment_partial($c);
        }
        &quot;&amp;lt;/div&amp;gt;&quot;;
        $this-&amp;gt;print_comments($c.replies);
    }
}

function EntryPage::print_comment(Comment c) {
    var string poster = defined $c.poster ? $c.poster-&amp;gt;as_string() : $*text_poster_anonymous;
    var string sub_icon;
    if (defined $c.subject_icon) {
        $sub_icon = $c.subject_icon-&amp;gt;as_string();
    }
    &quot;&amp;lt;a name=&apos;$c.anchor&apos;&amp;gt;&amp;lt;/a&amp;gt;&quot;;
    &quot;&amp;lt;div class=&apos;bodybox&apos;&quot; + ($c.depth&amp;gt;1? &quot; style=&apos;margin-top:${*font_leading}pt;&apos;&quot; : &quot;&quot;) + &quot;&amp;gt;&quot;;
    if (defined $c.userpic and $*comment_userpic_style != &quot;off&quot;) { 
        var int w = $c.userpic.width;
        var int h = $c.userpic.height;
        # WARNING: this will later be done by the system (it&apos;ll be a
        # constructional property), so don&apos;t copy this hack into your
        # layout layers or you&apos;ll be messed up later.
        if ($*comment_userpic_style == &quot;small&quot;) {
            $w = $w / 2;
            $h = $h / 2;
        }
        &quot;&amp;lt;img src=&apos;$c.userpic.url&apos; width=&apos;$w&apos; height=&apos;$h&apos; alt=&apos;$c.poster.username&apos; style=&apos;float: right;&apos; class=&apos;author&apos; /&amp;gt;&quot;;
    }

    ### From, date, etc
    &quot;&amp;lt;div class=&apos;noul&apos;&amp;gt;&quot;;
    if ($c.screened) { &quot;&amp;lt;span style=&apos;color:$*text_weaker;&apos;&amp;gt;$*text_comment_screened &amp;lt;/span&amp;gt;&quot;; }
    &quot;On &quot; + $c.time-&amp;gt;date_format(&quot;long&quot;) + &quot;, &quot; + $c.time-&amp;gt;time_format() + &quot;, $poster &quot;;
    if ($c.metadata{&quot;poster_ip&quot;}) { &quot;(&quot; + $c.metadata{&quot;poster_ip&quot;} + &quot;) &quot;; }
    &quot;&amp;lt;a href=&apos;$c.permalink_url&apos;&amp;gt;&quot;;
    if ($c.depth == 1) { &quot;$*text_comment_commented&quot;; }
    else { &quot;$*text_comment_replied&quot;; }
    &quot;&amp;lt;/a&amp;gt;:&amp;lt;/div&amp;gt;&quot;;

    print (defined $c.subject_icon or $c.subject != &quot;&quot;) ? &quot;&amp;lt;div class=&apos;caption&apos;&amp;gt;$c.subject_icon $c.subject&amp;lt;/div&amp;gt;&quot; : &quot;&quot;;

    &quot;&amp;lt;div class=&apos;body&apos;&amp;gt;&quot;;
    print_text($c);
    print &quot;&amp;lt;/div&amp;gt;&amp;lt;div class=&apos;smallbar&apos;&amp;gt;&quot;;
    if ($c.frozen) { 
        &quot;$*text_comment_frozen&quot;;
    } else {
        &quot;&amp;lt;a href=&apos;$c.reply_url&apos;&amp;gt;$*text_comment_reply&amp;lt;/a&amp;gt;&quot;;
    }
    if ($c.parent_url != &quot;&quot;) { &quot;$*text_seperator&amp;lt;a href=&apos;$c.parent_url&apos;&amp;gt;$*text_comment_parent&amp;lt;/a&amp;gt;&quot;; }
    if ($c.thread_url != &quot;&quot;) { &quot;$*text_seperator&amp;lt;a href=&apos;$c.thread_url&apos;&amp;gt;$*text_comment_thread&amp;lt;/a&amp;gt;&quot;; }
    $c-&amp;gt;print_linkbar();
    if ($this.multiform_on) {
        &quot;$*text_seperator&quot;;
        &quot;&amp;lt;label for=&apos;ljcomsel_$c.talkid&apos;&amp;gt;$*text_multiform_check&amp;lt;/label&amp;gt;&quot;;
        $c-&amp;gt;print_multiform_check();
    }
    &quot;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&quot;;
}


function EntryPage::print_comment_partial(Comment c) {
    var string poster = defined $c.poster ? $c.poster-&amp;gt;as_string() : $*text_poster_anonymous;
    var bool subj = $c.subject != &quot;&quot;;
    &quot;&amp;lt;div class=&apos;ult&apos; style=&apos;width:$*body_width; margin-top:${*font_leading}pt;&apos;&amp;gt;&quot;;
    &quot;On$*text_comment_on &quot; + $c.time-&amp;gt;date_format(&quot;long&quot;) + &quot;, &quot; + $c.time-&amp;gt;time_format() + &quot;, $poster &quot;;
    if ($c.metadata{&quot;poster_ip&quot;}) { &quot;(&quot; + $c.metadata{&quot;poster_ip&quot;} + &quot;) &quot;; }
    if($subj) { &quot;&quot;&quot;$*text_comment_replied, &amp;lt;a href=&quot;$c.permalink_url&quot;&amp;gt;&amp;amp;ldquo;$c.subject&amp;amp;rdquo;&amp;lt;/a&amp;gt;&quot;&quot;&quot;; }
    else { &quot;&quot;&quot;posted &amp;lt;a href=&quot;$c.permalink_url&quot;&amp;gt;a reply&amp;lt;/a&amp;gt;&quot;&quot;&quot;; }
    &quot;.&amp;lt;/div&amp;gt;&quot;;
}

function Comment::print_linkbar() {
    var Link link;
    foreach var string k ($.link_keyseq) {
        $link = $this-&amp;gt;get_link($k);
        ($link.caption != &quot;&quot;) ? &quot;$*text_seperator&amp;lt;a href=&apos;$link.url&apos;&amp;gt;$link.caption&amp;lt;/a&amp;gt;&quot; : &quot;&quot;;
    }
}

function ReplyPage::print_body() {
    var bool ent = $.replyto.permalink_url == $.entry.permalink_url;

    if($ent) {
        print_entry($this, $.entry);
    }
    else {
        &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
        &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
        &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
    
        var EntryLite c = $.replyto;
        var string poster = defined $c.poster ? $c.poster-&amp;gt;as_string() : $*text_poster_anonymous;
        &quot;&amp;lt;center&amp;gt;&amp;lt;div style=&apos;width: $*body_width;&apos;&amp;gt;&quot;;

        if (defined $c.userpic and $*comment_userpic_style != &quot;off&quot;) { 
            var int w = $c.userpic.width;
            var int h = $c.userpic.height;
            # WARNING: this will later be done by the system (it&apos;ll be a
            # constructional property), so don&apos;t copy this hack into your
            # layout layers or you&apos;ll be messed up later.
            if ($*comment_userpic_style == &quot;small&quot;) {
                $w = $w / 2;
                $h = $h / 2;
            }
            &quot;&amp;lt;img src=&apos;$c.userpic.url&apos; width=&apos;$w&apos; height=&apos;$h&apos; alt=&apos;$c.poster.name&apos; style=&apos;float: right;&apos; class=&apos;author&apos; /&amp;gt;&quot;;

        }
    
        ### From, date, etc

        &quot;&amp;lt;div class=&apos;noul&apos;&amp;gt;&quot;;
        &quot;On &quot; + $c.time-&amp;gt;date_format(&quot;long&quot;) + &quot;, &quot; + $c.time-&amp;gt;time_format() + &quot;, $poster &quot;;
        if ($c.metadata{&quot;poster_ip&quot;}) { &quot;(&quot; + $c.metadata{&quot;poster_ip&quot;} + &quot;) &quot;; }
        &quot;&amp;lt;a href=&apos;$c.permalink_url&apos;&amp;gt;$*text_comment_commented:&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&quot;;
    
        print ($c.subject != &quot;&quot;) ? &quot;&amp;lt;div class=&apos;caption&apos;&amp;gt;$c.subject&amp;lt;/div&amp;gt;&quot; : &quot;&quot;;
    
        &quot;&amp;lt;div class=&apos;body&apos;&amp;gt;&quot;;
        print_text($c);
        &quot;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/center&amp;gt;&quot;;
    }

    &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
    &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
    &quot;&amp;lt;div style=&apos;text-align:center;&apos;&amp;gt;&amp;lt;h2&amp;gt;&amp;lt;a href=&apos;$.entry.comments.read_url&apos;&amp;gt;$*text_reply_back&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;&amp;lt;/div&amp;gt;&quot;;
    &quot;&quot;&quot;&amp;lt;div class=&quot;bs&quot;&amp;gt;
    &amp;lt;img src=&quot;$*dingbar_url&quot; alt=&quot;$*text_dingbar_alt&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;

    if (not $.entry.comments.enabled) {
        print &quot;&amp;lt;div class=&apos;sct&apos;&amp;gt;$*text_reply_nocomments&amp;lt;/div&amp;gt;&quot;;
        return;
    }


    &quot;&amp;lt;center&amp;gt;&amp;lt;h3 style=&apos;margin-top:0px; line-height:&quot; + (2*$*font_leading) + &quot;pt;&apos;&amp;gt;$*text_reply_reply &quot; + ($ent ? &quot;$*text_reply_entry&quot; : &quot;$*text_reply_comment&quot;) + &quot;:&amp;lt;/h3&amp;gt;&quot;;
    $.form-&amp;gt;print();
    &quot;&amp;lt;/center&amp;gt;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid3-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2ljdotcom.livejournal.com/1255.html?view=comments#comments</comments>
  <category>moony kunundrum</category>
  <category>novel conundrum</category>
  <lj:mood>accomplished</lj:mood>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2ljdotcom.livejournal.com/940.html</guid>
  <pubDate>Mon, 04 Jul 2005 16:17:03 GMT</pubDate>
  <title>tranqunzy1</title>
  <author>kunzite1</author>
  <link>https://s2ljdotcom.livejournal.com/940.html</link>
  <description>property declarations prettyified.&lt;br /&gt;added properties for frozen comment colors.&lt;br /&gt;sidebar stuffs turned into own functions.&lt;br /&gt;tags list box added.&lt;br /&gt;disable reply link for frozen comments.&lt;br /&gt;stylesheet MUCH easier to read.&lt;br /&gt;ajax comments.&lt;br /&gt;added tags to Entry::print_metadata()&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;&lt;hr /&gt;&lt;pre&gt;# LAYER INFO
layerinfo &quot;redist_uniq&quot; = &quot;tranquilityii/layout&quot;;
layerinfo &quot;type&quot;        = &quot;layout&quot;;
layerinfo &quot;name&quot;        = &quot;Tranquility II&quot;;
layerinfo &quot;des&quot;         = &quot;XHTML/CSS Compliant layout.  Relax./Heavily edited by lj:kunzite1&quot;;
layerinfo &quot;author_name&quot; = &quot;Matthew Vince/Mike Trethewey&quot;;
layerinfo &quot;lang&quot;        = &quot;en&quot;;

set tags_aware = true;

# PROPERTIES: COLORS
propgroup Colors {
  # odd
  property Color c_main_border {
    des = &quot;Border color of main column&quot;;
  }
  property Color c_main_background {
  des = &quot;Background color of main column&quot;;
  }
  property Color c_menu_border {
  des = &quot;Border color of menu&quot;;
  }
  property Color c_header_background {
  des = &quot;Header background color&quot;;
  }
  property Color c_header_border {
  des = &quot;Header border color&quot;;
  }
  # page
  property Color c_page_background {
    des = &quot;Page background color&quot;;
  }
  property Color c_page_title {
    des = &quot;Page title color&quot;;
  }
  property Color c_page_text {
    des = &quot;Page text color&quot;;
  }
  property Color c_page_link {
    des = &quot;Page link color&quot;;
  }
  property Color c_page_link_visited {
    des = &quot;Page visited link color&quot;;
  }
  property Color c_page_link_hover {
    des = &quot;Page hover link color&quot;;
  }
  property Color c_page_link_active {
    des = &quot;Page active link color&quot;;
  }
  # menu
  property Color c_menu_background {
    des = &quot;Side Menu background color&quot;;
  }
  property Color c_menu_link {
    des = &quot;Side Menu link color&quot;;
  }
  property Color c_menu_link_visited {
    des = &quot;Side Menu visited link color&quot;;
  }
  property Color c_menu_link_hover {
    des = &quot;Side Menu hover link color&quot;;
  }
  property Color c_menu_link_active {
    des = &quot;Side Menu active link color&quot;;
  }
  property Color c_menu_text_color {
    des = &quot;Side Menu text color&quot;;
  }
  property Color c_menu_header_color {
    des = &quot;Side Menu header color&quot;;
  }
  property Color c_menu_current {
    des = &quot;Current menu item color&quot;;
  }
  # entry
  property Color c_entry_background {
    des = &quot;Entry background color&quot;;
  }
  property Color c_entry_link {
    des = &quot;Entry link color&quot;;
  }
  property Color c_entry_link_visited {
    des = &quot;Entry visited link color&quot;;
  }
  property Color c_entry_link_hover {
    des = &quot;Entry hover link color&quot;;
  }
  property Color c_entry_link_active {
    des = &quot;Entry active link color&quot;;
  }
  property Color c_entry_text_color {
    des = &quot;Entry text color&quot;;
  }
  property Color c_entry_title_color {
    des = &quot;Entry title color&quot;;
  }
  property Color c_entry_border {
    des = &quot;Entry bottom border color&quot;;
  }
  # metadata
  property Color c_meta_background {
    des = &quot;Entry metadata background color&quot;;
  }
  property Color c_meta_link {
    des = &quot;Entry metadata link color&quot;;
  }
  property Color c_meta_link_visited {
    des = &quot;Entry metadata visited link color&quot;;
  }
  property Color c_meta_link_hover {
    des = &quot;Entry metadata hover link color&quot;;
  }
  property Color c_meta_link_active {
    des = &quot;Entry metadata active link color&quot;;
  }
  property Color c_meta_text_color {
    des = &quot;Entry metadata text color&quot;;
  }
  # footer
  property Color c_footer_background {
    des = &quot;Page footer background color&quot;;
  }
  property Color c_footer_link {
    des = &quot;Page footer link color&quot;;
  }
  property Color c_footer_link_visited {
    des = &quot;Page footer visited link color&quot;;
  }
  property Color c_footer_link_hover {
    des = &quot;Page footer hover link color&quot;;
  }
  property Color c_footer_link_active {
    des = &quot;Page footer active link color&quot;;
  }
  property Color c_footer_text_color {
    des = &quot;Page footer text color&quot;;
  }
  # comments
  property Color c_comment_one_link {
    des = &quot;Comment one link color&quot;;
  }
  property Color c_comment_one_link_visited {
    des = &quot;Comment one visited link color&quot;;
  }
  property Color c_comment_one_link_hover {
    des = &quot;Comment one hover link color&quot;;
  }
  property Color c_comment_one_link_active {
    des = &quot;Comment one active link color&quot;;
  }
  property Color c_comment_one_text_color {
    des = &quot;Comment one text color&quot;;
  }
  property Color c_comment_one_title_color {
    des = &quot;Comment one title color&quot;;
  }
  property Color c_comment_one_background {
    des = &quot;Comment bar one background color&quot;;
  }
  property Color c_comment_one_border {
    des = &quot;Comment one bottom border color&quot;;
  }
  property Color c_comment_two_link {
    des = &quot;Comment two link color&quot;;
  }
  property Color c_comment_two_link_visited {
    des = &quot;Comment two visited link color&quot;;
  }
  property Color c_comment_two_link_hover {
    des = &quot;Comment two hover link color&quot;;
  }
  property Color c_comment_two_link_active {
    des = &quot;Comment two active link color&quot;;
  }
  property Color c_comment_two_text_color {
    des = &quot;Comment two text color&quot;;
  }
  property Color c_comment_two_title_color {
    des = &quot;Comment two title color&quot;;
  }
  property Color c_comment_two_background {
    des = &quot;Comment two background color&quot;;
  }
  property Color c_comment_two_border {
    des = &quot;Comment two bottom border color&quot;;
  }
  property Color c_comment_screened_link {
    des = &quot;Comment screened link color&quot;;
  }
  property Color c_comment_screened_link_visited {
    des = &quot;Comment screened visited link color&quot;;
  }
  property Color c_comment_screened_link_hover {
    des = &quot;Comment screened hover link color&quot;;
  }
  property Color c_comment_screened_link_active {
    des = &quot;Comment screened active link color&quot;;
  }
  property Color c_comment_screened_text_color {
    des = &quot;Comment screened text color&quot;;
  }
  property Color c_comment_screened_title_color {
    des = &quot;Comment screened title color&quot;;
  }
  property Color c_comment_screened_background {
    des = &quot;Comment screened background color&quot;;
  }
  property Color c_comment_screened_border {
    des = &quot;Comment screened bottom border color&quot;;
  }
  property Color c_comment_frozen_link {
    des = &quot;Comment frozen link color&quot;;
  }
  property Color c_comment_frozen_link_visited {
    des = &quot;Comment frozen visited link color&quot;;
  }
  property Color c_comment_frozen_link_hover {
    des = &quot;Comment frozen hover link color&quot;;
  }
  property Color c_comment_frozen_link_active {
    des = &quot;Comment frozen active link color&quot;;
  }
  property Color c_comment_frozen_text_color {
    des = &quot;Comment frozen text color&quot;;
  }
  property Color c_comment_frozen_title_color {
    des = &quot;Comment frozen title color&quot;;
  }
  property Color c_comment_frozen_background {
    des = &quot;Comment frozen background color&quot;;
  }
  property Color c_comment_frozen_border {
    des = &quot;Comment frozen bottom border color&quot;;
  }
}


# PROPERTIES: FONTS
propgroup Fonts {
  # page
  property string f_page {
    des = &quot;Generic font for use on the page&quot;;
  }
  property string f_page_size {
    des = &quot;Generic font size for use on the page&quot;;
  }
  property string f_page_title {
    des = &quot;Page title font&quot;;
  }
  property string f_page_title_size {
    des = &quot;Page title font size&quot;;
  }
  property string f_page_link {
    des = &quot;Generic font for links on the page&quot;;
  }
  property string f_page_link_size {
    des = &quot;Generic font size for links on the page&quot;;
  }
  # menu
  property string f_menu_link {
    des = &quot;Menu link font&quot;;
  }
  property string f_menu_link_size {
    des = &quot;Menu link font size&quot;;
  }
  property string f_menu {
    des = &quot;Menu font&quot;;
  }
  property string f_menu_size {
    des = &quot;Menu font size&quot;;
  }
  property string f_menu_header {
    des = &quot;Menu title font&quot;;
  }
  property string f_menu_header_size {
    des = &quot;Menu title font size&quot;;
  }
  property string f_menu_current {
    des = &quot;Current menu item font&quot;;
  }
  property string f_menu_current_size {
    des = &quot;Current menu item font size&quot;;
  }
  # entry
  property string f_entry {
    des = &quot;Entry font&quot;;
  }
  property string f_entry_size {
    des = &quot;Entry font size&quot;;
  }
  property string f_entry_link {
    des = &quot;Entry link font&quot;;
  }
  property string f_entry_link_size {
    des = &quot;Entry link font size&quot;;
  }
  property string f_entry_title {
    des = &quot;Entry title font&quot;;
  }
  property string f_entry_title_size {
    des = &quot;Entry title font size&quot;;
  }
  # metadata
  property string f_meta {
    des = &quot;Entry metadata font&quot;;
  }
  property string f_meta_size {
    des = &quot;Entry metadata font size&quot;;
  }
  property string f_meta_link {
    des = &quot;Entry metadata link font&quot;; }
  property string f_meta_link_size {
    des = &quot;Entry metadata link font size&quot;;
  }
  # footer
  property string f_footer {
    des = &quot;Footer font&quot;;
  }
  property string f_footer_size {
    des = &quot;Footer font size&quot;;
  }
  property string f_footer_link {
    des = &quot;Footer link font&quot;;
  }
  property string f_footer_link_size {
    des = &quot;Footer link font size&quot;;
  }
  # comments
  property string f_comment {
    des = &quot;Comment font&quot;;
  }
  property string f_comment_size {
    des = &quot;Comment font size&quot;;
  }
  property string f_comment_title {
    des = &quot;Comment title font&quot;;
  }
  property string f_comment_title_size {
    des = &quot;Comment title font size&quot;;
  }
  property string f_comment_link {
    des = &quot;Comment link font&quot;;
  }
  property string f_comment_link_size {
    des = &quot;Comment link font size&quot;;
  }
}


# PROPERTIES: PRESENTATION
propgroup Presentation {
  property use page_recent_items;
  property use page_friends_items;
  property use view_entry_disabled;
  property use use_shared_pic;
  property use comment_userpic_style;
  property bool show_recent_userpic {
    des = &quot;Show userpic on Recent view?&quot;;
  }
  property bool show_entry_userpic {
    des = &quot;Show userpic on Entry view?&quot;;
  }
  property bool show_day_userpic {
    des = &quot;Show userpic on Day view?&quot;;
  }
  property bool show_entrynav_icons {
    des = &quot;Toggle to show the next, memory, edit, etc icons on the entry view page&quot;;
  }
  property string time_format {
    des = &quot;Format for the time&quot;;
    example = &quot;%%hh%%:%%min%%:%%sec%% %%a%%m&quot;;
  }
  property string date_format {
    des = &quot;Format for the date&quot;;
    example = &quot;%%m%%/%%d%%/%%yy%%&quot;;
  }
  property bool menu_disable_userpic {
    des = &quot;Disable menu userpic&quot;;
  }
  property bool menu_disable_navigation {
    des = &quot;Disable menu navigation&quot;;
  }
  property bool menu_disable_summary {
    des = &quot;Disable menu summary view&quot;;
  }
  property bool menu_disable_linklist {
    des = &quot;Disable menu linklist&quot;;
  }
  property bool menu_disable_tag_list {
    des = &quot;Disable menu tag list&quot;;
  }
  property string tags_sidebar_height {
    des = &quot;Height of Tags sidebar box&quot;;
  }
  property string css_page_width {
    des = &quot;Width of the main page (increasing this will increase the main column&apos;s width)&quot;;
  }
  property string css_style_overrides {
    des = &quot;include any CSS here to override the default CSS&quot;;
  }
}


# PROPERTIES: TEXT
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_meta_music;
  property use text_meta_mood;
  property string text_meta_tags_header {
    des = &quot;Text for Tags header&quot;;
    example = &quot;Tags&quot;;
  }
  property string text_meta_tags_joiner {
    des = &quot;Text for Tags joiner&quot;;
    example = &quot;:&quot;;
  }
  property use text_permalink;
  property use text_view_recent;
  property use text_view_friends;
  property use text_view_archive;
  property use text_view_userinfo;
  property use text_reply_nocomments_header;
  property use text_reply_nocomments;
  property use text_comment_from;
  property use text_comment_ipaddr;
  property use text_comment_parent;
  property use text_comment_reply;
  property use text_comment_thread;
  property use text_nosubject;
  property use text_post_comment;
  property use text_post_comment_friends;
  property use text_max_comments;
  property use text_view_month;
  property use text_poster_anonymous;
  property string text_comment_viewall {
    des = &quot;Text for view all comments&quot;;
  }
  property string text_links_header {
    des = &quot;Sidebar links header text&quot;;
  }
  property string text_summary_header {
    des = &quot;Page summary text header&quot;;
  }
  property string text_links_spacer {
    des = &quot;String to act as links list spacer&quot;;
  }
}


# -------------------------------
# default property settings
# -------------------------------
# ODD
set c_comment_one_background        = &quot;#ffffff&quot;;
set c_comment_one_border            = &quot;#999999&quot;;
set c_comment_one_link              = &quot;#5ab300&quot;;
set c_comment_one_link_active       = &quot;#336600&quot;;
set c_comment_one_link_hover        = &quot;#336600&quot;;
set c_comment_one_link_visited      = &quot;#5ab300&quot;;
set c_comment_one_text_color        = &quot;#333333&quot;;
set c_comment_one_title_color       = &quot;#333333&quot;;
set c_comment_frozen_background     = &quot;#aaaaff&quot;;
set c_comment_frozen_border         = &quot;#999999&quot;;
set c_comment_frozen_text_color     = &quot;#333333&quot;;
set c_comment_frozen_title_color    = &quot;#333333&quot;;
set c_comment_frozen_link           = &quot;#eeeeff&quot;;
set c_comment_frozen_link_visited   = &quot;#eeeeff&quot;;
set c_comment_frozen_link_hover     = &quot;#eeeeff&quot;;
set c_comment_frozen_link_active    = &quot;#eeeeff&quot;;
set c_comment_screened_background   = &quot;#ffaaaa&quot;;
set c_comment_screened_border       = &quot;#999999&quot;;
set c_comment_screened_link         = &quot;#ffeeee&quot;;
set c_comment_screened_link_active  = &quot;#ffeeee&quot;;
set c_comment_screened_link_hover   = &quot;#ffeeee&quot;;
set c_comment_screened_link_visited = &quot;#ffeeee&quot;;
set c_comment_screened_text_color   = &quot;#000000&quot;;
set c_comment_screened_title_color  = &quot;#000000&quot;;
set c_comment_two_background        = &quot;#ffffff&quot;;
set c_comment_two_border            = &quot;#999999&quot;;
set c_comment_two_link              = &quot;#5ab300&quot;;
set c_comment_two_link_active       = &quot;#336600&quot;;
set c_comment_two_link_hover        = &quot;#336600&quot;;
set c_comment_two_link_visited      = &quot;#5ab300&quot;;
set c_comment_two_text_color        = &quot;#333333&quot;;
set c_comment_two_title_color       = &quot;#333333&quot;;
set c_entry_background              = &quot;#ffffff&quot;;
set c_entry_border                  = &quot;#cccccc&quot;;
set c_entry_link                    = &quot;#5ab300&quot;;
set c_entry_link_active             = &quot;#336600&quot;;
set c_entry_link_hover              = &quot;#336600&quot;;
set c_entry_link_visited            = &quot;#5ab300&quot;;
set c_entry_text_color              = &quot;#333333&quot;;
set c_entry_title_color             = &quot;#333333&quot;;
set c_footer_background             = &quot;#333333&quot;;
set c_footer_link                   = &quot;#ffffff&quot;;
set c_footer_link_active            = &quot;#ffffff&quot;;
set c_footer_link_hover             = &quot;#ffffff&quot;;
set c_footer_link_visited           = &quot;#ffffff&quot;;
set c_footer_text_color             = &quot;#ffffff&quot;;
set c_header_background             = &quot;#333333&quot;;
set c_header_border                 = &quot;#333333&quot;;
set c_main_background               = &quot;#ffffff&quot;;
set c_main_border                   = &quot;#000000&quot;;
set c_menu_background               = &quot;#333333&quot;;
set c_menu_border                   = &quot;#333333&quot;;
set c_menu_current                  = &quot;#ffffff&quot;;
set c_menu_header_color             = &quot;#ffffff&quot;;
set c_menu_link                     = &quot;#999999&quot;;
set c_menu_link_active              = &quot;#ffffff&quot;;
set c_menu_link_hover               = &quot;#ffffff&quot;;
set c_menu_link_visited             = &quot;#999999&quot;;
set c_menu_text_color               = &quot;#ffffff&quot;;
set c_meta_background               = &quot;#ffffff&quot;;
set c_meta_link                     = &quot;#5ab300&quot;;
set c_meta_link_active              = &quot;#336600&quot;;
set c_meta_link_hover               = &quot;#336600&quot;;
set c_meta_link_visited             = &quot;#5ab300&quot;;
set c_meta_text_color               = &quot;#000000&quot;;
set c_page_background               = &quot;#333333&quot;;
set c_page_link                     = &quot;#5ab300&quot;;
set c_page_link_active              = &quot;#336600&quot;;
set c_page_link_hover               = &quot;#336600&quot;;
set c_page_link_visited             = &quot;#5ab300&quot;;
set c_page_text                     = &quot;#333333&quot;;
set c_page_title                    = &quot;#ffffff&quot;;
# FONTS
set f_comment            = &quot;Georgia, serif&quot;;
set f_comment_link       = &quot;Georgia, serif&quot;;
set f_comment_link_size  = &quot;100%&quot;;
set f_comment_size       = &quot;100%&quot;;
set f_comment_title      = &quot;Georgia, serif&quot;;
set f_comment_title_size = &quot;130%&quot;;
set f_entry              = &quot;Georgia, serif&quot;;
set f_entry_link         = &quot;Georgia, serif&quot;;
set f_entry_link_size    = &quot;100%&quot;;
set f_entry_size         = &quot;100%&quot;;
set f_entry_title        = &quot;Georgia, serif&quot;;
set f_entry_title_size   = &quot;150%&quot;;
set f_footer             = &quot;Georgia, serif&quot;;
set f_footer_link        = &quot;Georgia, serif&quot;;
set f_footer_link_size   = &quot;100%&quot;;
set f_footer_size        = &quot;100%&quot;;
set f_menu               = &quot;Georgia, serif&quot;;
set f_menu_current       = &quot;Verdana, Helvetica, sans-serif&quot;;
set f_menu_current_size  = &quot;80%&quot;;
set f_menu_header        = &quot;Georgia, serif&quot;;
set f_menu_header_size   = &quot;120%&quot;;
set f_menu_link          = &quot;Verdana, Helvetica, sans-serif&quot;;
set f_menu_link_size     = &quot;80%&quot;;
set f_menu_size          = &quot;100%&quot;;
set f_meta               = &quot;Verdana, Helvetica, sans-serif&quot;;
set f_meta_link          = &quot;Verdana, Helvetica, sans-serif&quot;;
set f_meta_link_size     = &quot;100%&quot;;
set f_meta_size          = &quot;80%&quot;;
set f_page               = &quot;Georgia, serif&quot;;
set f_page_link          = &quot;Georgia, serif&quot;;
set f_page_link_size     = &quot;100%&quot;;
set f_page_size          = &quot;12px&quot;;
set f_page_title         = &quot;Georgia, serif&quot;;
set f_page_title_size    = &quot;190%&quot;;

# OTHER
set show_recent_userpic     = false;
set show_day_userpic        = true;
set show_entry_userpic      = true;
set show_entrynav_icons     = true;
set time_format             = &quot;%%hh%%:%%min%% %%a%%m&quot;;
set date_format             = &quot;%%mon%%. %%dayord%%, %%yyyy%%&quot;;
set menu_disable_userpic    = false;
set menu_disable_navigation = false;
set menu_disable_summary    = false;
set menu_disable_linklist   = false;
set menu_disable_tag_list   = false;
set tags_sidebar_height     = &quot;&quot;;
set css_style_overrides     = &quot;&quot;;
set css_page_width          = &quot;800px&quot;;

# TEXT
set text_meta_music            = &quot;music&quot;;
set text_links_header          = &quot;links&quot;;
set text_meta_mood             = &quot;mood&quot;;
set text_meta_tags_header      = &quot;tags&quot;;
set text_meta_tags_joiner      = &quot;:&quot;;
set text_read_comments         = &quot;{#}&quot;;
set text_read_comments_friends = &quot;{#}&quot;;
set text_poster_anonymous     = &quot;anonymous&quot;;
set text_comment_viewall       = &quot;view all comments&quot;;
set text_links_header          = &quot;Links&quot;;
set text_summary_header        = &quot;Page Summary&quot;;
set text_links_spacer          = &quot;_______________&quot;;



# ========================================
# METHODS
# ========================================


# -------------------------------
# stylesheet
# -------------------------------
function print_stylesheet() {
&quot;&quot;&quot;
@media screen, print {
  * {
    margin:  0;
    padding: 0;
  }
  hr {
    display: none;
  }
  body {
    background-color: $*c_page_background;
    font-family:      $*f_page;
    font-size:        $*f_page_size;
    line-height:      125%;
    color:            $*c_page_text;
    text-align:       center;
  }
  a {
    font-family:     $*f_page_link;
    font-size:       $*f_page_link_size;
    color:           $*c_page_link;
    text-decoration: none;
  }
  a:visited { color: $*c_page_link_visited; }
  a:hover, a:visited:hover { color: $*c_page_link_hover; text-decoration: underline; }
  a:active { color: $*c_page_link_active; }
  a img { border: none; }
  p {
    margin:  5px;
    padding: 5px;
  }
  form {
    display: inline;
    margin:  0px;
    padding: 0px;
  }
  input, select, textarea {
    font-family: $*f_meta;
    font-size:   $*f_meta_size;
    color:       $*c_meta_text_color;
    padding:     2px;
    margin:      3px;
  }
  #container {
    position:   relative;
    width:      $*css_page_width;
    margin:     0 auto;
    text-align: left;
  }
  #header {
    margin-bottom:    15px;
    border:            1px solid $*c_header_border;
    background-color: $*c_header_background;
  }
  #header h1 {
    padding:     20px;
    font-family: $*f_page_title;
    font-size:   $*f_page_title_size;
    color:       $*c_page_title;
  }
  #menu {
    position:         relative;
    background-color: $*c_menu_background;
    float:            left;
    width:            150px;
    font-family:      $*f_menu;
    font-size:        $*f_menu_size;
    color:            $*c_menu_text_color;
    border:           1px solid $*c_menu_border;
    padding:          4px;
  }
  #content {
    position:    relative;
    margin-left: 160px;
  }
  #entries {
    border:            1px solid $*c_main_border;
    padding:          15px;
    background-color: $*c_main_background;
  }
  #menu h2 {
    margin:      20px 0;
    font-family: $*f_menu_header;
    font-size:   $*f_menu_header_size;
    color:       $*c_menu_header_color;
  }
  #menu h2.userpic {
    text-align: center;
  }
  #menu a {
    font-family: $*f_menu_link;
    font-size:   $*f_menu_link_size;
    color:       $*c_menu_link;
  }
  #menu a:visited { color: $*c_menu_link_visited; }
  #menu a:hover, #menu a:visited:hover { color: $*c_menu_link_hover; }
  #menu a:active { color: $*c_menu_link_active; }
  #menu ul {
    margin:     3px;
    list-style: none;
  }
  #menu ul li {
    margin:     3px;
    padding:    2px;
    list-style: none;
  }
  #menu ul li.active {
    font-family: $*f_menu_current;
    font-size:   $*f_menu_current_size;
    color:       $*c_menu_current;
    font-weight: bold;
  }
  #content h2 {
    margin: 20px 0;
  }
  #entries, #comments {
    margin: 10px;
  }
  .ind-entry {
    padding: 5px;
    padding-bottom:   15px;
    border-bottom:     1px solid $*c_entry_border;
    background-color: $*c_entry_background;
  }
  .ind-entry h3 img, .ind-comment-one h3 img, .ind-comment-two h3 img, .ind-comment-screened h3 img {
    position: relative;
    float:    right;
    padding:  5px;
  }
  .ind-entry h2 {
    font-family: $*f_entry_title;
    font-size:   $*f_entry_title_size;
    color:       $*c_entry_title_color;
    margin:      20px 0px;
    line-height: 140%;
  }
  .ind-entry h4, .ind-comment-one h4, .ind-comment-two h4, .ind-comment-screened h4 {
    font-family: $*f_meta;
    font-size:   $*f_meta_size;
    color:       $*c_meta_text_color;
  }
  .ind-entry h4 {
    background-color: $*c_meta_background;
  }
  .ind-entry h4 a, .ind-comment-one h4 a, .ind-comment-two h4 a, .ind-comment-screened h4 a {
    font-family:     $*f_meta_link;
    font-size:       $*f_meta_link_size;
    color:           $*c_meta_link;
    text-decoration: underline;
  }
  .ind-entry h4 a:visited, .ind-comment-one h4 a:visited, .ind-comment-two h4 a:visited, .ind-comment-screened h4 a:visited { color: $*c_meta_link_visited; }
  .ind-entry h4 a:hover, .ind-comment-one h4 a:hover, .ind-comment-two h4 a:hover, .ind-comment-screened h4 a:hover { color: $*c_meta_link_hover; }
  .ind-entry h4 a:visited:hover, .ind-comment-one h4 a:visited:hover, .ind-comment-two h4 a:visited:hover, .ind-comment-screened h4 a:visited:hover { color: $*c_meta_link_hover; }
  .ind-entry h4 a:active, .ind-comment-one h4 a:active, .ind-comment-two h4 a:active, .ind-comment-screened h4 a:active { color: $*c_meta_link_active; }
  .ind-entry div.entry-item, .ind-entry div.month-entries {
    font-family: $*f_entry;
    font-size:   $*f_entry_size;
    color:       $*c_entry_text_color;
    margin:      15px 0px;
  }
  .ind-entry div.entry-item a, .ind-entry div.month-entries a {
    font-family:     $*f_entry_link;
    font-size:       $*f_entry_link_size;
    color:           $*c_entry_link;
    text-decoration: underline;
  }
  .ind-entry div.entry-item a:visited, .ind-entry div.month-entries a:visited { color: $*c_entry_link_visited; }
  .ind-entry div.entry-item a:hover, .ind-entry div.entry-item a:visited:hover { color: $*c_entry_link_hover; }
  .ind-entry div.month-entries a:hover, .ind-entry div.month-entries a:visited:hover { color: $*c_entry_link_hover; }
  .ind-entry div.entry-item a:active, .ind-entry div.month-entries a:active { color: $*c_entry_link_active; }
  .ind-comment-one, .ind-comment-two, .ind-comment-screened {
    margin:  10px 0;
    padding:  5px;
  }
  .ind-comment-one { background-color: $*c_comment_one_background; border-bottom: 1px solid $*c_comment_one_border; }
  .ind-comment-two { background-color: $*c_comment_two_background; border-bottom: 1px solid $*c_comment_two_border; }
  .ind-comment-screened { background-color: $*c_comment_screened_background; border-bottom: 1px solid $*c_comment_screened_border; }
  .ind-comment-one h2 {
    font-family: $*f_comment_title;
    font-size:   $*f_comment_title_size;
    color:       $*c_comment_one_title_color;
    margin:      20px 0px;
  }
  .ind-comment-one div.entry-item {
    font-family: $*f_comment;
    font-size:   $*f_comment_size;
    color:       $*c_comment_one_text_color;
    margin:      15px 0px;
  }
  .ind-comment-one div.entry-item a {
    font-family:     $*f_comment_link;
    font-size:       $*f_comment_link_size;
    color:           $*c_comment_one_link;
    text-decoration: underline;
  }
  .ind-comment-one div.entry-item a:visited { color: $*c_comment_one_link_visited; }
  .ind-comment-one div.entry-item a:hover, .ind-comment-one div.entry-item a:visited:hover { color: $*c_comment_one_link_hover; }
  .ind-comment-one div.entry-item a:active { color: $*c_comment_one_link_active; }
  .ind-comment-two h2 {
    font-family: $*f_comment_title;
    font-size:   $*f_comment_title_size;
    color:       $*c_comment_two_title_color;
    margin:      20px 0px;
    line-height: 140%;
  }
  .ind-comment-two div.entry-item {
    font-family: $*f_comment;
    font-size:   $*f_comment_size;
    color:       $*c_comment_two_text_color;
    margin:      10px 0px;
  }
  .ind-comment-two div.entry-item a {
    font-family:     $*f_comment_link;
    font-size:       $*f_comment_link_size;
    color:           $*c_comment_two_link;
    text-decoration: underline;
  }
  .ind-comment-two div.entry-item a:visited { color: $*c_comment_two_link_visited; }
  .ind-comment-two div.entry-item a:hover, .ind-comment-two div.entry-item a:visited:hover { color: $*c_comment_two_link_hover; }
  .ind-comment-two div.entry-item a:active { color: $*c_comment_two_link_active; }
  .ind-comment-screened h2 {
    font-family: $*f_comment_title;
    font-size:   $*f_comment_title_size;
    color:       $*c_comment_screened_title_color;
    margin:      20px 0px;
  }
  .ind-comment-screened div.entry-item {
    font-family: $*f_comment;
    font-size:   $*f_comment_size;
    color:       $*c_comment_screened_text_color;
    margin:      10px 0px;
  }
  .ind-comment-screened div.entry-item a {
    font-family:     $*f_comment_link;
    font-size:       $*f_comment_link_size;
    color:           $*c_comment_screened_link;
    text-decoration: underline;
  }
  .ind-comment-screened div.entry-item a:visited { color: $*c_comment_screened_link_visited; }
  .ind-comment-screened div.entry-item a:hover, .ind-comment-screened div.entry-item a:visited:hover { color: $*c_comment_screened_link_hover; }
  .ind-comment-screened div.entry-item a:active { color: $*c_comment_screened_link_active; }

.ind-comment-screened h3 img {
  position: relative;
  float:    right;
  padding:  5px;
}
.ind-comment-screened h4 {
  font-family: $*f_meta;
  font-size:   $*f_meta_size;
  color:       $*c_comment_screened_text_color;
}
.ind-comment-screened h4 a {
  font-family:     $*f_meta_link;
  font-size:       $*f_meta_link_size;
  color:           $*c_comment_screened_link;
  text-decoration: underline;
}
.ind-comment-screened h4 a:visited {
  color: $*c_comment_screened_link_visited;
}
.ind-comment-screened h4 a:hover {
  color: $*c_comment_screened_link_hover;
}
.ind-comment-screened h4 a:visited:hover {
  color: $*c_comment_screened_link_hover;
}
.ind-comment-screened h4 a:active {
  color: $*c_comment_screened_link_active;
}
.ind-comment-screened {
  margin:  10px 0;
  padding: 5px;
}
.ind-comment-screened {
  background-color: $*c_comment_screened_background;
  border-bottom:    1px solid $*c_comment_screened_border;
}
.ind-comment-screened h2 {
  font-family: $*f_comment_title;
  font-size:   $*f_comment_title_size;
  color:       $*c_comment_screened_title_color;
  margin:      20px 0px;
}
.ind-comment-screened div.entry-item {
  font-family: $*f_comment;
  font-size:   $*f_comment_size;
  color:       $*c_comment_screened_text_color;
  margin:      10px 0px;
}
.ind-comment-screened div.entry-item a {
  font-family:     $*f_comment_link;
  font-size:       $*f_comment_link_size;
  color:           $*c_comment_screened_link;
  text-decoration: underline;
}
.ind-comment-screened div.entry-item a:visited {
  color: $*c_comment_screened_link_visited;
}
.ind-comment-screened div.entry-item a:hover, .ind-comment-screened div.entry-item a:visited:hover {
  color: $*c_comment_screened_link_hover;
}
.ind-comment-screened div.entry-item a:active {
  color: $*c_comment_screened_link_active;
}
.ind-comment-frozen h3 img {
  position: relative;
  float:    right;
  padding:  5px;
}
.ind-comment-frozen h4 {
  font-family: $*f_meta;
  font-size:   $*f_meta_size;
  color:       $*c_comment_frozen_text_color;
}
.ind-comment-frozen h4 a {
  font-family:     $*f_meta_link;
  font-size:       $*f_meta_link_size;
  color:           $*c_comment_frozen_link;
  text-decoration: underline;
}
.ind-comment-frozen h4 a:visited {
  color: $*c_comment_frozen_link_visited;
}
.ind-comment-frozen h4 a:hover {
  color: $*c_comment_frozen_link_hover;
}
.ind-comment-frozen h4 a:visited:hover {
  color: $*c_comment_frozen_link_hover;
}
.ind-comment-frozen h4 a:active {
  color: $*c_comment_frozen_link_active;
}
.ind-comment-frozen {
  margin:  10px 0;
  padding: 5px;
}
.ind-comment-frozen {
  background-color: $*c_comment_frozen_background;
  border-bottom:    1px solid $*c_comment_frozen_border;
}
.ind-comment-frozen h2 {
  font-family: $*f_comment_title;
  font-size:   $*f_comment_title_size;
  color:       $*c_comment_frozen_title_color;
  margin:      20px 0px;
}
.ind-comment-frozen div.entry-item {
  font-family: $*f_comment;
  font-size:   $*f_comment_size;
  color:       $*c_comment_frozen_text_color;
  margin:      10px 0px;
}
.ind-comment-frozen div.entry-item a {
  font-family:     $*f_comment_link;
  font-size:       $*f_comment_link_size;
  color:           $*c_comment_frozen_link;
  text-decoration: underline;
}
.ind-comment-frozen div.entry-item a:visited {
  color: $*c_comment_frozen_link_visited;
}
.ind-comment-frozen div.entry-item a:hover, .ind-comment-frozen div.entry-item a:visited:hover {
  color: $*c_comment_frozen_link_hover;
}
.ind-comment-frozen div.entry-item a:active {
  color: $*c_comment_frozen_link_active;
}
#postform, #commenttext {
  width: 90%;
}

  .month-entries {
    margin: 10px 0;
  }
  .month-entries ul {
    list-style: none;
    margin:     10px;
  }
  .month-entries ul li {
    list-style: none;
    padding: 3px;
  }
  #footer {
    position: relative;
    font-family:      $*f_footer;
    font-size:        $*f_footer_size;
    color:            $*c_footer_text_color;
    background-color: $*c_footer_background;
  }
  #footer p {
    padding: 20px;
  }
  #footer a {
    font-family: $*f_footer_link;
    font-size:   $*f_footer_link_size;
    color:       $*c_footer_link;
  }
  #footer a:visited { color: $*c_footer_link_visited; }
  #footer a:hover, #footer a:visited:hover { color: $*c_footer_link_hover; }
  #footer a:active { color: $*c_footer_link_active; }
}

@media print {
  #menu {
    display: none;
  }
  #content {
    margin-left: 0px;
  }
  #entries, .ind-entry, .ind-comment, #footer, #header {
    border: none;
  }
}

$*css_style_overrides

&quot;&quot;&quot;;
}

function print_sidebar_box(string class, string header, string content) {
  if($header != &quot;&quot;) {
    &quot;&amp;lt;h2&quot;; if($class != &quot;&quot;) { &quot; class=\&quot;$class\&quot;&quot;; } &quot;&amp;gt;&quot;;
    print safe $header;
    &quot;&amp;lt;/h2&amp;gt;&quot;;
  }
  if($content != &quot;&quot;) {
    print safe $content;
  }
  &quot;&amp;lt;hr /&amp;gt;&quot;;
}

function print_sidebar_box(string header, string content) {
  print_sidebar_box(&quot;&quot;, $header, $content);
}

# -------------------------------
# user pic main page
# -------------------------------
function Page::lay_top_userpic() {
  var Image up_img = $.journal.default_pic;
  if ( defined $up_img ) {
    print_sidebar_box( &quot;userpic&quot;, &quot;&amp;lt;a href=\&quot;$*SITEROOT/allpics.bml?user=$.journal.username\&quot;&amp;gt;&amp;lt;img border=\&quot;0\&quot; src=\&quot;$up_img.url\&quot; height=\&quot;$up_img.height\&quot; width=\&quot;$up_img.width\&quot; alt=\&quot;$.journal.name\&quot; /&amp;gt;&amp;lt;/a&amp;gt;&quot;, &quot;&quot; );
  }
}


# -------------------------------
# returns a permalink link based on
# the url passed
# -------------------------------
function get_permalink ( string url ) : string {	
  return(&quot;&amp;lt;a href=\&quot;$url\&quot; title=\&quot;permalink\&quot; class=\&quot;$*text_permalink\&quot;&amp;gt;$*text_permalink&amp;lt;/a&amp;gt;&quot;);
}


# -------------------------------
# prints the user&apos;s &apos;link-list&apos;
# -------------------------------
function Page::print_linklist() {
  var string header  = &quot;&quot;;
  var string content = &quot;&quot;;
  if ( size $.linklist &amp;gt; 0 ) {
    $header  = $*text_links_header;
    $content = $content + &quot;&amp;lt;ul id=\&quot;user-links\&quot;&amp;gt;&quot;;
    foreach var UserLink l ( $.linklist ) {
      if ( $l.title == &quot;spacer&quot; ) {
        $content = $content + &quot;&amp;lt;li&amp;gt;$*text_links_spacer&amp;lt;/li&amp;gt;&quot;;
      } elseif ($l.is_heading) {
        $content = $content + &quot;&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;$l.title&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&quot;;
      } elseif ( $l.title ) {
        $content = $content + &quot;&amp;lt;li&amp;gt;&amp;lt;a href=\&quot;$l.url\&quot; title=\&quot;$l.title\&quot;&amp;gt;$l.title&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot;;
      }
    }
    $content = $content + &quot;&amp;lt;/ul&amp;gt;&quot;;
    print_sidebar_box($header, $content);
  }
}


# -------------------------------
# prints the LJ specific links (recent, friends, etc)
# -------------------------------
function print_lj_links ( Page p ) {
  var string links;
  var string[] views_order = $p.views_order; # view order
                                                                           # &quot;recent&quot;   = recent   view
                                                                           # &quot;friends&quot;  = friends  view
                                                                           # &quot;archive&quot;  = calendar view
                                                                           # &quot;userinfo&quot; = userinfo link
  var string{} view_text   = { # build text hash
                              &quot;recent&quot;   =&amp;gt; $*text_view_recent,
                              &quot;friends&quot;  =&amp;gt; $p.journal_type != &quot;C&quot; ? $*text_view_friends : $*text_view_friends_comm,
                              &quot;archive&quot;  =&amp;gt; $*text_view_archive,
                              &quot;userinfo&quot; =&amp;gt; $*text_view_userinfo
                             };
  var string   base_url    = $p.journal-&amp;gt;base_url(); # get base url
  var string{} view_url    = { # build url hash
                              &quot;recent&quot;   =&amp;gt; &quot;$base_url/&quot;,
                              &quot;friends&quot;  =&amp;gt; &quot;$base_url/friends/&quot;,
                              &quot;archive&quot;  =&amp;gt; &quot;$base_url/calendar/&quot;,
                              &quot;userinfo&quot; =&amp;gt; &quot;$*SITEROOT/userinfo.bml?user=$p.journal.username&amp;amp;mode=full&quot;
                             };
  foreach var string v ($views_order) {
    $links = $links + &quot;&quot;&quot;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;$view_url{$v}&quot;&amp;gt;$view_text{$v}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;
  }
  if($p.journal.website_url != &quot;&quot;) {
    $links = $links + &quot;&quot;&quot;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;$p.journal.website_url&quot;&amp;gt;&quot;&quot;&quot; + ($p.journal.website_name != &quot;&quot; ? $p.journal.website_name : $*text_website_default_name) + &quot;&quot;&quot;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;
  }
  $links = &quot;&amp;lt;ul id=\&quot;lj-links\&quot;&amp;gt;&quot; + $links + &quot;&amp;lt;/ul&amp;gt;&quot;;
  print_sidebar_box(&quot;&quot;, $links);
}

function Page::lay_sidebar_view_summary() : string {
  return(&quot;&quot;);
}

function print_tag_list(Page p) {
  var string header  = &quot;&quot;;
  var string content = &quot;&quot;;
  var Tag[] tags = $p-&amp;gt;visible_tag_list();
  if(size $tags) {
    $header = &quot;$*text_meta_tags_header$*text_meta_tags_joiner&quot;;
    var string height = $*tags_sidebar_height;
    if($height != &quot;&quot;) {
      $content = $content + &quot;&quot;&quot;&amp;lt;div style=&quot;position:relative; height:$height; overflow: auto;&quot;&amp;gt;&quot;&quot;&quot;;
    }
    $content = $content + &quot;&amp;lt;ul&amp;gt;&quot;;
    foreach var Tag tag ($tags) {
      $content = $content + &quot;&quot;&quot;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;$tag.url&quot;&amp;gt;$tag.name&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;
    }
    $content = $content + &quot;&amp;lt;/ul&amp;gt;&quot;;
    if($height != &quot;&quot;) {
      $content = $content + &quot;&amp;lt;/div&amp;gt;&quot;;
    }
    print_sidebar_box($header, $content);
  }
}

function print_sidebar(Page p) {
  # print userpic
  if(not $*menu_disable_userpic) {
    $p-&amp;gt;lay_top_userpic();
  }

  if(not $*menu_disable_navigation) {
    # print navigation
    print_lj_links($p);
  }

  # print summary
  print($p-&amp;gt;lay_sidebar_view_summary());

  if(not $*menu_disable_linklist) {
    # print linklist
    $p-&amp;gt;print_linklist();
  }
              
  if(not $*menu_disable_tag_list) {
    # print tag list
    print_tag_list($p);
  }
}

# -------------------------------
# main page layout
# -------------------------------
function Page::print() {
  var string title = $this-&amp;gt;title();

  # generate page id:
  var string current_view = $.view;
  if ( $.view == &quot;month&quot; or $.view == &quot;day&quot; ) {
    $current_view = &quot;archive&quot;;	
  }
  if ( $.view == &quot;entry&quot; or $.view == &quot;reply&quot; ) {
    $current_view = &quot;recent&quot;;	
  }

  # begin main page html:
  print &quot;&amp;lt;!DOCTYPE html PUBLIC \&quot;-//W3C//DTD XHTML 1.0 Transitional//EN\&quot; \&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\&quot;&amp;gt;\n&quot;;
  print &quot;&amp;lt;html xmlns=\&quot;http://www.w3.org/1999/xhtml\&quot; lang=\&quot;\&quot;&amp;gt;\n&quot;;
    print &quot;&amp;lt;head&amp;gt;\n&quot;;
      print &quot;&amp;lt;meta name=\&quot;resource-type\&quot; content=\&quot;Document\&quot; /&amp;gt;\n&quot;;
      print &quot;&amp;lt;meta name=\&quot;type\&quot; content=\&quot;index\&quot; /&amp;gt;\n&quot;;
      print &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; type=\&quot;text/css\&quot; href=\&quot;$.stylesheet_url\&quot; /&amp;gt;\n&quot;;
      $this-&amp;gt;print_head();
      print &quot;&amp;lt;link rel=\&quot;bookmark\&quot; href=\&quot;#header\&quot; title=\&quot;Top of the Page\&quot; /&amp;gt;\n&quot;;
      print &quot;&amp;lt;link rel=\&quot;bookmark\&quot; href=\&quot;#menu\&quot; title=\&quot;Main Menu\&quot; /&amp;gt;\n&quot;;
      print &quot;&amp;lt;link rel=\&quot;bookmark\&quot; href=\&quot;#summary\&quot; title=\&quot;Page Summary\&quot; /&amp;gt;\n&quot;;
      print &quot;&amp;lt;link rel=\&quot;bookmark\&quot; href=\&quot;#content\&quot; title=\&quot;Entries\&quot; /&amp;gt;\n&quot;;
      print &quot;&amp;lt;title&amp;gt;$title&amp;lt;/title&amp;gt;\n&quot;;
    print &quot;&amp;lt;/head&amp;gt;\n&quot;;
    print &quot;&amp;lt;body id=\&quot;$current_view\&quot;&amp;gt;\n&quot;;
      print &quot;&amp;lt;div id=\&quot;container\&quot;&amp;gt;\n&quot;;
        print &quot;&amp;lt;div id=\&quot;header\&quot;&amp;gt;\n&quot;;
          print &quot;&amp;lt;div id=\&quot;banner\&quot;&amp;gt;\n&quot;;
            print &quot;&amp;lt;h1&amp;gt;$title&amp;lt;/h1&amp;gt;\n&quot;;
            print &quot;&amp;lt;hr /&amp;gt;&quot;;
          print &quot;&amp;lt;/div&amp;gt;\n&quot;;
        print &quot;&amp;lt;/div&amp;gt;\n&quot;;
        print &quot;&amp;lt;div id=\&quot;menu\&quot;&amp;gt;\n&quot;;
          print_sidebar($this);
        print &quot;&amp;lt;/div&amp;gt;\n&quot;;
        print &quot;&amp;lt;div id=\&quot;content\&quot;&amp;gt;\n&quot;;
          $this-&amp;gt;print_body();
        print &quot;&amp;lt;/div&amp;gt;\n&quot;;
      print &quot;&amp;lt;/div&amp;gt;\n&quot;;
    print &quot;&amp;lt;/body&amp;gt;\n&quot;;
  print &quot;&amp;lt;/html&amp;gt;\n&quot;;
}

# -------------------------------
# main page display entries and
# footer
# -------------------------------
function RecentPage::print_body() {
  # print all entries
  print &quot;&amp;lt;div id=\&quot;entries\&quot;&amp;gt;\n&quot;;
  foreach var Entry e ( $.entries ) {
    $this-&amp;gt;print_entry($e);
  }
  print &quot;&amp;lt;/div&amp;gt;&quot;;

  var string range = &quot;most recent entries&quot;;
  if ( $.nav.skip &amp;gt; 0 ) {
    $range = &quot;$.nav.skip entries back&quot;;
  }

  print &quot;&amp;lt;div id=\&quot;footer\&quot;&amp;gt;&amp;lt;p&amp;gt;&quot;;
  print &quot;&amp;lt;b&amp;gt;viewing:&amp;lt;/b&amp;gt; $range&amp;lt;br /&amp;gt;&quot;;
  # go forward/backward if possible
  if ( $.nav.forward_url != &quot;&quot; or $.nav.backward_url != &quot;&quot; ) {
    var string sep;
    var string back;
    var string forward;
    if ( $.nav.backward_url != &quot;&quot; ) {
      $back = &quot;&amp;lt;a href=\&quot;$.nav.backward_url\&quot; title=\&quot;go earlier\&quot;&amp;gt;earlier&amp;lt;/a&amp;gt;&quot;;
    }
    if ( $.nav.forward_url != &quot;&quot; ) {
      $forward = &quot;&amp;lt;a href=\&quot;$.nav.forward_url\&quot; title=\&quot;go later\&quot;&amp;gt;later&amp;lt;/a&amp;gt;&quot;;
    }
    if ( $back != &quot;&quot; and $forward != &quot;&quot; ) { 
      $sep = &quot; | &quot;;
    }
    print &quot;&amp;lt;b&amp;gt;go&amp;lt;/b&amp;gt;: $back$sep$forward&amp;lt;br /&amp;gt;&quot;;
  }
  print &quot;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&quot;;
}


# -------------------------------
# entry view (show comments)
# -------------------------------
function EntryPage::print_body() {
  print &quot;&amp;lt;div id=\&quot;entries\&quot;&amp;gt;\n&quot;;
    $this-&amp;gt;print_entry ( $.entry );
    if ( $.entry.comments.enabled ) {
      print &quot;&amp;lt;h2&amp;gt;Comments {$.entry.comments.count}&amp;lt;/h2&amp;gt;&quot;;
      print &quot;&amp;lt;div id=\&quot;comments\&quot;&amp;gt;&quot;;
        if ( $.comment_pages.total_subitems &amp;gt; 0 ) {
          if ( $this.multiform_on ) {
            $this-&amp;gt;print_multiform_start();
          }
          $.comment_pages-&amp;gt;print();
          set_handler(&quot;unscreen_comment_#&quot;, [
                                             [ &quot;style_bgcolor&quot;, &quot;cmtbar#&quot;, &quot;$*c_comment_one_background&quot;,      ],
                                             [ &quot;style_color&quot;,   &quot;cmtbar#&quot;, &quot;$*c_comment_one_text_color&quot;,      ],
                                            ]);
          set_handler(&quot;screen_comment_#&quot;,   [
                                             [ &quot;style_bgcolor&quot;, &quot;cmtbar#&quot;, &quot;$*c_comment_screened_background&quot;, ],
                                             [ &quot;style_color&quot;,   &quot;cmtbar#&quot;, &quot;$*c_comment_screened_text_color&quot;, ],
                                            ]);
          set_handler(&quot;unfreeze_comment_#&quot;, [
                                             [ &quot;style_bgcolor&quot;, &quot;cmtbar#&quot;, &quot;$*c_comment_one_background&quot;,      ],
                                             [ &quot;style_color&quot;,   &quot;cmtbar#&quot;, &quot;$*c_comment_one_text_color&quot;,      ],
                                            ]);
          set_handler(&quot;freeze_comment_#&quot;,   [
                                             [ &quot;style_bgcolor&quot;, &quot;cmtbar#&quot;, &quot;$*c_comment_frozen_background&quot;, ],
                                             [ &quot;style_color&quot;,   &quot;cmtbar#&quot;, &quot;$*c_comment_frozen_text_color&quot;,      ],
                                            ]);
          $this-&amp;gt;print_comments($.comments);
          if ( $this.multiform_on ) {
            $this-&amp;gt;print_multiform_actionline();
            $this-&amp;gt;print_multiform_end();
          }
        }
      print &quot;&amp;lt;/div&amp;gt;&quot;;
    }
  print &quot;&amp;lt;/div&amp;gt;&quot;;
  print &quot;&amp;lt;div id=\&quot;footer\&quot;&amp;gt;&amp;lt;p&amp;gt;&quot;;
    print &quot;&amp;lt;a href=\&quot;$.entry.comments.post_url\&quot; title=\&quot;$*text_post_comment\&quot;&amp;gt;$*text_post_comment&amp;lt;/a&amp;gt;\n&quot;;
  print &quot;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&quot;;	
}

# -------------------------------
# day view
# -------------------------------
function DayPage::print_body() {
  if ( not $.has_entries ) {
    print &quot;&amp;lt;div id=\&quot;entries\&quot;&amp;gt;\n&quot;;
    print &quot;&amp;lt;div class=\&quot;ind-entry\&quot;&amp;gt;\n&quot;;
    print &quot;&amp;lt;h2&amp;gt;&quot; + $.date-&amp;gt;date_format(&quot;long&quot;) + &quot;&amp;lt;/h2&amp;gt;&quot;;
    print &quot;&amp;lt;p&amp;gt;$*text_noentries_day&amp;lt;/p&amp;gt;&quot;;
    print &quot;&amp;lt;/div&amp;gt;&quot;;
    print &quot;&amp;lt;/div&amp;gt;&quot;;
    print &quot;&amp;lt;hr /&amp;gt;&quot;;
  } else {
    print &quot;&amp;lt;div id=\&quot;entries\&quot;&amp;gt;\n&quot;;
    foreach var Entry e ( $.entries ) {
      $this-&amp;gt;print_entry($e);
    }
    print &quot;&amp;lt;/div&amp;gt;&quot;;
  }

  var string tprev = ehtml($*text_day_prev);
  var string tnext = ehtml($*text_day_next);

  print &quot;&amp;lt;div id=\&quot;footer\&quot;&amp;gt;&amp;lt;p&amp;gt;&quot;;
  print &quot;&amp;lt;a href=\&quot;$.prev_url\&quot; title=\&quot;laquo; $tprev\&quot;&amp;gt;&amp;amp;laquo; $*text_day_prev&amp;lt;/a&amp;gt; | &amp;lt;a href=\&quot;$.next_url\&quot; title=\&quot;$tnext &amp;amp;raquo;\&quot;&amp;gt;$*text_day_next &amp;amp;raquo;&amp;lt;/a&amp;gt;&quot;;
  print &quot;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&quot;;
}


# -------------------------------
# year view
# -------------------------------
function YearPage::print_body() {
  print &quot;&amp;lt;div id=\&quot;entries\&quot;&amp;gt;\n&quot;;
  $this-&amp;gt;print_year_links();
  foreach var YearMonth m ($.months) {
    $this-&amp;gt;print_month($m);
  }
  print &quot;&amp;lt;/div&amp;gt;&quot;;
}


# -------------------------------
# page summary for recent page
# -------------------------------
function RecentPage::lay_sidebar_view_summary() : string {
  var string return;
  if ( not $*menu_disable_summary ) {
    foreach var Entry e ( $.entries ) {
      $return = $return + &quot;&amp;lt;li&amp;gt;$e.security_icon &amp;lt;a href=\&quot;#$e.journal.username$e.itemid\&quot;&amp;gt;&quot; + ($e.subject != &quot;&quot; ? &quot;$e.subject&quot; : &quot;$*text_nosubject&quot;) + &quot;&amp;lt;/a&amp;gt; [&amp;lt;a href=\&quot;$e.permalink_url\&quot;&amp;gt;&quot; + (($e.comments.count &amp;gt; 0) ? $e.comments.count + &quot;&quot; : &quot;#&quot;) + &quot;&amp;lt;/a&amp;gt;]&amp;lt;/li&amp;gt;&quot;;
    }
  }
  if ( $return != &quot;&quot; ) {
    $return = &quot;&amp;lt;h2&amp;gt;$*text_summary_header&amp;lt;/h2&amp;gt;&amp;lt;ul id=\&quot;lj-summary\&quot;&amp;gt;&quot; + $return + &quot;&amp;lt;/ul&amp;gt;&amp;lt;hr /&amp;gt;&quot;; 
  }
  return($return);
}


# -------------------------------
# page summary for day page
# -------------------------------
function DayPage::lay_sidebar_view_summary() : string {
  var string return;
  if ( not $*menu_disable_summary ) {
    foreach var Entry e ( $.entries ) {
      $return = $return + &quot;&amp;lt;li&amp;gt;$e.security_icon &amp;lt;a href=\&quot;#$e.journal.username$e.itemid\&quot;&amp;gt;&quot; + ($e.subject != &quot;&quot; ? &quot;$e.subject&quot; : &quot;$*text_nosubject&quot;) + &quot;&amp;lt;/a&amp;gt; [&amp;lt;a href=\&quot;$e.permalink_url\&quot;&amp;gt;&quot; + (($e.comments.count &amp;gt; 0) ? $e.comments.count + &quot;&quot; : &quot;#&quot;) + &quot;&amp;lt;/a&amp;gt;]&amp;lt;/li&amp;gt;&quot;;
    }
  }
  if ( $return != &quot;&quot; ) {
    $return = &quot;&amp;lt;h2&amp;gt;$*text_summary_header&amp;lt;/h2&amp;gt;&amp;lt;ul id=\&quot;lj-summary\&quot;&amp;gt;&quot; + $return + &quot;&amp;lt;/ul&amp;gt;&amp;lt;hr /&amp;gt;&quot;; 
  }
  return($return);
}


# -------------------------------
# page summary for entry page
# -------------------------------
function EntryPage::lay_sidebar_view_summary() : string {
  var string return;
  if ( not $*menu_disable_summary ) {
    foreach var Comment c ( $.comments ) {
      if ( $c.depth == 1 ) {
        $return = $return + &quot;&amp;lt;li&amp;gt;&amp;lt;a href=\&quot;#c.anchor\&quot;&amp;gt;&quot; + ($c.subject != &quot;&quot; ? &quot;$c.subject&quot; : &quot;$*text_nosubject&quot;) + &quot;&amp;lt;/a&amp;gt; [&amp;lt;a href=\&quot;$c.permalink_url\&quot;&amp;gt;#&amp;lt;/a&amp;gt;]&amp;lt;/li&amp;gt;&quot;;	
      }
    }
  }
  if ( $return != &quot;&quot; ) {
    $return = &quot;&amp;lt;h2&amp;gt;$*text_summary_header&amp;lt;/h2&amp;gt;&amp;lt;ul id=\&quot;lj-summary\&quot;&amp;gt;&quot; + $return + &quot;&amp;lt;/ul&amp;gt;&amp;lt;hr /&amp;gt;&quot;; 
  }
  return($return);
}


function Entry::print_metadata() {
  var string tags_header          = $*text_meta_tags_header;
  var string tags_joiner          = $*text_meta_tags_joiner;
  var Link   edit_tags            = $this-&amp;gt;get_link(&quot;edit_tags&quot;);
  if ((size $.metadata &amp;gt; 0) or ((size $.tags &amp;gt; 0) and ($*tags_aware))){
    var string currents = &quot;&quot;;
    $currents = &quot;&quot;&quot;&amp;lt;div class=&quot;currents&quot;&amp;gt;&quot;&quot;&quot;;
    foreach var string k ($.metadata){
      var string text = $k;
      var string val = $.metadata{$k};
      if ($k == &quot;mood&quot;){
        $text = $*text_meta_mood;
      } 
      elseif ($k == &quot;music&quot;) {
        $text = $*text_meta_music;
      }
      if ($k == &quot;mood&quot; and defined $.mood_icon){
        var Image i = $.mood_icon;
        $val = &quot;&amp;lt;img src=&apos;$i.url&apos; width=&apos;$i.width&apos; height=&apos;$i.height&apos; align=&apos;middle&apos; alt=&apos;&apos; /&amp;gt; $val&quot;;
      }
      $currents = $currents + &quot;&quot;&quot;&amp;lt;div class=&quot;current$k&quot;&amp;gt;&amp;lt;strong&amp;gt;$text:&amp;lt;/strong&amp;gt; $val&amp;lt;/div&amp;gt;&quot;&quot;&quot;;        
    }
    if ((size $.tags &amp;gt; 0) and $*tags_aware) {
      var int    tcount               = 0;
      if($edit_tags.url != &quot;&quot;) {
        $tags_header = &quot;&quot;&quot;&amp;lt;a href=&quot;$edit_tags.url&quot;&amp;gt;$tags_header&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
      }
      $currents = $currents + &quot;&quot;&quot;&amp;lt;span class=&quot;tags_header&quot;&amp;gt;$tags_header$tags_joiner&amp;lt;/span&amp;gt; &quot;&quot;&quot;;
      foreach var Tag t ($.tags) {
        $currents = $currents + &quot;&quot;&quot;&amp;lt;a rel=&quot;tag&quot; href=&quot;$t.url&quot;&amp;gt;$t.name&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        $tcount++;
        if ($tcount != size $.tags) { $currents = $currents + &quot;, &quot;; }
      }
    }
    $currents = $currents + &quot;&amp;lt;/div&amp;gt;&quot;; 
    println &quot;$currents&quot;;
  }
}

# -------------------------------
# display an entry (all views )
# -------------------------------
function print_entry ( Page p, Entry e ) {
  # get date/time
  var string datetime;
  $datetime = $e.time-&amp;gt;date_format($*date_format) + &quot; | &quot; + $e.time-&amp;gt;time_format($*time_format);

  # get any extra user info (if posting to community, etc)
  var string poster = &quot;&quot;;
  var string userpic = &quot;&quot;;
  if ( $p.view == &quot;friends&quot; or $p.journal_type == &quot;C&quot; or $e.poster.username != $e.journal.username ) {
    if ( $e.poster.username != $e.journal.username ) {
      $poster = &quot;$e.poster in $e.journal&quot;;
    } else {
      $poster =  $e.poster-&amp;gt;as_string();
    }
    $poster = &quot;&amp;lt;b&amp;gt;posted by:&amp;lt;/b&amp;gt; $poster&quot;;
  }
  if ( defined $e.userpic and ( ($p.view == &quot;recent&quot; and $*show_recent_userpic) or ($p.view == &quot;day&quot; and $*show_day_userpic) or ($p.view == &quot;entry&quot; and $*show_entry_userpic) or ($p.view == &quot;friends&quot;) ) ) {
    $userpic = &quot;&quot;&quot;&amp;lt;h3 class=&quot;userpic&quot;&amp;gt;&amp;lt;a href=&quot;$*SITEROOT/allpics.bml?user=$e.poster.username&quot; target=&quot;_blank&quot;&amp;gt;&amp;lt;img border=&quot;0&quot; src=&quot;$e.userpic.url&quot; width=&quot;$e.userpic.width&quot; height=&quot;$e.userpic.height&quot; alt=&quot;$e.poster.username&apos;s user pictures&quot; title=&quot;$e.poster.username&apos;s user pictures&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h3&amp;gt;&quot;&quot;&quot;;
  }

  # print the entry now:
  print &quot;&amp;lt;div id=\&quot;$e.journal.username$e.itemid\&quot; class=\&quot;ind-entry\&quot;&amp;gt;&quot;;

    # print icon (if needed)
    if ( $userpic != &quot;&quot; ) {
      print &quot;$userpic&quot;;	
    }

    print &quot;&amp;lt;h2&amp;gt;&quot;;
      if ( $e.security != &quot;&quot; ) {
        $e.security_icon-&amp;gt;print();
        print &quot; &quot;;
      }
      if ( $e.subject == &quot;&quot; ) {
        print &quot;&amp;lt;i&amp;gt;$*text_nosubject&amp;lt;/i&amp;gt;&quot;;
      } else {
        print &quot;$e.subject&quot;;
      }
    print &quot;&amp;lt;/h2&amp;gt;&quot;;

    print &quot;&amp;lt;h4&amp;gt;&quot;;
      if ( $p.view == &quot;entry&quot; and $*show_entrynav_icons ) {
        var string item_link = &quot;&quot;;
        foreach var string key ([&quot;nav_prev&quot;,&quot;nav_next&quot;]) {
          var Link link = $e-&amp;gt;get_link($key);
          if ( $link ) { 
            if ( $key == &quot;nav_prev&quot; ) {
              $item_link = $item_link + &quot;&amp;lt;a href=\&quot;$link.url\&quot; title=\&quot;&quot; + $link.caption-&amp;gt;lower() + &quot;\&quot;&amp;gt;&amp;amp;laquo; &quot; + $link.caption-&amp;gt;lower() + &quot;&amp;lt;/a&amp;gt; | &quot;;
            } elseif ( $key == &quot;nav_next&quot; ) {
              $item_link = $item_link + &quot;&amp;lt;a href=\&quot;$link.url\&quot; title=\&quot;&quot; + $link.caption-&amp;gt;lower() + &quot;\&quot;&amp;gt;&quot; + $link.caption-&amp;gt;lower() + &quot; &amp;amp;raquo;&amp;lt;/a&amp;gt;&quot;;
            }
          }
        }
        print $item_link;
        print &quot;&amp;lt;br /&amp;gt;&quot;;
      }
      print &quot;&amp;lt;b&amp;gt;$datetime&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&quot;;
      $e-&amp;gt;print_metadata();
      if ( $poster != &quot;&quot; ) {
        print &quot;$poster&quot;;	
      }
    print &quot;&amp;lt;/h4&amp;gt;&quot;;

    print &quot;&amp;lt;div class=\&quot;entry-item\&quot;&amp;gt;&quot;; $e-&amp;gt;print_text(); &quot;&amp;lt;/div&amp;gt;\n&quot;;

    print &quot;&amp;lt;h4&amp;gt;&quot;;
#		print get_permalink($e.permalink_url);
      if ( $p.view != &quot;entry&quot; and $p.view != &quot;reply&quot; ) {
#			print &quot; | &quot;;
        $e.comments-&amp;gt;print();
      } elseif ( $e.comments.enabled ) {
#			print &quot; | &quot;;
        $e.comments-&amp;gt;print_postlink();
      }
      var Link tmp;
      var string[] link_keyseq = $e.link_keyseq;
      foreach var string key ($link_keyseq) {
        $tmp = $e-&amp;gt;get_link($key);
        if($tmp.caption != &quot;&quot; and $tmp.url != &quot;&quot;) {
          print &quot;&quot;&quot; | &amp;lt;a href=&quot;$tmp.url&quot; title=&quot;$tmp.caption&quot;&amp;gt;$tmp.caption&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        }
      }
      print &quot;&quot;&quot; | &amp;lt;a href=&quot;$e.permalink_url&quot; title=&quot;$*text_permalink&quot;&amp;gt;$*text_permalink&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
    print &quot;&amp;lt;/h4&amp;gt;&quot;;
  print &quot;&amp;lt;/div&amp;gt;&quot;;
  print &quot;&amp;lt;hr /&amp;gt;&quot;;
}


# -------------------------------
# entry wrapper for main page
# -------------------------------
function Page::print_entry(Entry e) {
  print_entry($this, $e);
}


# -------------------------------
# entry wrapper for friends page
# -------------------------------
function FriendsPage::print_entry(Entry e) {
   print_entry($this, $e);
}


function EntryPage::print_entry(Entry e) {
  print_entry($this, $e);
}


# -------------------------------
# comments
# -------------------------------
function CommentInfo::print() {
  if ( not $.enabled ) {
    return;
  }

  $this-&amp;gt;print_postlink();
  if ( $.count &amp;gt; 0 or $.screened ) {
    print &quot; &quot;;
    print &quot;&amp;lt;b&amp;gt;&quot;;
    $this-&amp;gt;print_readlink();
    print &quot;&amp;lt;/b&amp;gt;&quot;;
  }
}


# -------------------------------
# comment post link
# -------------------------------
function CommentInfo::print_postlink() {
  var Page p = get_page();
  var string linktext = ( $p.view == &quot;friends&quot; ? $*text_post_comment_friends : $*text_post_comment );
  if ( $.maxcomments ) {
    &quot;$*text_max_comments&quot;;
  } else {
    &quot;&amp;lt;a href=\&quot;$.post_url\&quot; title=\&quot;$linktext\&quot; class=\&quot;comments\&quot;&amp;gt;$linktext&amp;lt;/a&amp;gt;&quot;;
  }
}


# -------------------------------
# print comment
# -------------------------------
function EntryPage::print_comment(Comment c) {
  var string comment_class = &quot;&quot;;   
  if ( $c.screened ) {
    $comment_class = &quot;ind-comment-screened&quot;;
  } elseif ( $c.frozen ) {
    $comment_class = &quot;ind-comment-frozen&quot;;
  } elseif ( $c.depth % 2 == 0 ) {
    $comment_class = &quot;ind-comment-two&quot;;
  } else {
    $comment_class = &quot;ind-comment-one&quot;;
  }

  var string poster = defined $c.poster ? $c.poster-&amp;gt;as_string() : &quot;&amp;lt;i&amp;gt;$*text_poster_anonymous&amp;lt;/i&amp;gt;&quot;;
  var string poster_text = defined $c.poster ? $c.poster.name : &quot;&amp;lt;i&amp;gt;$*text_poster_anonymous&amp;lt;/i&amp;gt;&quot;;
  var string sub_icon;
  var int indent = (($c.depth - 1) * 5);
  if ( defined $c.subject_icon ) {
    $sub_icon = $c.subject_icon-&amp;gt;as_string();
  }

  print &quot;&amp;lt;div class=\&quot;$comment_class\&quot; id=\&quot;cmtbar$c.talkid\&quot; style=\&quot;margin-left: ${indent}px;\&quot;&amp;gt;\n&quot;;

    var string userpic;
    if ( defined $c.userpic and $*comment_userpic_style != &quot;off&quot; ) {
      $userpic = &quot;&quot;&quot;&amp;lt;h3 class=&quot;userpic&quot;&amp;gt;&amp;lt;a href=&quot;$*SITEROOT/allpics.bml?user=$c.poster.username&quot; target=&quot;_blank&quot;&amp;gt;&amp;lt;img border=&quot;0&quot; src=&quot;$c.userpic.url&quot; width=&quot;$c.userpic.width&quot; height=&quot;$c.userpic.height&quot; alt=&quot;$c.poster.username&apos;s user pictures&quot; title=&quot;$c.poster.username&apos;s user pictures&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h3&amp;gt;&quot;&quot;&quot;;
    }
    var string commentdate = &quot;&quot;;
    $commentdate = $c.time-&amp;gt;date_format($*date_format) + &quot; - &quot; + $c.time-&amp;gt;time_format($*time_format);

    #userpic
    print &quot;$userpic\n&quot;;

    # subject:
    if ( $c.subject == &quot;&quot; ) {
      print &quot;&amp;lt;h2 name=\&quot;$c.anchor\&quot; id=\&quot;$c.anchor\&quot;&amp;gt;$c.subject_icon &amp;lt;i&amp;gt;$*text_nosubject&amp;lt;/i&amp;gt;&amp;lt;/h2&amp;gt;&quot;;
    } else {
      print &quot;&amp;lt;h2 name=\&quot;$c.anchor\&quot; id=\&quot;$c.anchor\&quot;&amp;gt;$c.subject_icon $c.subject&amp;lt;/h2&amp;gt;&quot;;
    }

    print &quot;&amp;lt;h4&amp;gt;&quot;;
      print &quot;&amp;lt;b&amp;gt;$*text_comment_from&amp;lt;/b&amp;gt; $poster&amp;lt;br /&amp;gt;\n&quot;;
      print &quot;&amp;lt;b&amp;gt;$*text_comment_date&amp;lt;/b&amp;gt; $commentdate&amp;lt;br /&amp;gt;\n&quot;;
      if ( $c.metadata{&quot;poster_ip&quot;} ) {
        print &quot;&amp;lt;b&amp;gt;$*text_comment_ipaddr&amp;lt;/b&amp;gt; &quot; + $c.metadata{&quot;poster_ip&quot;} + &quot;&amp;lt;br /&amp;gt;&quot;;
      }
      print get_permalink($c.permalink_url) + &quot;&amp;lt;br /&amp;gt;\n&quot;;
      var Link lnk;
      foreach var string key ($c.link_keyseq) {
        $lnk = $c-&amp;gt;get_link($key); 
        if ( $lnk.url != &quot;&quot; ) { if($lnk.icon.url != &quot;&quot;) { print &quot;&quot;&quot;&amp;lt;a href=&quot;$lnk.url&quot;&amp;gt;&amp;lt;img src=&quot;$lnk.icon.url&quot; width=&quot;$lnk.icon.width&quot; height=&quot;$lnk.icon.height&quot; alt=&quot;$lnk.caption&quot; title=&quot;$lnk.caption&quot; border=&quot;0&quot; /&amp;gt;&amp;lt;/a&amp;gt; &quot;&quot;&quot;; } }
      }
    print &quot;&amp;lt;/h4&amp;gt;\n&quot;;

    if ( $this.multiform_on ) {
      print &quot;&amp;lt;label for=\&quot;ljcomsel_$c.talkid\&quot;&amp;gt;$*text_multiform_check&amp;lt;/label&amp;gt;&quot;;
      $c-&amp;gt;print_multiform_check();
    }

    print &quot;&amp;lt;div class=\&quot;entry-item\&quot;&amp;gt;&quot;; $c-&amp;gt;print_text(); &quot;&amp;lt;/div&amp;gt;\n&quot;;
    print &quot;&amp;lt;h4&amp;gt;&quot;;
      if ( not $c.frozen       ) { print &quot;&amp;lt;a href=\&quot;$c.reply_url\&quot; title=\&quot;$*text_comment_reply\&quot;&amp;gt;$*text_comment_reply&amp;lt;/a&amp;gt;&quot;;       } else { print $*text_comment_frozen; }
      if ( $c.parent_url != &quot;&quot; ) { print &quot; | &amp;lt;a href=\&quot;$c.parent_url\&quot; title=\&quot;$*text_comment_parent\&quot;&amp;gt;$*text_comment_parent&amp;lt;/a&amp;gt;&quot;; }
      if ( $c.thread_url != &quot;&quot; ) { print &quot; | &amp;lt;a href=\&quot;$c.thread_url\&quot; title=\&quot;$*text_comment_thread\&quot;&amp;gt;$*text_comment_thread&amp;lt;/a&amp;gt;&quot;; }
    print &quot;&amp;lt;/h4&amp;gt;&quot;;
  print &quot;&amp;lt;/div&amp;gt;\n\n&quot;;
  print &quot;&amp;lt;hr /&amp;gt;&quot;;
}

function EntryPage::print_comment_partial (Comment c) {
  var string poster = defined $c.poster ? $c.poster-&amp;gt;as_string() : &quot;&amp;lt;i&amp;gt;$*text_poster_anonymous&amp;lt;/i&amp;gt;&quot;;
  var string subj = $c.subject != &quot;&quot; ? $c.subject : $*text_nosubject;
  print &quot;&quot;&quot;&amp;lt;a href=&quot;$c.permalink_url&quot; name=&quot;$c.anchor&quot; id=&quot;$c.anchor&quot;&amp;gt;$subj&amp;lt;/a&amp;gt; - $poster&quot;&quot;&quot;;
}

# -------------------------------
# print reply form page
# -------------------------------
function ReplyPage::print_body() {
  if ( not $.entry.comments.enabled ) {
    print &quot;&amp;lt;div id=\&quot;entries\&quot;&amp;gt;\n&quot;;
      print &quot;&amp;lt;div class=\&quot;ind-entry\&quot;&amp;gt;&quot;;
        print &quot;&amp;lt;h2&amp;gt;$*text_reply_nocomments_header&amp;lt;/h2&amp;gt;&quot;;
        print &quot;$*text_reply_nocomments&quot;;
      print &quot;&amp;lt;/div&amp;gt;&quot;;
    print &quot;&amp;lt;/div&amp;gt;&quot;;
  } else {
    print &quot;&amp;lt;div id=\&quot;entries\&quot;&amp;gt;\n&quot;;

      # get date
      var string datetime;
      $datetime = $.replyto.time-&amp;gt;date_format($*date_format) + &quot; | &quot; + $.replyto.time-&amp;gt;time_format($*time_format);

      # get any extra user info (if posting to community, etc)
      var string poster = &quot;&quot;;
      var string userpic = &quot;&quot;;
      if ( defined $.replyto.poster ) {
        $poster = $.replyto.poster-&amp;gt;as_string();
        if ( defined $.replyto.userpic ) {
          $userpic = &quot;&quot;&quot;&amp;lt;h3 class=&quot;userpic&quot;&amp;gt;&amp;lt;a href=&quot;$*SITEROOT/allpics.bml?user=$.replyto.poster.username&quot; target=&quot;_blank&quot;&amp;gt;&amp;lt;img border=&quot;0&quot; src=&quot;$.replyto.userpic.url&quot; width=&quot;$.replyto.userpic.width&quot; height=&quot;$.replyto.userpic.height&quot; alt=&quot;$.replyto.poster.username&apos;s user pictures&quot; title=&quot;$.replyto.poster.username&apos;s user pictures&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h3&amp;gt;&quot;&quot;&quot;;
        }
      } else {
        $poster = &quot;&amp;lt;i&amp;gt;$*text_poster_anonymous&amp;lt;/i&amp;gt;&quot;;
      }

      # print the entry now:
      print &quot;&amp;lt;div class=\&quot;ind-entry\&quot;&amp;gt;&quot;;
        # print icon (if needed)
        if ( $userpic != &quot;&quot; ) {
          print &quot;$userpic&quot;;	
        }
        print &quot;&amp;lt;h2&amp;gt;&quot;;
          if ( $.replyto.subject == &quot;&quot; ) {
            print &quot;&amp;lt;i&amp;gt;$*text_nosubject&amp;lt;/i&amp;gt;&quot;;
          } else {
            print &quot;$.replyto.subject&quot;;
          }
        print &quot;&amp;lt;/h2&amp;gt;&quot;;

        print &quot;&amp;lt;h4&amp;gt;\n&quot;;
          print &quot;&amp;lt;b&amp;gt;$datetime&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&quot;;
          print &quot;&amp;lt;b&amp;gt;$*text_comment_from&amp;lt;/b&amp;gt; $poster&quot;;
          if ( $.replyto.metadata{&quot;poster_ip&quot;} ) {
            print &quot;&amp;lt;b&amp;gt;$*text_comment_ipaddr&amp;lt;/b&amp;gt; &quot; + $.replyto.metadata{&quot;poster_ip&quot;} + &quot;&amp;lt;br /&amp;gt;&quot;;
          }
        print &quot;&amp;lt;/h4&amp;gt;&quot;;
        print &quot;&amp;lt;div class=\&quot;entry-item\&quot;&amp;gt;&quot;; $.replyto-&amp;gt;print_text(); &quot;&amp;lt;/div&amp;gt;\n&quot;;
        print &quot;&amp;lt;h4&amp;gt;&quot;;
          print get_permalink($.replyto.permalink_url) + &quot; | &amp;lt;a href=\&quot;$.entry.comments.read_url\&quot; title=\&quot;$*text_comment_viewall\&quot;&amp;gt;$*text_comment_viewall&amp;lt;/a&amp;gt;\n&quot;;
        print &quot;&amp;lt;/h4&amp;gt;&quot;;
      print &quot;&amp;lt;/div&amp;gt;\n&quot;;
      print &quot;&amp;lt;hr /&amp;gt;&quot;;
      print &quot;&amp;lt;div class=\&quot;entry-form\&quot;&amp;gt;\n&quot;;
        print &quot;&amp;lt;h2&amp;gt;Reply&amp;lt;/h2&amp;gt;\n&quot;;
        $.form-&amp;gt;print();
      print &quot;&amp;lt;/div&amp;gt;&quot;;
    print &quot;&amp;lt;/div&amp;gt;&quot;;
  }
}

# -------------------------------
# print available years
# -------------------------------
function YearPage::print_year_links() {
  print &quot;&amp;lt;h4&amp;gt;&quot;;
    print &quot;&amp;lt;b&amp;gt;available years:&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&quot;;
    foreach var YearYear y ($.years) {
      if ($y.displayed) {
        print &quot;&amp;lt;b&amp;gt;$y.year&amp;lt;/b&amp;gt; &quot;;
      } else {
        print &quot;&amp;lt;a href=\&quot;$y.url\&quot; title=\&quot;$y.year\&quot;&amp;gt;$y.year&amp;lt;/a&amp;gt; &quot;;
      }
    }
  print &quot;&amp;lt;/h4&amp;gt;&quot;;
}


# -------------------------------
# print available month
# -------------------------------
function YearPage::print_month ( YearMonth m ) {
  if ( not $m.has_entries ) { 
    return;
  }

  print &quot;&amp;lt;div class=\&quot;ind-entry\&quot;&amp;gt;\n&quot;;
    print &quot;&amp;lt;h2&amp;gt;&quot; + $m-&amp;gt;month_format() + &quot;&amp;lt;/h2&amp;gt;\n&quot;;
    print &quot;&amp;lt;h4&amp;gt;&amp;lt;a href=\&quot;$m.url\&quot; title=\&quot;$*text_view_month\&quot;&amp;gt;$*text_view_month&amp;lt;/a&amp;gt;&amp;lt;/h4&amp;gt;&quot;;
    print &quot;&amp;lt;div style=\&quot;month\&quot;&amp;gt;&quot;;
      foreach var YearWeek w ( $m.weeks ) {
        foreach var YearDay d ( $w.days ) {
          if ( $d.num_entries &amp;gt; 0 ) {
            var string date = $d.date-&amp;gt;date_format(&quot;%%dayord%%&quot;);
            print &quot;&amp;lt;b&amp;gt;$date&amp;lt;/b&amp;gt; {&amp;lt;a href=\&quot;$d.url\&quot; title=\&quot;d.num_entries comments\&quot;&amp;gt;$d.num_entries&amp;lt;/a&amp;gt;}&amp;lt;br /&amp;gt;\n&quot;;
          }
        }
      }
      print &quot;&amp;lt;/div&amp;gt;\n&quot;;
    print &quot;&amp;lt;/div&amp;gt;\n&quot;;
  print &quot;&amp;lt;hr /&amp;gt;&quot;;
}


# -------------------------------
# month view
# -------------------------------
function MonthPage::print_body() {
  print &quot;&amp;lt;div id=\&quot;entries\&quot;&amp;gt;&quot;;
    print &quot;&amp;lt;div class=\&quot;ind-entry\&quot;&amp;gt;\n&quot;;
      print &quot;&amp;lt;h2&amp;gt;&quot; + $.date-&amp;gt;date_format($*lang_fmt_month_long) + &quot;&amp;lt;/h2&amp;gt;&quot;;

      print &quot;&amp;lt;form method=\&quot;post\&quot; action=\&quot;$.redir.url\&quot;&amp;gt;&quot;;
        $.redir-&amp;gt;print_hiddens();
        if ( $.prev_url != &quot;&quot; ) { 
          print &quot;[&amp;lt;a href=\&quot;$.prev_url\&quot; title=\&quot;&amp;amp;laquo;\&quot;&amp;gt;&amp;amp;laquo;&amp;lt;/a&amp;gt;]\n&quot;;
        }
        if ( size $.months &amp;gt; 1 ) {
          print &quot;&amp;lt;select name=\&quot;redir_key\&quot;&amp;gt;\n&quot;;
            foreach var MonthEntryInfo mei ( $.months ) {
              var string sel;
              if ( $mei.date.year == $.date.year and $mei.date.month == $.date.month ) {
                $sel = &quot; selected=\&quot;selected\&quot;&quot;;
              }
              print &quot;&amp;lt;option value=\&quot;$mei.redir_key\&quot; label=\&quot;&quot; + $mei.date-&amp;gt;date_format($*lang_fmt_month_long) + &quot;\&quot; $sel&amp;gt;&quot; + $mei.date-&amp;gt;date_format($*lang_fmt_month_long) + &quot;&amp;lt;/option&amp;gt;&quot;;
            }
          print &quot;&amp;lt;/select&amp;gt;\n&amp;lt;input type=\&quot;submit\&quot; value=\&quot;View\&quot; /&amp;gt;&quot;;
        }
        if ( $.next_url != &quot;&quot; ) { 
          print &quot;\n[&amp;lt;a href=\&quot;$.next_url\&quot; title=\&quot;&amp;amp;raquo;\&quot;&amp;gt;&amp;amp;raquo;&amp;lt;/a&amp;gt;]\n&quot;;
        }
      print &quot;&amp;lt;/form&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&quot;;

      # print dates:
      foreach var MonthDay d ( $.days ) {
        if ( $d.has_entries ) {
          print &quot;&amp;lt;div class=\&quot;month-entries\&quot;&amp;gt;\n&quot;;
            print &quot;&amp;lt;a href=\&quot;$d.url\&quot; title=\&quot;&quot; + lang_ordinal($d.day) + &quot;\&quot;&amp;gt;&amp;lt;b&amp;gt;&quot; + lang_ordinal($d.day) + &quot;&amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&quot;;
            print &quot;&amp;lt;ul&amp;gt;&quot;;
              foreach var Entry e ( $d.entries ) {
                print &quot;&amp;lt;li&amp;gt;&quot;;
                  print &quot;&quot; + $e.time-&amp;gt;time_format(&quot;short&quot;) + &quot; &quot;;
                  if ( $e.poster.username != $e.journal.username ) {
                    $e.poster-&amp;gt;print(); &quot; : &quot;;
                  }
                  &quot;$e.security_icon &quot;;
                  if ( $e.subject == &quot;&quot; ) {
                    print &quot;&amp;lt;a href=\&quot;$e.permalink_url\&quot; title=\&quot;$*text_nosubject\&quot;&amp;gt;&amp;lt;i&amp;gt;$*text_nosubject&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;&quot;;
                  } else {
                    print &quot;&amp;lt;a href=\&quot;$e.permalink_url\&quot; title=\&quot;$e.subject\&quot;&amp;gt;$e.subject&amp;lt;/a&amp;gt;&quot;;
                  }
                  if ( $e.comments.count &amp;gt; 0 ) {
                    print &quot; {&quot; + $e.comments.count + &quot;}&quot;;
                  }
                  print &quot;&amp;lt;/li&amp;gt;&quot;;
                }
            print &quot;&amp;lt;/ul&amp;gt;&quot;;
          print &quot;&amp;lt;/div&amp;gt;&quot;;
          print &quot;&amp;lt;hr /&amp;gt;&quot;;
        }
      }
    print &quot;&amp;lt;/div&amp;gt;\n&quot;;
  print &quot;&amp;lt;/div&amp;gt;&quot;;
}&lt;/pre&gt;&lt;a name=&apos;cutid2-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2ljdotcom.livejournal.com/940.html?view=comments#comments</comments>
  <category>tranqunzy1</category>
  <category>tranquilityii</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>15</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2ljdotcom.livejournal.com/763.html</guid>
  <pubDate>Sun, 03 Jul 2005 17:00:52 GMT</pubDate>
  <title>3kunumn1</title>
  <author>kunzite1</author>
  <link>https://s2ljdotcom.livejournal.com/763.html</link>
  <description>changes:&lt;br /&gt;property declarations prettyified.&lt;br /&gt;stylesheet MUCH easier to read.&lt;br /&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s for sidebars changed to table cells.&lt;br /&gt;&lt;span style=&quot;text-decoration:line-through;&quot;&gt;commented out images that don&apos;t work right.&lt;br /&gt;hard coded text for images that don&apos;t work right.&lt;/span&gt;&lt;br /&gt;added tags to &lt;code&gt;Entry::print_metadata()&lt;/code&gt;&lt;br /&gt;fixed header image&lt;br /&gt;k1-ified &lt;code&gt;Entry::print_linkbar()&lt;/code&gt; and added image toggle for links&lt;br /&gt;image toggle for comment links&lt;br /&gt;new text properties for edit entry, add to mem, edit tags, tell friend text&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;&lt;hr /&gt;todo:&lt;br /&gt;ajax comments&lt;br /&gt;quick reply comments&lt;a name=&apos;cutid2-end&apos;&gt;&lt;/a&gt;&lt;hr /&gt;&lt;pre&gt;&lt;code&gt;layerinfo &quot;type&quot;            = &quot;layout&quot;;
layerinfo &quot;name&quot;            = &quot;3 column&quot;;
layerinfo &quot;author_name&quot;     = &quot;Louise (unfloopy)/Kunzite (kunzite1)&quot;;
layerinfo &quot;author_email&quot;    = &quot;unfloopy@gmail.com/kunzite1@livejournal.com&quot;;
layerinfo &quot;des&quot;             = &quot;3 column layout by Louise (/~unfloopy)./Edited greatly by Kunzite (/~kunzite1)&quot;;
layerinfo &quot;redist_uniq&quot;     = &quot;3column/layout&quot;;
layerinfo &quot;source_viewable&quot; = 1;

################################## PROPERTIES ####################################

propgroup prez = &quot;Presentation&quot;;
propgroup prez {
  property bool show_entry_userpic {
    des = &quot;Always display userpic?&quot;;
  }
  property bool color_forms {
    des  = &quot;Form Elements&quot;;
    note = &quot;Select No to disable the customized form elements.&quot;;
  }
  property bool image_links {
    des  = &quot;Use Images for comment links&quot;;
  }
  property use  use_shared_pic;
  property use  view_entry_disabled;
  property use  page_recent_items;
  property use  page_friends_items;
  property use  tags_aware;

  set show_entry_userpic = true;
  set color_forms        = true;
  set image_links        = true;
  set page_recent_items  = 10;
  set page_friends_items = 20;
  set tags_aware         = true;
}

propgroup text = &quot;Text&quot;;
propgroup text {
  property use text_skiplinks_forward;
  property use text_skiplinks_back;
  property use text_post_comment;
  property use text_reply_back;
  property use text_permalink;
  property string t_divider {
    des = &quot;Entries Navigation: Links divider&quot;;
  }
  property string t_edit_entry {
    des = &quot;Text used for Edit Entry link/caption&quot;;
  }
  property string t_mem_add {
    des = &quot;Text used for Add to Memories link/caption&quot;;
  }
  property string t_edit_tags {
    des = &quot;Text used for Edit Tags link/caption&quot;;
  }
  property string t_tell_friend {
    des = &quot;Text used for Tell a Friend link/caption&quot;;
  }
  property use text_comment_reply;
  property use text_read_comments;
  property use text_view_recent;
  property use text_view_archive;
  property use text_view_userinfo;
  property use text_view_friends;
  property use text_nosubject;
  property use text_noentries_day;
  property use text_meta_music;
  property use text_meta_mood;
  property use text_view_month;
  property use text_read_comments_friends;
  property string links_header {
    des = &quot;Links header&quot;;
  }
  property string about_title {
    des = &quot;About box title&quot;;
  }
  property string nav_title {
    des = &quot;Navigation title&quot;;
  }
  property string blurb_title {
    des = &quot;Blurb Title&quot;;
  }
  property string blurb_text {
    des = &quot;Blurb Text&quot;;
  }

  set text_skiplinks_forward     = &quot;forward &amp;gt;&quot;;
  set text_skiplinks_back        = &quot;&amp;lt; back&quot;;
  set text_post_comment          = &quot;reply&quot;;
  set text_reply_back            = &quot;comments&quot;;
  set text_permalink             = &quot;link&quot;;
  set t_divider                  = &quot; &quot;;	
  set t_edit_entry               = &quot;edit entry&quot;;
  set t_mem_add                  = &quot;mem&quot;;
  set t_edit_tags                = &quot;edit tags&quot;;
  set t_tell_friend              = &quot;tell friend&quot;;
  set text_comment_reply         = &quot;reply&quot;;
  set text_read_comments         = &quot;#&quot;;
  set text_view_recent           = &quot;recent&quot;;
  set text_view_archive          = &quot;archive&quot;;
  set text_view_userinfo         = &quot;userinfo&quot;;
  set text_view_friends          = &quot;friends&quot;;
  set text_nosubject             = &quot;nothing&quot;;
  set text_noentries_day         = &quot;I didn&apos;t post on this day. Sorry!&quot;;
  set text_meta_music            = &quot;current song:&quot;;
  set text_meta_mood             = &quot;current mood:&quot;;
  set text_view_month            = &quot;view all&quot;;
  set text_read_comments_friends = &quot;#&quot;;
  set links_header               = &quot;links&quot;;
  set about_title                = &quot;about&quot;;
  set nav_title                  = &quot;navigate&quot;;
  set blurb_title                = &quot;blurb&quot;;
  set blurb_text                 = &quot;you can write here about anything you want.&quot;;
}	

propgroup images = &quot;Images&quot;;
propgroup images {
  property string bg_image {
    des = &quot;Background Image URL [optional]&quot;;
  }
  property string bg_repeat {
    des = &quot;Background Image Repeat [either repeat or no-repeat]&quot;;
  }
  property string header_image {
    des = &quot;Header: Image URL [optional]&quot;;
  }
  property string header_height {
    des = &quot;Header: Height [a must IF you have a header image]&quot;;
  }
  property string i_comment {
    des = &quot;Icon: Comments&quot;;
  }
  property string i_perma {
    des = &quot;Icon: PermaLink&quot;;
  }
  property string i_mem {
    des = &quot;Icon: Add To Memories&quot;;
  }
  property string i_leave {
    des = &quot;Icon: Leave A Comment&quot;;
  }
  property string i_edit {
    des = &quot;Icon: Edit Entry&quot;;
  }
  property string i_tags {
    des = &quot;Icon: Edit Tags&quot;;
  }

  set bg_image      = &quot;&quot;;
  set bg_repeat     = &quot;repeat&quot;;
  set header_image  = &quot;&quot;;
  set header_height = &quot;0px&quot;;
  set i_comment     = &quot;&quot;;
  set i_perma       = &quot;&quot;;
  set i_mem         = &quot;&quot;;
  set i_leave       = &quot;&quot;;
  set i_edit        = &quot;&quot;;
  set i_tags        = &quot;&quot;;
}

propgroup stylesheet = &quot;Stylesheet&quot;;
propgroup stylesheet {
  property string font_size {
    des = &quot;Overall: Font Size&quot;;
  }
  property string font_family {
    des = &quot;Overall: Font Family&quot;;
  }
  property string link_weight {
    des = &quot;Overall: Link Weight [either normal or bold]&quot;;
  }
  property string link_side_w {
    des = &quot;Sidebar: Link weight [normal or bold]&quot;;
  }
  property string side_h_size {
    des = &quot;Sidebar: Header Size&quot;;
  }
  property string entries_size {
    des = &quot;Entries: Font Size&quot;;
  }
  property string sub_size {
    des = &quot;Entries: Subject Text Size&quot;;
  }
  property string c_sub_size {
    des = &quot;Comments: Subject Text Size&quot;;
  }

  set font_size    =  &quot;8pt&quot;;
  set font_family  = &quot;arial&quot;;
  set link_weight  = &quot;normal&quot;;
  set link_side_w  = &quot;normal&quot;;
  set entries_size =  &quot;9pt&quot;;
  set c_sub_size   = &quot;10pt&quot;;
  set side_h_size  = &quot;13px&quot;;
  set sub_size     = &quot;15pt&quot;;
}

propgroup colors = &quot;Color&quot;;
propgroup colors {
  property Color color_bg {
    des = &quot;Background Color&quot;;
  }
  property Color font_color {
    des = &quot;Overall: Font Color&quot;;
  }
  property Color link_color {
    des = &quot;Overall: Link Color&quot;;
  }
  property Color link_hover {
    des = &quot;Overall: Link Hover Color&quot;;
  }
  property Color link_side {
    des = &quot;Sidebar: Link color&quot;;
  }
  property Color link_side_h {
    des = &quot;Sidebar: Link hover color&quot;;
  }
  property Color side_bg {
    des = &quot;Sidebar: Background color&quot;;
  }
  property Color side_t_color {
    des = &quot;Sidebar: Text color&quot;;
  }
  property Color side_border {
    des = &quot;Sidebar: Borders&quot;;
  }
  property Color side_h_color {
    des = &quot;Sidebar: Header Color&quot;;
  }
  property Color side_h_border {
    des = &quot;Sidebar: Header Border&quot;;
  }
  property Color side_h_bg {
    des = &quot;Sidebar: Header Background&quot;;
  }
  property Color entries_bg {
    des = &quot;Entries: Background color&quot;;
  }
  property Color entries_border {
    des = &quot;Entries: Border color&quot;;
  }
  property Color button_bg {
    des = &quot;Entries: Buttons background&quot;;
  }
  property Color button_bg_h {
    des = &quot;Entries: Buttons Background hover&quot;;
  }
  property Color entries_font_color {
    des = &quot;Entries: Font Color&quot;;
  }
  property Color sub_color {
    des = &quot;Entries: Subject Color&quot;;
  }
  property Color c_sub_color {
    des = &quot;Comments: Subject Text Color&quot;;
  }
  property Color c_sub_bg {
    des = &quot;Comments: Subject Background&quot;;
  }

  set color_bg           = &quot;#e6cabe&quot;;
  set font_color         = &quot;#4b3730&quot;;
  set link_color         = &quot;#78534b&quot;;
  set link_hover         = &quot;#78534b&quot;;
  set link_side          = &quot;#4b3730&quot;;
  set link_side_h        = &quot;#4b3730&quot;;
  set side_bg            = &quot;#e6cabe&quot;;
  set side_t_color       = &quot;#4b3730&quot;;
  set side_border        = &quot;#dab5ac&quot;;
  set side_h_color       = &quot;#333333&quot;;
  set side_h_border      = &quot;#333333&quot;;
  set side_h_bg          = &quot;#dab5ac&quot;;
  set entries_bg         = &quot;#e6cabe&quot;;
  set entries_border     = &quot;#dab5ac&quot;;
  set button_bg          = &quot;#e6cabe&quot;;
  set button_bg_h        = &quot;#ecd7c7&quot;;
  set entries_font_color = &quot;#4b3730&quot;;
  set sub_color          = &quot;#78534b&quot;;
  set c_sub_color        = &quot;#4b3730&quot;;
  set c_sub_bg           = &quot;#dab5ac&quot;;
}


####################################### STYLESHEET #######################################

function print_stylesheet ()  {&quot;&quot;&quot;
body {
  background: $*color_bg;
  font:       $*font_size $*font_family;
  color:      $*font_color; 
&quot;&quot;&quot;;
if (clean_url($*bg_image) != &quot;&quot;) {
  &quot;&quot;&quot;  background-image:  url($*bg_image);
  background-repeat: $*bg_repeat;
  &quot;&quot;&quot;; } &quot;&quot;&quot;}
a {
  color:       $*link_color;
  font-weight: $*link_weight;
}
a:hover {
  color:       $*link_hover;
  font-weight: $*link_weight;
}
.currenttags a {
  font-weight: bold;
}
h1 {
  color:         $*sub_color;
  font-size:     $*sub_size;
  text-align:    left;
  padding:       5px;
  margin:        0px;
  border-bottom: 1px dashed $*entries_border;
}
h2 {
  border:           1px solid $*side_h_border;
  font-size:        $*side_h_size;
  text-align:       center;
  margin:           3px 0px;
  padding:          0px;
  background-color: $*side_h_bg;
  color:            $*side_h_color;
}
h3 {
  color:      $*sub_color;
  text-align: left;
  font:       bold arial;
  padding:    5px;
  margin:     0px;
  border-top: solid 1px $*entries_border;
}
ul.links {
  margin:          1px 0px;
  padding:         3px;
  color:           $*side_t_color;
  list-style-type: none;
}
li.links {
  margin-left: 5px;
}
li.links a {
  text-decoration: none;
}
li.links_header {
  font:          11px;
  border-bottom:  1px solid $*side_t_color;
  padding-top:    7px;
}
&quot;&quot;&quot;;
if($*color_forms) {
&quot;&quot;&quot;
select, input, textarea {
  background-color: $*entries_bg;
  color:            $*font_color;
}
&quot;&quot;&quot;;
}
&quot;&quot;&quot;
#container{
/*  position: absolute;
  top:      $*header_height; */
}
#leftbar{
/*  position: absolute;
  top:       10px;
  left:      10px; */
  width:    170px;
}
#rightbar{
/*  position: absolute;
  top:       10px;
  right:      0px; */
  width:    170px;
}
#leftbar a, #rightbar a {
  color:       $*link_side;
  font-weight: $*link_side_w;
}
#leftbar a:hover, #rightbar a:hover {
  color: $*link_side_h;
}
#entries{
  margin:     10px 0px 10px 0px;
  text-align: center;
  background: $*entries_bg;
  border:      3px double $*entries_border;
  padding:    10px;
}
#readme {
  text-align: justify;
  padding:    2px;
}
#header {
position: absolute;
width:    100%;
top:      0px;
left:     0px;
height:   $*header_height;
&quot;&quot;&quot;; if (clean_url($*header_image) != &quot;&quot;) {
  &quot;&quot;&quot;  background-image:  url($*header_image);
  background-repeat: no-repeat;
  background-align:  center;
&quot;&quot;&quot;; } &quot;&quot;&quot; }

div.entrylinks {
  font:           8pt Verdana;
  text-align:    right;
  padding:        2px 10px 2px 10px;
  line-height:   20px;
  margin-bottom:  0px;
  margin-top:     5px;
  border-top:     1px dashed $*entries_border;
}
div.entrylinks a {
  background-color: $*button_bg;
  text-decoration:  none;
  margin:           2px;
  padding:          2px;
}
div.entrylinks a:hover {
  background-color: $*button_bg_h;
}
div.entrylinks img {
  border:          0px;
  text-decoration: none;
}
div.entry{
  margin-bottom: 35px;
}

.entrytext{
  font:       $*entries_size Arial;
  text-align: justify;
  color:      $*entries_font_color;
}
.aboutentry{
  text-align:   left;
  margin-right: 10px;
}
.userpic{
  margin: 5px;
}
.sidebox{
  border:      3px double $*side_border;
  background: $*side_bg;
  margin:     10px;
  padding:     5px;
}
.userpic2{
  position: relative;
  float:    left;
  padding:  5px;
  margin:   0px 0px 0px 0px;
}
.userpic_reply{
  position: relative;
  float:    left;
  padding:  5px;
}
.moodpic{
  position:     relative;
  float:        right;
  padding:        0px;
  padding-left:   5px;
  margin:         0px;
  margin-top:   -10px;
  margin-right:  -5px;
}
.calendarActive{
  font-weight: bold;
}
.blurb {
  color: $*side_t_color;
}
.nosubject {
  font-style: italic;
}
.replyform {
  text-align: left;
}
.comment_postedby {
  text-align:  left;
  font-weight: bold;
}
.comment_date{
  text-align: left;
}
.comment_subject {
  color:          $*c_sub_color;
  background:     $*c_sub_bg;
  font:           $*c_sub_size;
  font-weight:    bold;
  letter-spacing: 1.5px;
  text-align:     left;
  padding:        3px;
  margin-right:   0;
}
.comment_wrapper{
  border:     1px solid $*entries_border;
  background: $*entries_bg;
  padding:    5px;
  margin:     0px 0px 5px 0px;
}
.comment_info {
  width: 95%;
}
.comment_links {
  text-align: right;
  padding:    3px;
  margin:     0px;
  border-top: 1px dashed $*entries_border;
}
.comment_links a {
  padding:         2px;
  text-decoration: none;
}
.comment_child {
  margin: 0px 0px 0px 20px;
}
.minicomment {
  padding: 4px;
  border:  1px solid $*entries_border;
}
.minicommentholder {
  border: 1px solid $*entries_border;
}
&quot;&quot;&quot;; }

############################# FUNCTIONS ########################################

function prop_init() {
  if ($*i_comment == &quot;&quot;) { $*i_comment = &quot;$*IMGDIR/style/3column/comments.gif&quot;; }
  if ($*i_perma == &quot;&quot;)   { $*i_perma   = &quot;$*IMGDIR/style/3column/permalink.gif&quot;; }
  if ($*i_mem == &quot;&quot;)     { $*i_mem     = &quot;$*IMGDIR/style/3column/memories.gif&quot;; }
  if ($*i_leave == &quot;&quot;)   { $*i_leave   = &quot;$*IMGDIR/style/3column/leavecomment.gif&quot;; }
  if ($*i_edit == &quot;&quot;)    { $*i_edit    = &quot;$*IMGDIR/style/3column/editentry.gif&quot;; }
  if ($*i_tags == &quot;&quot;)    { $*i_tags    = &quot;$*IMGDIR/style/3column/edittags.gif&quot;; }
}

function replace_text(string text, string find, string replacement) : string &quot;Search within \$text and replaces any occurences of \$find with \$replacement.&quot; {
#######################################################
# from lj:mageboltrat&apos;s industrial nippon (id=533012) #
#######################################################
  var string[] findarray;
  var int pos = 1;
  foreach var string findcharacter($find) {
    $findarray[$pos] = $findcharacter;
    $pos             = $pos + 1;
  }
  var int    place         = 1;
  var bool   found         = false;
  var string completedtext = &quot;&quot;;
  var string foundtext     = &quot;&quot;;
  foreach var string searchcharacter($text) {
    if  ($searchcharacter == $findarray[$place]) {
      if ($place == $find-&amp;gt;length()) {
        $foundtext =  $replacement;
        $place     = 1;
      } else {
        $foundtext = $foundtext + $searchcharacter;
        $place     = $place + 1;
      }  
    } else {
      $completedtext = $completedtext + $foundtext + $searchcharacter;
      $foundtext     = &quot;&quot;;  
      $place         = 1;    
    }
  }
  $completedtext = $completedtext + $foundtext;
  return $completedtext;
}

function rehtml(string text) : string &quot;Unescape html in \$text by replacing &amp;amp;gt; with &amp;gt; and &amp;amp;lt; with &amp;lt;.&quot; {
####################################################################
# by lj:masterslacker using lj:mageboltrat&apos;s replace_text function #
####################################################################
  return replace_text(replace_text(replace_text(replace_text($text, &quot;&amp;amp;lt;&quot;, &quot;&amp;lt;&quot;), &quot;&amp;amp;gt;&quot;, &quot;&amp;gt;&quot;), &quot;&amp;amp;amp;lt;&quot;, &quot;&amp;lt;&quot;), &quot;&amp;amp;amp;gt;&quot;, &quot;&amp;gt;&quot;);
}

function generateDots (string un)  : string {
  var string dots;
  if($un != &quot;&quot;) {
    foreach var string s ($un)  {
      if($s == &quot;a&quot; or $s == &quot;c&quot; or $s == &quot;e&quot; or $s == &quot;f&quot; or $s == &quot;h&quot; or $s == &quot;k&quot; or $s == &quot;m&quot; or $s == &quot;n&quot; or $s == &quot;p&quot; or $s == &quot;r&quot; or $s == &quot;t&quot; or $s == &quot;v&quot; or $s == &quot;x&quot; or $s == &quot;z&quot;) {
        $dots = $dots + &quot;:&quot;;
      } elseif($s == &quot; &quot;) {
        $dots = $dots + &quot; &quot;;
      } else {
        $dots = $dots + &quot;.&quot;;
      }
    }
  }
  return $dots;
}

function print_linkbox (string header, string text)  {
  &quot;&quot;&quot;&amp;lt;div class=&quot;sidebox&quot;&amp;gt;\n&quot;&quot;&quot;;
  print safe &quot;&amp;lt;h2&amp;gt;$header&amp;lt;/h2&amp;gt;\n&quot;;
  print safe &quot;&quot;&quot;&amp;lt;ul class=&quot;links&quot;&amp;gt;\n$text\n&amp;lt;/ul&amp;gt;\n&quot;&quot;&quot;;
  &quot;&amp;lt;/div&amp;gt;\n&quot;;
}

function box_item (string text) : string {
  return &quot;$text\n&quot;;
}

function print_box (string header, string text) {
  &quot;&quot;&quot;&amp;lt;div class=&quot;sidebox&quot;&amp;gt;&quot;&quot;&quot;;
  print safe &quot;&quot;&quot;&amp;lt;h2&amp;gt;$header&amp;lt;/h2&amp;gt;&quot;&quot;&quot;;
  print safe &quot;$text\n&quot;;
  &quot;&amp;lt;/div&amp;gt;&quot;;
}

function Page::lay_print_userpic() : string {
  var string return = &quot;&quot;;
  if(defined $.journal.default_pic) {
    $return = &quot;&quot;&quot;&amp;lt;div id=&quot;userpic&quot;&amp;gt;&amp;lt;a href=&quot;$*SITEROOT/allpics.bml?user=$.journal.username&quot;&amp;gt;&amp;lt;img src=&quot;$.journal.default_pic.url&quot; width=&quot;$.journal.default_pic.width&quot; height=&quot;$.journal.default_pic.height&quot; alt=&quot;$.journal.name&quot; title=&quot;$.journal.name&quot; border=&quot;0&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
  }
  return $return;
}

function Page::lay_print_calendar ()  {
  var YearMonth m    = $this-&amp;gt;get_latest_month();
  var string    mon  = $m-&amp;gt;month_format();
  var string    text = &quot;&quot;;
  $text = &quot;&quot;&quot;&amp;lt;table cellspacing=&quot;2&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; width=&quot;100%&quot;&amp;gt;&quot;&quot;&quot;;
  foreach var YearWeek w ($m.weeks) {
    $text = $text + &quot;&quot;&quot;&amp;lt;tr&amp;gt;&quot;&quot;&quot;;
    if($w.pre_empty &amp;gt; 0) {
      foreach var int empty (1..$w.pre_empty)  {
        $text = $text + &quot;&quot;&quot;&amp;lt;td class=&quot;calempty&quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&quot;&quot;&quot;;
      }
    }
    foreach var YearDay d ($w.days) {
      if($d.num_entries &amp;gt; 0) {
        $text = $text + &quot;&quot;&quot;&amp;lt;td class=&quot;calendarActive&quot;&amp;gt;&amp;lt;a href=&quot;$d.url&quot;&amp;gt;$d.day&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&quot;&quot;&quot;;
      } else {
        $text = $text + &quot;&quot;&quot;&amp;lt;td class=&quot;calendarInactive&quot;&amp;gt;$d.day&amp;lt;/td&amp;gt;&quot;&quot;&quot;;
      }
    }
    $text = $text + &quot;&amp;lt;/tr&amp;gt;\n&quot;;
  }
  $text = $text + &quot;&amp;lt;/table&amp;gt;&quot;;
  print_box($mon, $text);
}

function print_left_bar() {
  var Page   p       = get_page();
  var string header  = &quot;&quot;;
  var string content = &quot;&quot;;
  &quot;&quot;&quot;
        &amp;lt;td id=&quot;leftbar&quot; valign=&quot;top&quot;&amp;gt;
          &amp;lt;div&amp;gt;
  &quot;&quot;&quot;;

  $header  = $*about_title;
  $content = &quot;&quot;&quot;&amp;lt;div align=&quot;center&quot;&amp;gt;&quot;&quot;&quot; + $p-&amp;gt;lay_print_userpic() + &quot;&amp;lt;br /&amp;gt;&quot; + $p.journal-&amp;gt;as_string() + &quot;&amp;lt;br /&amp;gt;&quot; + &quot;&quot;&quot;&amp;lt;a href=&quot;$*SITEROOT/friends/add.bml?user=$p.journal.username&quot;&amp;gt;&amp;lt;img src=&quot;$*IMGDIR/btn_addfriend.gif&quot; alt=&quot;Friend Me&quot; title=&quot;Friend Me&quot; width=&quot;22&quot; height=&quot;20&quot; style=&quot;border: 0;&quot; /&amp;gt;&amp;lt;/a&amp;gt; &amp;lt;a href=&quot;$*SITEROOT/todo/?user=$p.journal.username&quot;&amp;gt;&amp;lt;img src=&quot;$*IMGDIR/btn_todo.gif&quot; alt=&quot;My To-do List&quot; title=&quot;My To-do List&quot; width=&quot;22&quot; height=&quot;20&quot; style=&quot;border: 0;&quot; /&amp;gt;&amp;lt;/a&amp;gt; &amp;lt;a href=&quot;$*SITEROOT/tools/memories.bml?user=$p.journal.username&quot;&amp;gt;&amp;lt;img src=&quot;$*IMGDIR/btn_memories.gif&quot; alt=&quot;Memories&quot; title=&quot;Memories&quot; width=&quot;22&quot; height=&quot;20&quot; style=&quot;border: 0;&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
  print_box($header, $content);

  if($*blurb_text != &quot;&quot;) {
    $header  = $*blurb_title;
    $content = rehtml($*blurb_text);
    print_box($header, $content);
  }

  $p-&amp;gt;lay_print_calendar();
  &quot;&quot;&quot;
          &amp;lt;/div&amp;gt;
        &amp;lt;/td&amp;gt;
  &quot;&quot;&quot;;
}

function print_right_bar() {
  var Page   p       = get_page();
  var string header  = &quot;&quot;;
  var string content = &quot;&quot;;
  &quot;&quot;&quot;
        &amp;lt;td id=&quot;rightbar&quot; valign=&quot;top&quot;&amp;gt;
          &amp;lt;div&amp;gt;
  &quot;&quot;&quot;;

  $header  = $*nav_title;
  $content = &quot;&quot;&quot;&amp;lt;ul class=&quot;links&quot;&amp;gt;&quot;&quot;&quot;;
  var string[] views_order = [&quot;recent&quot;, &quot;friends&quot;, &quot;archive&quot;, &quot;userinfo&quot;]; # view order
                                                                           # &quot;recent&quot;   = recent   view
                                                                           # &quot;friends&quot;  = friends  view
                                                                           # &quot;archive&quot;  = calendar view
                                                                           # &quot;userinfo&quot; = userinfo link
  var string{} view_text   = { # build text hash
                              &quot;recent&quot;   =&amp;gt; $*text_view_recent,
                              &quot;friends&quot;  =&amp;gt; $p.journal_type != &quot;C&quot; ? $*text_view_friends : $*text_view_friends_comm,
                              &quot;archive&quot;  =&amp;gt; $*text_view_archive,
                              &quot;userinfo&quot; =&amp;gt; $*text_view_userinfo
                             };
  var string   base_url    = $p.journal-&amp;gt;base_url(); # get base url
  var string{} view_url    = { # build url hash
                              &quot;recent&quot;   =&amp;gt; &quot;$base_url/&quot;,
                              &quot;friends&quot;  =&amp;gt; &quot;$base_url/friends/&quot;,
                              &quot;archive&quot;  =&amp;gt; &quot;$base_url/calendar/&quot;,
                              &quot;userinfo&quot; =&amp;gt; &quot;$*SITEROOT/userinfo.bml?user=$p.journal.username&amp;amp;mode=full&quot;
                             };
  foreach var string v ($views_order) {
    $content = $content + &quot;&quot;&quot;&amp;lt;li class=&quot;links&quot;&amp;gt;&amp;lt;a href=&quot;$view_url{$v}&quot;&amp;gt;$view_text{$v}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;\n&quot;&quot;&quot;;
  }
  $content = $content + &quot;&amp;lt;/ul&amp;gt;&quot;;
  print_box($header, $content);

  $p-&amp;gt;print_linklist();

  &quot;&quot;&quot;
          &amp;lt;/div&amp;gt;
        &amp;lt;/td&amp;gt;
  &quot;&quot;&quot;;
}

function num_comments_in_thread (Comment[] comments) : int {
  var int total = 0;
  foreach var Comment c ($comments) {
    $total = $total + 1;
    if (size $c.replies &amp;gt; 0) {
      $total = $total + num_comments_in_thread($c.replies);
    }
  }
  return $total;
}

function Page::print_linklist() {
  if (size $.linklist &amp;lt;= 0) {
    return;
  }
  var string links;
  foreach var UserLink l ($.linklist) {
    if ($l.title) {
      if ($l.is_heading) {
        $links = $links + &quot;&quot;&quot;&amp;lt;li class=&quot;links_header&quot;&amp;gt;$l.title&amp;lt;/li&amp;gt;\n&quot;&quot;&quot;;
      } else {
        $links = $links + box_item(&quot;&quot;&quot;&amp;lt;li class=&quot;links&quot;&amp;gt;&amp;lt;a href=&quot;$l.url&quot;&amp;gt;$l.title&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;\n&quot;&quot;&quot;);
      }
    }
  }
  print_linkbox($*links_header, $links); 
}

function Page::lay_print_calendar ()  {
  var YearMonth m = $this-&amp;gt;get_latest_month();
  var string mon = $m-&amp;gt;month_format();
  var string text;
  $text = &quot;&quot;&quot;&amp;lt;table cellspacing=&quot;2&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; width=&quot;100%&quot;&amp;gt;\n&quot;&quot;&quot;;
  foreach var YearWeek w ($m.weeks) {
    $text = $text + &quot;&amp;lt;tr&amp;gt;\n&quot;;
    if($w.pre_empty &amp;gt; 0) {
      foreach var int empty (1..$w.pre_empty)  {
        $text = $text + &quot;&quot;&quot;&amp;lt;td class=&quot;calempty&quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;\n&quot;&quot;&quot;;
      }
    }
    foreach var YearDay d ($w.days) {
      if($d.num_entries &amp;gt; 0) {
        $text = $text + &quot;&quot;&quot;&amp;lt;td class=&quot;calendarActive&quot;&amp;gt;&amp;lt;a href=&quot;$d.url&quot;&amp;gt;$d.day&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;\n&quot;&quot;&quot;;
      } else {
        $text = $text + &quot;&quot;&quot;&amp;lt;td class=&quot;calendarInactive&quot;&amp;gt;$d.day&amp;lt;/td&amp;gt;\n&quot;&quot;&quot;;
      }
    }
    $text = $text + &quot;&amp;lt;/tr&amp;gt;\n&quot;;
  }
  $text = $text + &quot;&amp;lt;/table&amp;gt;&quot;;
  print_box($mon, $text);
}


function Page::lay_print_subnav ()  { }

function RecentPage::lay_print_subnav ()  {
  var string back;
  if($.nav.backward_url != &quot;&quot;) {
    $back = &quot;&quot;&quot;&amp;lt;a href=&quot;$.nav.backward_url&quot;&amp;gt;&quot;&quot;&quot; + rehtml(get_plural_phrase($.nav.backward_skip, &quot;text_skiplinks_back&quot;)) + &quot;&amp;lt;/a&amp;gt;&quot;;
  } else {
    $back = &quot;&amp;amp;nbsp;&quot;;
  }
  var string forward;
  if($.nav.forward_url != &quot;&quot;) {
    $forward = &quot;&quot;&quot;&amp;lt;a href=&quot;$.nav.forward_url&quot;&amp;gt;&quot;&quot;&quot; + rehtml(get_plural_phrase($.nav.forward_skip, &quot;text_skiplinks_forward&quot;)) + &quot;&amp;lt;/a&amp;gt;&quot;;
  } else {
    $forward = &quot;&amp;amp;nbsp;&quot;;
  }
  var int    start = $.nav.skip;
  var int    end   = $.nav.skip + size $.entries;
  var string text  = &quot;$start - $end&quot;;
  print &quot;&quot;&quot;&amp;lt;div class=&quot;systemmessage&quot;&amp;gt;&quot;&quot;&quot; + rehtml($back) + &quot; | $text | &quot; + rehtml($forward) + &quot;&amp;lt;/div&amp;gt;&quot;;
}

function FriendsPage::lay_make_username (Entry e) {
  var Friend f = $.friends{$e.journal.username};
  var string url = $e.poster-&amp;gt;base_url();
  &quot;&quot;&quot;&amp;lt;a href=&quot;$url&quot; class=&quot;friendname&quot; style=&quot;color: $f.fgcolor; background-color: $f.bgcolor;&quot;&amp;gt;$e.poster.username&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
  if($e.poster.username != $e.journal.username) {
    &quot;&quot;&quot; $e.journal&quot;&quot;&quot;;
  }
}

function EntryPage::print_body() {
  $this-&amp;gt;print_entry($.entry);
  if ($this.multiform_on) {
    $this-&amp;gt;print_multiform_start();
  }

  if ($.entry.comments.count &amp;gt; 0) {
    &quot;&quot;&quot;&amp;lt;h3&amp;gt;Comments&amp;lt;/h3&amp;gt;\n&quot;&quot;&quot;;
  }
	
  if ($.comment_pages.total_subitems &amp;gt; 0) {
    $.comment_pages-&amp;gt;print();
  }

  if ($.entry.comments.enabled) {
    $this-&amp;gt;print_comments($.comments);
  }

  if ($.entry.comments.count &amp;gt; 0) {
    &quot;&quot;&quot;&amp;lt;div class=&quot;systemmessage&quot;&amp;gt;\n&quot;&quot;&quot;;
    $.entry.comments-&amp;gt;print();
    &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
  }

  if ($.comment_pages.total_subitems &amp;gt; 0) {
    $.comment_pages-&amp;gt;print();
  }

  if ($this.multiform_on and ($.entry.comments.count &amp;gt; 0)) {
    &quot;&quot;&quot;&amp;lt;div class=&quot;replyform&quot;&amp;gt;\n&quot;&quot;&quot;;
    $this-&amp;gt;print_multiform_actionline();
    &quot;&quot;&quot;&amp;lt;/div&amp;gt;\n&quot;&quot;&quot;;
    $this-&amp;gt;print_multiform_end();
  }
}

function EntryPage::print_comments(Comment[] cs) {
  if (size $cs == 0) { return; }
  foreach var Comment c ($cs) {
    if ($c.full) {
      $this-&amp;gt;print_comment($c);
    } else {
      $this-&amp;gt;print_comment_partial($c);
    }
  }
}

function EntryPage::print_comment(Comment c) {
  var string datetime;
  $datetime = $c.time-&amp;gt;date_format(&quot;long&quot;)+&quot;, &quot; + $c.time-&amp;gt;time_format();
  var string picword;
  if (defined $c.userpic and $*comment_userpic_style !=&quot;off&quot;) {
    $picword = $c.metadata{&quot;picture_keyword&quot;};

  }
  var string parent;
  var string thread;
  if($c.parent_url != &quot;&quot;) {
    $parent = &quot;&quot;&quot;&amp;lt;a href=&quot;$c.parent_url&quot;&amp;gt;$*text_comment_parent&amp;lt;/a&amp;gt;$*t_divider&quot;&quot;&quot;;
  }
  if($c.thread_url != &quot;&quot;) {
    $thread = &quot;&quot;&quot;&amp;lt;a href=&quot;$c.thread_url&quot;&amp;gt;$*text_comment_thread&amp;lt;/a&amp;gt;$*t_divider&quot;&quot;&quot;;
  }
  var string subjecticon;
  if (defined $c.subject_icon) {
    $subjecticon = &quot;&quot;&quot;&amp;lt;img src=&quot;$c.subject_icon.url&quot; width=&quot;$c.subject_icon.width&quot; height=&quot;$c.subject_icon.height&quot; alt=&quot;&quot; /&amp;gt;&quot;&quot;&quot;;
  }
  var string ip;
  if ($c.metadata{&quot;poster_ip&quot;}) { 
    $ip = &quot;&quot;&quot; &amp;amp;nbsp;  &quot;&quot;&quot; + $c.metadata{&quot;poster_ip&quot;}; 
  }
  var string poster = defined $c.poster ? $c.poster-&amp;gt;as_string() : &quot;&amp;lt;b&amp;gt;(Anonymous)&amp;lt;/b&amp;gt;&quot;;
  var string poster_name; $poster_name= $c.poster.name;
  var string pic;
  if (defined $c.userpic and $*comment_userpic_style != &quot;off&quot;) {
    $pic = &quot;&quot;&quot;&amp;lt;img src=&quot;$c.userpic.url&quot; width=&quot;$c.userpic.width&quot; height=&quot;$c.userpic.height&quot; alt=&quot;$picword&quot; title=&quot;$picword&quot; /&amp;gt;&quot;&quot;&quot;;
  }
  var string indent = ($c.depth - 1) * 25 + &quot;px&quot;;
  &quot;&quot;&quot;
  &amp;lt;a name=&apos;$c.anchor&apos;&amp;gt;&amp;lt;/a&amp;gt;
  &amp;lt;div class=&quot;comment_wrapper&quot;&amp;gt;
    &amp;lt;table class=&quot;comment_info&quot;&amp;gt;
      &amp;lt;tr&amp;gt;
        &amp;lt;td&amp;gt;
          &amp;lt;div class=&quot;comment_postedby&quot;&amp;gt;Posted by: $poster_name ($poster)  &amp;lt;span class=&quot;ip&quot;&amp;gt;$ip&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;
          &amp;lt;div class=&quot;comment_date&quot;&amp;gt;Posted at: $subjecticon $datetime&amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;
	
  if ($.multiform_on) {
    &quot;&quot;&quot;
          &amp;lt;div class=&quot;comment_date&quot;&amp;gt;&amp;lt;label for=&quot;ljcomsel_$c.talkid&quot;&amp;gt;$*text_multiform_check&amp;lt;/label&amp;gt;
    &quot;&quot;&quot;; 
    $c-&amp;gt;print_multiform_check();
    &quot;
          &amp;lt;/div&amp;gt;
    &quot;;
  }
  &quot;&quot;&quot;
          &amp;lt;div class=&quot;comment_subject&quot;&amp;gt;$c.subject&amp;lt;/div&amp;gt;
        &amp;lt;/td&amp;gt;
        &amp;lt;td valign=&quot;top&quot;&amp;gt;$pic&amp;lt;/td&amp;gt;
      &amp;lt;/tr&amp;gt;
    &amp;lt;/table&amp;gt;
    &amp;lt;div class=&quot;entrytext&quot;&amp;gt;&amp;lt;p&amp;gt;&quot;&quot;&quot;; $c-&amp;gt;print_text(); &quot;&quot;&quot;&amp;lt;/p&amp;gt; &amp;lt;/div&amp;gt;
    &amp;lt;div class=&quot;comment_links&quot;&amp;gt; &amp;lt;a href=&quot;$c.reply_url&quot;&amp;gt;$*text_comment_reply&amp;lt;/a&amp;gt;$*t_divider

      &amp;lt;a href=&quot;$c.permalink_url&quot;&amp;gt;$*text_permalink&amp;lt;/a&amp;gt;$*t_divider $parent$thread
    &amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;

  if ((size $c.replies) &amp;gt; 0 and $c.replies[0].full == false) {
    &quot;&quot;&quot;
    &amp;lt;div class=&quot;comment_child&quot;&amp;gt;\n&quot;&quot;&quot;;
    $this-&amp;gt;print_comments($c.replies);
    &quot;
    &amp;lt;/div&amp;gt;\n&quot;;
  }

  &quot;&quot;&quot;
  &amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;
  if ((size $c.replies) &amp;gt; 0 and $c.replies[0].full == true) {
    &quot;&quot;&quot;
  &amp;lt;div class=&quot;comment_child&quot;&amp;gt;
    &quot;&quot;&quot;;
    $this-&amp;gt;print_comments($c.replies);
    &quot;&quot;&quot;
  &amp;lt;/div&amp;gt;
    &quot;&quot;&quot;;
  }
}

function EntryPage::print_comment_partial(Comment c) {
  var string poster = defined $c.poster ? $c.poster-&amp;gt;as_string() : &quot;&amp;lt;i&amp;gt;(Anonymous)&amp;lt;/i&amp;gt;&quot;;
  var string subj   = $c.subject != &quot;&quot; ? $c.subject : &quot;&quot;&quot;&amp;lt;i class=&quot;nosubject&quot;&amp;gt;$*text_nosubject&amp;lt;/i&amp;gt;&quot;&quot;&quot;;
  var string indent = ($c.depth - 1) * 25 + &quot;px&quot;;
  &quot;&quot;&quot;
  &amp;lt;div class=&quot;entry&quot; style=&quot;margin-left: $indent;&quot;&amp;gt;
    &amp;lt;div class=&quot;minicommentholder&quot;&amp;gt;
      &amp;lt;div class=&quot;minicomment&quot;&amp;gt;$poster - &amp;lt;a href=&quot;$c.permalink_url&quot;&amp;gt;$subj&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;
  $this-&amp;gt;print_comments($c.replies);
}

function ItemRange::print() {
  if ($.all_subitems_displayed) { return; }
  &quot;&quot;&quot;
  &amp;lt;div class=&quot;systemmessage&quot;&amp;gt;
    &amp;lt;b&amp;gt;
  &quot;&quot;&quot;;
  print lang_page_of_pages($.current, $.total);
  &quot;&amp;lt;/b&amp;gt; &amp;amp;mdash; &quot;;
  foreach var int i (1..$.total) {
    if ($i == $.current) {
      &quot;&quot;&quot;&amp;lt;b class=&quot;systemtext&quot;&amp;gt;[$i]&amp;lt;/b&amp;gt;&quot;&quot;&quot;;
    } else { 
      var string url_of = $this-&amp;gt;url_of($i);
      &quot;&amp;lt;a href=&apos;$url_of&apos;&amp;gt;&amp;lt;b&amp;gt;[$i]&amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt;&quot;;
    }
  }
  &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
}

function Entry::print_linkbar() {
  var string   link_seperator = $*t_divider; # seperator for links

  # initialize array/hashes
  var string[] link_keyseq    = [&quot;&quot;];
  var string{} link_url       = {&quot;&quot; =&amp;gt; &quot;&quot;};
  var string{} link_caption   = {&quot;&quot; =&amp;gt; &quot;&quot;};
  var string{} link_image     = {&quot;&quot; =&amp;gt; &quot;&quot;};

  var string print           = &quot;&quot;;                                         # var for printing
  var Page   p               = get_page();                                 # page handle to determine interentry
  var bool   show_interentry = ($p.view == &quot;entry&quot; or $p.view == &quot;reply&quot;); # if entry/reply view, show interentry
  var int    keyseq_index    = 0;                                          # set index point for new link_keyseq array

  if($show_interentry) {
    # if show interentry, put previous entry link first
    $link_keyseq[$keyseq_index++] = &quot;nav_prev&quot;;

    # get previous entry link information
    var Link prev             = $this-&amp;gt;get_link(&quot;nav_prev&quot;);
    $link_url{&quot;nav_prev&quot;}     = $prev.url;
    $link_caption{&quot;nav_prev&quot;} = $prev.caption;
    $link_image{&quot;nav_prev&quot;}   = $prev.icon.url;

    # get next entry link information
    var Link next             = $this-&amp;gt;get_link(&quot;nav_next&quot;);
    $link_url{&quot;nav_next&quot;}     = $next.url;
    $link_caption{&quot;nav_next&quot;} = $next.caption;
    $link_image{&quot;nav_next&quot;}   = $next.icon.url;
  }

  # gather current linkbar
  foreach var string link_key ($.link_keyseq) {
    var Link  link            = $this-&amp;gt;get_link($link_key);
    $link_url{$link_key}      = $link.url;
    $link_caption{$link_key}  = $link.caption;
    $link_image{$link_key}    = $link.icon.url;
    $link_keyseq[$keyseq_index++] = $link_key; # add this to new link_keyseq array
  }
  if($show_interentry) {
    # if show interentry, put next entry link last
    $link_keyseq[$keyseq_index++] = &quot;nav_next&quot;;
  }

  #################################################################################################################
  # by now, the above hashes should look something like:                                                          #
  #                                                                                                               #
  # If interentry:                                                                                                #
  #   Previous Entry:                                                                                             # 
  #    $link_url{&quot;nav_prev&quot;}     = http://www.livejournal.com/go.bml?journal=exampleusername&amp;amp;itemid=256&amp;amp;dir=prev  #
  #    $link_caption{&quot;nav_prev&quot;} = Previous Entry                                                                 #
  #    $link_image{&quot;nav_prev&quot;}   = http://stat.livejournal.com/img/btn_prev.gif                                   #
  #                                                                                                               #
  # Edit Entry:                                                                                                   # 
  #  $link_url{&quot;edit_entry&quot;}     = http://www.livejournal.com/editjournal.bml?journal=exampleusername&amp;amp;itemid=256  #
  #  $link_caption{&quot;edit_entry&quot;} = Edit Entry                                                                     #
  #  $link_image{&quot;edit_entry&quot;}   = http://stat.livejournal.com/img/btn_edit.gif                                   #
  #                                                                                                               #
  # Edit Tags:                                                                                                    # 
  #  $link_url{&quot;edit_tags&quot;}      = http://www.livejournal.com/edittags.bml?journal=exampleusername&amp;amp;itemid=256     #
  #  $link_caption{&quot;edit_tags&quot;}  = Edit Tags                                                                      #
  #  $link_image{&quot;edit_tags&quot;}    = http://stat.livejournal.com/img/btn_edittags.gif                               #
  #                                                                                                               #
  # Add to Memories:                                                                                              # 
  #  $link_url{&quot;mem_add&quot;}        = http://www.livejournal.com/tools/memadd.bml?journal=exampleusername&amp;amp;itemid=256 #
  #  $link_caption{&quot;mem_add&quot;}    = Add to Memories                                                                #
  #  $link_image{&quot;mem_add&quot;}      = http://stat.livejournal.com/img/btn_memories.gif                               #
  #                                                                                                               #
  # If interentry:                                                                                                #
  #   Next Entry:                                                                                                 #
  #    $link_url{&quot;nav_next&quot;}     = http://www.livejournal.com/go.bml?journal=exampleusername&amp;amp;itemid=256&amp;amp;dir=next  #
  #    $link_caption{&quot;nav_next&quot;} = Next Entry                                                                     #
  #    $link_image{&quot;nav_next&quot;}   = http://stat.livejournal.com/img/btn_next.gif                                   #
  #################################################################################################################

  $link_image{&quot;edit_entry&quot;} = $*i_edit;
  $link_image{&quot;mem_add&quot;}    = $*i_mem;
  $link_image{&quot;edit_tags&quot;}  = $*i_tags;

  $link_caption{&quot;edit_entry&quot;}  = $*t_edit_entry;
  $link_caption{&quot;mem_add&quot;}     = $*t_mem_add;
  $link_caption{&quot;edit_tags&quot;}   = $*t_edit_tags;
  $link_caption{&quot;tell_friend&quot;} = $*t_tell_friend;

  $link_keyseq[size($link_keyseq)] = &quot;permalink&quot;;      # add a permalink to end of linkbar
  $link_url{&quot;permalink&quot;}           = $.permalink_url;
  $link_caption{&quot;permalink&quot;}       = $*text_permalink;
  $link_image{&quot;permalink&quot;}         = $*i_perma;

  # loop thru linkbar and add links to print var
  foreach var string link_key ($link_keyseq) {
    # if we can do performed action, url will be present
    if($link_url{$link_key} != &quot;&quot;) {
      $print = $print + &quot;&quot;&quot;&amp;lt;a href=&quot;$link_url{$link_key}&quot; title=&quot;$link_caption{$link_key}&quot;&amp;gt;&quot;&quot;&quot;;
      # if image url available, use it
      if(($link_image{$link_key} != &quot;&quot;) and ($*image_links == true)) {
        $print = $print + &quot;&quot;&quot;&amp;lt;img src=&quot;$link_image{$link_key}&quot; alt=&quot;$link_caption{$link_key}&quot; title=&quot;$link_caption{$link_key}&quot; border=&quot;0&quot; /&amp;gt;&quot;&quot;&quot;;
      } else {
        # else, just use text
        $print = $print + &quot;$link_caption{$link_key}&quot;;
      }
      # add a seperator
      $print = $print + &quot;&amp;lt;/a&amp;gt;$link_seperator&quot;;
    }
  }

  # hack off last seperator
  $print = $print-&amp;gt;substr(0, $print-&amp;gt;length() - $link_seperator-&amp;gt;length());

  # we&apos;re done! let&apos;s print it!
  print $print;
}

function Page::print_entry (Entry e)  {
  # Print an anchor
  &quot;&quot;&quot;&amp;lt;a name=&quot;item$e.itemid&quot; id=&quot;item$e.itemid&quot;&amp;gt;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
  # Get the right time and date of the post
  var string time = $e.time-&amp;gt;time_format();
  var string date = $e.time-&amp;gt;date_format(&quot;long&quot;);
  # Get the Locked or Private icon, if needed.
  var string security;
  if ($e.security != &quot;&quot;) {
    $security =  &quot;&quot;&quot;&amp;lt;img src=&quot;$e.security_icon.url&quot; align=&quot;right&quot; width=&quot;$e.security_icon.width&quot; height=&quot;$e.security_icon.height&quot; alt=&quot;[$e.security]&quot; title=&quot;[$e.security]&quot; /&amp;gt;&quot;&quot;&quot;;
  }
  var string subject = ($e.subject != &quot;&quot;) ? $e.subject : &quot;&amp;lt;i&amp;gt;$*text_nosubject&amp;lt;/i&amp;gt;&quot;;

  var UserLite name;
  var string pname;
  var string poster_name = $e.poster.name;
  var string poster  = defined $e.poster ? $e.poster-&amp;gt;as_string() : &quot;&amp;lt;b&amp;gt;$*text_poster_anonymous&amp;lt;/b&amp;gt;&quot;;
  var bool show_name = ($.view == &quot;friends&quot; or $e.poster.username != $.journal.username or $.view == &quot;entry&quot;) ? true : false;
  var bool show_pic  = (defined $e.userpic and ($.view == &quot;friends&quot; or $*show_entry_userpic or $e.poster.username != $e.journal.username or $.view == &quot;entry&quot;)) ? true : false;

  &quot;&quot;&quot;
  &amp;lt;div class=&quot;comment_wrapper&quot;&amp;gt;
  &quot;&quot;&quot;;
  if($show_pic) {
    &quot;&quot;&quot;
    &amp;lt;div class=&quot;userpic2&quot;&amp;gt;
      &amp;lt;img src=&quot;$e.userpic.url&quot; width=&quot;$e.userpic.width&quot; height=&quot;$e.userpic.height&quot; alt=&quot;$e.poster.name [userpic]&quot; title=&quot;$e.poster.name [userpic]&quot; border=&quot;0&quot; /&amp;gt;
    &amp;lt;/div&amp;gt;
    &quot;&quot;&quot;;
  }
  &quot;&quot;&quot;
    &amp;lt;div class=&quot;comment_subject&quot;&amp;gt;$security $subject&amp;lt;/div&amp;gt;
    &amp;lt;div class=&quot;comment_postedby&quot;&amp;gt;
  &quot;&quot;&quot;;
  if(true) {
    var string date_time = &quot;$date ($time)&quot;;
    if($.view == &quot;friends&quot; or $e.journal.journal_type == &quot;C&quot;) {
      $date_time = &quot;at $date_time&quot;;
    }
    if($.view == &quot;friends&quot; or $e.journal.journal_type == &quot;C&quot;) {
      if($e.journal.journal_type == &quot;C&quot;) {
        &quot;&quot;&quot;
    in $e.journal&amp;lt;br /&amp;gt;
        &quot;&quot;&quot;;
      }
      &quot;&quot;&quot;
    by $poster_name ($poster)
      &quot;&quot;&quot;;
    }
    &quot;&quot;&quot;
    &amp;lt;div class=&quot;comment_date&quot;&amp;gt;$date_time&amp;lt;/div&amp;gt;
    &quot;&quot;&quot;;  
  }
  $e-&amp;gt;print_metadata();
  &quot;&quot;&quot;
    &amp;lt;/div&amp;gt;
  &amp;lt;div class=&quot;entrytext&quot;&amp;gt;&amp;lt;p&amp;gt;&quot;&quot;&quot;; $e-&amp;gt;print_text(); &quot;&quot;&quot;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class=&quot;comment_links&quot;&amp;gt;
  &quot;&quot;&quot;;
  # Prints the row of comment links
  $e.comments-&amp;gt;print();
  $e-&amp;gt;print_linkbar();
  &quot;&quot;&quot;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;
}

function CommentInfo::print() {
  if ($.enabled) {
    if ($.count &amp;gt; 0 or $.screened) {
      $this-&amp;gt;print_readlink();
    }
    $this-&amp;gt;print_postlink();
  }
}

function CommentInfo::print_postlink() {
  var Page p = get_page();
  var string alttext = $p.view == &quot;friends&quot; ? $*text_post_comment_friends : $*text_post_comment;
  &quot;&quot;&quot;&amp;lt;a href=&quot;$.post_url&quot;&amp;gt;&quot;&quot;&quot;;
  if($*image_links) {
    &quot;&quot;&quot;&amp;lt;img src=&quot;$*i_leave&quot; border=&quot;0&quot; title=&quot;$alttext&quot; alt=&quot;$alttext&quot; /&amp;gt;&quot;&quot;&quot;;
  } else {
    print $alttext;
  }
  &quot;&quot;&quot;&amp;lt;/a&amp;gt;$*t_divider&quot;&quot;&quot;;
}

function CommentInfo::print_readlink {
  var Page p = get_page();
  var string alttext = get_plural_phrase($.count, $p.view == &quot;friends&quot; ? 
                               &quot;text_read_comments_friends&quot; :
                               &quot;text_read_comments&quot;
                     );
  &quot;&quot;&quot;&amp;lt;a href=&quot;$.read_url&quot;&amp;gt;&quot;&quot;&quot;;
  if($*image_links) {
    &quot;&quot;&quot;&amp;lt;img src=&quot;$*i_comment&quot; border=&quot;0&quot; title=&quot;$alttext&quot; alt=&quot;$alttext&quot; /&amp;gt;&quot;&quot;&quot;;
  } else {
    print $alttext;
  }
  &quot;&quot;&quot;&amp;lt;/a&amp;gt;$*t_divider&quot;&quot;&quot;;
}

function DayPage::lay_print_subnav ()  {
  var string back;
  if($.prev_url != &quot;&quot;) {
    $back = &quot;&quot;&quot;&amp;lt;a href=&quot;$.prev_url&quot;&amp;gt;&quot;&quot;&quot; + rehtml($*text_day_prev) + &quot;&amp;lt;/a&amp;gt;&quot;;
  } else {
    $back = &quot;&amp;amp;nbsp;&quot;;
  }
  var string forward;
  if($.next_url != &quot;&quot;) {
    $forward = &quot;&quot;&quot;&amp;lt;a href=&quot;$.next_url&quot;&amp;gt;&quot;&quot;&quot; + rehtml($*text_day_next) + &quot;&amp;lt;/a&amp;gt;&quot;;
  } else {
    $forward = &quot;&amp;amp;nbsp;&quot;;
  }
  var string text = $.date-&amp;gt;date_format(&quot;long&quot;);
  &quot;&quot;&quot;&amp;lt;div class=&quot;systemmessage&quot;&amp;gt;$back | $text | $forward&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
}



############################# REPLY PAGE #########################################

function ReplyPage::print_body() {
  var EntryLite e     = $.replyto;
  var string poster   = defined $e.poster ? $e.poster-&amp;gt;as_string() : &quot;&amp;lt;i&amp;gt;(Anonymous)&amp;lt;/i&amp;gt;&quot;;
  var string datetime;
  var string time     = $e.time-&amp;gt;time_format();
  var string date     = $e.time-&amp;gt;date_format(&quot;long&quot;);

  var UserLite name;
  &quot;&quot;&quot;	
  &amp;lt;div class=&quot;entry&quot;&amp;gt;
    &amp;lt;h3&amp;gt;$date&amp;lt;/h3&amp;gt;
  &quot;&quot;&quot;;
  if(defined $e.userpic and $*comment_userpic_style != &quot;off&quot;) {
    $name = $e.poster;
    &quot;&quot;&quot;
      &amp;lt;div class=&quot;userpic_reply&quot;&amp;gt;
    &quot;&quot;&quot;;
    if (defined $e.userpic or (defined $e.userpic and $.view == &quot;entry&quot; and $*show_entry_userpic)) {
      &quot;&quot;&quot;
        &amp;lt;img src=&quot;$e.userpic.url&quot; width=&quot;$e.userpic.width&quot; height=&quot;$e.userpic.height&quot; alt=&quot;&quot; /&amp;gt;
      &quot;&quot;&quot;;
    }
    &quot;&quot;&quot;
      &amp;lt;/div&amp;gt;
    &quot;&quot;&quot;;
  }
  &quot;&quot;&quot;
    &amp;lt;h1&amp;gt;$e.subject&amp;lt;/h1&amp;gt;
    &amp;lt;div class=&quot;entrytext&quot;&amp;gt;
      &amp;lt;p&amp;gt;&quot;&quot;&quot;; $e-&amp;gt;print_text(); &quot;&quot;&quot;&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class=&quot;entrylinks&quot;&amp;gt;
      Posted at $time $*t_divider &amp;lt;a href=&quot;$.entry.comments.read_url&quot; class=&quot;comments&quot;&amp;gt;$*text_reply_back&amp;lt;/a&amp;gt;
  &quot;&quot;&quot;;
  foreach var string key ([&quot;edit_entry&quot;,&quot;mem_add&quot;,&quot;edit_tags&quot;]) {
    var Link link = $e-&amp;gt;get_link($key);
    if ($link) {
      &quot;&quot;&quot;$*t_divider &amp;lt;a href=\&quot;$link.url\&quot;&amp;gt;$link.caption&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
    }
  }
  &quot;&quot;&quot; $*t_divider &amp;lt;a href=&quot;$e.permalink_url&quot;&amp;gt;$*text_permalink&amp;lt;/a&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class=&quot;replyform&quot;&amp;gt;
  &quot;&quot;&quot;;
  $.form-&amp;gt;print();
  &quot;&quot;&quot;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;
}

function Entry::print_metadata() {
  var string tags_header = &quot;tags&quot;;
  var string tags_joiner = &quot;:&quot;;
  var Link   edit_tags   = $this-&amp;gt;get_link(&quot;edit_tags&quot;);
  var string currents    = &quot;&quot;;
  if ((size $.metadata &amp;gt; 0) or ((size $.tags &amp;gt; 0) and ($*tags_aware))){
    $currents = $currents + &quot;&quot;&quot;&amp;lt;div class=&quot;currents&quot;&amp;gt;&quot;&quot;&quot;;
    foreach var string k ($.metadata){
      var string text = $k;
      var string val = $.metadata{$k};
      if ($k == &quot;mood&quot;){
        $text = $*text_meta_mood;
      } 
      elseif ($k == &quot;music&quot;) {
        $text = $*text_meta_music;
      }
      if ($k == &quot;mood&quot; and defined $.mood_icon){
        var Image i = $.mood_icon;
        $val = &quot;&amp;lt;img src=&apos;$i.url&apos; width=&apos;$i.width&apos; height=&apos;$i.height&apos; align=&apos;middle&apos; alt=&apos;&apos; /&amp;gt; $val&quot;;
      }
      $currents = $currents + &quot;&quot;&quot;&amp;lt;div class=&quot;current$k&quot;&amp;gt;&amp;lt;strong&amp;gt;$text&amp;lt;/strong&amp;gt; $val&amp;lt;/div&amp;gt;&quot;&quot;&quot;;        
    }
    if ((size $.tags &amp;gt; 0) and $*tags_aware) {
      var int    tcount               = 0;
      if($edit_tags.url != &quot;&quot;) {
        $tags_header = &quot;&quot;&quot;&amp;lt;a href=&quot;$edit_tags.url&quot;&amp;gt;$tags_header&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
      }
      $currents = $currents + &quot;&quot;&quot;&amp;lt;div class=&quot;currenttags&quot;&amp;gt;&amp;lt;strong&amp;gt;$tags_header$tags_joiner&amp;lt;/strong&amp;gt; &quot;&quot;&quot;;
      var string tags_root = $.journal-&amp;gt;base_url() + &quot;/tag&quot;;
      foreach var Tag t ($.tags) {
        $currents = $currents + &quot;&quot;&quot;&amp;lt;a rel=&quot;tag&quot; href=&quot;$tags_root/$t.name&quot;&amp;gt;$t.name&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        $tcount++;
        if ($tcount != size $.tags) { $currents = $currents + &quot;, &quot;; }
      }
      $currents = $currents + &quot;&amp;lt;/div&amp;gt;&quot;;
    }
    $currents = $currents + &quot;&amp;lt;/div&amp;gt;&quot;;
    println &quot;$currents&quot;;
  }
}


################################ VIEWS #########################################

function RecentPage::print_body ()  {
  &quot;&quot;&quot;
  &amp;lt;div class=&quot;entries&quot;&amp;gt;
  &quot;&quot;&quot;;
  foreach var Entry e ($.entries) {
    $this-&amp;gt;print_entry($e);
  }
  &quot;&quot;&quot;
  &amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;
}

function DayPage::print_body() {
  &quot;&quot;&quot;&amp;lt;div class=&quot;entries&quot;&amp;gt;&quot;&quot;&quot;;
  if ($.has_entries) {
    foreach var Entry e ($.entries) {
      $this-&amp;gt;print_entry($e);
    }
  } else {
    &quot;&amp;lt;p&amp;gt;$*text_noentries_day&amp;lt;/p&amp;gt;&quot;;
  }
  &quot;&amp;lt;/div&amp;gt;&quot;;
}

function MonthPage::view_title : string {
  return $.date-&amp;gt;date_format($*lang_fmt_month_long);
}

function MonthPage::print_body {
  &quot;&amp;lt;form method=&apos;post&apos; action=&apos;$.redir.url&apos;&amp;gt;&quot;;
  $.redir-&amp;gt;print_hiddens();
  var string back;
  var string forward;
  if ($.prev_url != &quot;&quot;) { $back = &quot;&quot;&quot;&amp;lt;a href=&quot;$.prev_url&quot;&amp;gt;back&amp;lt;/a&amp;gt;&quot;&quot;&quot;; }
  if ($.next_url != &quot;&quot;) { $forward = &quot;&quot;&quot;&amp;lt;a href=&quot;$.next_url&quot;&amp;gt;forward&amp;lt;/a&amp;gt;&quot;&quot;&quot;; }
  var string select;
  if (size $.months &amp;gt; 1) {
    $select = &quot;&amp;lt;select name=&apos;redir_key&apos;&amp;gt;\n&quot;;
    foreach var MonthEntryInfo mei ($.months) {
      var string sel;
      if ($mei.date.year == $.date.year and $mei.date.month == $.date.month) {
        $sel = &quot; selected=&apos;selected&apos;&quot;;
      }
      $select = $select + &quot;&amp;lt;option value=&apos;$mei.redir_key&apos;$sel&amp;gt;&quot; + $mei.date-&amp;gt;date_format($*lang_fmt_month_long) + &quot;&amp;lt;/option&amp;gt;&quot;;
    }
    $select = $select + &quot;&amp;lt;/select&amp;gt;\n&amp;lt;input type=&apos;submit&apos; value=&apos;View&apos; /&amp;gt;&quot;;
  }
  &quot;&quot;&quot;
  &amp;lt;div class=&quot;messageholder&quot;&amp;gt;
    &amp;lt;div class=&quot;systemmessage&quot;&amp;gt;
      &amp;lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&amp;gt;
        &amp;lt;tr&amp;gt;
          &amp;lt;td width=&quot;15%&quot;&amp;gt;$back&amp;lt;/td&amp;gt;
          &amp;lt;td align=&quot;center&quot; width=&quot;70%&quot;&amp;gt;$select&amp;lt;/td&amp;gt;
          &amp;lt;td align=&quot;right&quot; width=&quot;15%&quot;&amp;gt;$forward&amp;lt;/td&amp;gt;
        &amp;lt;/tr&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;
  &quot;&amp;lt;/form&amp;gt;&quot;;
  foreach var MonthDay d ($.days) {
    if ($d.has_entries) {
      &quot;&quot;&quot;
      &amp;lt;a name=&quot;anchor$d.day&quot; id=&quot;achor$d.day&quot;&amp;gt;&amp;lt;/a&amp;gt;
        &amp;lt;div class=&quot;entry&quot;&amp;gt;
          &amp;lt;div class=&quot;entrydivider&quot;&amp;gt;&amp;lt;/div&amp;gt;
          &amp;lt;div class=&quot;entrylinks&quot;&amp;gt;
            &amp;lt;a href=\&quot;$d.url\&quot;&amp;gt; &amp;amp;nbsp; &amp;lt;b&amp;gt;
      &quot;&quot;&quot;;
      print lang_ordinal($d.day);
      &quot;&quot;&quot;
            &amp;lt;/b&amp;gt; &amp;amp;nbsp; &amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;div class=&quot;entries&quot;&amp;gt;
              &amp;lt;div class=&quot;entrytext&quot;&amp;gt;
      &quot;&quot;&quot;;
      $d-&amp;gt;print_subjectlist();
      &quot;&quot;&quot;
              &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
          &amp;lt;/div&amp;gt;
      &quot;&quot;&quot;;
    }
  }
}

function MonthDay::print_subjectlist() {
  foreach var Entry e ($.entries) {
    print $e.time-&amp;gt;time_format(&quot;short&quot;) + &quot;: &quot;;
    if ($e.poster.username != $e.journal.username) {
      $e.poster-&amp;gt;print(); &quot; &quot;;
    }
    &quot;$e.security_icon&quot;;
    if ($e.subject != &quot;&quot;) {
      &quot; &amp;lt;a href=\&quot;$e.permalink_url\&quot;&amp;gt;$e.subject&amp;lt;/a&amp;gt;&quot;;
    } else {
      &quot;&quot;&quot; &amp;lt;a href=&quot;$e.permalink_url&quot;&amp;gt;&amp;lt;i class=&quot;nosubject&quot;&amp;gt;$*text_nosubject&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
    }
    if ($e.comments.count &amp;gt; 0) {
      &quot; - &quot; + get_plural_phrase($e.comments.count, &quot;text_read_comments&quot;);
    }
    if ($e.comments.screened) {
      &quot; &amp;lt;b&amp;gt;$*text_month_screened_comments&amp;lt;/b&amp;gt;&quot;;
    }
    &quot;&amp;lt;br /&amp;gt;\n&quot;;
  }
}

function YearPage::print_body {
  $this-&amp;gt;print_year_links();
  &quot;&quot;&quot;&amp;lt;div id=&quot;cal&quot;&amp;gt;&quot;&quot;&quot;;
  foreach var YearMonth m ($.months) {
    $this-&amp;gt;print_month($m);
  }
  &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
}

function YearPage::print_year_links() {
  &quot;&quot;&quot;&amp;lt;div class=&quot;systemmessage&quot;&amp;gt;&quot;&quot;&quot;;
  foreach var YearYear y ($.years) {
    if ($y.displayed) {
      &quot;&quot;&quot;&amp;lt;b class=&quot;systemtext&quot;&amp;gt;$y.year&amp;lt;/b&amp;gt;&quot;&quot;&quot;;
    } else {
      &quot;&quot;&quot;&amp;lt;b&amp;gt;$*t_divider&amp;lt;a href=&quot;$y.url&quot;&amp;gt;$y.year&amp;lt;/a&amp;gt;$*t_divider&amp;lt;/b&amp;gt;&quot;&quot;&quot;;
    }
  }
  &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
}

function YearPage::print_month(YearMonth m) {
  if (not $m.has_entries) { return; }
  &quot;&quot;&quot;
  &amp;lt;a name=&quot;anchor$m.month&quot;&amp;gt;&amp;lt;/a&amp;gt;
  &amp;lt;div class=&quot;entry&quot;&amp;gt;
    &amp;lt;div class=&quot;entrydivider&quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&quot;entryinfo&quot;&amp;gt;
  &quot;&quot;&quot;;
  print $m-&amp;gt;month_format();
  &quot;&quot;&quot;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class=&quot;entrylinks&quot;&amp;gt;&amp;lt;a href=&quot;$m.url&quot;&amp;gt;$*text_view_month&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&quot;entrytext&quot;&amp;gt;
      &amp;lt;div align=&quot;center&quot;&amp;gt;
        &amp;lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&amp;gt;
          &amp;lt;tr&amp;gt;
  &quot;&quot;&quot;;
  foreach var int d (weekdays()) {
    &quot;&quot;&quot;
            &amp;lt;td width=&quot;14%&quot;&amp;gt;&amp;lt;div class=&quot;calendarInactive&quot;&amp;gt;$*lang_dayname_short[$d]&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;
    &quot;&quot;&quot;;
  }
  &quot;&quot;&quot;
          &amp;lt;/tr&amp;gt;
  &quot;&quot;&quot;;
  foreach var YearWeek w ($m.weeks) {
    $w-&amp;gt;print();
  }
  &quot;&quot;&quot;
        &amp;lt;/table&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;
}

function YearWeek::print() {
  &quot;&quot;&quot;
          &amp;lt;tr&amp;gt;
  &quot;&quot;&quot;;
  if ($.pre_empty &amp;gt; 0) {
    &quot;&quot;&quot;
            &amp;lt;td colspan=&quot;$.pre_empty&quot;&amp;gt;&amp;lt;/td&amp;gt;
    &quot;&quot;&quot;;
  }

  foreach var YearDay d ($.days) {
    var string day = zeropad($d.day, 2);
    &quot;&quot;&quot;
            &amp;lt;td&amp;gt;
              &amp;lt;div class=&quot;calendarInactive&quot;&amp;gt;$day&amp;lt;/div&amp;gt;
    &quot;&quot;&quot;;
    if ($d.num_entries &amp;gt; 0) {
      var string num = $d.num_entries &amp;lt; 10 ? &quot;&amp;amp;nbsp;&quot; + string($d.num_entries) : string($d.num_entries);
      &quot;&quot;&quot;
              &amp;lt;div class=&quot;calendarActive&quot;&amp;gt;&amp;lt;a href=&quot;$d.url&quot;&amp;gt;$num&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
      &quot;&quot;&quot;;
    } else {
      &quot;&quot;&quot;
              &amp;lt;div class=&quot;calendarInactive&quot;&amp;gt; - &amp;lt;/div&amp;gt;
      &quot;&quot;&quot;;
    }
    &quot;&quot;&quot;
            &amp;lt;/td&amp;gt;
    &quot;&quot;&quot;;
  }
  &quot;&quot;&quot;
          &amp;lt;/tr&amp;gt;
  &quot;&quot;&quot;;
}

############################## COMMON HTML ############################################

function Page::print() {
  var string title = $this-&amp;gt;title();
  &quot;&quot;&quot;
&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;&quot; lang=&quot;&quot;&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;$title&amp;lt;/title&amp;gt;
    &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;$.stylesheet_url&quot; type=&quot;text/css&quot; /&amp;gt;
  &quot;&quot;&quot;;
  $this-&amp;gt;print_head();
  &quot;&quot;&quot;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;a name=&quot;top&quot;&amp;gt;&amp;lt;/a&amp;gt;
  &quot;&quot;&quot;;
  if($*header_image != &quot;&quot;) {
  &quot;&quot;&quot;
    &amp;lt;div align=&quot;center&quot;&amp;gt;&amp;lt;img src=&quot;$*header_image&quot; alt=&quot;&quot; title=&quot;&quot; /&amp;gt;&amp;lt;/div&amp;gt;
  &quot;&quot;&quot;;
  }
  &quot;&quot;&quot;
    &amp;lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&amp;gt;
      &amp;lt;tr&amp;gt;
  &quot;&quot;&quot;;
  print_left_bar();
  &quot;&quot;&quot;
        &amp;lt;td id=&quot;container&quot; valign=&quot;top&quot;&amp;gt;
          &amp;lt;div&amp;gt;
            &amp;lt;div id=&quot;entries&quot;&amp;gt;
  &quot;&quot;&quot;;
  $this-&amp;gt;lay_print_subnav();
  $this-&amp;gt;print_body();
  $this-&amp;gt;lay_print_subnav();
  &quot;&quot;&quot;
            &amp;lt;/div&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/td&amp;gt;
  &quot;&quot;&quot;;
  print_right_bar();
  &quot;&quot;&quot;
      &amp;lt;/tr&amp;gt;
    &amp;lt;/table&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
  &quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid3-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2ljdotcom.livejournal.com/763.html?view=comments#comments</comments>
  <category>3kunumn1</category>
  <category>3 column</category>
  <category>3column</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>63</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2ljdotcom.livejournal.com/366.html</guid>
  <pubDate>Sun, 03 Jul 2005 16:50:30 GMT</pubDate>
  <title>first post</title>
  <author>kunzite1</author>
  <link>https://s2ljdotcom.livejournal.com/366.html</link>
  <description>&lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2ljdotcom&quot; lj:user=&quot;s2ljdotcom&quot; &gt;&lt;a href=&quot;https://s2ljdotcom.livejournal.com/profile/&quot;  target=&quot;_self&quot;  class=&quot;i-ljuser-profile&quot; &gt;&lt;img  class=&quot;i-ljuser-userhead&quot;  src=&quot;https://l-stat.livejournal.net/img/community.png?v=556&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://s2ljdotcom.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2ljdotcom&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; was created for me to post &quot;fixed&quot; versions of the layouts here on livejournal.com.&lt;br /&gt;&lt;br /&gt;If property names are changed, give a mapping diagram like:&lt;pre&gt;text:
nav_recent_text -&amp;gt; text_view_recent

colors:
calendar_fgcolor -&amp;gt; calendar_active_fgcolor &lt;/pre&gt;</description>
  <comments>https://s2ljdotcom.livejournal.com/366.html?view=comments#comments</comments>
  <category>rules</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>0</lj:reply-count>
  </item>
</channel>
</rss>
