set font_base = "";
layerinfo "type" = "theme";
layerinfo "name" = "pederasy";
layerinfo source_viewable = 1;
layerinfo is_public = 1;

### Custom CSS
function Page::print_custom_head() {
"""
<style type="text/css">
td.metabar { text-align: center }   
a:visited {color: #500050; }
a:hover {color: #8b1a1a; }
</style>
""";
}
### Custom CSS End

function print_entry (Page p, Entry e, Color bgcolor, Color fgcolor, bool hide_text)
{
    var string time = $e.time->time_format();
    var string userpic = "";
    if (defined $e.userpic)
    {
        $userpic = "<img src='$e.userpic.url' alt='[User Picture]' height='$e.userpic.height' width='$e.userpic.width' />";
    }
    if ($e.new_day or $p.view == "entry")
    {
        "<tr><th colspan='2' align='left' class='headerbar'>";
        print $e.time->date_format("%%month%% %%dayord%%, %%yyyy%%");
        "</th></tr>\n";
    } elseif ($p.view == "day") {
        "<tr><th class='headerbar'>Time</td><td class='headerbar' style='width: 100%'>Event</th></tr>";
    }
    "<tr valign='top'>";

    # Metabar
      "<td style='background-color: $bgcolor;' class='metabar'>";
      # Time
      "<em>$time</em><br />";
      # Altposter crap
      if ($p.view == "friends")
      {
          "<strong><a style='color: $fgcolor' href='" + $e.journal->base_url() + "/'>";
          print $e.journal.username;
          "</a></strong><br />";
      }
      if ($e.journal.username != $e.poster.username)
      {
          "[<a href='" + $e.poster->base_url() + "/'>";
          print $e.poster.username;
          "</a>]<br />";
      }
      if ($userpic != "" and ($p.view == "friends" or $*show_entry_userpic == true))
      {
          print $userpic;
      }
      # Security icon
      if ($e.security) { print $e.security_icon; }
      # Permalink
      "<p>[<a href='$e.permalink_url'>$*text_permalink</a>]</p>";
      "</td>";

    # Entry
       
    #    "<td style='text-align:left;padding-left: 2%'>"; 
    # deleted because of problems with IE 7
    # instead use padding
    "<td style='text-align:left;padding: 0.2cm'>";

    # now the rest

      if ($p.view == "entry" and $*show_entrynav_icons)
      {
          print "<div style='text-align: center'>";
          $e->print_linkbar();
          print "</div>";
      }

      if ($e.subject) { "\n\n<span class='subject'>$e.subject</span><br />"; }
      if (not $hide_text) {
          print $e.text; "\n\n";
          if (size $e.metadata or size $e.tags)
          {
              "<p>";
              foreach var string k ($e.metadata)
              {
                  var string key = $k;
                  var string val = $e.metadata{$k};
                  if ($k == "mood")  { $key = $*text_meta_mood;  }
                  if ($k == "music") { $key = $*text_meta_music; }
                  if ($k == "mood" and defined $e.mood_icon)
                  {
                      var Image i = $e.mood_icon;
                      $val = "<img src='$i.url' width='$i.width' height='$i.height' alt='' /> $val";
                  }
                  "<strong>$key:</strong> $val<br />";
              }

              if ($e.tags) {
                  var int tcount = 0;
                  "<strong>Tags:</strong> ";
                  foreach var Tag t ($e.tags) {
                      """<a rel="tag" href="$t.url">$t.name</a>""";
                      $tcount++;
                      if ($tcount != size $e.tags) { ", "; }
                  }
                  "<br />";
              }

              "</p>";
          }
      }
#     $e.comments->print(); 
"<div align=right> <small>(";  # if ($e.comments.count>0) {
 $e.comments->print_readlink();  print " | "; # }
$e.comments->print_postlink(); 
if ($e.comments.count<900) { if ($e.comments.count>150) {
print " | <a href=" + $e.permalink_url +"?uncollapse>Uncollapse</a>"; }}" 
)</small></div>";
      "</td>";
    "</tr>\n";
}