<?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 Layers</title>
  <link>https://s2layers.livejournal.com/</link>
  <description>S2 Layers - LiveJournal.com</description>
  <lastBuildDate>Wed, 04 Jun 2008 14:02:42 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>s2layers</lj:journal>
  <lj:journalid>4476045</lj:journalid>
  <lj:journaltype>community</lj:journaltype>
  <image>
    <url>https://l-userpic.livejournal.com/28630163/4476045</url>
    <title>S2 Layers</title>
    <link>https://s2layers.livejournal.com/</link>
    <width>100</width>
    <height>100</height>
  </image>

  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/72678.html</guid>
  <pubDate>Wed, 04 Jun 2008 14:02:42 GMT</pubDate>
  <title>tag cloud</title>
  <author>ex_hexsex</author>
  <link>https://s2layers.livejournal.com/72678.html</link>
  <description>Hallo. &lt;br /&gt;How i can get to my style (Disjointed) tag list or tag cloud? i have paid account and &lt;a target=&apos;_blank&apos; href=&apos;http://www.livejournal.com/customize/advanced/&apos;&gt;http://www.livejournal.com/customize/advanced/&lt;/a&gt; avaliable.&lt;br /&gt;&lt;br /&gt;Thank You.</description>
  <comments>https://s2layers.livejournal.com/72678.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:poster>ex_hexsex</lj:poster>
  <lj:posterid>1373218</lj:posterid>
  <lj:reply-count>2</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/72282.html</guid>
  <pubDate>Fri, 14 Dec 2007 12:29:55 GMT</pubDate>
  <title>Легко настраиваемый дизайн</title>
  <author>drhobbot</author>
  <link>https://s2layers.livejournal.com/72282.html</link>
  <description>Итак. Хотелось бы предложить идею, так как на реализацию таковой у меня не хватит (совсем) ни знаний ни опыта. Искренне надеюсь, что на нее обратит внимание кто нибудь из создателей стилей и (очень надеюсь!) &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;camomiletea&quot; lj:user=&quot;camomiletea&quot; &gt;&lt;a href=&quot;https://camomiletea.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://camomiletea.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;camomiletea&lt;/b&gt;&lt;/a&gt;&lt;a class=&quot;i-ljuser-badge i-ljuser-badge--pro&quot; data-badge-type=&quot;pro&quot; data-placement=&quot;bottom&quot; data-pro-badge data-pro-badge-type=&quot;1&quot; data-is-raw hidden href=&quot;#&quot;&gt;&lt;span class=&quot;i-ljuser-badge__icon&quot;&gt;&lt;svg class=&quot;svgicon&quot; width=&quot;25&quot; height=&quot;16&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 33 24&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M19.326 11.95c0 2.01 1.47 3.45 3.48 3.45 2.02 0 3.49-1.44 3.49-3.45 0-2.01-1.47-3.45-3.49-3.45-2.01 0-3.48 1.44-3.48 3.45Zm5.51 0c0 1.24-.8 2.19-2.03 2.19-1.23 0-2.02-.95-2.02-2.19 0-1.25.79-2.19 2.02-2.19s2.03.94 2.03 2.19ZM7.92 15.28H6.5V8.61h3.12c1.45 0 2.24.98 2.24 2.15 0 1.16-.8 2.15-2.24 2.15h-1.7v2.37Zm1.51-3.62c.56 0 .98-.35.98-.9 0-.56-.42-.9-.98-.9H7.92v1.8h1.51ZM18.3802 15.28h-1.63l-1.31-2.37h-1.04v2.37h-1.42V8.61h3.12c1.39 0 2.24.91 2.24 2.15 0 1.18-.74 1.81-1.46 1.98l1.5 2.54Zm-2.49-3.62c.57 0 1-.34 1-.9s-.43-.9-1-.9h-1.49v1.8h1.49Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M2 8c0-2.20914 1.79086-4 4-4h20.5c2.2091 0 4 1.79086 4 4v7.9c0 2.2091-1.7909 4-4 4H6c-2.20914 0-4-1.7909-4-4V8Zm4-2.5h20.5C27.8807 5.5 29 6.61929 29 8v7.9c0 1.3807-1.1193 2.5-2.5 2.5H6c-1.38071 0-2.5-1.1193-2.5-2.5V8c0-1.38071 1.11929-2.5 2.5-2.5Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Так вот. Сколько бы я не искал, но нет среди предложенных даже для платных аккаунтов такого стиля при котором можно бы было максимально контролировать собственный дизайн не обладая при этом какими либо знаниями в программировании и т.п.&lt;br /&gt;&lt;br /&gt;Долго думал я и ковырялся, и вот нашел некоторую систему:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Так или иначе любой стиль в жж (да и вообще в сети) чаще всего имеет схему:&lt;br /&gt;1) topbanner&lt;br /&gt;2) sidebar&lt;br /&gt;3) contentbox&lt;br /&gt;&lt;br /&gt;sidebar в свою очередь помимо всего прочего имеет внутри себя (как правило) некий linkbox в которых и находится все что душеньке угодно, от ссылок до счетчиков, инфоблоков и прочая прочая прочая.&lt;br /&gt;&lt;br /&gt;см. рисунок&lt;br /&gt;&lt;a href=&quot;http://www.ljplus.ru/img4/d/r/drhobbot/table2.jpg&quot; target=&quot;_blank&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;https://www.ljplus.ru/img4/d/r/drhobbot/th_table2.jpg&quot; width=&quot;128&quot; height=&quot;150&quot; border=&quot;0&quot; fetchpriority=&quot;high&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Теперь перейду собственно к задумке.&lt;br /&gt;А вот хорошо бы было, что бы пользователь (даже самый непонятливый) имел возможность в настройке своего стиля указывать следующие параметры:&lt;br /&gt;&lt;br /&gt;Общие:&lt;br /&gt;1.общий фон - задать цвет или загрузить картинку&lt;br /&gt;2.topbanner - задать размер в высоту, загрузить картинку&lt;br /&gt;3.общая таблица - задать цвет и толщину бордюра&lt;br /&gt; &lt;br /&gt;sidebar: &lt;br /&gt;1. установить количество linkbox&lt;br /&gt;2. выбрать цвет(и или) картинку для параметров 1-9 linkbox см.картинку&lt;br /&gt;&lt;br /&gt;выбрать расположение usermenu (левый верхний угол topbanner, другие его углы, полоска под topbanner (и местоположение на ней) или один из linkbox в sidebar)&lt;br /&gt;&lt;br /&gt;выбрать шрифт и размер для заголовка и подзаголовка. (хорошо бы было если бы было два topbanner один над другим, тогда некоторые платные пользователи могли бы размещать там свой баннер с рекламой или название жж или еще что нибудь что угодно))&lt;br /&gt;&lt;br /&gt;выбрать шрифт и размер для линков и текста в sidebar, заголовков тем, текста тела сообщения, даты и прочь.&lt;br /&gt;&lt;br /&gt;Добавить постоянную подпись в сообщение.&lt;br /&gt;&lt;br /&gt;Ну и хорошо бы было так же настраисать и тело сообщений, расположение аватара, настроений, цвет подложки для заголовка.... и так далее.&lt;br /&gt;&lt;br /&gt;Спасибо за внимание, надеюсь желающие реализовать эту идею найдутся.&lt;br /&gt;Если что обращайтесь за идеями ко мне )))&lt;br /&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/72282.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:poster>drhobbot</lj:poster>
  <lj:posterid>7561522</lj:posterid>
  <lj:reply-count>2</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/71697.html</guid>
  <pubDate>Thu, 25 Oct 2007 12:17:45 GMT</pubDate>
  <title>Вопрос про редактируемый sidebar | Question about edited sidebar,</title>
  <author>drhobbot</author>
  <link>https://s2layers.livejournal.com/71697.html</link>
  <description>S2 платный - Родительский слой - собственный на основе &lt;b&gt;Style Contest/Cleanstyle Black and White&lt;/b&gt;&lt;br /&gt;Не уверен, что мне тут помогут, но....&lt;br /&gt;Ситуация следующая: Style Contest мною был выбран в следствии долгих экспериментов, по причине того, что это единственный родительский слой, в котором прописаны полностью адреса к css файлам оформлений. И единственный слой, в котором внесение мной незначительных изменений изменений дало именно тот результат, который я хотел. В ситуации с Expressive, например, даже внесение своего css файла в custome css давала результат в виде отображение жж вообще без дизайна или с дизайном по умолчению взятом из weblog.css&lt;br /&gt;&lt;br /&gt;Так вот:&lt;br /&gt;Есть S2 родительский слой названный мною &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=9368144&amp;amp;fmt=html&quot; target=&quot;_blank&quot;&gt;LiderBlog&lt;/a&gt; на основе, как я уже говорил &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=7457659&amp;amp;fmt=html&quot; target=&quot;_blank&quot;&gt;Style Contest&lt;/a&gt;&lt;br /&gt;То, чего в нем не реализовано - это внесение изменений в sidebar. Зато это очень красиво реализовано в &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=420357&amp;amp;fmt=html&quot; target=&quot;_blank&quot;&gt;Digital Multiplex (OSWD)&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Внимание вопрос: Какие части кода нужно перенести из Digital Multiplex (OSWD) в мой LiderBlog, что бы эти функции там заработали?&lt;br /&gt;Сразу скажу, что тупой перенос группы &lt;pre&gt;&lt;span class=&quot;&quot;&gt;propgroup&lt;/span&gt; &lt;span class=&quot;&quot;&gt;sidebar&lt;/span&gt;&lt;/pre&gt; результата не дают. В настройках стиля эта фишка появляется, но вносимые изменения в силу не вступают. Тоже самое относится и к &quot;Entry footer HTML&quot;&lt;br /&gt;&lt;br /&gt;Еще один ворос:&lt;br /&gt;Как в принципе работает &quot;Entry footer HTML&quot;? То есть, что дает внесение в это окошко html кода и где он в итоге отображается.&lt;br /&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;S2 Paid - the Parental layer - own on a basis &lt;b&gt; Style Contest/Cleanstyle Black and White &lt;/b&gt;&lt;br /&gt;It is not confident, that to me here will help, but....&lt;br /&gt;Situation following: Style Contest me has been chosen in consequence(investigation) of long experiments for the reason that it is a unique parental layer in which addresses to css to files of registrations are registered completely. And a unique layer in which entering of minor alterations of changes by me has given(allowed) that result which I wanted. In a situation with Expressive, for example, even entering of the css a file in custome css gave result as display жж in general without design or with design by default taken of weblog.css&lt;br /&gt;&lt;br /&gt;And so:&lt;br /&gt;Is S2 a parental layer named me &lt;a href=&quot;http:// // www.livejournal.com/customize/advanced/layersource.bml? id=9368144*fmt=html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt; LiderBlog &lt;/a&gt; on a basis how I already spoke &lt;a href=&quot;http:// // www.livejournal.com/customize/advanced/layersource.bml? id=7457659*fmt=html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt; Style Contest &lt;/a&gt;&lt;br /&gt;What in it(him) it is not realized is a modification in sidebar. But it is very beautifully realized in &lt;a href=&quot;http:// // www.livejournal.com/customize/advanced/layersource.bml? id=420357*fmt=html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt; Digital Multiplex (OSWD) &lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Attention a question: What parts of a code need to be transferred from Digital Multiplex (OSWD) to mine LiderBlog, what these functions there would earn?&lt;br /&gt;At once I shall tell, that stupid(blunt) carry of group &lt;pre&gt; &lt;span class=&quot;&quot;&gt; propgroup &lt;/span&gt; &lt;span class=&quot;&quot;&gt; sidebar &lt;/span&gt; &lt;/pre&gt; result do not give. In adjustments(options) of style this chesspiece appears, but brought changes valid do not enter. Too most concerns and to &quot; Entry footer HTML &quot;&lt;br /&gt;&lt;br /&gt;One more question:&lt;br /&gt;How basically works &quot; Entry footer HTML &quot;? That is, that entering into it окошко html gives a code and where it(he) in a result is displayed.&lt;br /&gt;&lt;a name=&apos;cutid2-end&apos;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color=&quot;#808080&quot;&gt;Beforehand I apologize, that I use the electronic translator - English I do not own :(&lt;/font&gt;</description>
  <comments>https://s2layers.livejournal.com/71697.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:poster>drhobbot</lj:poster>
  <lj:posterid>7561522</lj:posterid>
  <lj:reply-count>35</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/70332.html</guid>
  <pubDate>Sun, 01 Apr 2007 14:11:58 GMT</pubDate>
  <title>[theme] - [tranqii] - [sticky entry]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/70332.html</link>
  <description>in response to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;sdlucly&quot; lj:user=&quot;sdlucly&quot; &gt;&lt;a href=&quot;https://sdlucly.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://sdlucly.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;sdlucly&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;a href=&quot;http://community.livejournal.com/s2tranquility2/28672.html?thread=152832#t152832&quot; target=&quot;_blank&quot;&gt;comment&lt;/a&gt; in &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;jdark&quot; lj:user=&quot;jdark&quot; &gt;&lt;a href=&quot;https://jdark.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://jdark.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;jdark&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2tranquility2&quot; lj:user=&quot;s2tranquility2&quot; &gt;&lt;a href=&quot;https://s2tranquility2.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://s2tranquility2.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2tranquility2&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://community.livejournal.com/s2tranquility2/28672.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;# -------------------------------
# main page display entries and
# footer
# -------------------------------
function RecentPage::print_body () {
  var bool   enable_sticky      = true;
  var string sticky_subject     = &quot;&quot;; # Welcome
  var string sticky_date        = &quot;&quot;; # Apr. 1st, 2007
  var string sticky_location    = &quot;&quot;; # San Francisco, CA
  var string sticky_mood        = &quot;&quot;; # creative
  var string sticky_music       = &quot;&quot;; # Mirrors on Shoes - LiveJournal
  var string sticky_permalink   = &quot;&quot;; # http://exampleusername.livejournal.com/289.html
  var string sticky_posturl     = &quot;&quot;; # http://exampleusername.livejournal.com/289.html?mode=reply
  var string sticky_poster      = &quot;&quot;; # exampleusername
  var string sticky_userpic     = &quot;&quot;; # http://stat.livejournal.com/img/goat-normal.gif
  var string sticky_userpic_alt = &quot;&quot;; # $.journal.username

  var bool   print_sticky = (not $this isa FriendsPage) and ($.nav.skip == 0) and $enable_sticky;

  # print all entries
  &quot;&quot;&quot;
  &amp;lt;div id=&quot;entries&quot;&amp;gt;&quot;&quot;&quot;;

  if($print_sticky) {
    var string sticky_meta = &quot;&quot;;
    if($sticky_subject == &quot;&quot;) {
      $sticky_subject = &quot;&quot;&quot;&amp;lt;i class=&quot;nosubject&quot;&amp;gt;$*text_nosubject&amp;lt;/i&amp;gt;&quot;&quot;&quot;;
    }
    foreach var string k ([&quot;location&quot;, &quot;mood&quot;, &quot;music&quot;]) {
      var string text = lang_metadata_title($k);
      var string val  = &quot;&quot;;
      if($k == &quot;location&quot;) {
        $val = $sticky_location;
        if($val != &quot;&quot;) {
          $val = &quot;&quot;&quot;&amp;lt;a href=&quot;http://maps.google.com/maps?q=$sticky_location&quot;&amp;gt;$sticky_location&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        }
      } elseif ($k == &quot;mood&quot;) {
        $val = $sticky_mood;
      } elseif ($k == &quot;music&quot;) {
        $val = $sticky_music;
      }
      if($val != &quot;&quot;) {
        $sticky_meta = $sticky_meta + &quot;\n&quot; + &quot;        &amp;lt;b&amp;gt;&quot; + $text + &quot;:&amp;lt;/b&amp;gt; &quot; + $val + &quot;&amp;lt;br /&amp;gt;&quot;;
      }
    }
    if($sticky_poster != &quot;&quot;) {
      var UserLite u = UserLite($sticky_poster);
      $sticky_poster = $u-&amp;gt;ljuser();
      if($u.username != $.journal.username) {
        $sticky_poster = $sticky_poster + &quot; in &quot; + $.journal-&amp;gt;as_string();
      }
      $sticky_poster = &quot;\n&quot; + &quot;        &quot; + $sticky_poster;
    }
    if($sticky_userpic != &quot;&quot;) {
      $sticky_userpic = &quot;&quot;&quot;
      &amp;lt;h3 class=&quot;userpic&quot;&amp;gt;&amp;lt;img border=&quot;0&quot; src=&quot;$sticky_userpic&quot; alt=&quot;$sticky_userpic_alt&quot; title=&quot;$sticky_userpic_alt&quot; /&amp;gt;&amp;lt;/h3&amp;gt;&quot;&quot;&quot;;
    }

    &quot;&quot;&quot;
    &amp;lt;div id=&quot;entry_sticky&quot; class=&quot;ind-entry&quot;&amp;gt;&quot;&quot;&quot;;

    print $sticky_userpic;

    &quot;&quot;&quot;
      &amp;lt;h2&amp;gt;$sticky_subject&amp;lt;/h2&amp;gt;&quot;&quot;&quot;;

    var bool h4 = ($sticky_date != &quot;&quot;) or ($sticky_meta != &quot;&quot;) or ($sticky_poster != &quot;&quot;);
    if($h4) {
      &quot;&quot;&quot;
      &amp;lt;h4&amp;gt;&quot;&quot;&quot;;
      if($sticky_date != &quot;&quot;) {
        &quot;&quot;&quot;
        &amp;lt;b&amp;gt;$sticky_date&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&quot;&quot;&quot;;
      }

      print $sticky_meta;

      print $sticky_poster;

      &quot;&quot;&quot;
      &amp;lt;/h4&amp;gt;&quot;&quot;&quot;;
    }

    &quot;&quot;&quot;
      &amp;lt;div class=&quot;entry-item&quot;&amp;gt;&quot;&quot;&quot;;

    &quot;&quot;&quot;
        Entry text here
    &quot;&quot;&quot;;

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

    $h4 = ($sticky_permalink != &quot;&quot;) or (($sticky_permalink != &quot;&quot;) and ($sticky_posturl != &quot;&quot;));

    if($h4) {
      &quot;&quot;&quot;
      &amp;lt;h4&amp;gt;&quot;&quot;&quot;;
      &quot;\n&quot;;
      &quot;        &quot;;
      var bool print_permalink = get_permalink($sticky_permalink) != &quot;&quot;;
      var bool print_posturl   = $sticky_posturl != &quot;&quot;;
      if($print_permalink) {
        print get_permalink($sticky_permalink);
      }
      if($print_permalink and $print_posturl) {
        &quot; | &quot;;
      }
      if($print_posturl) {
        &quot;&quot;&quot;&amp;lt;a href=&quot;$sticky_posturl&quot; class=&quot;comments&quot; title=&quot;$*text_post_comment&quot;&amp;gt;$*text_post_comment&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
      }
      &quot;&quot;&quot;
      &amp;lt;/h4&amp;gt;&quot;&quot;&quot;;
    }

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

  foreach var Entry e ( $.entries ) {
    $this-&amp;gt;print_entry($e);
    if ($e-&amp;gt;viewer_sees_ebox()) {
      &quot;&quot;&quot;
    &amp;lt;div class=&quot;ind-entry&quot;&amp;gt;&amp;lt;table align=&quot;center&quot;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&quot;&quot;&quot;;
      $e-&amp;gt;print_ebox();
      &quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&amp;lt;/div&amp;gt;&quot;;
    }
  }
  &quot;&quot;&quot;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;

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

  &quot;&quot;&quot;
    &amp;lt;div id=&quot;footer&quot;&amp;gt;
      &amp;lt;p&amp;gt;
        &amp;lt;b&amp;gt;viewing:&amp;lt;/b&amp;gt; $range&amp;lt;br /&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; title=&quot;go earlier&quot;&amp;gt;earlier&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; title=&quot;go later&quot;&amp;gt;later&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
    }
    if ( $back != &quot;&quot; and $forward != &quot;&quot; ) {
      $sep = &quot; | &quot;;
    }
    &quot;&quot;&quot;
        &amp;lt;b&amp;gt;go&amp;lt;/b&amp;gt;: $back$sep$forward&amp;lt;br /&amp;gt;&quot;&quot;&quot;;
  }
  &quot;&quot;&quot;
      &amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/70332.html?view=comments#comments</comments>
  <category>function print_body</category>
  <category>class recentpage</category>
  <category>layout tranqii</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>1</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/69869.html</guid>
  <pubDate>Fri, 02 Mar 2007 21:52:03 GMT</pubDate>
  <title>[theme] - [expressive] - [tagspage: limited list of tags]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/69869.html</link>
  <description>in response to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;wasd&quot; lj:user=&quot;wasd&quot; &gt;&lt;a href=&quot;https://wasd.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://wasd.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;wasd&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2expressive&quot; lj:user=&quot;s2expressive&quot; &gt;&lt;a href=&quot;https://s2expressive.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://s2expressive.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2expressive&lt;/b&gt;&lt;/a&gt;&lt;a class=&quot;i-ljuser-badge i-ljuser-badge--pro&quot; data-badge-type=&quot;pro&quot; data-placement=&quot;bottom&quot; data-pro-badge data-pro-badge-type=&quot;1&quot; data-is-raw hidden href=&quot;#&quot;&gt;&lt;span class=&quot;i-ljuser-badge__icon&quot;&gt;&lt;svg class=&quot;svgicon&quot; width=&quot;25&quot; height=&quot;16&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 33 24&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M19.326 11.95c0 2.01 1.47 3.45 3.48 3.45 2.02 0 3.49-1.44 3.49-3.45 0-2.01-1.47-3.45-3.49-3.45-2.01 0-3.48 1.44-3.48 3.45Zm5.51 0c0 1.24-.8 2.19-2.03 2.19-1.23 0-2.02-.95-2.02-2.19 0-1.25.79-2.19 2.02-2.19s2.03.94 2.03 2.19ZM7.92 15.28H6.5V8.61h3.12c1.45 0 2.24.98 2.24 2.15 0 1.16-.8 2.15-2.24 2.15h-1.7v2.37Zm1.51-3.62c.56 0 .98-.35.98-.9 0-.56-.42-.9-.98-.9H7.92v1.8h1.51ZM18.3802 15.28h-1.63l-1.31-2.37h-1.04v2.37h-1.42V8.61h3.12c1.39 0 2.24.91 2.24 2.15 0 1.18-.74 1.81-1.46 1.98l1.5 2.54Zm-2.49-3.62c.57 0 1-.34 1-.9s-.43-.9-1-.9h-1.49v1.8h1.49Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M2 8c0-2.20914 1.79086-4 4-4h20.5c2.2091 0 4 1.79086 4 4v7.9c0 2.2091-1.7909 4-4 4H6c-2.20914 0-4-1.7909-4-4V8Zm4-2.5h20.5C27.8807 5.5 29 6.61929 29 8v7.9c0 1.3807-1.1193 2.5-2.5 2.5H6c-1.38071 0-2.5-1.1193-2.5-2.5V8c0-1.38071 1.11929-2.5 2.5-2.5Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://community.livejournal.com/s2expressive/54777.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;class MyClass {
  function quicksort(string[] list, int start, int end) : string[];
  function quicksort(string[] list)                     : string[];
}

###############
# &amp;lt;quicksort&amp;gt; #
###############
#// These two functions perform sorting capabilities
#//
#// Credit goes to &apos;Tony Chang &amp;lt;tychang1 [at] uiuc [dot] edu&amp;gt;&apos;
#// See: http://www.livejournal.com/customize/advanced/layersource.bml?id=54714
#// % Partitions then recursively calls.
#// % Tested up to 172 sortable elements in a string array
function MyClass::quicksort(string[] list, int start, int end) : string[] {
  if ($end &amp;lt;= $start) {
    return $list;
  }
  
  #// Pick a pivot and move to the front
  var int pivot  = rand($start, $end);
  var string tmp = $list[$start];
  $list[$start]  = $list[$pivot];
  $list[$pivot]  = $tmp;
  
  #// Now Partition
  var int left  = ($start + 1);
  var int right = $end;
  
  foreach var int i ($start .. ($end - 2)) {
    if ($list[$left] &amp;gt; $list[$start]) {
      #// Swap the left and the right, then move the right back
      $tmp          = $list[$left];
      $list[$left]  = $list[$right];
      $list[$right] = $tmp;
      $right--;
    } else {
      $left++;
    }
  }

  # put the pivot back in the middle
  if ($list[$start] &amp;lt; $list[$left]) {
    #// Swap $start and ($left - 1)
    $tmp               = $list[$start];
    $list[$start]      = $list[($left - 1)];
    $list[($left - 1)] = $tmp;
    $pivot             = ($left - 1);
  } else {
    #// Swap $start and $left
    $tmp          = $list[$start];
    $list[$start] = $list[$left];
    $list[$left]  = $tmp;
    $pivot        = $left;
  }
  
  #// Sort either side of the pivot
  $list = $this-&amp;gt;quicksort($list, $start,       ($pivot - 1));
  $list = $this-&amp;gt;quicksort($list, ($pivot + 1), $end);
  
  return $list;
}

#// Recursing Function
function MyClass::quicksort(string[] list) : string[] {
  return $this-&amp;gt;quicksort($list, 0, size $list - 1);
}
################
# &amp;lt;/quicksort&amp;gt; #
################

function TagsPage::print_body() {
  var TagDetail[]   tags      = $this-&amp;gt;visible_tag_list(); # get available tags
  var TagDetail[]{} my_tags   = {};                        # repackage tags, group by use count
  var string{}{}    cloud     = {};                        # final package for individual tags
  var string[]      tag_names = [];                        # keep track of tag names that are in final set
  var int           max_count = 0;                         # keep track of max number of uses for any tag
  var int           max_list  = 20;                        # max number of tags to list

  # print opening to Expressive&apos;s TagsPage
  print safe &quot;&quot;&quot;&amp;lt;h2 class=&quot;asset-name page-header2&quot;&amp;gt;$*text_tags_page_header&amp;lt;/h2&amp;gt;&quot;&quot;&quot;;

  # cycle thru tags
  foreach var TagDetail t ($tags) {
    # get highest count
    if($t.use_count &amp;gt; $max_count) {
      $max_count = $t.use_count;
    }

    # get existing set of tags for this use count
    var TagDetail[] array  = $my_tags{$t.use_count};

    # add this tag
    $array[size($array)]   = $t;

    # save
    $my_tags{$t.use_count} = $array;
  }

  # cycle thru sorted tags
  foreach var int i (0 .. $max_count) {
    # get tag group by use count
    var TagDetail[] ts = $my_tags{$max_count - $i};

    # if this use count has tags
    if($ts) {
      # cycle thru tags with this use count
      foreach var TagDetail t ($ts) {
        var string{} hash = {};
        $hash{&quot;url&quot;}                 = $t.url;            # copy url
        $hash{&quot;uses&quot;}                = $t.use_count + &quot;&quot;; # copy use count
        $hash{&quot;sec&quot;}                 = $t.visibility;     # copy security/visibility
        $hash{&quot;size&quot;}                = ($t.use_count &amp;gt; 1) ? (((($t.use_count * 16) / $max_count) + 7) + &quot;&quot;) : &quot;7&quot;; # calculate font size
        $cloud{$t.name}              = $hash;   # add hash to cloud
        $tag_names[size($tag_names)] = $t.name; # add tag name to final set record

        # decrement max list var because we&apos;ve added a tag to the final set
        $max_list--;

        # if we&apos;re at the end of the list, stop adding more
        if($max_list &amp;lt;= 0) {
          break;
        }
      }
    }

    # if we&apos;re at the end of the list, stop adding more
    if($max_list &amp;lt;= 0) {
      break;
    }
  }

  # instantiate MyClass object
  var MyClass mc = new MyClass;

  # sort tag names
  $tag_names = $mc-&amp;gt;quicksort($tag_names);

  # cycle thru final set
  foreach var string name ($tag_names) {
    var string{} hash = $cloud{$name}; # get tag data
    var string   url  = $hash{&quot;url&quot;};  # get url
    var string   uses = $hash{&quot;uses&quot;}; # get uses
    var string   sec  = $hash{&quot;sec&quot;};  # get security/visibility
    var string   size = $hash{&quot;size&quot;}; # get font size
    var string   alt  = $uses + &quot; use&quot; + (int($uses) != 1 ? &quot;s&quot; : &quot;&quot;) + &quot;, &quot; + $sec; # built alt string

    # put it all together
    &quot;&quot;&quot;&amp;lt;a href=&quot;$url&quot; alt=&quot;$alt&quot; title=&quot;$alt&quot; style=&quot;font-size: ${size}px;&quot;&amp;gt;$name&amp;lt;/a&amp;gt; &quot;&quot;&quot;;
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/69869.html?view=comments#comments</comments>
  <category>function print_body</category>
  <category>layout expressive</category>
  <category>class tagspage</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>9</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/69439.html</guid>
  <pubDate>Wed, 14 Feb 2007 03:04:16 GMT</pubDate>
  <title>[user/theme] - [smoothsailing] - [multi-level tags in sidebar]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/69439.html</link>
  <description>this code is a quick&apos;n&apos;dirty conversion of &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;s2flexisquared&quot; lj:user=&quot;s2flexisquared&quot; &gt;&lt;a href=&quot;https://s2flexisquared.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://s2flexisquared.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2flexisquared&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2flexisquares&quot; lj:user=&quot;s2flexisquares&quot; &gt;&lt;a href=&quot;https://s2flexisquares.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://s2flexisquares.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2flexisquares&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://www.livejournal.com/community/s2flexisquares/525551.html&quot; target=&quot;_blank&quot;&gt;multi-level tags in sidebar&lt;/a&gt;.&lt;br /&gt;the following set commands should be added to your user layer and replace any that are currently in there.&lt;pre&gt;&lt;code&gt;set layout_sidebox_profile_visibility     = &quot;1&quot;;
set layout_sidebox_latestmonth_visibility = &quot;2&quot;;
set layout_sidebox_links_visibility       = &quot;3&quot;;
set layout_sidebox_summary_visibility     = &quot;4&quot;;
set layout_sidebox_multisearch_visibility = &quot;5&quot;;
set layout_sidebox_freetext_2_visibility  = &quot;6&quot;;
set layout_sidebox_tags_visibility        = &quot;hide&quot;;&lt;/code&gt;&lt;/pre&gt;the following function overrides should be placed into a theme layer.  if you are using one of the system-provided theme layers, you&apos;ll need to move those set commands for the colors into your user layer, create a new theme layer, place this code into it, and attach the new theme layer to your style.&lt;pre&gt;&lt;code&gt;function Page::print_custom_head()
{

    &quot;&quot;&quot;
    &amp;lt;style type=&quot;text/css&quot;&amp;gt;

    /* List Alignment */
    /* Styles to ensure that the tag list is correctly aligned beneath the sidebox title */
    li.tagBox  {padding-left: 0;    margin-left: 0; list-style: none;}
    ul.tagList {padding-left: 0;    margin-left: 0; list-style: none;}
    li.tagItem {padding-left: 15px;                 list-style: none;}
    
    /* Vertical Scroll */
    /* Need to shrink the list width to prevent horizontal scrollbar in Firefox. */
    /* Note this won&apos;t prevent it if your tags are super long, it will only */
    /* prevent it from displaying unnecessarily. */
    ul.tagList {width: 90%;}

    &amp;lt;/style&amp;gt;
    &quot;&quot;&quot;;
}

function Page::lay_print_sidebar_freetextbox_2() {

#####   Config   #####

  # Specify your delimiter.  One char only -- extra chars get truncated.
  var string delimiter = &quot;:&quot;;

  # Do you want to show the tag use counts? Set to true or false.
  var bool show_count = true;

  # Specify the text to show just before the use count, if any.
  var string pre_count = &quot;[&quot;;

  # Specify the text to show just after the use count, if any.
  var string post_count = &quot;]&quot;;

  # Specify the title of your tag box!
  var string tag_title = &quot;Tags&quot;;

##### End Config #####

  var Page p = get_page();
  var string list = &quot;&quot;;    
  
  if (size $p-&amp;gt;visible_tag_list() &amp;gt; 0) { 
    if ($delimiter-&amp;gt;length() &amp;gt; 1) {
      $delimiter = $delimiter-&amp;gt;substr(0, 1);
    } 

    var string[] closing_html;
    var string[] prev_tags;
    var int tag_list_pos = 0;
    var string tier_code = &quot;&quot;;
    $closing_html[0] = &quot;&quot;;
    $prev_tags[0] = &quot;&quot;;
    foreach var TagDetail t ($p-&amp;gt;visible_tag_list()) {
      var string[] tags;
 
      if ($t.name) {  
        # mt:20050623
        # Split tags into array on delimiter. Oh god, my kingdom
        # for a function.  Stolen shamelessly from lj-user rane500.
        var int array_counter = 0;
        var string buffer = &quot;&quot;;
        foreach var string char ($t.name) {
          if($char == $delimiter) {
            $tags[$array_counter] = $buffer;
            $array_counter = $array_counter + 1;
            $buffer = &quot;&quot;;
          }
          else {
            $buffer = $buffer + $char;
          } 
        }  
        $tags[$array_counter] = $buffer;
  
        var int pos = 0;
        foreach var string tier($tags) {
          if (size $closing_html &amp;lt;= $pos) {
            # mt:20050623
            # $closing_html keeps track of html that is used to close off open
            # lists.  Its length must be kept &amp;gt;= to that of the current tag.
            $closing_html[$pos] = &quot;&quot;;
          }   

          if (size $prev_tags &amp;lt;= $pos) {
            # mt:20050625
            # The current tag has more tiers than the previous tag.  To avoid array
            # ref errors when comparing the current tier to the previous one (which
            # is non-existent, of course) add empty string to $prev_tags.
            $prev_tags[$pos] = &quot;&quot;;
          }
    
          # mt:20050623
          # If we&apos;re on a tag&apos;s last tier, we need to return a link to the tag,
          # otherwise plain text is returned.
          if (size $tags == ($pos + 1)) {
            $tier_code = &quot;&quot;&quot;&amp;lt;a rel=&quot;tag&quot; href=&quot;$t.url&quot;&amp;gt;$tier&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            if ($show_count) {
              $tier_code = $tier_code + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
            }
          }
          else {
            $tier_code = &quot;&quot;&quot;$tier&quot;&quot;&quot;;
          }

          # mt:20050625
          # $prev_tags stuffed with dummy empty string when it has fewer tiers than 
          # current tag.
          if ($prev_tags[$pos] == &quot;&quot;) {     
            # mt:20050623
            # The current tag has more tiers than the previous tag, so a new
            # list must be opened.  
            if (($tag_list_pos == 0) and ($pos == 0)) {
              # mt:20061216
              # The outermost ul is supplied later by print_sidebar_box,
              # so omit it from this stage.
              $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;sbaritem&quot;&amp;gt;$tier_code&quot;&quot;&quot;;                  
              $closing_html[$pos] = &quot;&amp;lt;/li&amp;gt;&quot;;  
            }
            else {
              $list = $list + &quot;&quot;&quot;&amp;lt;ul&amp;gt;&amp;lt;li class=&quot;sbaritem&quot;&amp;gt;$tier_code&quot;&quot;&quot;;                  
              $closing_html[$pos] = &quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&quot;;
            }
          }
          elseif ($tags[$pos] != $prev_tags[$pos]) {   
            # mt:20050623
            # The current tag&apos;s tier is not the same as the previous tag&apos;s tier of  
            # the same level.  This means we may need to close some lists.
            var int i = size $closing_html;
            foreach var string html ($closing_html) {
              if ($i &amp;gt; $pos) {
                $list = $list + $closing_html[$i];                                 
                # mt:20050623: As we append the closing code, pop it off the array.
                $closing_html[$i] = &quot;&quot;;
              }
              $i--;
            }                    
 
            if ($closing_html[$pos] == &quot;&quot;) {          
              # mt:20050623
              # This is the first tier at this level, so open list.
              $list = $list + &quot;&quot;&quot;&amp;lt;ul&amp;gt;&amp;lt;li class=&quot;sbaritem&quot;&amp;gt;$tier_code&quot;&quot;&quot;;
              $closing_html[$pos] = &quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&quot;;
            }
            else {              
              # mt:20050623
              # There have already been tiers added at this level, so just close the previous
              # list item before adding the new tier.
              $list = $list + &quot;&quot;&quot;&amp;lt;/li&amp;gt;&amp;lt;li class=&quot;sbaritem&quot;&amp;gt;$tier_code&quot;&quot;&quot;;
            }                    
          }
          else {
            # mt:20050623
            # The current tag&apos;s tier is exactly the same as the previous tag&apos;s tier at
            # this same level.  It has already been included in the list, so do nothing.
          }  
          # mt:20050623: Moving on to next tier in this tag!
          $pos++;
        }
        $prev_tags = $tags;           
      }        
      # mt:20050623: Next tag in the list!
      $tag_list_pos++;
    }  

    # mt:20050623
    # All the tags have been added so close all outstanding lists.
    var int i = 0;
    var string remaining_html = &quot;&quot;;
    foreach var string html ($closing_html) { 
      if ($html != &quot;&quot;) {
        $remaining_html = $html + $remaining_html;
        $closing_html[$i] = &quot;&quot;;
      }
      $i++;
    }
    $list = $list + $remaining_html;
  }

  if ($list != &quot;&quot;){
    $this-&amp;gt;lay_print_sidebox_top($tag_title);
    print &quot;&quot;&quot;&amp;lt;ul&amp;gt;&quot;&quot;&quot; + $list + &quot;&quot;&quot;&amp;lt/ul&amp;gt;&quot;&quot;&quot;;
    $this-&amp;gt;lay_print_sidebox_bottom();
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/69439.html?view=comments#comments</comments>
  <category>function lay_print_sidebar_freetextbox_2</category>
  <category>class page</category>
  <category>layout smoothsailing</category>
  <category>function print_custom_head</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>7</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/68721.html</guid>
  <pubDate>Tue, 05 Dec 2006 20:25:55 GMT</pubDate>
  <title>[theme] - [linkbar/metadata handling]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/68721.html</link>
  <description>to make sure that these work, make sure that the function that prints entries calls &lt;code&gt;Entry::print_linkbar()&lt;/code&gt; and &lt;code&gt;Entry::print_metadata()&lt;/code&gt;.  also make sure that &lt;code&gt;Entry::print_comment(Comment c)&lt;/code&gt; calls &lt;code&gt;Comment::print_linkbar()&lt;/code&gt;.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function Comment::print_linkbar() {
  var bool     add_links     = false;
  var bool     first_sep     = false;
  var bool     last_sep      = false;
  var string   img_id        = &quot;&quot;;
  var string   link_key      = &quot;&quot;;
  var string   link_link     = &quot;&quot;;
  var string   link_sep      = &quot;&quot;;
  var string   print         = &quot;&quot;;
  var string[] link_keyseq   = [];
  var string{} link_captions = {};
  var string{} link_images   = {};
  var string{} link_urls     = {};
  var Link     link          = new Link;

  # add a sep before the links?
  $first_sep = true;

  # add a sep after the links?
  $last_sep  = false;

  # define the sep
  $link_sep  = &quot;&quot;&quot; &amp;lt;span class=&quot;separator&quot;&amp;gt;|&amp;lt;/span&amp;gt; &quot;&quot;&quot;;

  # define the link order
  #   comment_reply    : reply to comment
  #   comment_parent   : parent of comment
  #   comment_thread   : comment thread
  #   delete_comment   : delete comment
  #   freeze_thread    : freeze thread
  #   permalink        : permalink of comment
  #   screen_comment   : screen comment
  #   unfreeze_thread  : unfreeze thread
  #   unscreen_comment : unscreen comment
  #   unwatch_thread   : untrack/unwatch thread
  #   watch_thread     : track/watch thread
  #   watching_parent  : tracking/watching parent of comment
  $link_keyseq = [ # comment_reply, comment_parent, comment_thread, permalink, delete_comment, freeze_thread, screen_comment, unscreen_comment, unfreeze_thread, unwatch_thread, watch_thread, watching_parent
                  &quot;comment_reply&quot;,
                  &quot;comment_parent&quot;,
                  &quot;comment_thread&quot;,
                  &quot;permalink&quot;,
                  &quot;delete_comment&quot;,
                  &quot;freeze_thread&quot;,
                  &quot;screen_comment&quot;,
                  &quot;unscreen_comment&quot;,
                  &quot;unfreeze_thread&quot;,
                  &quot;unwatch_thread&quot;,
                  &quot;watch_thread&quot;,
                  &quot;watching_parent&quot;,
                 ];

  # define the link images
  $link_images = {
                  &quot;permalink&quot;        =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/link.png&quot;,

                  &quot;nav_prev&quot;         =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/arrow_left.png&quot;,
                  &quot;edit_entry&quot;       =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/pencil.png&quot;,
                  &quot;edit_tags&quot;        =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/tag_blue_edit.png&quot;,
                  &quot;mem_add&quot;          =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/disk.png&quot;,
                  &quot;tell_friend&quot;      =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/email_go.png&quot;,
                  &quot;watch_comments&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_add.png&quot;,
                  &quot;unwatch_comments&quot; =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_delete.png&quot;,
                  &quot;nav_next&quot;         =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/arrow_right.png&quot;,

                  &quot;comment_frozen&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/comment_frozen.png&quot;,
                  &quot;comment_parent&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/arrow_up.png&quot;,
                  &quot;comment_reply&quot;    =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/comment_add.png&quot;,
                  &quot;comment_thread&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/comment.png&quot;,
                  &quot;delete_comment&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/cancel.png&quot;,
                  &quot;freeze_thread&quot;    =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/lightbulb_off.png&quot;,
                  &quot;screen_comment&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/eye_cross.png&quot;,
                  &quot;unscreen_comment&quot; =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/eye.png&quot;,
                  &quot;unfreeze_thread&quot;  =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/lightbulb.png&quot;,
                  &quot;unwatch_thread&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_delete.png&quot;,
                  &quot;watch_thread&quot;     =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_add.png&quot;,
                  &quot;watching_parent&quot;  =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_magnify.png&quot;,
                 };

  # define permalink data
  $link_key                  = &quot;permalink&quot;;
  $link_captions{$link_key}  = $*text_permalink;
  $link_urls{$link_key}      = $.permalink_url;

  # define reply link data
  $link_key                  = &quot;comment_reply&quot;;
  $link_captions{$link_key}  = $.frozen ? $*text_comment_frozen : $*text_comment_reply;
  $link_images{$link_key}    = $.frozen ? $link_images{&quot;comment_frozen&quot;} : $link_images{&quot;comment_reply&quot;};
  $link_urls{$link_key}      = $.frozen ? &quot;&quot; : $.reply_url;

  # define parent link data
  $link_key                  = &quot;comment_parent&quot;;
  $link_captions{$link_key}  = $*text_comment_parent;
  $link_urls{$link_key}      = $.parent_url;

  # define thread link data
  $link_key                  = &quot;comment_thread&quot;;
  $link_captions{$link_key}  = $*text_comment_thread;
  $link_urls{$link_key}      = $.thread_url;

  # if there aren&apos;t any links defined in the array, let&apos;s add &apos;em
  $add_links = (size($link_keyseq) &amp;lt; 1);

  # cycle thru links and gather data
  foreach $link_key ($.link_keyseq) {
    $link                            = $this-&amp;gt;get_link($link_key);
    $link_captions{$link_key}        = $link_captions{$link_key} != &quot;&quot; ? $link_captions{$link_key} : $link.caption;
    $link_images{$link_key}          = $link_images{$link_key}   != &quot;&quot; ? $link_images{$link_key}   : $link.icon.url;
    $link_urls{$link_key}            = $link_urls{$link_key}     != &quot;&quot; ? $link_urls{$link_key}     : $link.url;

    # if we&apos;re adding links
    if($add_links) {
      # add it to the array
      $link_keyseq[size($link_keyseq)] = $link_key;
    }
  }

  # give linkbar a css class
  $print = $print + &quot;&quot;&quot;&amp;lt;span class=&quot;comment-linkbar&quot;&amp;gt;&quot;&quot;&quot;;

  # if we&apos;ve got links to process
  if(size($link_keyseq) &amp;gt; 0) {
    # if we&apos;re adding a first sep
    if($first_sep) {
      # add it
      $print = $print + $link_sep;
    }

    # cycle thru links
    foreach $link_key ($link_keyseq) {
      var bool have_img = $link_images{$link_key} != &quot;&quot;; # do we have an image?
      var bool have_url = $link_urls{$link_key}   != &quot;&quot;; # do we have a url?
      var bool is_reply = $link_key == &quot;comment_reply&quot;;  # is this the reply link?

      if($have_url or $is_reply) {                       # if we have a url or it&apos;s the reply link
        if($have_url or ($is_reply and not $have_url)) { #   if we have a url, or it&apos;s the reply link without a url
          $link_link = $link_captions{$link_key};        #     set the link text
          if($have_img) {                                #     if we have an image
            if($link_key-&amp;gt;contains(&quot;freeze&quot;)) {          #       if it&apos;s the [un]freeze link
              $img_id = &quot;fuf&quot;;                           #         set img id prefix of &quot;fuf&quot;
            } elseif ($link_key-&amp;gt;contains(&quot;screen&quot;)) {   #       if it&apos;s the [un]screen link
              $img_id = &quot;sus&quot;;                           #         set img id prefix of &quot;sus&quot;
            } elseif ($link_key-&amp;gt;contains(&quot;watch&quot;)) {    #       if it&apos;s the [un]track/watch link
              $img_id = &quot;tut&quot;;                           #         set img id prefix of &quot;tut&quot;
            } else {                                     #       else, we&apos;re not doing a special image
              $img_id = &quot;&quot;;                              #         set img id prefix of nothing
            }

            if($img_id != &quot;&quot;) {                          #       if we have an img id prefix
              $img_id = &quot; id=\&quot;${img_id}_${.talkid}\&quot;&quot;;  #         set it up
            }

            # add the image
            $link_link = &quot;&quot;&quot;&amp;lt;img$img_id src=&quot;$link_images{$link_key}&quot; alt=&quot;$link_link&quot; title=&quot;$link_link&quot; border=&quot;0&quot; /&amp;gt;&quot;&quot;&quot;;
          }

          # if we have a url, apply it
          if($have_url) {
            $link_link = &quot;&quot;&quot;&amp;lt;a href=&quot;$link_urls{$link_key}&quot;&amp;gt;$link_link&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
          }

          # add a link sep
          $print     = $print + $link_link + $link_sep;

        } else {

          # else, we&apos;re doing the reply link with a url

          print $print; # print what we&apos;ve got
          $print = &quot;&quot;;  # set print var to nothing

          # create array for QR reply link
          var string{} opts = {};

          # if we have an image
          if($have_img) {
            $opts{&quot;img_url&quot;} = $link_images{$link_key};   # set image url
            $opts{&quot;alt&quot;}     = $link_captions{$link_key}; # set image alt
            $opts{&quot;title&quot;}   = $link_captions{$link_key}; # set image title
          } else {
            # else, we don&apos;t have an image
            $opts{&quot;linktext&quot;} = $link_captions{$link_key}; # set linktext
          }

          # set url
          $opts{&quot;reply_url&quot;} = $link_urls{$link_key};

          # print QR reply link
          $this-&amp;gt;print_reply_link($opts);

          # add a link sep
          $print = $print + $link_sep;
        }
      }
    }

    # if we don&apos;t have a sep on the end
    if(not $last_sep) {
      # hack it off
      $print = $print-&amp;gt;substr(0, $print-&amp;gt;length() - $link_sep-&amp;gt;length());
    }
  }

  # close span
  $print = $print + &quot;&amp;lt;/span&amp;gt;&quot;;

  # print linkbar
  print $print;

  # print reply container
  $this-&amp;gt;print_reply_container();
}

function CommentInfo::print() {
  # define a link sep
  var string link_sep = &quot;&quot;&quot; &amp;lt;span class=&quot;separator&quot;&amp;gt;|&amp;lt;/span&amp;gt; &quot;&quot;&quot;;

  var bool show_readlink = $.show_readlink;                   # are we showing the  link to read   comments?
  var bool show_postlink = $.show_postlink;                   # are we showing the  link to post a comment?
  var bool show_sep      = $show_readlink and $show_postlink; # are we showing both and therefore need a sep?

  # give comment links a css class
  &quot;&quot;&quot;&amp;lt;span class=&quot;entry-commentlinks&quot;&amp;gt;&quot;&quot;&quot;;

  # if we&apos;re showing the readlink
  if($show_readlink) {
    # print it
    $this-&amp;gt;print_readlink();
  }

  # if we&apos;re showing both links
  if($show_sep) {
    # print a sep
    print $link_sep;
  }

  # if we&apos;re showing the postlink
  if($show_postlink) {
    # print it
    $this-&amp;gt;print_postlink();
  }

  &quot;&amp;lt;/span&amp;gt;&quot;;
}

function CommentInfo::print_postlink() {
  # get page handle
  var Page   p         = get_page();

  # define image url for postlink
  var string image_url = &quot;http://mike.mm1swebcreations.com/lj/silk/comments_add.png&quot;;

  # get postlink url
  var string url       = $.post_url;

  # get postlink text
  var string text      = get_plural_phrase(0, &quot;text_post_comment&quot; + ($p.view == &quot;friends&quot; ? &quot;_friends&quot; : &quot;&quot;));

  # if we&apos;ve reached max comments
  if($.maxcomments) {
    $url  = &quot;&quot;;                  # clear url
    $text = $*text_max_comments; # set max comments text
  }

  # if we have a url
  if($url != &quot;&quot;) {
    # open it
    &quot;&quot;&quot;&amp;lt;a href=&quot;$url&quot;&amp;gt;&quot;&quot;&quot;;
  }

  # if we have an image
  if($image_url != &quot;&quot;) {
    # print it
    &quot;&quot;&quot;&amp;lt;img src=&quot;$image_url&quot; alt=&quot;$text&quot; title=&quot;$text&quot; border=&quot;0&quot; /&amp;gt;&quot;&quot;&quot;;
  } else {
    # else, print text
    print $text;
  }

  # if we have a url
  if($url != &quot;&quot;) {
    # close it
    &quot;&quot;&quot;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
  }

}

function CommentInfo::print_readlink() {
  # get page handle
  var Page   p         = get_page();

  # define image url for readlink
  var string image_url = &quot;http://mike.mm1swebcreations.com/lj/silk/comments.png&quot;;

  # get readlink url
  var string url       = $.read_url;

  # get readlink text
  var string text      = get_plural_phrase($.count, &quot;text_read_comments&quot; + ($p.view == &quot;friends&quot; ? &quot;_friends&quot; : &quot;&quot;));

  # if we have a url
  if($url != &quot;&quot;) {
    # open it
    &quot;&quot;&quot;&amp;lt;a href=&quot;$url&quot;&amp;gt;&quot;&quot;&quot;;
  }

  # if we have an image
  if($image_url != &quot;&quot;) {
    # print it
    &quot;&quot;&quot;&amp;lt;img src=&quot;$image_url&quot; alt=&quot;$text&quot; title=&quot;$text&quot; border=&quot;0&quot; /&amp;gt;&quot;&quot;&quot;;
  } else {
    # else, print text
    print $text;
  }

  # if we have a url
  if($url != &quot;&quot;) {
    # close it
    &quot;&quot;&quot;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
  }

}

function Entry::print_linkbar() {
  var Page     p             = get_page();

  var bool     add_links     = false;
  var bool     first_sep     = false;
  var bool     interentry    = ($p.view == &quot;entry&quot;) or ($p.view == &quot;reply&quot;);
  var bool     last_sep      = false;
  var string   link_key      = &quot;&quot;;
  var string   link_link     = &quot;&quot;;
  var string   link_sep      = &quot;&quot;;
  var string   print         = &quot;&quot;;
  var string[] link_keyseq   = [];
  var string{} link_captions = {};
  var string{} link_images   = {};
  var string{} link_urls     = {};
  var Link     link          = new Link;

  # add a sep before the links?
  $first_sep = true;

  # add a sep after the links?
  $last_sep  = false;

  # define the sep
  $link_sep  = &quot;&quot;&quot; &amp;lt;span class=&quot;separator&quot;&amp;gt;|&amp;lt;/span&amp;gt; &quot;&quot;&quot;;

  # define the link order
  #   edit_entry       : edit entry
  #   edit_tags        : edit tags
  #   mem_add          : add to memories
  #   nav_next         : next entry
  #   nav_prev         : previous entry
  #   permalink        : permalink of entry
  #   tell_friend      : tell a friend
  #   unwatch_comments : untrack/unwatch comments
  #   watch_comments   : track/watch comments
  $link_keyseq = [ # permalink, nav_prev, edit_entry, edit_tags, mem_add, tell_friend, watch_comments, unwatch_comments, nav_next
                  &quot;permalink&quot;,
                  &quot;nav_prev&quot;,
                  &quot;edit_entry&quot;,
                  &quot;edit_tags&quot;,
                  &quot;mem_add&quot;,
                  &quot;tell_friend&quot;,
                  &quot;watch_comments&quot;,
                  &quot;unwatch_comments&quot;,
                  &quot;nav_next&quot;,
                 ];

  # define the link images
  $link_images = {
                  &quot;permalink&quot;        =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/link.png&quot;,

                  &quot;nav_prev&quot;         =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/arrow_left.png&quot;,
                  &quot;edit_entry&quot;       =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/pencil.png&quot;,
                  &quot;edit_tags&quot;        =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/tag_blue_edit.png&quot;,
                  &quot;mem_add&quot;          =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/disk.png&quot;,
                  &quot;tell_friend&quot;      =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/email_go.png&quot;,
                  &quot;watch_comments&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_add.png&quot;,
                  &quot;unwatch_comments&quot; =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_delete.png&quot;,
                  &quot;nav_next&quot;         =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/arrow_right.png&quot;,

                  &quot;comment_parent&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/arrow_up.png&quot;,
                  &quot;comment_reply&quot;    =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/comment_add.png&quot;,
                  &quot;comment_thread&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/comment.png&quot;,
                  &quot;delete_comment&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/cancel.png&quot;,
                  &quot;freeze_thread&quot;    =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/lightbulb_off.png&quot;,
                  &quot;screen_comment&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/eye_cross.png&quot;,
                  &quot;unscreen_comment&quot; =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/eye.png&quot;,
                  &quot;unfreeze_thread&quot;  =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/lightbulb.png&quot;,
                  &quot;unwatch_thread&quot;   =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_delete.png&quot;,
                  &quot;watch_thread&quot;     =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_add.png&quot;,
                  &quot;watching_parent&quot;  =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_magnify.png&quot;,
                 };

  # if there aren&apos;t any links defined in the array, let&apos;s add &apos;em
  $add_links = (size($link_keyseq) &amp;lt; 1);

  # define permalink data
  $link_key                  = &quot;permalink&quot;;
  $link_captions{$link_key}  = $*text_permalink;
  $link_urls{$link_key}      = $.permalink_url;

  # if we&apos;re viewing an entry
  if($interentry) {
    # get previous entry link data
    $link_key                        = &quot;nav_prev&quot;;
    $link                            = $this-&amp;gt;get_link($link_key);
    $link_captions{$link_key}        = $link_captions{$link_key} != &quot;&quot; ? $link_captions{$link_key} : $link.caption;
    $link_images{$link_key}          = $link_images{$link_key}   != &quot;&quot; ? $link_images{$link_key}   : $link.icon.url;
    $link_urls{$link_key}            = $link_urls{$link_key}     != &quot;&quot; ? $link_urls{$link_key}     : $link.url;

    # if we&apos;re adding links
    if($add_links) {
      # add it to the array
      $link_keyseq[size($link_keyseq)] = $link_key;
    }
  }

  # cycle thru links and gather data
  foreach $link_key ($.link_keyseq) {
    $link                            = $this-&amp;gt;get_link($link_key);
    $link_captions{$link_key}        = $link_captions{$link_key} != &quot;&quot; ? $link_captions{$link_key} : $link.caption;
    $link_images{$link_key}          = $link_images{$link_key}   != &quot;&quot; ? $link_images{$link_key}   : $link.icon.url;
    $link_urls{$link_key}            = $link_urls{$link_key}     != &quot;&quot; ? $link_urls{$link_key}     : $link.url;

    # if we&apos;re adding links
    if($add_links) {
      # add it to the array
      $link_keyseq[size($link_keyseq)] = $link_key;
    }
  }

  # if we&apos;re viewing an entry
  if($interentry) {
    # get next entry link data
    $link_key                        = &quot;nav_next&quot;;
    $link                            = $this-&amp;gt;get_link($link_key);
    $link_captions{$link_key}        = $link_captions{$link_key} != &quot;&quot; ? $link_captions{$link_key} : $link.caption;
    $link_images{$link_key}          = $link_images{$link_key}   != &quot;&quot; ? $link_images{$link_key}   : $link.icon.url;
    $link_urls{$link_key}            = $link_urls{$link_key}     != &quot;&quot; ? $link_urls{$link_key}     : $link.url;

    # if we&apos;re adding links
    if($add_links) {
      # add it to the array
      $link_keyseq[size($link_keyseq)] = $link_key;
    }
  }

  # give linkbar a css class
  $print = $print + &quot;&quot;&quot;&amp;lt;span class=&quot;entry-linkbar&quot;&amp;gt;&quot;&quot;&quot;;

  # if we&apos;ve got links to process
  if(size($link_keyseq) &amp;gt; 0) {
    # if we&apos;re adding a first sep
    if($first_sep) {
      # add it
      $print = $print + $link_sep;
    }

    # cycle thru links
    foreach $link_key ($link_keyseq) {
      var bool have_img = $link_images{$link_key} != &quot;&quot;; # do we have an image?
      var bool have_url = $link_urls{$link_key}   != &quot;&quot;; # do we have a url?

      # if we have a url
      if($have_url) {
        # set the link text
        $link_link = $link_captions{$link_key};

        # if we have an image
        if($have_img) {
          # add the image
          $link_link = &quot;&quot;&quot;&amp;lt;img src=&quot;$link_images{$link_key}&quot; alt=&quot;$link_link&quot; title=&quot;$link_link&quot; border=&quot;0&quot; /&amp;gt;&quot;&quot;&quot;;
        }
        
        # if we have a url, apply it
        $link_link = &quot;&quot;&quot;&amp;lt;a href=&quot;$link_urls{$link_key}&quot;&amp;gt;$link_link&amp;lt;/a&amp;gt;&quot;&quot;&quot;;

        # add a link sep
        $print     = $print + $link_link + $link_sep;
      }
    }

    # if we don&apos;t have a sep on the end
    if(not $last_sep) {
      # hack it off
      $print = $print-&amp;gt;substr(0, $print-&amp;gt;length() - $link_sep-&amp;gt;length());
    }
  }

  # close span
  $print = $print + &quot;&amp;lt;/span&amp;gt;&quot;;

  # print linkbar
  print $print;
}

function Entry::print_metadata() {
  var string[] metadata    = [];
  var string{} meta_images = {};
  var string{} meta_labels = {};

  # define the meta order
  #   location : current location
  #   mood     : current mood
  #   music    : current music
  #   tags     : current tags
  $metadata    = [ # location, mood, music, tags
                  &quot;location&quot;,
                  &quot;mood&quot;,
                  &quot;music&quot;,
                  &quot;tags&quot;
                 ];

  # define the meta labels
  $meta_labels = {
                  &quot;location&quot;        =&amp;gt; lang_metadata_title(&quot;location&quot;),
                  &quot;mood&quot;            =&amp;gt; lang_metadata_title(&quot;mood&quot;),
                  &quot;music&quot;           =&amp;gt; lang_metadata_title(&quot;music&quot;),
                  &quot;picture_keyword&quot; =&amp;gt; &quot;Picture Keyword:&quot;,
                  &quot;tags&quot;            =&amp;gt; &quot;Current Tags:&quot;,
                 };

  # define the meta images
  $meta_images = {
                  &quot;location&quot;        =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/map_magnify.png&quot;,
                  &quot;mood&quot;            =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/user.png&quot;,
                  &quot;music&quot;           =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/music.png&quot;,
                  &quot;picture_keyword&quot; =&amp;gt; &quot;&quot;,
                  &quot;tags&quot;            =&amp;gt; &quot;http://mike.mm1swebcreations.com/lj/silk/tag_blue.png&quot;,
                 };

  var string   currents_open    = &quot;&quot;&quot;&amp;lt;div class=&quot;entry-metadata&quot;&amp;gt;&quot;&quot;&quot;; # html to open  metadata container
  var string   meta_label_open  = &quot;&quot;&quot;&amp;lt;div&amp;gt;&amp;lt;b&amp;gt;&quot;&quot;&quot;;                     # html to open  metadata label
  var string   meta_label_close = &quot;&quot;&quot;&amp;lt;/b&amp;gt;&quot;&quot;&quot;;                         # html to close metadata label
  var string   meta_val_open    = &quot; &quot;;                                # html to open  metadata value
  var string   meta_val_close   = &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;                       # html to close metadata value
  var string   currents_close   = &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;                       # html to close metadata container
  var bool     vanilla_loc      = false;                              # strip current location value?

  var bool     have_meta        = (size($.metadata) &amp;gt; 0);                # do we have meta?
  var bool     have_tags        = ((size($.tags) &amp;gt; 0) and $*tags_aware); # do we have tags?
  var int      tcount           = 0;
  var string   currents         = &quot;&quot;;
  var string   image            = &quot;&quot;;
  var string   k                = &quot;&quot;;
  var string   label            = &quot;&quot;;
  var string   meta             = &quot;&quot;;
  var string   tag              = &quot;&quot;;
  var string   val              = &quot;&quot;;
  var Tag      t                = new Tag;

  # if we have meta or we have tags
  if($have_meta or $have_tags) {
    # add opening of metadata container
    $currents = $currents + $currents_open;


    # cycle thru meta
    foreach $k ($metadata) {
      $label = $meta_labels{$k} != &quot;&quot; ? $meta_labels{$k} : lang_metadata_title($k); # get label
      $image = $meta_images{$k} != &quot;&quot; ? $meta_images{$k} : &quot;&quot;;                      # get image
      $val   = $.metadata{$k};                                                      # get value

      # if we have an image
      if($image != &quot;&quot;) {
        # add it
        $label = &quot;&quot;&quot;&amp;lt;img src=&quot;$image&quot; alt=&quot;$label&quot; title=&quot;$label&quot; /&amp;gt;&quot;&quot;&quot;;
      }

      # if we&apos;re doing the location and we&apos;re stripping t
      if(($k == &quot;location&quot;) and $vanilla_loc) {
        # do it
        $val = striphtml($val);
      }

      # this piece of meta has a specific class
      $meta_label_open = &quot;&quot;&quot;&amp;lt;div class=&quot;current$k&quot;&amp;gt;&amp;lt;b&amp;gt;&quot;&quot;&quot;;

      # if we&apos;re doing tags
      if($k == &quot;tags&quot;) {
        # clear val
        $val = &quot;&quot;;

        # if we have tags
        if($have_tags) {
          # cycle thru tags
          foreach $t ($.tags) {
            $tag = &quot;&quot;&quot;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$t.name&amp;lt;/a&amp;gt;&quot;&quot;&quot;; # build tag
            $val = $val + $tag;                        # add tag to val
            $tcount++;                                 # increment tag counter

            # if current count is less than the size of the tags
            if($tcount &amp;lt; size($.tags)) {
              # add a sep
              $val = $val + &quot;, &quot;;
            }
          }
        }
      }

      # if we have a val
      if($val != &quot;&quot;) {
        # build meta row
        $meta   = $meta_label_open + $label + $meta_label_close + $meta_val_open + $val + $meta_val_close;
      }

      # add meta
      $currents = $currents + $meta;
    }

    # add closing of metadata container
    $currents = $currents + $currents_close;
  }

  # print metadata
  print $currents;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/68721.html?view=comments#comments</comments>
  <category>class comment</category>
  <category>function print_metadata</category>
  <category>class entry</category>
  <category>function print_linkbar</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>10</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/68607.html</guid>
  <pubDate>Sun, 03 Dec 2006 22:50:55 GMT</pubDate>
  <title>[theme] - [lickable] - [multi-level tags]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/68607.html</link>
  <description>in response to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;sreya&quot; lj:user=&quot;sreya&quot; &gt;&lt;a href=&quot;https://sreya.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://sreya.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;sreya&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2lickable&quot; lj:user=&quot;s2lickable&quot; &gt;&lt;a href=&quot;https://s2lickable.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://s2lickable.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2lickable&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://community.livejournal.com/s2lickable/18152.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function Page::lay_print_custom_paraphernalia() {
    var string id      = &quot;&quot;;
    var string header  = &quot;&quot;;
    var string content = &quot;&quot;;
    
    # tagslist

    #####   Config   #####

    # Specify your delimiter!  One char only -- extra chars get truncated.
    # Making the delimiter an empty string will result in an un-tiered list, 
    # which may be what you prefer, but this code is serious overkill for 
    # that purpose.
    var string delimiter = &quot;:&quot;;

    # Specify the title of your tag box!
    var string tag_title = &quot;Tags&quot;;

    ##### End Config #####

    var Page p = get_page();
    var string list = &quot;&quot;;
    
    # mt:20050627
    # Replaced erroneous return code with if statement (otherwise
    # entire sidebar not printed at all if no visible tags!).
    if (size $this-&amp;gt;visible_tag_list() &amp;gt; 0) { 
        # mt:20050624
        # Can&apos;t use delimiter longer than one char, so truncate if necessary.
        if ($delimiter-&amp;gt;length() &amp;gt; 1) {
            $delimiter = $delimiter-&amp;gt;substr(0, 1);
        }

        var bool list_started = false;
        var string list_item = &quot;&quot;;
        var string[] prev_tags = [&quot;&quot;, &quot;&quot;];

        # mt:20050624: Start the list.
        $list = &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot;; 
        
        foreach var TagDetail t ($this-&amp;gt;visible_tag_list()) {        
            var string[] tags;
             
            if ($t.name) {  
                # mt:20050624
                # Split tags into a 1- or 2-element array on delimiter. Oh god, my
                # kingdom for a function.  Adapted from lj-user rane500&apos;s explode 
                # function to only care about first instance of the delimiter.
                var int array_counter = 0;
                var string buffer = &quot;&quot;;
                var bool found_delimiter = false;
                foreach var string char ($t.name) {
                    if (($found_delimiter == false) and ($char == $delimiter)) {
                        $found_delimiter = true;
                        $tags[$array_counter] = $buffer;
                        $array_counter = $array_counter + 1;
                        $buffer = &quot;&quot;;
                    } else {
                        $buffer = $buffer + $char;
                    } 
                }  
                $tags[$array_counter] = $buffer;
                
                # mt:20050624: Now examine the tags array to determine how to display the tag.
                if (size $tags == 1) {
                    # mt:20050624: This tag has no subtag.
        
                    if ($list_started) {
                        # mt:20050624: Previous tag had a subtag, so must close its outstanding list. 
                        $list = $list + &quot;&quot;&quot;&amp;lt;/ul&amp;gt;&quot;&quot;&quot;;
                        $list_started = false;
                    }
                    if ($prev_tags[0] != &quot;&quot;) {
                        # mt:20050624: This is not the very first tag in the list, so close off previous tag.
                        $list = $list + &quot;&quot;&quot;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;
                    }
                    # mt:20050624: Now add the new tag.
                    $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$tags[0]&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
                } else {   
                    # mt:20050624: This tag has a subtag.
        
                    $list_item = &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$tags[1]&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;
                   
                    if (($tags[0] == $prev_tags[0]) and ($list_started)) {
                        # mt:20050624
                        # This tag fits under the previous tag&apos;s tier, and it is not the first item in that tier.
                        $list = $list + $list_item;
                    } elseif (($tags[0] == $prev_tags[0]) and ($list_started == false)) {
                        # mt:20050624
                        # This tag fits under the previous tag&apos;s tier, and it is the very first item in that tier.
                        $list = $list + &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot; + $list_item;
                        $list_started = true;
                    } elseif (($tags[0] != $prev_tags[0]) and ($list_started)) {
                        # mt:20050624: This tag initializes a new tier and must also close off the previous tag&apos;s list.
                        # $list_started retains its true state.
                        $list = $list + &quot;&quot;&quot;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tags[0]&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot; + $list_item;
                    } elseif (($tags[0] != $prev_tags[0]) and ($list_started == false)) {
                        # mt:20050624: This tag initializes a new tier but does not have to close off a list.
                        
                        if ($prev_tags[0] != &quot;&quot;) {
                            # mt:20050624: This is not the very first tag in the list, so close off previous tag.
                            $list = $list + &quot;&quot;&quot;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;
                        }
                        
                        # mt:20050624: Now add the new tag.
                        $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tags[0]&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot; + $list_item;
                        $list_started = true;
                    }
                }       
                $prev_tags = $tags;           
            }        
            # mt:20050623: Next tag in the list!
        } 
    
        # mt:20050624: Close any outstanding lists.
        if ($list_started) {
            $list = $list + &quot;&quot;&quot;&amp;lt;/ul&amp;gt;&quot;&quot;&quot;;
        }	   
    	$list = $list + &quot;&quot;&quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&quot;&quot;&quot;;
	   
        $list = &quot;&quot;&quot;&amp;lt;div class=&quot;tagBox&quot;&amp;gt;&quot;&quot;&quot; + $list + &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
    }

    $header  = $tag_title;
    $id      = &quot;tagslist&quot;;
    $content = $list;

    paraphernalia_box_open ($id, $header);
    print $content;
    paraphernalia_box_close($id, $header);
}

function Page::print_custom_head() {
  &quot;&quot;&quot;
  &amp;lt;style type=&quot;text/css&quot;&amp;gt;

  /* List Alignment */
  /* Styles to ensure that the tag list is correctly aligned beneath the sidebox title */
  li.tagBox {
    padding-left: 0;
    margin-left:  0;
    list-style:   none;
  }
  ul.tagList {
    padding-left: 0;
    margin-left:  0;
    list-style:   none;
  }
  li.tagItem {
    padding-left: 15px;
    list-style:   none;
  }
    
  /* Vertical Scroll */
  /* Need to shrink the list width to prevent horizontal scrollbar in Firefox. */
  /* Note this won&apos;t prevent it if your tags are super long, it will only */
  /* prevent it from displaying unnecessarily. For the pleasure of IE users */
  /* you can also colour any resulting scrollbars as you desire. */ 
  ul.tagList {
    width: 90%;
  }
  .tagBox {
    height:                     200px;
    overflow:                   auto;
    scrollbar-arrow-color:      #dae3b2;
    scrollbar-base-color:       #ffffcc;
    scrollbar-face-color:       #ffffcc;
    scrollbar-highlight-color:  #dae3b2;
    scrollbar-darkshadow-color: #dae3b2;
    scrollbar-shadow-color:     #dae3b2;
  }
  &amp;lt;/style&amp;gt;
  &quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/68607.html?view=comments#comments</comments>
  <category>class page</category>
  <category>layout lickable</category>
  <category>function lay_print_custom_paraphernalia</category>
  <category>function print_custom_head</category>
  <media:title type="plain">freezepop - get ready 2 rokk</media:title>
  <lj:music>freezepop - get ready 2 rokk</lj:music>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>3</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/67889.html</guid>
  <pubDate>Fri, 01 Sep 2006 17:28:32 GMT</pubDate>
  <title>[theme - quitelickable - mood icon to left of metadata]</title>
  <author>girlboheme</author>
  <link>https://s2layers.livejournal.com/67889.html</link>
  <description>This code is &lt;span class=&quot;&quot;&gt;&lt;img style=&quot;VERTICAL-ALIGN: bottom&quot; height=&quot;17&quot; alt=&quot;&quot; width=&quot;17&quot; src=&quot;https://www.livejournal.com/stc/fck/editor/plugins/livejournal/userinfo.gif&quot; /&gt;kunzite1&lt;/span&gt;&apos;s code for Boxer, just tweaked a teensy bit by me to work with Quite Lickable. So just credit him with it. I was just saving him the trouble. Thanks. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;function Entry::lay_print_metadata() {&lt;br /&gt;var string tags_header&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &quot;Tags&quot;; # text for tags header,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;Current Tags&quot;&lt;br /&gt;var string tags_joiner&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &quot;&quot;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# text for tags joiner,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;:&quot;&lt;br /&gt;var string tags_sep&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= &quot;, &quot;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # text for tags separator, &quot;, &quot;&lt;br /&gt;var bool&amp;nbsp;&amp;nbsp; show_edit_tags_link = false;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# set to true if you want edit tags link as tags header&lt;br /&gt;var string currents_open&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &quot;&quot;&quot;&amp;lt;div class=&quot;metadata&quot;&amp;gt;&quot;&quot;&quot;; # html for opening of currents container&lt;br /&gt;var string currents_close&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;; # html for closing of currents container&lt;br /&gt;var bool&amp;nbsp;&amp;nbsp; loc_after_mood&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= false;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # set to true to print location after mood&lt;br /&gt;var bool&amp;nbsp;&amp;nbsp; vanilla_loc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = false;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # set to true to delinkify location&lt;br /&gt;# if you need data specific to the meta to be in these strings you&apos;ll have to set those individually down further&lt;br /&gt;# one example is provided with meta_label_open&lt;br /&gt;var string meta_label_open&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &quot;&quot;&quot;&amp;lt;strong&amp;gt;&quot;&quot;&quot;;&amp;nbsp;&amp;nbsp; # html for opening of metadata label&lt;br /&gt;var string meta_label_close&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= &quot;&quot;&quot;&amp;lt;/strong&amp;gt;: &quot;&quot;&quot;; # html for closing of metadata label&lt;br /&gt;var string meta_val_open&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &quot;&quot;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # html for opening of metadata value&lt;br /&gt;var string meta_val_close&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= &quot;&quot;&quot;&amp;lt;br /&amp;gt;&quot;&quot;&quot;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # html for closing of metadata value&lt;br /&gt;var Link&amp;nbsp;&amp;nbsp; edit_tags&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $this-&amp;gt;get_link(&quot;edit_tags&quot;); # helper var to see if remote user can edit tags&lt;br /&gt;if ((size $.metadata &amp;gt; 0) or ((size $.tags &amp;gt; 0) and ($*tags_aware))){&lt;br /&gt;if($.metadata{&quot;mood&quot;} == &quot;&quot; and $loc_after_mood) {&lt;br /&gt;# if we&apos;re printing loc after mood but we have no mood, set loc_after_mood to false&lt;br /&gt;$loc_after_mood = false;&lt;br /&gt;}&lt;br /&gt;var string currents = &quot;&quot;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # make var for printing&lt;br /&gt;$currents&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $currents_open; # add opening of currents container&lt;br /&gt;if(defined $.mood_icon) {&lt;br /&gt;var Image i = $.mood_icon;&lt;br /&gt;$currents = $currents + &quot;&quot;&quot;&amp;lt;table border=&quot;0&quot;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;img src=&quot;$i.url&quot; _fcksavedurl=&quot;$i.url&quot; width=&quot;$i.width&quot; height=&quot;$i.height&quot; alt=&quot;$.metadata{&quot;mood&quot;}&quot; title=&quot;$.metadata{&quot;mood&quot;}&quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&quot;&quot;&quot;;&lt;br /&gt;}&lt;br /&gt;foreach var string k ($.metadata){&amp;nbsp;&amp;nbsp;# step thru metadata&lt;br /&gt;var string text = $k;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # set text to key&lt;br /&gt;var string val&amp;nbsp;&amp;nbsp;= $.metadata{$k}; # get val&lt;br /&gt;if ($k == &quot;mood&quot;){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# if mood, set text to mood property&lt;br /&gt;$text = $*text_meta_mood;&lt;br /&gt;}&lt;br /&gt;elseif ($k == &quot;music&quot;) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# if music, set text to music property&lt;br /&gt;$text = $*text_meta_music;&lt;br /&gt;} elseif ($k == &quot;location&quot;) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # if location, set text to loc variable&lt;br /&gt;$text = $*text_meta_location;&lt;br /&gt;if($vanilla_loc) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# if vanilla loc, striphtml() it&lt;br /&gt;$val = striphtml($val);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(not ($k == &quot;location&quot; and $loc_after_mood)) {&lt;br /&gt;# if we&apos;re doing loc right now and printing loc after mood, skip it&lt;br /&gt;# if we&apos;re doing loc right now and we&apos;re not printing loc after mood, print it now&lt;br /&gt;# if we&apos;re not doing loc right now, print this piece of meta&lt;br /&gt;# add the meta&lt;br /&gt;$currents = $currents + &quot;&quot;&quot;$meta_label_open$text$meta_label_close$meta_val_open$val$meta_val_close&quot;&quot;&quot;;&lt;br /&gt;}&lt;br /&gt;if($k == &quot;mood&quot; and $loc_after_mood) {&lt;br /&gt;# if we just now did the mood and we&apos;re printing loc after mood, print the loc&lt;br /&gt;$k&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= &quot;location&quot;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # set meta key to &quot;location&quot;&lt;br /&gt;$text = $*text_meta_location; # set text to loc variable&lt;br /&gt;$val&amp;nbsp;&amp;nbsp;= $.metadata{$k};&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # get val&lt;br /&gt;# if we have a loc, do stuff&lt;br /&gt;if($val != &quot;&quot;) {&lt;br /&gt;# if vanilla loc, striphtml() it&lt;br /&gt;if($vanilla_loc) {&lt;br /&gt;$val = striphtml($val);&lt;br /&gt;}&lt;br /&gt;# add the meta&lt;br /&gt;$currents&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $currents + &quot;&quot;&quot;$meta_label_open$text$meta_label_close$meta_val_open$val$meta_val_close&quot;&quot;&quot;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if ((size $.tags &amp;gt; 0) and $*tags_aware) {&lt;br /&gt;var string k&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= &quot;tags&quot;; # set key to &quot;tags&quot;&lt;br /&gt;var int tcount = 0; # set counter for tags&lt;br /&gt;if($edit_tags.url != &quot;&quot; and $show_edit_tags_link) { # if remote user can edit tags, let&apos;s give them a link&lt;br /&gt;$tags_header = &quot;&quot;&quot;&amp;lt;a href=&quot;$edit_tags.url&quot; _fcksavedurl=&quot;$edit_tags.url&quot;&amp;gt;$tags_header&amp;lt;/a&amp;gt;&quot;&quot;&quot;;&lt;br /&gt;}&lt;br /&gt;# add text, open val container&lt;br /&gt;$currents = $currents + &quot;&quot;&quot;$meta_label_open$tags_header$tags_joiner$meta_label_close$meta_val_open&quot;&quot;&quot;;&lt;br /&gt;# build tag list&lt;br /&gt;foreach var Tag t ($.tags) {&lt;br /&gt;$currents = $currents + &quot;&quot;&quot;&amp;lt;a rel=&quot;tag&quot; href=&quot;$t.url&quot; _fcksavedurl=&quot;$t.url&quot;&amp;gt;$t.name&amp;lt;/a&amp;gt;&quot;&quot;&quot;;&lt;br /&gt;$tcount++;&lt;br /&gt;# if we haven&apos;t hit the last tag, add a separator&lt;br /&gt;if ($tcount != size $.tags) { $currents = $currents + $tags_sep; }&lt;br /&gt;}&lt;br /&gt;# close val container&lt;br /&gt;$currents = $currents + $meta_val_close;&lt;br /&gt;}&lt;br /&gt;if(defined $.mood_icon) {&lt;br /&gt;$currents = $currents + &quot;&quot;&quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&quot;&quot;&quot;;&lt;br /&gt;}&lt;br /&gt;# close currents container&lt;br /&gt;$currents = $currents + $currents_close;&lt;br /&gt;# print currents&lt;br /&gt;println &quot;$currents&quot;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;strong&gt;TO CUSTOMIZE CSS:&lt;/strong&gt; &lt;br /&gt;&lt;code&gt;.metadata{ &lt;br /&gt;list-style: none; &lt;br /&gt;display: block; &lt;br /&gt;} &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;note to&amp;nbsp;&lt;span class=&quot;&quot;&gt;&lt;img style=&quot;VERTICAL-ALIGN: bottom&quot; height=&quot;17&quot; alt=&quot;&quot; width=&quot;17&quot; src=&quot;/stc/fck/editor/plugins/livejournal/userinfo.gif&quot; /&gt;kunzite1&lt;/span&gt; :&lt;/strong&gt; &lt;br /&gt;I hope that this was okay :) and if it looks horrible, feel free to delete and repost it.&amp;nbsp; I just wanted to share it.&amp;nbsp; thanks.&amp;lt;/div&amp;gt;</description>
  <comments>https://s2layers.livejournal.com/67889.html?view=comments#comments</comments>
  <category>function print_metadata</category>
  <category>class entry</category>
  <lj:security>public</lj:security>
  <lj:poster>girlboheme</lj:poster>
  <lj:posterid>7862713</lj:posterid>
  <lj:reply-count>3</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/67468.html</guid>
  <pubDate>Sun, 20 Aug 2006 02:01:06 GMT</pubDate>
  <title>[theme] - [smoothsailing] - [mood icon to left of metadata]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/67468.html</link>
  <description>&lt;pre&gt;&lt;code&gt;# add colons because hard-coding it is silly
set text_meta_location          = &quot;Location:&quot;;
set text_meta_mood              = &quot;Mood:&quot;;
set text_meta_music             = &quot;Music:&quot;;
set layout_arrangement_metadata = &quot;block&quot;;

function Entry::print_metadata() {
  var string tags_header         = &quot;Tags&quot;; # text for tags header,    &quot;Current Tags&quot;
  var string tags_joiner         = &quot;:&quot;;            # text for tags joiner,    &quot;:&quot;
  var string tags_sep            = &quot;, &quot;;           # text for tags separator, &quot;, &quot;
  var bool   show_edit_tags_link = false;          # set to true if you want edit tags link as tags header

  var string currents_open       = &quot;&quot;&quot;&amp;lt;div class=&quot;entryMetadata&quot;&amp;gt;&amp;lt;ul&amp;gt;&quot;&quot;&quot;; # html for opening of currents container
  var string currents_close      = &quot;&quot;&quot;&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&quot;&quot;&quot;; # html for closing of currents container

  var bool   loc_after_mood      = false;               # set to true to print location after mood
  var bool   vanilla_loc         = false;               # set to true to delinkify location

  # if you need data specific to the meta to be in these strings you&apos;ll have to set those individually down further
  # one example is provided with meta_label_open
  var string meta_label_open     = &quot;&quot;&quot;&amp;lt;li&amp;gt;&amp;lt;span class=&quot;entryMetadata-label&quot;&amp;gt;&quot;&quot;&quot;;   # html for opening of metadata label
  var string meta_label_close    = &quot;&quot;&quot;&amp;lt;/span&amp;gt;&quot;&quot;&quot;; # html for closing of metadata label
  var string meta_val_open       = &quot;&quot;&quot;&amp;lt;span class=&quot;entryMetadata-content&quot;&amp;gt;&quot;&quot;&quot;;               # html for opening of metadata value
  var string meta_val_close      = &quot;&quot;&quot;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;     # html for closing of metadata value

  var Link   edit_tags           = $this-&amp;gt;get_link(&quot;edit_tags&quot;); # helper var to see if remote user can edit tags

  if (((size $.metadata &amp;gt; 0) or ((size $.tags &amp;gt; 0) and ($*tags_aware))) and ($.itemid != int($*layout_guestbook_entryid))) {
    if($.metadata{&quot;mood&quot;} == &quot;&quot; and $loc_after_mood) {
      # if we&apos;re printing loc after mood but we have no mood, set loc_after_mood to false
      $loc_after_mood = false;
    }
    var string currents = &quot;&quot;;             # make var for printing

    if(defined $.mood_icon) {
      var Image i = $.mood_icon;
      $currents = $currents + &quot;&quot;&quot;&amp;lt;table border=&quot;0&quot;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;img src=&quot;$i.url&quot; width=&quot;$i.width&quot; height=&quot;$i.height&quot; alt=&quot;$.metadata{&quot;mood&quot;}&quot; title=&quot;$.metadata{&quot;mood&quot;}&quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&quot;&quot;&quot;;
    }

    $currents           = $currents + $currents_open; # add opening of currents container

    foreach var string k ($.metadata){  # step thru metadata
      var string text = $k;             # set text to key
      var string val  = $.metadata{$k}; # get val
      if ($k == &quot;mood&quot;){                # if mood, set text to mood property
        $text = $*text_meta_mood;
      } 
      elseif ($k == &quot;music&quot;) {          # if music, set text to music property
        $text = $*text_meta_music;
      } elseif ($k == &quot;location&quot;) {     # if location, set text to loc variable
        $text = $*text_meta_location;
        if($vanilla_loc) {              # if vanilla loc, striphtml() it
          $val = striphtml($val);
        }
      }
      if(not ($k == &quot;location&quot; and $loc_after_mood)) {
        # if we&apos;re doing loc right now and printing loc after mood, skip it
        # if we&apos;re doing loc right now and we&apos;re not printing loc after mood, print it now
        # if we&apos;re not doing loc right now, print this piece of meta

        # add the meta
        $currents = $currents + &quot;&quot;&quot;$meta_label_open$text$meta_label_close$meta_val_open$val$meta_val_close&quot;&quot;&quot;;
      }

      if($k == &quot;mood&quot; and $loc_after_mood) {
        # if we just now did the mood and we&apos;re printing loc after mood, print the loc
        $k    = &quot;location&quot;;           # set meta key to &quot;location&quot;
        $text = $*text_meta_location; # set text to loc variable
        $val  = $.metadata{$k};       # get val

        # if we have a loc, do stuff
        if($val != &quot;&quot;) {

          # if vanilla loc, striphtml() it
          if($vanilla_loc) {
            $val = striphtml($val);
          }

          # in this layout, each piece of meta gets its own class
          $meta_label_open  = &quot;&quot;&quot;&amp;lt;div class=&quot;current$k&quot;&amp;gt;&amp;lt;strong&amp;gt;&quot;&quot;&quot;;

          # add the meta
          $currents         = $currents + &quot;&quot;&quot;$meta_label_open$text$meta_label_close$meta_val_open$val$meta_val_close&quot;&quot;&quot;;
        }
      }
    }
    if ((size $.tags &amp;gt; 0) and ($*tags_aware) and ($*layout_position_entrytags == &quot;metadata&quot;)) {
      var string k      = &quot;tags&quot;; # set key to &quot;tags&quot;

      var int tcount = 0; # set counter for tags
      if($edit_tags.url != &quot;&quot; and $show_edit_tags_link) { # if remote user can edit tags, let&apos;s give them a link
        $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;;
      }

      # add text, open val container
      $currents = $currents + &quot;&quot;&quot;$meta_label_open$tags_header$tags_joiner$meta_label_close$meta_val_open&quot;&quot;&quot;;

      # build tag list
      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 we haven&apos;t hit the last tag, add a separator
        if ($tcount != size $.tags) { $currents = $currents + $tags_sep; }
      }

      # close val container
      $currents = $currents + $meta_val_close;
    }

    # close currents container
    $currents = $currents + $currents_close;

    if(defined $.mood_icon) {
      $currents = $currents + &quot;&quot;&quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&quot;&quot;&quot;;
    }

    # print currents
    println &quot;$currents&quot;;
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/67468.html?view=comments#comments</comments>
  <category>function print_metadata</category>
  <category>class entry</category>
  <category>layout smoothsailing</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>25</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/66931.html</guid>
  <pubDate>Tue, 15 Aug 2006 07:02:10 GMT</pubDate>
  <title>[theme - generator - mood icon to left of metadata]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/66931.html</link>
  <description>&lt;pre&gt;&lt;code&gt;function Entry::print_metadata() {
  var string tags_header         = &quot;Current Tags&quot;; # text for tags header,    &quot;Current Tags&quot;
  var string tags_joiner         = &quot;:&quot;;            # text for tags joiner,    &quot;&quot;
  var string tags_sep            = &quot;, &quot;;           # text for tags separator, &quot;, &quot;
  var bool   show_edit_tags_link = false;          # set to true if you want edit tags link as tags header

  var string currents_open       = &quot;&quot;&quot;&amp;lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot;&amp;gt;&quot;&quot;&quot;; # html for opening of currents container
  var string currents_close      = &quot;&quot;&quot;&amp;lt;/table&amp;gt;&amp;lt;br /&amp;gt;&quot;&quot;&quot;; # html for closing of currents container

  var bool   loc_after_mood      = false;               # set to true to print location after mood
  var bool   vanilla_loc         = false;               # set to true to delinkify location

  # if you need data specific to the meta to be in these strings you&apos;ll have to set those individually down further
  # one example is provided with meta_label_open
  var string meta_label_open     = &quot;&quot;&quot;&amp;lt;tr&amp;gt;&amp;lt;td class=&quot;meta&quot;&amp;gt;[&amp;lt;/td&amp;gt;&amp;lt;td class=&quot;meta&quot; align=&quot;right&quot;&amp;gt;&amp;lt;b&amp;gt;&quot;&quot;&quot;; # html for opening of metadata label
  var string meta_label_close    = &quot;&quot;&quot;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td class=&quot;meta&quot; align=&quot;center&quot;&amp;gt;|&amp;lt;/td&amp;gt;&quot;&quot;&quot;; # html for closing of metadata label
  var string meta_val_open       = &quot;&quot;&quot;&amp;lt;td class=&quot;meta&quot;&amp;gt;&quot;&quot;&quot;; # html for opening of metadata value
  var string meta_val_close      = &quot;&quot;&quot;&amp;lt;/td&amp;gt;&amp;lt;td class=&quot;meta&quot;&amp;gt;]&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&quot;&quot;&quot;; # html for closing of metadata value

  var Link   edit_tags           = $this-&amp;gt;get_link(&quot;edit_tags&quot;); # helper var to see if remote user can edit tags

  var string currents = &quot;&quot;;             # make var for printing

  if ((size $.metadata &amp;gt; 0) or ((size $.tags &amp;gt; 0) and ($*tags_aware))){
    if(defined $.mood_icon) {
      var Image i = $.mood_icon;
      $currents = $currents + &quot;&quot;&quot;&amp;lt;table border=&quot;0&quot;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;img src=&quot;$i.url&quot; width=&quot;$i.width&quot; height=&quot;$i.height&quot; alt=&quot;$.metadata{&quot;mood&quot;}&quot; title=&quot;$.metadata{&quot;mood&quot;}&quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&quot;&quot;&quot;;
    }
    if($.metadata{&quot;mood&quot;} == &quot;&quot; and $loc_after_mood) {
      # if we&apos;re printing loc after mood but we have no mood, set loc_after_mood to false
      $loc_after_mood = false;
    }
    $currents           = $currents + $currents_open; # add opening of currents container

    foreach var string k ($.metadata){  # step thru metadata
      var string text = $k;             # set text to key
      var string val  = $.metadata{$k}; # get val
      if ($k == &quot;mood&quot;){                # if mood, set text to mood property
        $text = $*text_meta_mood;
      } 
      elseif ($k == &quot;music&quot;) {          # if music, set text to music property
        $text = $*text_meta_music;
      } elseif ($k == &quot;location&quot;) {     # if location, set text to loc variable
        $text = $*text_meta_location;
        if($vanilla_loc) {              # if vanilla loc, striphtml() it
          $val = striphtml($val);
        }
      }
      if(not ($k == &quot;location&quot; and $loc_after_mood)) {
        # if we&apos;re doing loc right now and printing loc after mood, skip it
        # if we&apos;re doing loc right now and we&apos;re not printing loc after mood, print it now
        # if we&apos;re not doing loc right now, print this piece of meta

        # add the meta
        $currents = $currents + &quot;&quot;&quot;$meta_label_open$text$meta_label_close$meta_val_open$val$meta_val_close&quot;&quot;&quot;;
      }

      if($k == &quot;mood&quot; and $loc_after_mood) {
        # if we just now did the mood and we&apos;re printing loc after mood, print the loc
        $k    = &quot;location&quot;;           # set meta key to &quot;location&quot;
        $text = $*text_meta_location; # set text to loc variable
        $val  = $.metadata{$k};       # get val

        # if we have a loc, do stuff
        if($val != &quot;&quot;) {

          # if vanilla loc, striphtml() it
          if($vanilla_loc) {
            $val = striphtml($val);
          }

          # add the meta
          $currents         = $currents + &quot;&quot;&quot;$meta_label_open$text$meta_label_close$meta_val_open$val$meta_val_close&quot;&quot;&quot;;
        }
      }
    }
    if ((size $.tags &amp;gt; 0) and $*tags_aware) {
      var string k      = &quot;tags&quot;; # set key to &quot;tags&quot;

      var int tcount = 0; # set counter for tags
      if($edit_tags.url != &quot;&quot; and $show_edit_tags_link) { # if remote user can edit tags, let&apos;s give them a link
        $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;;
      }

      # add text, open val container
      $currents = $currents + &quot;&quot;&quot;$meta_label_open$tags_header$tags_joiner$meta_label_close$meta_val_open&quot;&quot;&quot;;

      # build tag list
      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 we haven&apos;t hit the last tag, add a separator
        if ($tcount != size $.tags) { $currents = $currents + $tags_sep; }
      }

      # close val container
      $currents = $currents + $meta_val_close;
    }

    if(defined $.mood_icon) {
      $currents = $currents + &quot;&quot;&quot;&amp;lt;/table&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&quot;&quot;&quot;;
    }

    # close currents container
    $currents = $currents + $currents_close;

    # print currents
    println &quot;$currents&quot;;
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/66931.html?view=comments#comments</comments>
  <category>function print_metadata</category>
  <category>class entry</category>
  <category>layout generator</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>5</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/66728.html</guid>
  <pubDate>Wed, 26 Jul 2006 19:58:58 GMT</pubDate>
  <title>K1&apos;s LJ Tools</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/66728.html</link>
  <description>i&apos;m moving my domain hosting.  it shall take a few days to propogate.&lt;br /&gt;&lt;br /&gt;this means that the neat toys i have will be intermittently available for a bit.&lt;br /&gt;&lt;br /&gt;they can also be found &lt;a href=&quot;http://72.29.78.36/~mm1sweb/mike/lj/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.</description>
  <comments>https://s2layers.livejournal.com/66728.html?view=comments#comments</comments>
  <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://s2layers.livejournal.com/66353.html</guid>
  <pubDate>Fri, 09 Jun 2006 05:15:04 GMT</pubDate>
  <title>[theme] - [smooth sailing] - [use TagsPage to print special content]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/66353.html</link>
  <description>in response to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;geisha_doll&quot; lj:user=&quot;geisha_doll&quot; &gt;&lt;a href=&quot;https://geisha-doll.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://geisha-doll.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;geisha_doll&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2smoothsailing&quot; lj:user=&quot;s2smoothsailing&quot; &gt;&lt;a href=&quot;https://s2smoothsailing.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://s2smoothsailing.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2smoothsailing&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://community.livejournal.com/s2smoothsailing/55011.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.  uses TagCloud as example for &quot;special page.&quot;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function TagsPage::view_title : string {
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # get special page type&lt;/span&gt;
  var string page = $.args{&quot;page&quot;};

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # set special page titles&lt;/span&gt;
  var string{} pages = {
                        &quot;one&quot;      =&amp;gt; &quot;One&quot;,      &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# &quot;one&quot;      page title&lt;/span&gt;
                        &quot;two&quot;      =&amp;gt; &quot;Two&quot;,      &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# &quot;two&quot;      page title&lt;/span&gt;
                        &quot;tagcloud&quot; =&amp;gt; &quot;TagCloud&quot;, &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# &quot;tagcloud&quot; page title&lt;/span&gt;
                       };

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # if we are doing a special page, get special page title
  #  else, return normal page title
  #  change this to &quot;Tags Page&quot; if not using Smooth Sailing&lt;/span&gt;
  return $pages{$page} != &quot;&quot; ? $pages{$page} : $*text_tags_pagetitle;
}

function TagsPage::print_body() {
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # get special page type&lt;/span&gt;
  var string page = $.args{&quot;page&quot;};

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # &quot;one&quot; page content&lt;/span&gt;
  if($page == &quot;one&quot;) {
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # &amp;lt;one&amp;gt;&lt;/span&gt;

    &quot;one&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # &amp;lt;/one&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # &quot;two&quot; page content&lt;/span&gt;
  } elseif ($page == &quot;two&quot;) {
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # &amp;lt;two&amp;gt;&lt;/span&gt;

    &quot;two&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # &amp;lt;/two&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # &quot;tagcloud&quot; page content&lt;/span&gt;
  } elseif ($page == &quot;tagcloud&quot;) {
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # &amp;lt;tagcloud&amp;gt;&lt;/span&gt;

    var string      header      = $this-&amp;gt;view_title();
    var string      datetime    = $.time-&amp;gt;date_format($*text_format_entry_date_and_time);
    var string      content     = &quot;&quot;;

    var int         int_groups  =   5; # number of groups
    var int         int_percent =  20; # perecentage difference for each interval

    var int         adjust      = 0; # font size adjustment
    var int         factor      = 0; # factor of font size adjustment
    var int         interval    = 0; # tag use count interval per group
    var int         max         = 1; # max number of tag uses
    var TagDetail[] my_tags     = $this-&amp;gt;visible_tag_list(); # list of visible tags

    # implement cloudstyle ala delicious, etc
    if ($my_tags) {
      $content = $content + &quot;&quot;&quot;
      &amp;lt;table name=&quot;taglist&quot; width=&quot;100%&quot; cellpadding=&quot;3&quot;&amp;gt;
        &amp;lt;tr&amp;gt;
          &amp;lt;td&amp;gt;
      &quot;&quot;&quot;;

      # get max
      foreach var TagDetail t ($my_tags) {
        if($t.use_count &amp;gt; $max) {
          $max = $t.use_count;
        }
      }

      # now we get tag use count interval per group
      $interval = $max / $int_groups;

      # now print each item, and adjust its
      # fontsize as a function of where in the
      # continuum of $int_groups intervals it is
      foreach var TagDetail t ($my_tags) {
        # if we&apos;re not going to divide by 0
        if($interval &amp;gt; 0) {
          # get the proportion based on use_count and interval
          $factor = $t.use_count / $interval;
        } else {
          # if we&apos;re dividing by 0, set factor to 0
          $factor = 0;
        }
        $adjust  = ($factor * $int_percent) + 100;
        $content = $content + &quot;&quot;&quot;&amp;lt;span style=&quot;font-size: ${adjust}%&quot;&amp;gt;&amp;lt;a rel=&quot;tag&quot; href=&quot;$t.url&quot;&amp;gt;$t.name&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt; &quot;&quot;&quot;;
      }
      $content = $content + &quot;&quot;&quot;
          &amp;lt;/td&amp;gt;
        &amp;lt;/tr&amp;gt;
      &amp;lt;/table&amp;gt;
      &quot;&quot;&quot;;
    } else {
      $content = $content + &quot;&quot;&quot;&amp;lt;p&amp;gt;There are currently no tags or categories for this journal.&amp;lt;/p&amp;gt;&quot;&quot;&quot;;
    }
    &quot;&quot;&quot;
    &amp;lt;div class=&quot;entryHolder&quot;&amp;gt;
      &amp;lt;div class=&apos;entryHeader&apos;&amp;gt;
        &amp;lt;span class=&quot;entryHeaderDate&quot;&amp;gt;$datetime&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;entryHeaderSubject&quot;&amp;gt; - $header&amp;lt;/span&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;table width=&quot;100%&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot;&amp;gt;
        &amp;lt;tr valign=&quot;top&quot;&amp;gt;
          &amp;lt;td&amp;gt;&quot;&quot;&quot;;

    if ($*layout_position_userinfo_entry == &quot;left&quot; or $*layout_wrapping_userinfo_entry) {
      if(defined $.journal.default_pic) {
        &quot;&quot;&quot;
            &amp;lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; align=&quot;left&quot; class=&quot;entryUserinfo&quot;&amp;gt;
              &amp;lt;tr&amp;gt;
                &amp;lt;td&amp;gt;
                  &amp;lt;div class=&quot;entryUserinfo-usericon&quot;&amp;gt;&amp;lt;a href=&quot;$.journal.userpic_listing_url&quot;&amp;gt;&amp;lt;img src=&quot;$.journal.default_pic.url&quot; alt=&quot;$.journal.name&quot; title=&quot;$.journal.name&quot; height=&quot;$.journal.default_pic.height&quot; width=&quot;$.journal.default_pic.width&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
                &amp;lt;/td&amp;gt;
              &amp;lt;/tr&amp;gt;
            &amp;lt;/table&amp;gt;&quot;&quot;&quot;;
        if (not $*layout_wrapping_userinfo_entry) {
          &quot;&quot;&quot;
          &amp;lt;/td&amp;gt;
          &amp;lt;td width=&quot;100%&quot;&amp;gt;&quot;&quot;&quot;;
        }
      }
    }

    &quot;&quot;&quot;
            &amp;lt;div class=&quot;entryText&quot;&amp;gt;
              $content
            &amp;lt;/div&amp;gt;&quot;&quot;&quot;;

    if ($*layout_position_userinfo_entry == &quot;right&quot; and not $*layout_wrapping_userinfo_entry) {
      if(defined $.journal.default_pic) {
        &quot;&quot;&quot;
            &amp;lt;/td&amp;gt;
            &amp;lt;td&amp;gt;
              &amp;lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; align=&quot;left&quot; class=&quot;entryUserinfo&quot;&amp;gt;
                &amp;lt;tr&amp;gt;
                  &amp;lt;td&amp;gt;
                    &amp;lt;div class=&quot;entryUserinfo-usericon&quot;&amp;gt;&amp;lt;a href=&quot;$.journal.userpic_listing_url&quot;&amp;gt;&amp;lt;img src=&quot;$.journal.default_pic.url&quot; alt=&quot;$.journal.name&quot; title=&quot;$.journal.name&quot; height=&quot;$.journal.default_pic.height&quot; width=&quot;$.journal.default_pic.width&quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
                  &amp;lt;/td&amp;gt;
                &amp;lt;/tr&amp;gt;
              &amp;lt;/table&amp;gt;&quot;&quot;&quot;;
      }
    }

    &quot;&quot;&quot;
          &amp;lt;/td&amp;gt;
        &amp;lt;/tr&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # &amp;lt;/tagcloud&amp;gt;&lt;/span&gt;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # no special page
  #  print as normal
  #  existing TagsPage::print_body() goes here&lt;/span&gt;
  } else {
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # &amp;lt;normal&amp;gt;&lt;/span&gt;

    if(size $.tags &amp;gt; 0) {
      if ($*layout_tagspage == &quot;table&quot;) {
        $this-&amp;gt;lay_print_tagstable();
      } elseif($*layout_tagspage == &quot;list&quot;) {
        $this-&amp;gt;lay_print_tagslist();
      }
    } else {
      &quot;&quot;&quot;&amp;lt;center&amp;gt;$*text_tags_none&amp;lt;/center&amp;gt;&quot;&quot;&quot;;
    }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # &amp;lt;/normal&amp;gt;&lt;/span&gt;
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/66353.html?view=comments#comments</comments>
  <category>function print_body</category>
  <category>class tagspage</category>
  <category>layout smoothsailing</category>
  <category>function view_title</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>11</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/66055.html</guid>
  <pubDate>Tue, 06 Jun 2006 23:51:16 GMT</pubDate>
  <title>[theme] - [flexisquares] - [ajax/qr/timezone support]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/66055.html</link>
  <description>in response to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;didaio&quot; lj:user=&quot;didaio&quot; &gt;&lt;a href=&quot;https://didaio.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://didaio.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;didaio&lt;/b&gt;&lt;/a&gt;&lt;a class=&quot;i-ljuser-badge i-ljuser-badge--pro&quot; data-badge-type=&quot;pro&quot; data-placement=&quot;bottom&quot; data-pro-badge data-pro-badge-type=&quot;1&quot; data-is-raw hidden href=&quot;#&quot;&gt;&lt;span class=&quot;i-ljuser-badge__icon&quot;&gt;&lt;svg class=&quot;svgicon&quot; width=&quot;25&quot; height=&quot;16&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 33 24&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M19.326 11.95c0 2.01 1.47 3.45 3.48 3.45 2.02 0 3.49-1.44 3.49-3.45 0-2.01-1.47-3.45-3.49-3.45-2.01 0-3.48 1.44-3.48 3.45Zm5.51 0c0 1.24-.8 2.19-2.03 2.19-1.23 0-2.02-.95-2.02-2.19 0-1.25.79-2.19 2.02-2.19s2.03.94 2.03 2.19ZM7.92 15.28H6.5V8.61h3.12c1.45 0 2.24.98 2.24 2.15 0 1.16-.8 2.15-2.24 2.15h-1.7v2.37Zm1.51-3.62c.56 0 .98-.35.98-.9 0-.56-.42-.9-.98-.9H7.92v1.8h1.51ZM18.3802 15.28h-1.63l-1.31-2.37h-1.04v2.37h-1.42V8.61h3.12c1.39 0 2.24.91 2.24 2.15 0 1.18-.74 1.81-1.46 1.98l1.5 2.54Zm-2.49-3.62c.57 0 1-.34 1-.9s-.43-.9-1-.9h-1.49v1.8h1.49Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M2 8c0-2.20914 1.79086-4 4-4h20.5c2.2091 0 4 1.79086 4 4v7.9c0 2.2091-1.7909 4-4 4H6c-2.20914 0-4-1.7909-4-4V8Zm4-2.5h20.5C27.8807 5.5 29 6.61929 29 8v7.9c0 1.3807-1.1193 2.5-2.5 2.5H6c-1.38071 0-2.5-1.1193-2.5-2.5V8c0-1.38071 1.11929-2.5 2.5-2.5Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2flexisquares&quot; lj:user=&quot;s2flexisquares&quot; &gt;&lt;a href=&quot;https://s2flexisquares.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://s2flexisquares.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2flexisquares&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://community.livejournal.com/s2flexisquares/331285.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function Comment::print_linkbar() {
  var string   link_seperator = &quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # initialize array/hashes&lt;/span&gt;
  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;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # gather current linkbar&lt;/span&gt;
  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[size($link_keyseq)] = $link_key; # add this to new link_keyseq array
  }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # set new linkbar images&lt;/span&gt;
  var Color delete_comment   = $*entry_bgcolor;
  var Color screen_comment   = $*entry_bgcolor;
  var Color unscreen_comment = &quot;#ffaaaa&quot;;
  var Color freeze_thread    = $*entry_bgcolor;
  var Color unfreeze_thread  = &quot;#aaaaff&quot;;
  $link_image = {
                 &quot;delete_comment&quot;   =&amp;gt; palimg_tint(&quot;boxer/delete.gif&quot;,   $delete_comment),
                 &quot;&lt;span style=&quot;color:red;&quot;&gt;screen_comment&lt;/span&gt;&quot;   =&amp;gt; palimg_tint(&quot;boxer/screen.gif&quot;,   $screen_comment),
                 &quot;&lt;span style=&quot;color:red;&quot;&gt;unscreen_comment&lt;/span&gt;&quot; =&amp;gt; palimg_tint(&quot;boxer/unscreen.gif&quot;, $unscreen_comment),
                 &quot;&lt;span style=&quot;color:blue;&quot;&gt;freeze_thread&lt;/span&gt;&quot;    =&amp;gt; palimg_tint(&quot;boxer/freeze.gif&quot;,   $freeze_thread),
                 &quot;&lt;span style=&quot;color:blue;&quot;&gt;unfreeze_thread&lt;/span&gt;&quot;  =&amp;gt; palimg_tint(&quot;boxer/unfreeze.gif&quot;, $unfreeze_thread),
                };

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # loop thru linkbar and add links to print var&lt;/span&gt;
  foreach var string link_key ($link_keyseq) {

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # if we can do performed action, url will be present&lt;/span&gt;
    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;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;      # if image url available, use it&lt;/span&gt;
      if($link_image{$link_key} != &quot;&quot;) {

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;        # build an id for the image&lt;/span&gt;
        var string id = &quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;        # if we&apos;re screening, add screen handle (&quot;sus_#&quot;, where &apos;#&apos; is the comment talkid) to image&lt;/span&gt;
        if($link_key-&amp;gt;contains(&quot;screen&quot;)) {
          $id = &quot;&lt;span style=&quot;color:red;&quot;&gt;sus_&lt;/span&gt;&quot;;
        }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;        # if we&apos;re freezing, add freeze handle (&quot;fuf_#&quot;, where &apos;#&apos; is the comment talkid) to image&lt;/span&gt;
        if($link_key-&amp;gt;contains(&quot;freeze&quot;)) {
          $id = &quot;&lt;span style=&quot;color:blue;&quot;&gt;fuf_&lt;/span&gt;&quot;;
        }

        $id = &quot;$id$.talkid&quot;;
        $print = $print + &quot;&quot;&quot;&amp;lt;img id=&quot;$id&quot; 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 {
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;        # else, just use text&lt;/span&gt;
        $print = $print + &quot;$link_caption{$link_key}&quot;;

      }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;      # add a seperator&lt;/span&gt;
      $print = $print + &quot;&amp;lt;/a&amp;gt;$link_seperator&quot;;
    }
  }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # hack off last seperator&lt;/span&gt;
  $print = $print-&amp;gt;substr(0, $print-&amp;gt;length() - $link_seperator-&amp;gt;length());

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # we&apos;re done! let&apos;s print it!&lt;/span&gt;
  print $print;
}

function EntryPage::print_comment (Comment comment) {
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # set colors for comments&lt;/span&gt;
  var Color color_comment_bar_screened         = &quot;#ffaaaa&quot;;
  var Color color_comment_bar_screened_fgcolor = &quot;#000000&quot;;
  var Color color_comment_bar_frozen           = &quot;#aaaaff&quot;;
  var Color color_comment_bar_frozen_fgcolor   = &quot;#000000&quot;;
  var Color bgcolor                            = $*entrytitle_bgcolor;
  var Color fgcolor                            = $*entry_fgcolor;

  if($comment.screened) {
    $bgcolor = $color_comment_bar_screened;
    $fgcolor = $color_comment_bar_screened_fgcolor;
  }
  if($comment.frozen) {
    $bgcolor = $color_comment_bar_frozen;
    $fgcolor = $color_comment_bar_frozen_fgcolor;
  }

  var string  subject   = $comment.subject ? $comment.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  poster    = isnull $comment.poster ? $*text_poster_anonymous : $comment.poster-&amp;gt;as_string();
  var string  reply     = &quot;&quot;;
  var string  parent    = &quot;&quot;;
  var string  thread    = &quot;&quot;;

  $subject = &quot;&quot;&quot;&amp;lt;span class=&quot;commentsubject&quot;&amp;gt;$subject&amp;lt;/span&amp;gt;&quot;&quot;&quot;;

  if($comment.subject_icon.url != &quot;&quot;) {
    $subject = &quot;$comment.subject_icon $subject&quot;;
  }
	
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  #Comment Userpic&lt;/span&gt;
  &quot;&quot;&quot;
  &amp;lt;div class=&quot;datesubjectcomment&quot; id=&quot;&lt;span style=&quot;color:#ffaf00;&quot;&gt;cmtbar$comment.talkid&lt;/span&gt;&quot; style=&quot;background-color: $bgcolor; color: $fgcolor;&quot;&amp;gt;&quot;&quot;&quot;;
  if (defined $comment.userpic and $*show_entry_userpic) {
    var int    w   = $comment.userpic.width;
    var int    h   = $comment.userpic.height; 
    var string alt = $comment.metadata{&quot;picture_keyword&quot;};
    if ($*comment_userpic_style == &quot;small&quot;) {
      $w = $w / 2;
      $h = $h / 2;
    }  
    if ($alt != &quot;&quot;) {
      $alt = &quot;: &quot; + $alt;
    }
    &quot;&quot;&quot;
    &amp;lt;img class=&quot;userpiccomment&quot; src=&quot;$comment.userpic.url&quot; width=&quot;$w&quot; height=&quot;$h&quot; alt=&quot;$comment.poster.name$alt&quot; title=&quot;$comment.poster.name$alt&quot; /&amp;gt;&quot;&quot;&quot;;
  }

  print $poster;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # use Comment::time_display()&lt;/span&gt;
  print &quot; on &quot; + $comment-&amp;gt;time_display();

  &quot;&quot;&quot;&amp;lt;br /&amp;gt;
    $subject&amp;lt;br /&amp;gt;&quot;&quot;&quot;;

  if ($comment.metadata{&quot;poster_ip&quot;}) {
    var string ip = $comment.metadata{&quot;poster_ip&quot;};
    &quot;&quot;&quot;&amp;lt;br /&amp;gt;
    $*text_comment_ipaddr($ip)&amp;lt;br /&amp;gt;&quot;&quot;&quot;;
  }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # use Comment::print_text()&lt;/span&gt;
  &quot;&quot;&quot;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&quot;commentreply&quot;&amp;gt;&quot;&quot;&quot;; $comment-&amp;gt;print_text(); &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;

  var string alignlinks = &quot;&quot;;
  if ($*userpic_position == &quot;left&quot;) {
    $alignlinks = &quot;right&quot;;
  } else {
    $alignlinks = &quot;left&quot;;
  }

  &quot;&quot;&quot;
    &amp;lt;div style=&quot;margin-top: 3px; font-size: smaller; text-align: $alignlinks;&quot;&amp;gt;&quot;&quot;&quot;;

  $reply = $*text_comment_reply;
    
  if ($comment.frozen) {
    $reply = $*text_comment_frozen;
  }
  if ($.entry.comments.maxcomments) {
    $reply = $*text_max_comments;
  }
    
  if ($comment.parent_url != &quot;&quot;) {
    $parent = &quot;&quot;&quot;(&amp;lt;a href=&quot;$comment.parent_url&quot;&amp;gt;$*text_comment_parent&amp;lt;/a&amp;gt;) &quot;&quot;&quot;;
  }
    
  if ($comment.thread_url != &quot;&quot;) { 
    $thread = &quot;&quot;&quot;(&amp;lt;a href=&quot;$comment.thread_url&quot;&amp;gt;$*text_comment_thread&amp;lt;/a&amp;gt;) &quot;&quot;&quot;;
  }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # print reply link&lt;/span&gt;
  print &quot;(&quot;;
  if($reply == $*text_comment_reply) {
    $comment-&amp;gt;print_reply_link({&quot;linktext&quot; =&amp;gt; $reply});
  } else {
    print $reply;
  }
  print &quot;) &quot;;

  &quot;&quot;&quot;$parent$thread(&amp;lt;a href=&quot;$comment.permalink_url&quot;&amp;gt;$*text_permalink&amp;lt;/a&amp;gt;)&quot;&quot;&quot;;

  &quot;&quot;&quot;&amp;lt;div style=&quot;padding: 10px; text-align: $alignlinks;&quot;&amp;gt;&quot;&quot;&quot;;
  if ($this.multiform_on) {
    &quot;&quot;&quot;&amp;lt;label for=&quot;ljcomsel_$comment.talkid&quot;&amp;gt;$*text_multiform_check&amp;lt;/label&amp;gt;&quot;&quot;&quot;;
    $comment-&amp;gt;print_multiform_check();
  }

  $comment-&amp;gt;print_linkbar();

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

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # print reply container&lt;/span&gt;
  $comment-&amp;gt;print_reply_container();

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

function EntryPage::print_body() {
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # set colors for comments&lt;/span&gt;
  var Color color_comment_bar_screened         = &quot;#ffaaaa&quot;;
  var Color color_comment_bar_screened_fgcolor = &quot;#000000&quot;;
  var Color color_comment_bar_frozen           = &quot;#aaaaff&quot;;
  var Color color_comment_bar_frozen_fgcolor   = &quot;#000000&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # set new linkbar images&lt;/span&gt;
  var Color delete_comment   = $*entry_bgcolor;
  var Color screen_comment   = $*entry_bgcolor;
  var Color unscreen_comment = &quot;#ffaaaa&quot;;
  var Color freeze_thread    = $*entry_bgcolor;
  var Color unfreeze_thread  = &quot;#aaaaff&quot;;
  var string{} link_image = {
                             &quot;delete_comment&quot;   =&amp;gt; palimg_tint(&quot;boxer/delete.gif&quot;,   $delete_comment),
                             &quot;&lt;span style=&quot;color:red;&quot;&gt;screen_comment&lt;/span&gt;&quot;   =&amp;gt; palimg_tint(&quot;boxer/screen.gif&quot;,   $screen_comment),
                             &quot;&lt;span style=&quot;color:red;&quot;&gt;unscreen_comment&lt;/span&gt;&quot; =&amp;gt; palimg_tint(&quot;boxer/unscreen.gif&quot;, $unscreen_comment),
                             &quot;&lt;span style=&quot;color:blue;&quot;&gt;freeze_thread&lt;/span&gt;&quot;    =&amp;gt; palimg_tint(&quot;boxer/freeze.gif&quot;,   $freeze_thread),
                             &quot;&lt;span style=&quot;color:blue;&quot;&gt;unfreeze_thread&lt;/span&gt;&quot;  =&amp;gt; palimg_tint(&quot;boxer/unfreeze.gif&quot;, $unfreeze_thread),
                            };

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # change bgcolor/fgcolor and images of screened comments&lt;/span&gt;
  set_handler(&quot;screen_comment_#&quot;,   [
                                     [ &quot;set_image&quot;,     &quot;&lt;span style=&quot;color:red;&quot;&gt;sus_#&lt;/span&gt;&quot;,   $link_image{&quot;unscreen_comment&quot;},       ],
                                     [ &quot;style_bgcolor&quot;, &quot;&lt;span style=&quot;color:#ffaf00;&quot;&gt;cmtbar#&lt;/span&gt;&quot;, &quot;$color_comment_bar_screened&quot;,         ],
                                     [ &quot;style_color&quot;,   &quot;&lt;span style=&quot;color:#ffaf00;&quot;&gt;cmtbar#&lt;/span&gt;&quot;, &quot;$color_comment_bar_screened_fgcolor&quot;, ],
                                    ]);
  set_handler(&quot;unscreen_comment_#&quot;, [
                                     [ &quot;set_image&quot;,     &quot;&lt;span style=&quot;color:red;&quot;&gt;sus_#&lt;/span&gt;&quot;,   $link_image{&quot;screen_comment&quot;},   ],
                                     [ &quot;style_bgcolor&quot;, &quot;&lt;span style=&quot;color:#ffaf00;&quot;&gt;cmtbar#&lt;/span&gt;&quot;, &quot;$*entrytitle_bgcolor&quot;,          ],
                                     [ &quot;style_color&quot;,   &quot;&lt;span style=&quot;color:#ffaf00;&quot;&gt;cmtbar#&lt;/span&gt;&quot;, &quot;$*entry_fgcolor&quot;,               ],
                                    ]);

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # change bgcolor/fgcolor and images of frozen comments&lt;/span&gt;
  set_handler(&quot;freeze_comment_#&quot;,   [
                                     [ &quot;set_image&quot;,     &quot;&lt;span style=&quot;color:blue;&quot;&gt;fuf_#&lt;/span&gt;&quot;,   $link_image{&quot;unfreeze_thread&quot;},      ],
                                     [ &quot;style_bgcolor&quot;, &quot;&lt;span style=&quot;color:#ffaf00;&quot;&gt;cmtbar#&lt;/span&gt;&quot;, &quot;$color_comment_bar_frozen&quot;,         ],
                                     [ &quot;style_color&quot;,   &quot;&lt;span style=&quot;color:#ffaf00;&quot;&gt;cmtbar#&lt;/span&gt;&quot;, &quot;$color_comment_bar_frozen_fgcolor&quot;, ],
                                    ]);
  set_handler(&quot;unfreeze_comment_#&quot;, [
                                     [ &quot;set_image&quot;,     &quot;&lt;span style=&quot;color:blue;&quot;&gt;fuf_#&lt;/span&gt;&quot;,   $link_image{&quot;freeze_thread&quot;}, ],
                                     [ &quot;style_bgcolor&quot;, &quot;&lt;span style=&quot;color:#ffaf00;&quot;&gt;cmtbar#&lt;/span&gt;&quot;, &quot;$*entrytitle_bgcolor&quot;,       ],
                                     [ &quot;style_color&quot;,   &quot;&lt;span style=&quot;color:#ffaf00;&quot;&gt;cmtbar#&lt;/span&gt;&quot;, &quot;$*entry_fgcolor&quot;,            ],
                                    ]);

  $this-&amp;gt;print_entry($.entry);

  if ($.multiform_on and $.entry.comments.enabled and $.comment_pages.total_subitems &amp;gt; 0) {
    $this-&amp;gt;print_multiform_start();
  }

  if ($.entry.comments.enabled) {
    &quot;&quot;&quot;
    &amp;lt;div class=&quot;box&quot;&amp;gt;
      &amp;lt;center&amp;gt;&quot;&quot;&quot;;

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

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # print reply link&lt;/span&gt;
    &quot;&quot;&quot;
        &amp;lt;b&amp;gt;( &quot;&quot;&quot;; $this-&amp;gt;print_reply_link({&quot;linktext&quot; =&amp;gt; $*text_post_comment, &quot;target&quot; =&amp;gt; &quot;topcomment&quot;}); &quot;&quot;&quot; )&amp;lt;/b&amp;gt;&quot;&quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    # print reply container&lt;/span&gt;
    $this-&amp;gt;print_reply_container({&quot;target&quot; =&amp;gt; &quot;topcomment&quot;});

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

    $this-&amp;gt;print_comments($.comments);

    if(size($.comments) &amp;gt; 0) {
      &quot;&quot;&quot;
      &amp;lt;center&amp;gt;&quot;&quot;&quot;;

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

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;      # print reply link&lt;/span&gt;
      &quot;&quot;&quot;
        &amp;lt;b&amp;gt;( &quot;&quot;&quot;; $this-&amp;gt;print_reply_link({&quot;linktext&quot; =&amp;gt; $*text_post_comment, &quot;target&quot; =&amp;gt; &quot;bottomcomment&quot;}); &quot;&quot;&quot; )&amp;lt;/b&amp;gt;&quot;&quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;      # print reply container&lt;/span&gt;
      $this-&amp;gt;print_reply_container({&quot;target&quot; =&amp;gt; &quot;bottomcomment&quot;});

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

    &quot;&quot;&quot;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
  }
    
  if ($this.multiform_on and $.entry.comments.enabled and ($.entry.comments.count &amp;gt; 0 or $.entry.comments.screened)) {
    &quot;&quot;&quot;
    &amp;lt;div class=&quot;box&quot;&amp;gt;&quot;&quot;&quot;;

    $this-&amp;gt;print_multiform_actionline();
    $this-&amp;gt;print_multiform_end(); 

    &quot;&quot;&quot;
      &amp;lt;center&amp;gt;&quot;&quot;&quot;;

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

    &quot;&quot;&quot;
        &amp;lt;br /&amp;gt;
      &amp;lt;/center&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/66055.html?view=comments#comments</comments>
  <category>layout flexisquares</category>
  <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://s2layers.livejournal.com/65995.html</guid>
  <pubDate>Fri, 12 May 2006 22:54:12 GMT</pubDate>
  <title>[theme] - [flexisquares] - [page summary]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/65995.html</link>
  <description>in response to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-deleted  i-ljuser-type-P     &quot;  data-ljuser=&quot;epigram&quot; lj:user=&quot;epigram&quot; &gt;&lt;a href=&quot;https://epigram.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://epigram.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;epigram&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2flexisquares&quot; lj:user=&quot;s2flexisquares&quot; &gt;&lt;a href=&quot;https://s2flexisquares.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://s2flexisquares.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2flexisquares&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://community.livejournal.com/s2flexisquares/308578.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;in addition to using this code, you&apos;ll have to override &lt;code&gt;print_entry()&lt;/code&gt; and include the following near the top of the function:&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;&amp;lt;a name=&quot;$e.journal.username$e.itemid&quot; id=&quot;$e.journal.username$e.itemid&quot;&amp;gt;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;pre&gt;&lt;code&gt;class MyUtils {
  function num_comments_in_thread(Comment[] comments) : int;
}

function MyUtils::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 + $this-&amp;gt;num_comments_in_thread($c.replies);
    }
  }
  return $total;
}

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

  var string month = $m-&amp;gt;month_format();
  &quot;&quot;&quot;
  &amp;lt;a name=&quot;month$m.month&quot; id=&quot;month$m.month&quot;&amp;gt;&amp;lt;/a&amp;gt;
  &amp;lt;table class=&quot;yeartable&quot; align=&quot;center&quot;&amp;gt;
    &amp;lt;tr&amp;gt;
      &amp;lt;td colspan=&quot;4&quot; class=&quot;yearmonth&quot; align=&quot;left&quot;&amp;gt;$month&amp;lt;/td&amp;gt;
      &amp;lt;td colspan=&quot;3&quot; class=&quot;yearmonth&quot; align=&quot;right&quot;&amp;gt;&amp;lt;a href=&quot;$m.url&quot;&amp;gt;$*text_view_month&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
    &amp;lt;tr&amp;gt;&quot;&quot;&quot;;
    foreach var int d (weekdays()) {
        &quot;&quot;&quot;
      &amp;lt;td width=&quot;50px&quot; class=&quot;yearday&quot;&amp;gt;&quot;&quot;&quot;+$*lang_dayname_short[$d]+&quot;&amp;lt;/td&amp;gt;\n&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;br /&amp;gt;
  &amp;lt;br /&amp;gt;
  &amp;lt;br /&amp;gt;&quot;&quot;&quot;;
}

function MonthPage::print_body {
  &quot;&quot;&quot;
  &amp;lt;form method=&apos;post&apos; action=&apos;$.redir.url&apos;&amp;gt;
    &amp;lt;center&amp;gt;&amp;lt;br /&amp;gt;&quot;&quot;&quot;;
  $.redir-&amp;gt;print_hiddens();
  if ($.prev_url != &quot;&quot;) { 
    &quot;[&amp;lt;a href=&apos;$.prev_url&apos;&amp;gt;&amp;amp;lt;&amp;amp;lt;&amp;amp;lt;&amp;lt;/a&amp;gt;]\n&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;\n[&amp;lt;a href=&apos;$.next_url&apos;&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;lt;/a&amp;gt;]\n&quot;; 
  }
  &quot;&quot;&quot;
    &amp;lt;/center&amp;gt;
  &amp;lt;/form&amp;gt;&amp;lt;br /&amp;gt;
  &amp;lt;br /&amp;gt;
  &amp;lt;div class=&quot;subcontent&quot;&amp;gt;
    &amp;lt;div class=&quot;entry&quot;&amp;gt;
      &amp;lt;dl&amp;gt;&quot;&quot;&quot;;
  foreach var MonthDay d ($.days) {
    if ($d.has_entries) {
      var string day = lang_ordinal($d.day);
      &quot;&quot;&quot;
        &amp;lt;dt&amp;gt;
          &amp;lt;a name=&quot;day$d.day&quot; id=&quot;day$d.day&quot; href=&quot;$d.url&quot;&amp;gt;
            &amp;lt;b&amp;gt;$day&amp;lt;/b&amp;gt;
          &amp;lt;/a&amp;gt;
        &amp;lt;/dt&amp;gt;
        &amp;lt;dd&amp;gt;&quot;&quot;&quot;;
      $d-&amp;gt;print_subjectlist();
      &quot;&quot;&quot;
        &amp;lt;/dd&amp;gt;&quot;&quot;&quot;;
    }
  }
  &quot;&quot;&quot;
      &amp;lt;/dl&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
}

function print_sidebar() {
  # create helper vars for sidebar boxes
  var string k1Sheader      = &quot;&quot;;
  var string k1Sheader_one  = &quot;&quot;&quot;&amp;lt;li class=&quot;sbartitle&quot;&amp;gt;&quot;&quot;&quot;;
  var string k1Sheader_two  = &quot;&amp;lt;/li&amp;gt;&quot;;
  var string k1Scontent     = &quot;&quot;;
  var string k1Scontent_one = &quot;&quot;&quot;&amp;lt;li class=&quot;sbaritem&quot;&amp;gt;&quot;&quot;&quot;;
  var string k1Scontent_two = &quot;&amp;lt;/li&amp;gt;&quot;;

  # create var for header of summary box
  var string    summary_header = &quot;Page Summary&quot;;

  # create helper vars for summary sidebar box
  var Page      p        = get_page();
  var Comment[] comments = [];
  var Entry[]   entries  = [];
  var int       items    = 0;
  var string    summary  = &quot;&quot;;

  # if we&apos;re on a RecentPage or FriendsPage
  if($p isa RecentPage) {
    var RecentPage rp = $p as RecentPage;

    # grab the entries and number of them
    if(size($rp.entries) &amp;gt; 0) {
      $entries = $rp.entries;
      $items   = size($entries);
    }
  }

  # if we&apos;re on a YearPage
  if($p isa YearPage) {
    var YearPage yp    = $p as YearPage;
    var string   month = &quot;&quot;;
    foreach var YearMonth m ($yp.months) {
      if($m.has_entries) {
        $month   = &quot;&quot;&quot;&amp;lt;a href=&quot;#month$m.month&quot;&amp;gt;&quot;&quot;&quot; + $m-&amp;gt;month_format() + &quot;&quot;&quot;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        $month   = &quot;$k1Scontent_one$month$k1Scontent_two&quot;;
        $summary = $summary + $month + &quot;\n&quot;;
      }
    }
  }

  # if we&apos;re on a MonthPage
  if($p isa MonthPage) {
    var MonthPage mp  = $p as MonthPage;
    var string    day = &quot;&quot;;
    foreach var MonthDay d ($mp.days) {
      if($d.num_entries &amp;gt; 0) {
        $day     = &quot;&quot;&quot;&amp;lt;a href=&quot;#day$d.day&quot;&amp;gt;&quot;&quot;&quot; + $d.date-&amp;gt;date_format(&quot;long&quot;) + &quot;&quot;&quot;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        $day     = &quot;$k1Scontent_one$day$k1Scontent_two&quot;;
        $summary = $summary + $day + &quot;\n&quot;;
      }
    }
  }

  # if we&apos;re on a DayPage
  if($p isa DayPage) {
    var DayPage dp = $p as DayPage;
    if(size($dp.entries) &amp;gt; 0) {
      $entries = $dp.entries;
      $items   = size($entries);
    }
  }

  # if we&apos;re on an EntryPage
  if($p isa EntryPage) {
    var EntryPage ep = $p as EntryPage;
    if(size($ep.comments) &amp;gt; 0) {

      # grab the comments and number of them
      $comments = $ep.comments;
      $items    = size($comments);
    }
  }

  # if we got entries from Recent/Friends/DayPage
  if(size($entries) &amp;gt; 0) {
    var string security = &quot;&quot;;
    var string subject  = &quot;&quot;;
    var string poster   = &quot;&quot;;
    var string journal  = &quot;&quot;;
    var string count   = &quot;&quot;;
    var string item     = &quot;&quot;;

    # cycle thru entries
    foreach var Entry e ($entries) {
      $security = &quot;&quot;;
      $subject  = &quot;&quot;;
      $poster   = &quot;&quot;;
      $journal  = &quot;&quot;;
      $count    = &quot;&quot;;
      $item     = &quot;&quot;;

      # get security icon
      if($e.security_icon.url != &quot;&quot;) {
        $security = $e.security_icon + &quot; &quot;;
      }

      # get subject
      if($e.subject != &quot;&quot;) {
        $subject = striphtml($e.subject);
      } else {
        $subject = &quot;&quot;&quot;&amp;lt;i class=&quot;nosubject&quot;&amp;gt;$*text_nosubject&amp;lt;/i&amp;gt;&quot;&quot;&quot;;
      }

      # get journal
      if($p.view == &quot;friends&quot; and (not ($e.poster-&amp;gt;equals($e.journal)))) {
        $journal = &quot;$e.journal ::&amp;lt;br /&amp;gt;&quot;;
      }

      # get poster
      if($p.view == &quot;friends&quot; or  (not ($e.poster-&amp;gt;equals($e.journal)))) {
        $poster = &quot;$e.poster :&amp;lt;br /&amp;gt;&quot;;
      }

      # get comment count
      $count   = &quot;&quot;&quot; [&amp;lt;a href=&quot;$e.permalink_url&quot;&amp;gt;+$e.comments.count&amp;lt;/a&amp;gt;]&quot;&quot;&quot;;

      # put it all together
      $item    = &quot;&quot;&quot;$security$journal$poster&amp;lt;a href=&quot;#$e.journal.username$e.itemid&quot;&amp;gt;$subject&amp;lt;/a&amp;gt;$count&quot;&quot;&quot;;

      # format it for a sidebar box line item
      $item    = &quot;$k1Scontent_one$item$k1Scontent_two&quot;;

      # add it to the summary var
      $summary = $summary + $item + &quot;\n&quot;;
    }
  }

  # if we got comments from EntryPage
  if(size($comments) &amp;gt; 0) {
    var MyUtils mu      = new MyUtils;
    var string  subject = &quot;&quot;;
    var string  icon    = &quot;&quot;;
    var string  poster  = &quot;&quot;;
    var string  count   = &quot;&quot;;
    var string  item    = &quot;&quot;;

    # cycle thru comments
    foreach var Comment c ($comments) {
      $subject = &quot;&quot;;
      $icon    = &quot;&quot;;
      $poster  = &quot;&quot;;
      $count   = &quot;&quot;;
      $item    = &quot;&quot;;

      # get subject icon
      $icon    = $c.subject_icon.url != &quot;&quot; ? $c.subject_icon + &quot; &quot; : &quot;&quot;;

      # get subject
      $subject = $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;;
      $subject = &quot;$subject&quot;;

      # get poster
      $poster  = $c.poster.username  != &quot;&quot; ? $c.poster + &quot;&quot; : &quot;&quot;&quot;&amp;lt;i class=&quot;noposter&quot;&amp;gt;$*text_poster_anonymous&amp;lt;/i&amp;gt;&quot;&quot;&quot;;
      $poster  = $poster + &quot; :&amp;lt;br /&amp;gt;&quot;;

      # get reply count
      $count   = &quot;&quot;&quot; [&amp;lt;a href=&quot;$c.permalink_url&quot;&amp;gt;+&quot;&quot;&quot; + $mu-&amp;gt;num_comments_in_thread($c.replies) + &quot;&quot;&quot;&amp;lt;/a&amp;gt;]&quot;&quot;&quot;;

      # put it all together
      $item    = &quot;&quot;&quot;$icon$poster&amp;lt;a href=&quot;#t$c.talkid&quot;&amp;gt;$subject&amp;lt;/a&amp;gt;$count&quot;&quot;&quot;;

      # format it for a sidebar box line item
      $item    = &quot;$k1Scontent_one$item$k1Scontent_two&quot;;

      # add it to the summary var
      $summary = $summary + $item + &quot;\n&quot;;
    }
  }

  # if we&apos;ve got a summary
  if($summary != &quot;&quot;) {
    # set header
    $k1Sheader  = $summary_header;

    # set content
    $k1Scontent = $summary;

    # print sidebar box
    print_sidebar_box(&quot;$k1Sheader_one$k1Sheader$k1Sheader_two&quot;, &quot;$k1Scontent_one$k1Scontent$k1Scontent_two&quot;);
  }

  sidebar_order($*sidebar_order_1);
  sidebar_order($*sidebar_order_2);
  sidebar_order($*sidebar_order_3);
  sidebar_order($*sidebar_order_4);
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/65995.html?view=comments#comments</comments>
  <category>function print_month</category>
  <category>function print_body</category>
  <category>class yearpage</category>
  <category>layout flexisquares</category>
  <category>class monthpage</category>
  <category>function print_sidebar</category>
  <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://s2layers.livejournal.com/65321.html</guid>
  <pubDate>Tue, 02 May 2006 21:54:35 GMT</pubDate>
  <title>[theme] - [change info icons via css]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/65321.html</link>
  <description>in response to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;troublesrollby&quot; lj:user=&quot;troublesrollby&quot; &gt;&lt;a href=&quot;https://troublesrollby.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://troublesrollby.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;troublesrollby&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2flexisquares&quot; lj:user=&quot;s2flexisquares&quot; &gt;&lt;a href=&quot;https://s2flexisquares.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://s2flexisquares.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2flexisquares&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://community.livejournal.com/s2flexisquares/297077.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;this works in browsers that support attribute selectors.&lt;br /&gt;browsers that don&apos;t support attribute selectors will use the new image that you set for personal journals.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function Page::print_custom_head() {

# create an order of account types
var string[] types_order = [&quot;personal&quot;, &quot;community&quot;, &quot;syndicated&quot;, &quot;news&quot;, &quot;identity&quot;, &quot;sponcomm&quot;];

# original URLs used by livejournal
var string{} old_urls = {
                         &quot;personal&quot;      =&amp;gt; &quot;http://p-stat.livejournal.com/img/userinfo.gif&quot;,
                         &quot;community&quot;     =&amp;gt; &quot;http://p-stat.livejournal.com/img/community.gif&quot;,
                         &quot;syndicated&quot;    =&amp;gt; &quot;http://stat.livejournal.com/img/syndicated.gif&quot;,
                         &quot;news&quot;          =&amp;gt; &quot;http://p-stat.livejournal.com/img/newsinfo.gif&quot;,
                         &quot;identity&quot;      =&amp;gt; &quot;http://p-stat.livejournal.com/img/openid-profile.gif&quot;,
                         &quot;sponcomm&quot;      =&amp;gt; &quot;http://p-stat.livejournal.com/img/sponcomm.gif&quot;,
                        };

# original widths used by livejournal
var string{} old_widths = {
                           &quot;personal&quot;    =&amp;gt; &quot;17&quot;,
                           &quot;community&quot;   =&amp;gt; &quot;16&quot;,
                           &quot;syndicated&quot;  =&amp;gt; &quot;16&quot;,
                           &quot;news&quot;        =&amp;gt; &quot;16&quot;,
                           &quot;identity&quot;    =&amp;gt; &quot;16&quot;,
                           &quot;sponcomm&quot;    =&amp;gt; &quot;16&quot;,
                          };

# original heights used by livejournal
var string{} old_heights = {
                            &quot;personal&quot;   =&amp;gt; &quot;17&quot;,
                            &quot;community&quot;  =&amp;gt; &quot;16&quot;,
                            &quot;syndicated&quot; =&amp;gt; &quot;16&quot;,
                            &quot;news&quot;       =&amp;gt; &quot;16&quot;,
                            &quot;identity&quot;   =&amp;gt; &quot;16&quot;,
                            &quot;sponcomm&quot;   =&amp;gt; &quot;16&quot;,
                           };

# new URLs to your images
# if you don&apos;t have an image for a specific type, leave it blank to use the original
var string{} new_urls = {
                         &quot;personal&quot;      =&amp;gt; &quot;http://pics.livejournal.com/kunzite1/pic/000x8y5d.gif&quot;,
                         &quot;community&quot;     =&amp;gt; &quot;http://pics.livejournal.com/kunzite1/pic/000x7th0.gif&quot;,
                         &quot;syndicated&quot;    =&amp;gt; &quot;http://pics.livejournal.com/kunzite1/pic/000x6cww.gif&quot;,
                         &quot;news&quot;          =&amp;gt; &quot;http://pics.livejournal.com/kunzite1/pic/000x5pdc.gif&quot;,
                         &quot;identity&quot;      =&amp;gt; &quot;http://pics.livejournal.com/kunzite1/pic/0026r895.gif&quot;,
                         &quot;sponcomm&quot;      =&amp;gt; &quot;http://pics.livejournal.com/kunzite1/pic/002asx0e.gif&quot;,
                        };

# new widths for your images
# if you don&apos;t have an image for a specific type, leave it blank to use the original
var string{} new_widths = {
                           &quot;personal&quot;    =&amp;gt; &quot;17&quot;,
                           &quot;community&quot;   =&amp;gt; &quot;16&quot;,
                           &quot;syndicated&quot;  =&amp;gt; &quot;15&quot;,
                           &quot;news&quot;        =&amp;gt; &quot;17&quot;,
                           &quot;identity&quot;    =&amp;gt; &quot;16&quot;,
                           &quot;sponcomm&quot;    =&amp;gt; &quot;16&quot;,
                          };

# new heights for your images
# if you don&apos;t have an image for a specific type, leave it blank to use the original
var string{} new_heights = {
                            &quot;personal&quot;   =&amp;gt; &quot;17&quot;,
                            &quot;community&quot;  =&amp;gt; &quot;16&quot;,
                            &quot;syndicated&quot; =&amp;gt; &quot;18&quot;,
                            &quot;news&quot;       =&amp;gt; &quot;16&quot;,
                            &quot;identity&quot;   =&amp;gt; &quot;16&quot;,
                            &quot;sponcomm&quot;   =&amp;gt; &quot;16&quot;,
                           };

var string ie_url    = $new_urls{&quot;personal&quot;};
var string ie_width  = $new_widths{&quot;personal&quot;};
var string ie_height = $new_heights{&quot;personal&quot;};
&quot;&quot;&quot;
&amp;lt;style type=&quot;text/css&quot;&amp;gt;
.ljuser img { 
  width:             0;
  height:            0;
  background-repeat: no-repeat;

  /* so that IE users will still see an image */
  background-image: url($ie_url); 
  padding:          ${ie_height}px ${ie_width}px 0 0;
}
&quot;&quot;&quot;;

foreach var string type ($types_order) {
  var string old_url    = $old_urls{$type};
  var string new_url    = $new_urls{$type}    != &quot;&quot; ? $new_urls{$type}    : $old_url;
  var string new_width  = $new_widths{$type}  != &quot;&quot; ? $new_widths{$type}  : $old_widths{$type};
  var string new_height = $new_heights{$type} != &quot;&quot; ? $new_heights{$type} : $old_heights{$type};
  &quot;&quot;&quot;
.ljuser img[src=&quot;$old_url&quot;] {
  background-image: url($new_url);
  padding:          ${new_height}px ${new_width}px 0 0;
}
  &quot;&quot;&quot;;
}
&quot;&quot;&quot;
&amp;lt;/style&amp;gt;
&quot;&quot;&quot;;

}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/65321.html?view=comments#comments</comments>
  <category>class page</category>
  <category>function print_custom_head</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>54</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/65193.html</guid>
  <pubDate>Mon, 01 May 2006 05:30:22 GMT</pubDate>
  <title>Base64</title>
  <author>night_watch</author>
  <link>https://s2layers.livejournal.com/65193.html</link>
  <description>Simple one this time: Generation of Base64 and &lt;a href=&quot;http://en.wikipedia.org/wiki/Data:_URL&quot; target=&quot;_blank&quot;&gt;data: URLs&lt;/a&gt;. With a little hacking, you can embed little (dynamically-generated? hmmmm) images and stuff directly into your layout using this, no hosting needed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
# -----------------------------------------------------------------------------
#   S2 Base64 routines                                     v0.01 - 04/30/2006
#   Copyright (c) 2006 Patrick Walton but freely redistributable
# -----------------------------------------------------------------------------

function BSFEncodeBase64(int[] data) : string
{
    var string mapString =
        &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/&quot;;
    var string[] map;
    var int i = 0;
    foreach var string ch ($mapString) {
        $map[$i] = $ch;
        $i++;
    }

    var string result = &quot;&quot;;
    var int val = 0;

    $i = 0;
    foreach var int octet ($data) {
        if ($i == 0) {          # 000000 00
            $val = $octet / 4;
            $result = $result + $map[$val];
            $val = $octet % 4;
            $i++;
        } elseif ($i == 1) {    # 001111 1111
            $val = $val * 16 + $octet / 16;
            $result = $result + $map[$val];
            $val = $octet % 16;
            $i++;
        } else {                # 111122 222222
            $val = $val * 4 + $octet / 64;
            $result = $result + $map[$val];
            $val = $octet % 64;
            $result = $result + $map[$val];
            $i = 0;
        }
    }

    if ($i == 1) {              # one input byte remaining
        $val = $val * 16;
        $result = $result + $map[$val] + &quot;==&quot;;
    } elseif ($i == 2) {        # two input bytes remaining
        $val = $val * 4;
        $result = $result + $map[$val] + &quot;=&quot;;
    }

    return $result;
}

function BSFGenerateDataURL(int[] data, string mimeType) : string
{
    return &quot;data:&quot; + $mimeType + &quot;;base64,&quot; + BSFEncodeBase64($data);
}

# -- End of Base64 package ----------------------------------------------------

&lt;/pre&gt;&lt;br /&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/65193.html?view=comments#comments</comments>
  <category>string functions</category>
  <lj:security>public</lj:security>
  <lj:poster>night_watch</lj:poster>
  <lj:posterid>1482266</lj:posterid>
  <lj:reply-count>1</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/65012.html</guid>
  <pubDate>Sat, 29 Apr 2006 20:11:09 GMT</pubDate>
  <title>EntryPage is hosed after Timezone Support Update</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/65012.html</link>
  <description>those of you using the code in &lt;a href=&quot;http://community.livejournal.com/s2layers/41265.html&quot; target=&quot;_blank&quot;&gt;this entry&lt;/a&gt; or those of you who have overridden &lt;code&gt;Page::print_entry(Entry e)&lt;/code&gt; or &lt;code&gt;EntryPage::print_comment(Comment e)&lt;/code&gt; are prolly getting errors when you view entries or reply to comments.  the following edits should fix that.&lt;br /&gt;&lt;br /&gt;in &lt;code&gt;EntryPage::print_comment(Comment e)&lt;/code&gt;:&lt;pre&gt;&lt;code&gt;    if (not $e.full) {
        # Collapsed mode

        &quot;&amp;lt;div class=&apos;comment collapsed-comment&apos;&quot;+($e.dom_id ? &quot; id=&apos;$e.dom_id&apos;&quot; : &quot;&quot;)+&quot;&amp;gt;\n&quot;;
        &quot;&amp;lt;div class=&apos;comment-footer&apos;&amp;gt;&quot;;
        var string subject = $e.subject;
        if ($subject == &quot;&quot;) { $subject = $*text_nosubject; }
        &quot;&amp;lt;a href=&apos;$e.permalink_url&apos; class=&apos;collapsed-comment-link&apos;&amp;gt;$subject&amp;lt;/a&amp;gt; &amp;lt;span class=&apos;separator&apos;&amp;gt;-&amp;lt;/span&amp;gt; &quot;;
&lt;span style=&quot;color:red;text-decoration:line-through;&quot;&gt;#       print lang_posted_by_date_and_time($e.poster, $e.time, true, true, true);&lt;/span&gt;
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;        print lang_posted_by_date_and_time($e, $e.poster, $e.time, true, true, true);&lt;/span&gt;
        &quot;&amp;lt;/div&amp;gt;&quot;;
        &quot;&amp;lt;/div&amp;gt;&quot;;

        return;
    }&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;also in &lt;code&gt;EntryPage::print_comment(Comment e)&lt;/code&gt;:&lt;pre&gt;&lt;code&gt;    var string sep = &quot;&amp;lt;span class=&apos;separator&apos;&amp;gt;|&amp;lt;/span&amp;gt;&quot;;
 
&lt;span style=&quot;color:red;text-decoration:line-through;&quot;&gt;#   print lang_posted_by_date_and_time($e.poster, $e.time, true, true, true)+&quot; $sep &quot;;&lt;/span&gt;
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;    print lang_posted_by_date_and_time($e, $e.poster, $e.time, true, true, true)+&quot; $sep &quot;;&lt;/span&gt;
 
    &quot;&amp;lt;a class=&apos;permalink&apos; href=&apos;$e.permalink_url&apos;&amp;gt;$*text_permalink&amp;lt;/a&amp;gt;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;in &lt;code&gt;Page::print_entry(Entry e)&lt;/code&gt;:&lt;pre&gt;&lt;code&gt;         if ($showdate or $showtime or $showposter) {
&lt;span style=&quot;color:red;text-decoration:line-through;&quot;&gt;#            print lang_posted_by_date_and_time($e.poster, $e.journal, $e.time, $showposter, $showdate, $showtime)+&quot; $sep &quot;;&lt;/span&gt;
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;             print lang_posted_by_date_and_time($e, $e.poster, $e.journal, $e.time, $showposter, $showdate, $showtime)+&quot; $sep &quot;;&lt;/span&gt;
         }
         &quot;&amp;lt;a class=&apos;permalink&apos; href=&apos;$e.permalink_url&apos;&amp;gt;$*text_permalink&amp;lt;/a&amp;gt;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/65012.html?view=comments#comments</comments>
  <category>function print_entry</category>
  <category>class page</category>
  <category>function print_comment</category>
  <category>class entrypage</category>
  <category>layout bloggish</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>3</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/64664.html</guid>
  <pubDate>Tue, 18 Apr 2006 01:31:58 GMT</pubDate>
  <title>Unicode character functions (chr/fromCharCode and ord/charCodeAt)</title>
  <author>night_watch</author>
  <link>https://s2layers.livejournal.com/64664.html</link>
  <description>As some of you may have noticed, S2&apos;s Unicode support is rather buggy. I&apos;ve written a little package to convert S2 strings to and from their Unicode character numbers. If you&apos;ve programmed Perl, this is the equivalent of chr() and ord(). If you&apos;ve programmed Java or JavaScript, this is the same as fromCharCode() and charCodeAt(). I&apos;ve tested it on input from a variety of sources, and it seems to work in all cases.&lt;br /&gt;&lt;br /&gt;Hopefully this&apos;ll add a little sanity to S2&apos;s handling of Unicode.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Be sure your browser&apos;s encoding is set correctly before copying this into your layer. There are some funky characters here, and if they don&apos;t copy correctly things will break badly!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# -----------------------------------------------------------------------------
#   UC - S2 Unicode package                                v0.02 - 04/18/2006
#   Copyright (c) 2006 Patrick Walton but freely redistributable
# -----------------------------------------------------------------------------

# Converts the given 32-bit integer to a binary string.
function UCIntToBinaryString(int n) : string
{
    var string str = &amp;#x22;&amp;#x22;;

    var int power = 32768;
    foreach var int i (0..31) {
        if ($n &amp;#x3E;= $power) {
            $n = $n - $power;
            $str = $str + &amp;#x22;1&amp;#x22;;
        } else {
            $str = $str + &amp;#x22;0&amp;#x22;;
        }

        $power = $power / 2; 
    }

    foreach var int i (0..2) {
        if ($str-&amp;#x3E;starts_with(&amp;#x22;00000000&amp;#x22;)) {
            $str = $str-&amp;#x3E;substr(8, $str-&amp;#x3E;length() - 8);
        }
    }

    return $str;
}

# Converts the given binary string to an integer.
function UCBinaryStringToInt(string str) : int
{
    var int n = 0;
    var int power = 1;

    var string reversedStr = reverse $str;
    foreach var string bit ($reversedStr) {
        if ($bit == &amp;#x22;1&amp;#x22;) {
            $n = $n + $power;
        }

        $power = $power * 2;
    }

    return $n;
}

# Like Java String.toCharArray(), turns a string into an array of Unicode code
# points.
function UCConvertStringToCodePoints(string str) : int[]
{
    var int{} baseCharPoints = {
        &amp;#x22; &amp;#x22; =&amp;#x3E; 32, &amp;#x22;,&amp;#x22; =&amp;#x3E; 44, &amp;#x22;-&amp;#x22; =&amp;#x3E; 45, &amp;#x22;.&amp;#x22; =&amp;#x3E; 46, &amp;#x22;/&amp;#x22; =&amp;#x3E; 47, &amp;#x22;0&amp;#x22; =&amp;#x3E; 48, 
        &amp;#x22;1&amp;#x22; =&amp;#x3E; 49, &amp;#x22;2&amp;#x22; =&amp;#x3E; 50, &amp;#x22;3&amp;#x22; =&amp;#x3E; 51, &amp;#x22;4&amp;#x22; =&amp;#x3E; 52, &amp;#x22;5&amp;#x22; =&amp;#x3E; 53, &amp;#x22;6&amp;#x22; =&amp;#x3E; 54, 
        &amp;#x22;7&amp;#x22; =&amp;#x3E; 55, &amp;#x22;8&amp;#x22; =&amp;#x3E; 56, &amp;#x22;9&amp;#x22; =&amp;#x3E; 57, &amp;#x22;:&amp;#x22; =&amp;#x3E; 58, &amp;#x22;A&amp;#x22; =&amp;#x3E; 65, &amp;#x22;B&amp;#x22; =&amp;#x3E; 66, 
        &amp;#x22;C&amp;#x22; =&amp;#x3E; 67, &amp;#x22;D&amp;#x22; =&amp;#x3E; 68, &amp;#x22;E&amp;#x22; =&amp;#x3E; 69, &amp;#x22;F&amp;#x22; =&amp;#x3E; 70, &amp;#x22;G&amp;#x22; =&amp;#x3E; 71, &amp;#x22;H&amp;#x22; =&amp;#x3E; 72, 
        &amp;#x22;I&amp;#x22; =&amp;#x3E; 73, &amp;#x22;J&amp;#x22; =&amp;#x3E; 74, &amp;#x22;K&amp;#x22; =&amp;#x3E; 75, &amp;#x22;L&amp;#x22; =&amp;#x3E; 76, &amp;#x22;M&amp;#x22; =&amp;#x3E; 77, &amp;#x22;N&amp;#x22; =&amp;#x3E; 78, 
        &amp;#x22;O&amp;#x22; =&amp;#x3E; 79, &amp;#x22;P&amp;#x22; =&amp;#x3E; 80, &amp;#x22;Q&amp;#x22; =&amp;#x3E; 81, &amp;#x22;R&amp;#x22; =&amp;#x3E; 82, &amp;#x22;S&amp;#x22; =&amp;#x3E; 83, &amp;#x22;T&amp;#x22; =&amp;#x3E; 84, 
        &amp;#x22;U&amp;#x22; =&amp;#x3E; 85, &amp;#x22;V&amp;#x22; =&amp;#x3E; 86, &amp;#x22;W&amp;#x22; =&amp;#x3E; 87, &amp;#x22;X&amp;#x22; =&amp;#x3E; 88, &amp;#x22;Y&amp;#x22; =&amp;#x3E; 89, &amp;#x22;Z&amp;#x22; =&amp;#x3E; 90, 
        &amp;#x22;\\&amp;#x22; =&amp;#x3E; 92, &amp;#x22;_&amp;#x22; =&amp;#x3E; 95, &amp;#x22;a&amp;#x22; =&amp;#x3E; 97, &amp;#x22;b&amp;#x22; =&amp;#x3E; 98, &amp;#x22;c&amp;#x22; =&amp;#x3E; 99, &amp;#x22;d&amp;#x22; =&amp;#x3E; 100, 
        &amp;#x22;e&amp;#x22; =&amp;#x3E; 101, &amp;#x22;f&amp;#x22; =&amp;#x3E; 102, &amp;#x22;g&amp;#x22; =&amp;#x3E; 103, &amp;#x22;h&amp;#x22; =&amp;#x3E; 104, &amp;#x22;i&amp;#x22; =&amp;#x3E; 105, &amp;#x22;j&amp;#x22; =&amp;#x3E; 106, 
        &amp;#x22;k&amp;#x22; =&amp;#x3E; 107, &amp;#x22;l&amp;#x22; =&amp;#x3E; 108, &amp;#x22;m&amp;#x22; =&amp;#x3E; 109, &amp;#x22;n&amp;#x22; =&amp;#x3E; 110, &amp;#x22;o&amp;#x22; =&amp;#x3E; 111, &amp;#x22;p&amp;#x22; =&amp;#x3E; 112, 
        &amp;#x22;q&amp;#x22; =&amp;#x3E; 113, &amp;#x22;r&amp;#x22; =&amp;#x3E; 114, &amp;#x22;s&amp;#x22; =&amp;#x3E; 115, &amp;#x22;t&amp;#x22; =&amp;#x3E; 116, &amp;#x22;u&amp;#x22; =&amp;#x3E; 117, &amp;#x22;v&amp;#x22; =&amp;#x3E; 118, 
        &amp;#x22;w&amp;#x22; =&amp;#x3E; 119, &amp;#x22;x&amp;#x22; =&amp;#x3E; 120, &amp;#x22;y&amp;#x22; =&amp;#x3E; 121, &amp;#x22;z&amp;#x22; =&amp;#x3E; 122
    };

    var string{} hexNibbles = {
        &amp;#x22;0&amp;#x22; =&amp;#x3E;  &amp;#x22;0000&amp;#x22;, &amp;#x22;1&amp;#x22; =&amp;#x3E;  &amp;#x22;0001&amp;#x22;, &amp;#x22;2&amp;#x22; =&amp;#x3E;  &amp;#x22;0010&amp;#x22;, &amp;#x22;3&amp;#x22; =&amp;#x3E;  &amp;#x22;0011&amp;#x22;,
        &amp;#x22;4&amp;#x22; =&amp;#x3E;  &amp;#x22;0100&amp;#x22;, &amp;#x22;5&amp;#x22; =&amp;#x3E;  &amp;#x22;0101&amp;#x22;, &amp;#x22;6&amp;#x22; =&amp;#x3E;  &amp;#x22;0110&amp;#x22;, &amp;#x22;7&amp;#x22; =&amp;#x3E;  &amp;#x22;0111&amp;#x22;,
        &amp;#x22;8&amp;#x22; =&amp;#x3E;  &amp;#x22;1000&amp;#x22;, &amp;#x22;9&amp;#x22; =&amp;#x3E;  &amp;#x22;1001&amp;#x22;, &amp;#x22;A&amp;#x22; =&amp;#x3E;  &amp;#x22;1010&amp;#x22;, &amp;#x22;B&amp;#x22; =&amp;#x3E;  &amp;#x22;1011&amp;#x22;,
        &amp;#x22;C&amp;#x22; =&amp;#x3E;  &amp;#x22;1100&amp;#x22;, &amp;#x22;D&amp;#x22; =&amp;#x3E;  &amp;#x22;1101&amp;#x22;, &amp;#x22;E&amp;#x22; =&amp;#x3E;  &amp;#x22;1110&amp;#x22;, &amp;#x22;F&amp;#x22; =&amp;#x3E;  &amp;#x22;1111&amp;#x22;
    };

    var int[] translatedString = [];
    var string bitString = &amp;#x22;&amp;#x22;;

    foreach var string ch ($str) {
        var int codePoint;

        var bool wasBase = false;
        if ($baseCharPoints{$ch}) {
            if ($bitString == &amp;#x22;&amp;#x22;) { # ugly but S2 has no exists on hashes, sigh
                $codePoint = $baseCharPoints{$ch};
                $translatedString[size $translatedString] = $codePoint;
                $wasBase = true;
            }
        }

        if (not $wasBase) {
            var string hexString = eurl($ch);   # and magic happens!

            var string thisBitString = &amp;#x22;&amp;#x22;;
            foreach var string nibble ($hexString) {
                if (($nibble &amp;#x3E;= &amp;#x22;0&amp;#x22; and $nibble &amp;#x3C;= &amp;#x22;9&amp;#x22;) or
                    ($nibble &amp;#x3E;= &amp;#x22;A&amp;#x22; and $nibble &amp;#x3C;= &amp;#x22;F&amp;#x22;)) {
                    $thisBitString = $thisBitString + $hexNibbles{$nibble};
                }
            }

            # Add a null high nibble if needed
            if ($thisBitString-&amp;#x3E;length() % 8 == 4) {
                $thisBitString = &amp;#x22;0000&amp;#x22; + $bitString;
            }

            $bitString = $bitString + $thisBitString;

            var bool finished = false;
            if ($bitString-&amp;#x3E;starts_with(&amp;#x22;0&amp;#x22;)) {         # 0xxxxxxx
                $finished = true;
            } elseif ($bitString-&amp;#x3E;starts_with(&amp;#x22;110&amp;#x22;) and $bitString-&amp;#x3E;length()
                == 16) {                                # 110zzzzx 10xxxxxx
                $finished = true;
                $bitString =    $bitString-&amp;#x3E;substr(3, 5) +
                                $bitString-&amp;#x3E;substr(10, 6);
            } elseif ($bitString-&amp;#x3E;starts_with(&amp;#x22;1110&amp;#x22;) and $bitString-&amp;#x3E;length()
                == 24) {                                # 1110zzzz ...
                $finished = true;
                $bitString =    $bitString-&amp;#x3E;substr(4, 4) +
                                $bitString-&amp;#x3E;substr(10, 6) +
                                $bitString-&amp;#x3E;substr(18, 6);
            } elseif ($bitString-&amp;#x3E;starts_with(&amp;#x22;11110&amp;#x22;) and $bitString-&amp;#x3E;length()
                == 32) {
                $finished = true;
                $bitString =    $bitString-&amp;#x3E;substr(5, 3) +
                                $bitString-&amp;#x3E;substr(10, 6) +
                                $bitString-&amp;#x3E;substr(18, 6) +
                                $bitString-&amp;#x3E;substr(26, 6);
            }

            if ($finished) {
                $codePoint = UCBinaryStringToInt($bitString);
                $translatedString[size $translatedString] = $codePoint;
                $bitString = &amp;#x22;&amp;#x22;;
            } 
        }
    }

    return $translatedString;
}

# Like &amp;#x22;ord&amp;#x22; in Perl and &amp;#x22;String.charCodeAt()&amp;#x22; in Java and JavaScript, returns
# the Unicode code point that represents character pos in string str.
function UCGetCodePointAt(string str, int pos) : int
{
    var int[] translatedString = UCConvertStringToCodePoints($str);
    return $translatedString[$pos]; 
}

# Like String.fromCharArray() in Java, takes an array of code points and
# returns an S2 string.
function UCConvertCodePointsToString(int[] codePoints) : string
{
    # To say that this function is hacky is an understatement. The theory is
    # that this string contains every single legal UTF-8 byte. We then cut up
    # this string, Frankenstein-style, to piece together the result string.

    var string fundamentalString = 
	&amp;#x22;&amp;#x1;&amp;#x2;&amp;#x3;&amp;#x4;&amp;#x5;&amp;#x6;&amp;#x7;&amp;#x8; \n&amp;#xB;&amp;#xC; &amp;#xE;&amp;#xF;&amp;#x10;&amp;#x11;&amp;#x12;&amp;#x13;&amp;#x14;&amp;#x15;&amp;#x16;&amp;#x17;&amp;#x18;&amp;#x19;&amp;#x1A;&amp;#x1B;&amp;#x1C;&amp;#x1D;&amp;#x1E;&amp;#x1F; !\&amp;#x22;#\$%&amp;#x22; +
	&amp;#x22;&amp;#x26;&apos;()*+,-./0123456789:;&amp;#x3C;=&amp;#x3E;?@ABCDEFGHIJKLM&amp;#x22; +
	&amp;#x22;NOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrst&amp;#x22; +
	&amp;#x22;uvwxyz{|}~ &amp;#x100;&amp;#x101;&amp;#x102;&amp;#x103;&amp;#x104;&amp;#x105;&amp;#x106;&amp;#x107;&amp;#x108;&amp;#x109;&amp;#x10A;&amp;#x10B;&amp;#x10C;&amp;#x10D;&amp;#x10E;&amp;#x10F;&amp;#x110;&amp;#x111;&amp;#x112;&amp;#x113;&amp;#x114;&amp;#x115;&amp;#x116;&amp;#x117;&amp;#x118;&amp;#x119;&amp;#x11A;&amp;#x11B;&amp;#x11C;&amp;#x22; +
	&amp;#x22;&amp;#x11D;&amp;#x11E;&amp;#x11F;&amp;#x120;&amp;#x121;&amp;#x122;&amp;#x123;&amp;#x124;&amp;#x125;&amp;#x126;&amp;#x127;&amp;#x128;&amp;#x129;&amp;#x12A;&amp;#x12B;&amp;#x12C;&amp;#x12D;&amp;#x12E;&amp;#x12F;&amp;#x130;&amp;#x131;&amp;#x132;&amp;#x133;&amp;#x134;&amp;#x135;&amp;#x136;&amp;#x137;&amp;#x138;&amp;#x139;&amp;#x13A;&amp;#x13B;&amp;#x13C;&amp;#x13D;&amp;#x13E;&amp;#x13F;&amp;#xC9;&amp;#x109;&amp;#x149;&amp;#x189;&amp;#x22; +
	&amp;#x22;&amp;#x1C9;&amp;#x209;&amp;#x249;&amp;#x289;&amp;#x2C9;&amp;#x309;&amp;#x349;&amp;#x389;&amp;#x3C9;&amp;#x409;&amp;#x449;&amp;#x489;&amp;#x4C9;&amp;#x509;&amp;#x549;&amp;#x589;&amp;#x5C9;&amp;#x609;&amp;#x649;&amp;#x689;&amp;#x6C9;&amp;#x709;&amp;#x749;&amp;#x789;&amp;#x7C9;&amp;#x1001;&amp;#x2001;&amp;#x3001;&amp;#x4001;&amp;#x5001;&amp;#x6001;&amp;#x7001;&amp;#x8001;&amp;#x9001;&amp;#xA001;&amp;#xB001;&amp;#xC001;&amp;#xD001;&amp;#xE001;&amp;#xF001;&amp;#x22; +
	&amp;#x22;       &amp;#x22;;

    # Change the code points into an array of UTF-8 bytes.
    var int[] utf8Bytes = [];
    foreach var int codePoint ($codePoints) {
        if ($codePoint &amp;#x3C;= 127) {
            $utf8Bytes[size $utf8Bytes] = $codePoint;
        } else {
            var string binaryString = UCIntToBinaryString($codePoint);
            if ($binaryString-&amp;#x3E;starts_with(&amp;#x22;00000&amp;#x22;)) {
                $utf8Bytes[size $utf8Bytes] = UCBinaryStringToInt(&amp;#x22;110&amp;#x22; +
                    $binaryString-&amp;#x3E;substr(5, 5));
                $utf8Bytes[size $utf8Bytes] = UCBinaryStringToInt(&amp;#x22;10&amp;#x22; +
                    $binaryString-&amp;#x3E;substr(10, 6));
            } else {
                $utf8Bytes[size $utf8Bytes] = UCBinaryStringToInt(&amp;#x22;1110&amp;#x22; +
                    $binaryString-&amp;#x3E;substr(0, 4));
                $utf8Bytes[size $utf8Bytes] = UCBinaryStringToInt(&amp;#x22;10&amp;#x22; +
                    $binaryString-&amp;#x3E;substr(4, 6));
                $utf8Bytes[size $utf8Bytes] = UCBinaryStringToInt(&amp;#x22;10&amp;#x22; +
                    $binaryString-&amp;#x3E;substr(10, 6));
            }
        }
    }

    var string convertedString = &amp;#x22;&amp;#x22;;
    foreach var int utf8Byte ($utf8Bytes) {
        # Find the position we want in the fundamental string.
        var int fsIndex;
        if ($utf8Byte == 0) {
            $fsIndex = 0;
        } elseif ($utf8Byte &amp;#x3C;= 127) {
            $fsIndex = $utf8Byte - 1;
        } elseif ($utf8Byte &amp;#x3C;= 191) {
            $fsIndex = 127 + ($utf8Byte - 128)*2 + 1;
        } elseif ($utf8Byte &amp;#x3C;= 193) {
            $fsIndex = 0;
        } elseif ($utf8Byte &amp;#x3C;= 223) {
            $fsIndex = 127 + ($utf8Byte - 130)*2;
        } elseif ($utf8Byte &amp;#x3C;= 224) {
            $fsIndex = 0;
        } elseif ($utf8Byte &amp;#x3C;= 239) {
            $fsIndex = 309 + ($utf8Byte - 223)*3;
        } elseif ($utf8Byte &amp;#x3C;= 240) {
            $fsIndex = 0;
        } else {
            $fsIndex = 0;
        }

        # Navigate to that position and insert the character.
        var int i = 0;
        foreach var string ch ($fundamentalString) {
            if ($i == $fsIndex) {
                $convertedString = $convertedString + $ch;
            }

            $i++;
        }
    }

    return $convertedString;
}

# Like Java and JavaScript String.fromCharCode and Perl chr, converts the given
# Unicode code point to a string.
function UCConvertCodePointToString(int codePoint) : string
{
    var int[] cps = [ $codePoint ];
    return UCConvertCodePointsToString($cps);
}

# -- End of S2 Unicode routines -----------------------------------------------

&lt;/pre&gt;&lt;br /&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/64664.html?view=comments#comments</comments>
  <category>string functions</category>
  <lj:mood>geeky</lj:mood>
  <lj:security>public</lj:security>
  <lj:poster>night_watch</lj:poster>
  <lj:posterid>1482266</lj:posterid>
  <lj:reply-count>6</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/64439.html</guid>
  <pubDate>Fri, 14 Apr 2006 17:52:08 GMT</pubDate>
  <title>[theme] - [opal] - [tags redirect]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/64439.html</link>
  <description>&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;
############################################
# LiveJournal Tags List and Redirector     #
# by lj:kunzite1, posted by lj:xtomxfallsx #
# Component: component-help/873563         #
# Opal:      s2layers/64439                #
############################################&lt;/span&gt; 

  var string      k1TRheader    = &quot;&lt;span class=&quot;&quot;&gt;Tags In This Journal&lt;/span&gt;&quot;; &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# set the boxheader text, you can change this to whatever you want&lt;/span&gt;
  var string      k1TRbutton    = &quot;&lt;span class=&quot;&quot;&gt;Go&lt;/span&gt;&quot;;                   &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# button text, change it to whatever you want&lt;/span&gt;
  var bool        k1TRblank     = &lt;span class=&quot;&quot;&gt;true&lt;/span&gt;;                   &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# set to true to create a blank option at top the list, or false not to&lt;/span&gt;

  &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# No need to change anything below this line (unless you know what you are doing!)&lt;/span&gt;
 
  var string      k1TRbase_url  = $.journal-&amp;gt;base_url(); 
  var string      k1TRcontent   = &quot;&quot;;
  var TagDetail[] k1TRtags      = $this-&amp;gt;visible_tag_list();

  foreach var TagDetail k1TRtag ($k1TRtags) {
    $k1TRcontent = $k1TRcontent + &quot;&quot;&quot;&amp;lt;option value=&quot;$k1TRtag.name&quot;&amp;gt;$k1TRtag.name&amp;lt;/option&amp;gt;\n&quot;&quot;&quot;;
  }

  $k1TRcontent = &quot;&quot;&quot;
  &amp;lt;form action=&quot;$k1TRbase_url/&quot; method=&quot;get&quot;&amp;gt;
    &amp;lt;select id=&quot;tags_select&quot; name=&quot;tag&quot;&amp;gt;&quot;&quot;&quot; + $k1TRcontent;
    if($k1TRblank) {
      $k1TRcontent = $k1TRcontent + &quot;&quot;&quot;      &amp;lt;option value=&quot;&quot; selected=&quot;selected&quot;&amp;gt;&amp;lt;/option&amp;gt;\n&quot;&quot;&quot;;
    }
    $k1TRcontent = $k1TRcontent + &quot;&quot;&quot;
    &amp;lt;/select&amp;gt;&amp;lt;br /&amp;gt;
    &amp;lt;input type=&quot;submit&quot; value=&quot;$k1TRbutton&quot; /&amp;gt;
  &amp;lt;/form&amp;gt;&quot;&quot;&quot;;

  print_box($k1TRheader, $k1TRcontent);&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/64439.html?view=comments#comments</comments>
  <category>function lay_print_sidebar</category>
  <category>class page</category>
  <category>layout opal</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>3</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/64164.html</guid>
  <pubDate>Mon, 10 Apr 2006 22:13:44 GMT</pubDate>
  <title>Adding linklist support to Gradient Strip</title>
  <author>camomiletea</author>
  <link>https://s2layers.livejournal.com/64164.html</link>
  <description>This lack has been bugging me since I switched to Gradient Strip on my other journals. An example may be seen at: &lt;a target=&apos;_blank&apos; href=&apos;http://camomiletea.livejournal.com/?s2id=10802076&apos;&gt;http://camomiletea.livejournal.com/?s2id=10802076&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First adding the function:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;function Page::print_linklist() {
	if (size $.linklist &amp;lt;= 0) {
		return;
	}

	var bool slash = false;
	var string links;

	lay_nav_box_top();
	
	foreach var UserLink l ($.linklist) {
		if ($l.title) {
			if ($l.is_heading) {
				&quot;&quot;&quot;&amp;lt;strong&amp;gt;$l.title&amp;lt;/strong&amp;gt;&quot;&quot;&quot;;
				$slash = false;
			} else {
				if($slash) {
					&quot;&quot;&quot; $*link_divider &quot;&quot;&quot;;
				}
				&quot;&quot;&quot; &amp;lt;a href=&quot;$l.url&quot;&amp;gt;$l.title&amp;lt;/a&amp;gt; &quot;&quot;&quot;;
				$slash = true;
			}
		} else {
			&quot;&amp;lt;br /&amp;gt;&quot;;
		}
	}

	lay_nav_box_bottom();
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then we need to add &lt;span style=&quot;color:blue&quot;&gt;$this-&amp;gt;print_linklist();&lt;/span&gt; to the function Page::print, as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;function Page::print()  {
   var string title = $.global_title;
   var string subtitle = $.global_subtitle; 
   var string view_title = $this-&amp;gt;view_title() != &quot;&quot; ? $this-&amp;gt;view_title() : &quot;Unknown View&quot;;

   &quot;&quot;&quot;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot;
     &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&amp;gt;
   &amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
   &amp;lt;head&amp;gt;
   &quot;&quot;&quot;;
         $this-&amp;gt;print_head();
         println &quot;&quot;&quot;&amp;lt;title&amp;gt;$title :: $view_title&amp;lt;/title&amp;gt;&quot;&quot;&quot;;
         if ($*external_stylesheet) {
            print safe &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 {
            &quot;&quot;&quot;&amp;lt;style type=&quot;text/css&quot;&amp;gt;&quot;&quot;&quot;; 
            start_css();
            print_stylesheet(); 
            end_css();
            &quot;&amp;lt;/style&amp;gt;&quot;;
         }
   &quot;&quot;&quot;&amp;lt;/head&amp;gt;
   &amp;lt;body&amp;gt;&quot;&quot;&quot;;
   $this-&amp;gt;print_control_strip();
   $this-&amp;gt;lay_print_header();
   if (viewer_sees_ads()) {
      &quot;&quot;&quot;&amp;lt;table width=&quot;100%&quot; height=&quot;100%&quot;&amp;gt;&quot;&quot;&quot;;
      &quot;&quot;&quot;&amp;lt;tr&amp;gt;&amp;lt;td valign=&quot;top&quot;&amp;gt;&quot;&quot;&quot;;
   }
   &lt;span style=&quot;color:blue&quot;&gt;$this-&amp;gt;print_linklist();&lt;/span&gt;
   $this-&amp;gt;print_body();
   if (viewer_sees_ads()) {
      &quot;&amp;lt;/td&amp;gt;&quot;;
      &quot;&quot;&quot;&amp;lt;td valign=&quot;top&quot; align=&quot;right&quot; width=&quot;20%&quot;&amp;gt;&quot;&quot;&quot;;
      &quot;&quot;&quot;&amp;lt;div style=&quot;margin-right: 10px;&quot;&amp;gt;&quot;&quot;&quot;;
      $this-&amp;gt;print_ad(&quot;Journal-Skyscraper&quot;);
      &quot;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&quot;;
   }
   &quot;&quot;&quot;&amp;lt;/body&amp;gt;
   &amp;lt;/html&amp;gt;&quot;&quot;&quot;;
}&lt;/pre&gt;&lt;br /&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/64164.html?view=comments#comments</comments>
  <category>function print</category>
  <category>class page</category>
  <category>layout gradient strip</category>
  <category>function print_linklist</category>
  <lj:security>public</lj:security>
  <lj:poster>camomiletea</lj:poster>
  <lj:posterid>1321849</lj:posterid>
  <lj:reply-count>10</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://s2layers.livejournal.com/63971.html</guid>
  <pubDate>Mon, 10 Apr 2006 07:01:12 GMT</pubDate>
  <title>navigation strip</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/63971.html</link>
  <description>i just now added &lt;code&gt;$this-&amp;gt;print_control_strip();&lt;/code&gt; to all the entries tagged with &lt;a href=&quot;http://community.livejournal.com/s2layers/tag/function+print&quot; target=&quot;_blank&quot;&gt;function print&lt;/a&gt;.  if y&apos;all who have time could check &apos;em for me and make sure i didn&apos;t break anything, that&apos;d be awesome.&lt;br /&gt;&lt;br /&gt;disabling comments on this entry.  please leave bug reports on the corresponding entries.&lt;br /&gt;&lt;br /&gt;many thankies. :)</description>
  <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://s2layers.livejournal.com/63264.html</guid>
  <pubDate>Sat, 08 Apr 2006 05:52:11 GMT</pubDate>
  <title>yay for capital letters!!!</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/63264.html</link>
  <description>BIG ANNOYING BOLD TYPE WARNING THAT ALL SHOULD READ ABOUT THE NAVIGATION STRIP CODE THAT I POSTED: DO NOT ATTEMPT THIS UNLESS YOU HAVE AMPLE PAID TIME LEFT OR A PERMANENT ACCOUNT. THE NAVIGATION STRIP MAY CHANGE IN THE FUTURE AND THIS CODE MAY BECOME OBSOLETE VERY FAST. PLZ 2 HEED THIS WARNING KTHX.</description>
  <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://s2layers.livejournal.com/63161.html</guid>
  <pubDate>Fri, 07 Apr 2006 20:51:47 GMT</pubDate>
  <title>[theme] - [haven] - [k1ified print_entry]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/63161.html</link>
  <description>in response to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;dancingyel&quot; lj:user=&quot;dancingyel&quot; &gt;&lt;a href=&quot;https://dancingyel.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://dancingyel.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;dancingyel&lt;/b&gt;&lt;/a&gt;&lt;a class=&quot;i-ljuser-badge i-ljuser-badge--pro&quot; data-badge-type=&quot;pro&quot; data-placement=&quot;bottom&quot; data-pro-badge data-pro-badge-type=&quot;1&quot; data-is-raw hidden href=&quot;#&quot;&gt;&lt;span class=&quot;i-ljuser-badge__icon&quot;&gt;&lt;svg class=&quot;svgicon&quot; width=&quot;25&quot; height=&quot;16&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 33 24&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M19.326 11.95c0 2.01 1.47 3.45 3.48 3.45 2.02 0 3.49-1.44 3.49-3.45 0-2.01-1.47-3.45-3.49-3.45-2.01 0-3.48 1.44-3.48 3.45Zm5.51 0c0 1.24-.8 2.19-2.03 2.19-1.23 0-2.02-.95-2.02-2.19 0-1.25.79-2.19 2.02-2.19s2.03.94 2.03 2.19ZM7.92 15.28H6.5V8.61h3.12c1.45 0 2.24.98 2.24 2.15 0 1.16-.8 2.15-2.24 2.15h-1.7v2.37Zm1.51-3.62c.56 0 .98-.35.98-.9 0-.56-.42-.9-.98-.9H7.92v1.8h1.51ZM18.3802 15.28h-1.63l-1.31-2.37h-1.04v2.37h-1.42V8.61h3.12c1.39 0 2.24.91 2.24 2.15 0 1.18-.74 1.81-1.46 1.98l1.5 2.54Zm-2.49-3.62c.57 0 1-.34 1-.9s-.43-.9-1-.9h-1.49v1.8h1.49Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M2 8c0-2.20914 1.79086-4 4-4h20.5c2.2091 0 4 1.79086 4 4v7.9c0 2.2091-1.7909 4-4 4H6c-2.20914 0-4-1.7909-4-4V8Zm4-2.5h20.5C27.8807 5.5 29 6.61929 29 8v7.9c0 1.3807-1.1193 2.5-2.5 2.5H6c-1.38071 0-2.5-1.1193-2.5-2.5V8c0-1.38071 1.11929-2.5 2.5-2.5Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-deleted  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2haven&quot; lj:user=&quot;s2haven&quot; &gt;&lt;a href=&quot;https://s2haven.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://s2haven.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2haven&lt;/b&gt;&lt;/a&gt;&lt;a class=&quot;i-ljuser-badge i-ljuser-badge--pro&quot; data-badge-type=&quot;pro&quot; data-placement=&quot;bottom&quot; data-pro-badge data-pro-badge-type=&quot;1&quot; data-is-raw hidden href=&quot;#&quot;&gt;&lt;span class=&quot;i-ljuser-badge__icon&quot;&gt;&lt;svg class=&quot;svgicon&quot; width=&quot;25&quot; height=&quot;16&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 33 24&quot;&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M19.326 11.95c0 2.01 1.47 3.45 3.48 3.45 2.02 0 3.49-1.44 3.49-3.45 0-2.01-1.47-3.45-3.49-3.45-2.01 0-3.48 1.44-3.48 3.45Zm5.51 0c0 1.24-.8 2.19-2.03 2.19-1.23 0-2.02-.95-2.02-2.19 0-1.25.79-2.19 2.02-2.19s2.03.94 2.03 2.19ZM7.92 15.28H6.5V8.61h3.12c1.45 0 2.24.98 2.24 2.15 0 1.16-.8 2.15-2.24 2.15h-1.7v2.37Zm1.51-3.62c.56 0 .98-.35.98-.9 0-.56-.42-.9-.98-.9H7.92v1.8h1.51ZM18.3802 15.28h-1.63l-1.31-2.37h-1.04v2.37h-1.42V8.61h3.12c1.39 0 2.24.91 2.24 2.15 0 1.18-.74 1.81-1.46 1.98l1.5 2.54Zm-2.49-3.62c.57 0 1-.34 1-.9s-.43-.9-1-.9h-1.49v1.8h1.49Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;path fill-rule=&quot;evenodd&quot; d=&quot;M2 8c0-2.20914 1.79086-4 4-4h20.5c2.2091 0 4 1.79086 4 4v7.9c0 2.2091-1.7909 4-4 4H6c-2.20914 0-4-1.7909-4-4V8Zm4-2.5h20.5C27.8807 5.5 29 6.61929 29 8v7.9c0 1.3807-1.1193 2.5-2.5 2.5H6c-1.38071 0-2.5-1.1193-2.5-2.5V8c0-1.38071 1.11929-2.5 2.5-2.5Z&quot; clip-rule=&quot;evenodd&quot;/&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://community.livejournal.com/s2haven/17680.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;set tags_aware         = true;
set text_meta_location = &quot;Current Location:&quot;;
set text_meta_mood     = &quot;Current Mood:&quot;;
set text_meta_music    = &quot;Current Music:&quot;;

function CommentInfo::print_readlink() {
  var string img_url    = &quot;&quot;;
  var int    img_width  = 0;
  var int    img_height = 0;
  var bool   img_count  = false;

  if($.show_readlink) {
    var Page p      = get_page();
    var string url  = $.read_url;
    var string text = get_plural_phrase($.count, &quot;text_read_comments&quot; + ($p.view == &quot;friends&quot; ? &quot;_friends&quot; : &quot;&quot;));
    if($.screened) {
      $text = $text + &quot; &quot; + $*text_month_screened_comments;
    }

    if($url != &quot;&quot;) {
      &quot;&quot;&quot;&amp;lt;a href=&quot;$url&quot;&amp;gt;&quot;&quot;&quot;;
    }
    if($img_url != &quot;&quot;) {
      if($img_count) {
        print $.count;
      }
      &quot;&quot;&quot;&amp;lt;img src=&quot;$img_url&quot; width=&quot;$img_width&quot; height=&quot;$img_height&quot; alt=&quot;$text&quot; title=&quot;$text&quot; border=&quot;0&quot; /&amp;gt;&quot;&quot;&quot;;
    } else {
      print $text;
    }
    if($url != &quot;&quot;) {
      &quot;&quot;&quot;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
    }
  }
}

function CommentInfo::print_postlink() {
  var string img_url    = &quot;&quot;;
  var int    img_width  = 0;
  var int    img_height = 0;

  if($.show_postlink) {
    var Page p      = get_page();
    var string url  = $.post_url;
    var string text = get_plural_phrase(0, &quot;text_post_comment&quot; + ($p.view == &quot;friends&quot; ? &quot;_friends&quot; : &quot;&quot;));
    if($.maxcomments) {
      $url  = &quot;&quot;;
      $text = $*text_max_comments;
    }

    if($url != &quot;&quot;) {
      &quot;&quot;&quot;&amp;lt;a href=&quot;$url&quot;&amp;gt;&quot;&quot;&quot;;
    }
    if($img_url != &quot;&quot;) {
      &quot;&quot;&quot;&amp;lt;img src=&quot;$img_url&quot; width=&quot;$img_width&quot; height=&quot;$img_height&quot; alt=&quot;$text&quot; title=&quot;$text&quot; border=&quot;0&quot; /&amp;gt;&quot;&quot;&quot;;
    } else {
      print $text;
    }
    if($url != &quot;&quot;) {
      &quot;&quot;&quot;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
    }
  }
}

function CommentInfo::print() {
  var string text_comment_divider = &quot; | &quot;;

  if($.show_readlink) {
    $this-&amp;gt;print_readlink();
    if($.show_postlink) {
      print $text_comment_divider;
    }
  }
  if($.show_postlink) {
    $this-&amp;gt;print_postlink();
    print $text_comment_divider;
  }
}

function Entry::print_metadata() {
  var string tags_header         = &quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;Current Tags&lt;/span&gt;&quot;; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# text for tags header,    &quot;Current Tags&quot;&lt;/span&gt;
  var string tags_joiner         = &quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;:&lt;/span&gt;&quot;;            &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# text for tags joiner,    &quot;:&quot;&lt;/span&gt;
  var string tags_sep            = &quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;, &lt;/span&gt;&quot;;           &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# text for tags separator, &quot;, &quot;&lt;/span&gt;

  var bool   show_edit_tags_link = &lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;false&lt;/span&gt;;          &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# set to true if you want edit tags link as tags header&lt;/span&gt;

  var string currents_open       = &quot;&quot;&quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;&amp;lt;div class=&quot;currents&quot;&amp;gt;&lt;/span&gt;&quot;&quot;&quot;; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# html for opening of currents container&lt;/span&gt;
  var string currents_close      = &quot;&quot;&quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&quot;&quot;&quot;; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# html for closing of currents container&lt;/span&gt;

  var bool   loc_after_mood      = &lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;false&lt;/span&gt;;               &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# set to true to print location after mood&lt;/span&gt;
  var bool   vanilla_loc         = &lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;false&lt;/span&gt;;               &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# set to true to delinkify location&lt;/span&gt;

  # if you need data specific to the meta to be in these strings you&apos;ll have to set those individually down further
  # one example is provided with meta_label_open
  var string meta_label_open     = &quot;&quot;;               &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# html for opening of metadata label&lt;/span&gt;

  var string meta_label_close    = &quot;&quot;&quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;&amp;lt;/strong&amp;gt; &lt;/span&gt;&quot;&quot;&quot;; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# html for closing of metadata label&lt;/span&gt;
  var string meta_val_open       = &quot;&quot;;               &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# html for opening of metadata value&lt;/span&gt;
  var string meta_val_close      = &quot;&quot;&quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&quot;&quot;&quot;;     &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# html for closing of metadata value&lt;/span&gt;

  var Link   edit_tags           = $this-&amp;gt;get_link(&quot;edit_tags&quot;); &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# helper var to see if remote user can edit tags&lt;/span&gt;

  if ((size $.metadata &amp;gt; 0) or ((size $.tags &amp;gt; 0) and ($*tags_aware))){
    if($.metadata{&quot;mood&quot;} == &quot;&quot; and $loc_after_mood) {
      &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if we&apos;re printing loc after mood but we have no mood, set loc_after_mood to false&lt;/span&gt;
      $loc_after_mood = false;
    }
    var string currents = &quot;&quot;;             &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# make var for printing&lt;/span&gt;

    $currents           = $currents_open; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# add opening of currents container&lt;/span&gt;

    foreach var string k ($.metadata){  &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# step thru metadata&lt;/span&gt;
      var string text = $k;             &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# set text to key&lt;/span&gt;
      var string val  = $.metadata{$k}; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# get val&lt;/span&gt;

      if ($k == &quot;mood&quot;){                &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if mood, set text to mood property&lt;/span&gt;
        $text = $*text_meta_mood;
        if (defined $.mood_icon){       &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if we have a mood icon, add it&lt;/span&gt;
          var Image i = $.mood_icon;
          $val        = &quot;&quot;&quot;&amp;lt;img src=&quot;$i.url&quot; width=&quot;$i.width&quot; height=&quot;$i.height&quot; align=&quot;middle&quot; alt=&quot;$val&quot; title=&quot;$val&quot; /&amp;gt; $val&quot;&quot;&quot;;
        }
      } 
      elseif ($k == &quot;music&quot;) {          &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if music, set text to music property&lt;/span&gt;
        $text = $*text_meta_music;
      } elseif ($k == &quot;location&quot;) {     &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if location, set text to loc variable&lt;/span&gt;

        $text = $*text_meta_location;
        if($vanilla_loc) {              &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if vanilla loc, striphtml() it&lt;/span&gt;
          $val = striphtml($val);
        }
      }
      if(not ($k == &quot;location&quot; and $loc_after_mood)) {
        &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if we&apos;re doing loc right now and printing loc after mood, skip it
        # if we&apos;re doing loc right now and we&apos;re not printing loc after mood, print it now
        # if we&apos;re not doing loc right now, print this piece of meta

        # in this layout, each piece of meta gets its own class&lt;/span&gt;
        $meta_label_open  = &quot;&quot;&quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;&amp;lt;div class=&quot;current$k&quot;&amp;gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&quot;&quot;&quot;;

        &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# add the meta&lt;/span&gt;
        $currents = $currents + &quot;&quot;&quot;$meta_label_open$text$meta_label_close$meta_val_open$val$meta_val_close&quot;&quot;&quot;;
      }

      if($k == &quot;mood&quot; and $loc_after_mood) {
        &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if we just now did the mood and we&apos;re printing loc after mood, print the loc&lt;/span&gt;

        $k    = &quot;location&quot;;           &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# set meta key to &quot;location&quot;&lt;/span&gt;
        $text = $*text_meta_location; &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# set text to loc variable&lt;/span&gt;
        $val  = $.metadata{$k};       &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# get val

        # if we have a loc, do stuff&lt;/span&gt;
        if($val != &quot;&quot;) {

          &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if vanilla loc, striphtml() it&lt;/span&gt;
          if($vanilla_loc) {
            $val = striphtml($val);
          }

          &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# in this layout, each piece of meta gets its own class&lt;/span&gt;

          $meta_label_open  = &quot;&quot;&quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;&amp;lt;div class=&quot;current$k&quot;&amp;gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&quot;&quot;&quot;;

          &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# add the meta&lt;/span&gt;
          $currents         = $currents + &quot;&quot;&quot;$meta_label_open$text$meta_label_close$meta_val_open$val$meta_val_close&quot;&quot;&quot;;
        }
      }
    }
    if ((size $.tags &amp;gt; 0) and $*tags_aware) {
      var string k      = &quot;tags&quot;; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# set key to &quot;tags&quot;&lt;/span&gt;

      &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# in this layout, each piece of meta gets its own class&lt;/span&gt;

      $meta_label_open  = &quot;&quot;&quot;&lt;span style=&quot;color: maroon; font-style: italic;&quot;&gt;&amp;lt;div class=&quot;current$k&quot;&amp;gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&quot;&quot;&quot;;

      var int tcount = 0; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# set counter for tags&lt;/span&gt;
      if($edit_tags.url != &quot;&quot; and $show_edit_tags_link) { &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if remote user can edit tags, let&apos;s give them a link&lt;/span&gt;
        $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;;
      }

      &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# add text, open val container&lt;/span&gt;

      $currents = $currents + &quot;&quot;&quot;$meta_label_open$tags_header$tags_joiner$meta_label_close$meta_val_open&quot;&quot;&quot;;

      &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# build tag list&lt;/span&gt;
      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++;

        &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if we haven&apos;t hit the last tag, add a separator&lt;/span&gt;
        if ($tcount != size $.tags) { $currents = $currents + $tags_sep; }
      }

      &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# close val container&lt;/span&gt;
      $currents = $currents + $meta_val_close;
    }

    &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# close currents container&lt;/span&gt;

    $currents = $currents + $currents_close;

    &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# print currents&lt;/span&gt;
    println &quot;$currents&quot;;
  }
}

function Entry::print_linkbar() {
  var string   link_seperator = &quot; | &quot;; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# seperator for links&lt;/span&gt;

  &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# initialize array/hashes&lt;/span&gt;
  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;;                                         &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# var for printing&lt;/span&gt;
  var Page   p               = get_page();                                 &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# page handle to determine interentry&lt;/span&gt;
  var bool   show_interentry = ($p.view == &quot;entry&quot; or $p.view == &quot;reply&quot;); &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if entry/reply view, show interentry&lt;/span&gt;
  var int    keyseq_index    = 0;                                          &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# set index point for new link_keyseq array&lt;/span&gt;

  if($show_interentry) {
    &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if show interentry, put previous entry link first&lt;/span&gt;
    $link_keyseq[$keyseq_index++] = &quot;nav_prev&quot;;

    &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# get previous entry link information&lt;/span&gt;
    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;

    &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# get next entry link information&lt;/span&gt;
    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;
  }

  &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# gather current linkbar&lt;/span&gt;
  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; &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# add this to new link_keyseq array&lt;/span&gt;
  }
  if($show_interentry) {
    &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;# if show interentry, put next entry link last&lt;/span&gt;
    $link_keyseq[$keyseq_index++] = &quot;nav_next&quot;;
  }

&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;  #################################################################################################################
  # 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                                   #
  #################################################################################################################&lt;/span&gt;

&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;  # disable images&lt;/span&gt;
  $link_image{&quot;nav_prev&quot;   } = &quot;&quot;;
  $link_image{&quot;mem_add&quot;    } = &quot;&quot;;
  $link_image{&quot;edit_entry&quot; } = &quot;&quot;;
  $link_image{&quot;edit_tags&quot;  } = &quot;&quot;;
  $link_image{&quot;tell_friend&quot;} = &quot;&quot;;
  $link_image{&quot;nav_next&quot;   } = &quot;&quot;;

&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;  # loop thru linkbar and add links to print var&lt;/span&gt;
  foreach var string link_key ($link_keyseq) {
&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;    # if we can do performed action, url will be present&lt;/span&gt;
    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;;
&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;      # if image url available, use it&lt;/span&gt;
      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 {
&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;        # else, just use text&lt;/span&gt;
        $print = $print + &quot;$link_caption{$link_key}&quot;;
      }
&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;      # add a seperator&lt;/span&gt;
      $print = $print + &quot;&amp;lt;/a&amp;gt;$link_seperator&quot;;
    }
  }

&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;  # hack off last seperator&lt;/span&gt;
  $print = $print-&amp;gt;substr(0, $print-&amp;gt;length() - $link_seperator-&amp;gt;length());

&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;  # we&apos;re done! let&apos;s print it!&lt;/span&gt;
  print $print;
}

function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor, bool viewing_thread) {
  var string entry = &quot;&quot;;

  var bool   have_meta = (size ($e.metadata) &amp;gt; 0);
  var bool   have_tags = ($*tags_aware and (size ($e.tags) &amp;gt; 0));

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # Named anchor to link from page summary&lt;/span&gt;
  $entry = $entry + &quot;&quot;&quot;&amp;lt;a name=&quot;entry_$e.itemid&quot;&amp;gt;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
  $entry = $entry + &quot;&quot;&quot;&amp;lt;div class=&quot;entry&quot;&amp;gt;&quot;&quot;&quot;;
  var string subject = $e.subject != &quot;&quot; ? $e.subject : $*text_nosubject;
  var string time    = $e.time-&amp;gt;time_format();
  $entry = $entry + &quot;&quot;&quot;&amp;lt;h4 class=&quot;subject&quot;&amp;gt;$e.security_icon $subject @ $time&amp;lt;/h4&amp;gt;&quot;&quot;&quot;;
  $entry = $entry + &quot;&quot;&quot;&amp;lt;div class=&quot;text&quot;&amp;gt;&quot;&quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # build poster info&lt;/span&gt;
  if(
     (
      $p.view == &quot;friends&quot; or
      (not $e.poster-&amp;gt;equals($e.journal)) or
      ($*show_entry_userpic and defined $e.userpic)
     )
    ) {
    if ($p.view == &quot;friends&quot;) {
      if (defined $e.userpic) {
        $entry = $entry + &quot;&quot;&quot;&amp;lt;img src=&quot;$e.userpic.url&quot; width=&quot;$e.userpic.width&quot; style=&quot;color: $fgcolor; background: $bgcolor; border: 5px solid $bgcolor;&quot; height=&quot;$e.userpic.height&quot; alt=&quot;&quot; class=&quot;userpic&quot; /&amp;gt;&quot;&quot;&quot;;
      }
      if (not $e.poster-&amp;gt;equals($e.journal)) {
        $entry = $entry + $e.poster-&amp;gt;as_string() + &quot;, posting in &quot;;
      }
      $entry = $entry + $e.journal-&amp;gt;as_string() + &quot;:&amp;lt;br /&amp;gt;&quot;;
    } elseif (not $e.poster-&amp;gt;equals($e.journal)) {
      if (defined $e.userpic) {
        $entry = $entry + &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; class=&quot;userpic&quot; /&amp;gt;&quot;&quot;&quot;;
      }
      $entry = $entry + $e.poster-&amp;gt;as_string() + &quot;:&amp;lt;br /&amp;gt;&quot;;
    } elseif (defined $e.userpic) {
      $entry = $entry + &quot;&quot;&quot;&amp;lt;p&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;&quot; class=&quot;userpic&quot; /&amp;gt;&quot;&quot;&quot;;
    }
  }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # print what we&apos;ve got and clear it&lt;/span&gt;
  print $entry;
  $entry = &quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # print metadata&lt;/span&gt;
  $e-&amp;gt;print_metadata();

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # if we have meta or tags, add a line break&lt;/span&gt;
  if ($have_meta or $have_tags) {
    $entry = &quot;$entry&amp;lt;br /&amp;gt;&quot;;
  }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # print what we&apos;ve got and clear it&lt;/span&gt;
  print $entry;
  $entry = &quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # if we&apos;re not viewing a thread, print entry text&lt;/span&gt;
  if (not $viewing_thread) {
    $e-&amp;gt;print_text();
  }

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # add some more blank lines&lt;/span&gt;
  $entry = $entry + &quot;&quot;&quot;&amp;lt;div class=&quot;clearer&quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
  $entry = $entry + &quot;&amp;lt;/div&amp;gt;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # Comments&lt;/span&gt;
  $entry = $entry + &quot;&quot;&quot;&amp;lt;div class=&quot;comments&quot;&amp;gt;&quot;&quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # print what we&apos;ve got and clear it&lt;/span&gt;
  print $entry;
  $entry = &quot;&quot;;

  $e.comments-&amp;gt;print();
  $e-&amp;gt;print_linkbar();

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # close entry div&lt;/span&gt;
  $entry = $entry + &quot;&amp;lt;/div&amp;gt;&quot;;
  $entry = $entry + &quot;&amp;lt;/div&amp;gt;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # print what we&apos;ve got and clear it&lt;/span&gt;
  print $entry;
  $entry = &quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/63161.html?view=comments#comments</comments>
  <category>function print_entry</category>
  <category>class entry</category>
  <category>function print_linkbar</category>
  <category>function print</category>
  <category>class commentinfo</category>
  <category>function print_postlink</category>
  <category>function print_metadata</category>
  <category>function print_readlink</category>
  <category>layout haven</category>
  <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://s2layers.livejournal.com/62881.html</guid>
  <pubDate>Fri, 07 Apr 2006 19:45:29 GMT</pubDate>
  <title>[theme] - [generator] - [move navigation strip to bottom]</title>
  <author>kunzite1</author>
  <link>https://s2layers.livejournal.com/62881.html</link>
  <description>in response to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-deleted  i-ljuser-type-P     &quot;  data-ljuser=&quot;panda_cookie&quot; lj:user=&quot;panda_cookie&quot; &gt;&lt;a href=&quot;https://panda-cookie.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/userinfo_v8.png?v=17080&amp;v=923.1&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://panda-cookie.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;panda_cookie&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2styles&quot; lj:user=&quot;s2styles&quot; &gt;&lt;a href=&quot;https://s2styles.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://s2styles.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2styles&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; &lt;a href=&quot;http://community.livejournal.com/s2styles/325086.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;&lt;b&gt;BIG ANNOYING WARNING: DO NOT ATTEMPT THIS UNLESS YOU HAVE AMPLE PAID TIME LEFT OR A PERMANENT ACCOUNT.  THE NAVIGATION STRIP MAY CHANGE IN THE FUTURE AND THIS CODE MAY BECOME OBSOLETE VERY FAST.  PLZ 2 HEED THIS WARNING KTHX.&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function Page::print_custom_head() {
var int    nav_strip_border_width = 2;         &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# navigation strip border width          (2 for generator)&lt;/span&gt;
var string nav_strip_font_family  = &quot;Verdana&quot;; &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# navigation strip font family           (&quot;$*font_base, $*font_fallback&quot; for generator)&lt;/span&gt;
var Color  nav_strip_link_fgcolor = &quot;#0000ff&quot;; &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# navigation strip link color            ($*page_link for generator)&lt;/span&gt;
var Color  nav_strip_main_bgcolor = &quot;#ffffff&quot;; &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# navigation strip main background color ($*entry_back for generator)&lt;/span&gt;
var Color  nav_strip_main_fgcolor = &quot;#000000&quot;; &lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;# navigation strip main foreground color ($*entry_text for generator)&lt;/span&gt;
&quot;&quot;&quot;
&amp;lt;style type=&quot;text/css&quot;&amp;gt;
&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;/* set body padding to 0 */&lt;/span&gt;
html body {
  padding: 0 0 0 0;
}

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;/* un-stick navigation strip */&lt;/span&gt;
#lj_controlstrip {
  position: relative;
}

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;/* set navigation strip bgcolor/fgcolor/font */&lt;/span&gt;
#lj_controlstrip td, #lj_controlstrip a,  #lj_controlstrip input, #lj_controlstrip_statustext {
  background-color: $nav_strip_main_bgcolor;
  color:            $nav_strip_main_fgcolor;
  font-family:      $nav_strip_font_family;
}

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;/* set navigation strip link color */&lt;/span&gt;
#lj_controlstrip a {
  color: $nav_strip_link_fgcolor;
}

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;/* add border to whole navigation strip */&lt;/span&gt;
#lj_controlstrip {
  border: ${nav_strip_border_width}px solid $nav_strip_main_fgcolor;
}

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;/* alter navigation strip table cell borders */&lt;/span&gt;
#lj_controlstrip_user, #lj_controlstrip_userlinks, #lj_controlstrip_login {
  border-color: $nav_strip_main_fgcolor;
  border-width: ${nav_strip_border_width}px;
}

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;/* hide the server signature since it doesn&apos;t seem to play nice with moving the navigation strip */&lt;/span&gt;
#lj_controlstrip_poweredby {
  display: none;
}
&amp;lt;/style&amp;gt;
&quot;&quot;&quot;;
}

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

  var string website_name = $.journal.website_name ? $.journal.website_name : $*text_website_default_name;
  var string website;
  if ($.journal.website_url != &quot;&quot;) {
    $website = &quot;&quot;&quot;&amp;lt;tr&amp;gt;&amp;lt;td class=&quot;meta&quot;&amp;gt;[&amp;lt;/td&amp;gt;
    &amp;lt;td class=&quot;meta&quot; align=&quot;right&quot;&amp;gt;&amp;lt;b&amp;gt;$*text_website&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;td class=&quot;meta&quot; align=&quot;center&quot;&amp;gt;|&amp;lt;/td&amp;gt;
    &amp;lt;td class=&quot;meta&quot; align=&quot;left&quot;&amp;gt;&amp;lt;a href=&quot;$.journal.website_url&quot;&amp;gt;$website_name&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;td class=&quot;meta&quot;&amp;gt;]&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&quot;&quot;&quot;;
  }

  var string links = &quot;&quot;;
  var bool firstlink = true;
  foreach var string v ($.views_order) {
    var string url  = $.view_url{$v};
    var string text = lang_viewname($v);
    if ($firstlink == false) {
      $links = &quot;$links|&quot;;
    } else {
      $firstlink = false;
    }
    if($.view == $v) {
      $links = $links + &quot;&quot;&quot;&amp;lt;b&amp;gt;$text&amp;lt;/b&amp;gt;&quot;&quot;&quot;;
    } else {
      $links = $links + &quot;&quot;&quot;&amp;lt;a class=&quot;index&quot; href=&quot;$url&quot;&amp;gt;$text&amp;lt;/a&amp;gt;&quot;&quot;&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;;

  $this-&amp;gt;print_head();

  if ($*external_stylesheet) {
    println safe &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;; start_css(); print_stylesheet(); end_css(); &quot;&amp;lt;/style&amp;gt;&quot;;
  }

  &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;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # remove navigation strip from top&lt;/span&gt;
&lt;span style=&quot;color:red;font-weight:bold;text-decoration:line-through;&quot;&gt;  # $this-&amp;gt;print_control_strip();&lt;/span&gt;

  if (viewer_sees_ads()) {
    &quot;&quot;&quot;
  &amp;lt;table width=&quot;100%&quot; height=&quot;100%&quot;&amp;gt;
    &amp;lt;tr&amp;gt;
      &amp;lt;td valign=&quot;top&quot;&amp;gt;&quot;&quot;&quot;;
  }

  &quot;&quot;&quot;
        &amp;lt;div align=&quot;center&quot;&amp;gt;
          &amp;lt;table width=&quot;$*box_width&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot;&amp;gt;
            &amp;lt;tr&amp;gt;
              &amp;lt;td bgcolor=&quot;$*stronger_back&quot; align=&quot;center&quot;&amp;gt;
                &amp;lt;table width=&quot;100%&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot;&amp;gt;
                  &amp;lt;tr class=&quot;caption&quot;&amp;gt;
                    &amp;lt;td class=&quot;caption&quot; align=&quot;left&quot;&amp;gt;&amp;lt;b&amp;gt;$title&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;
                    &amp;lt;td class=&quot;index&quot; align=&quot;right&quot;&amp;gt;[$links]&amp;lt;/td&amp;gt;
                  &amp;lt;/tr&amp;gt;
                &amp;lt;/table&amp;gt;
                &amp;lt;table width=&quot;100%&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot;&amp;gt;
                  &amp;lt;tr&amp;gt;
                    &amp;lt;td class=&quot;shadowed&quot; align=&quot;center&quot;&amp;gt;
                      &amp;lt;table cellspacing=&quot;5&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&amp;gt;
                        &amp;lt;tr&amp;gt;&quot;&quot;&quot;;
  $this-&amp;gt;lay_top_userpic();

  var string sitename_lc = $*SITENAMESHORT-&amp;gt;lower();

  &quot;&quot;&quot;
                          &amp;lt;td&amp;gt;
                            &amp;lt;div align=&quot;center&quot;&amp;gt;&amp;lt;b&amp;gt;$.journal.name&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;p&amp;gt;
                            &amp;lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot;&amp;gt;
                              $website
                              &amp;lt;tr&amp;gt;
                                &amp;lt;td class=&quot;meta&quot;&amp;gt;[&amp;lt;/td&amp;gt;
                                &amp;lt;td class=&quot;meta&quot; align=&quot;right&quot;&amp;gt;&amp;lt;b&amp;gt;&quot;&quot;&quot;+lang_viewname(&quot;userinfo&quot;)+&quot;&quot;&quot;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;
                                &amp;lt;td class=&quot;meta&quot; align=&quot;center&quot;&amp;gt;|&amp;lt;/td&amp;gt;
                                &amp;lt;td class=&quot;meta&quot; align=&quot;left&quot;&amp;gt;&amp;lt;a href=&quot;$.view_url{&quot;userinfo&quot;}&quot;&amp;gt;$sitename_lc userinfo&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
                                &amp;lt;td class=&quot;meta&quot;&amp;gt;]&amp;lt;/td&amp;gt;
                              &amp;lt;/tr&amp;gt;
                              &amp;lt;tr&amp;gt;
                                &amp;lt;td class=&quot;meta&quot;&amp;gt;[&amp;lt;/td&amp;gt;
                                &amp;lt;td class=&quot;meta&quot; align=&quot;right&quot;&amp;gt;&amp;lt;b&amp;gt;&quot;&quot;&quot;+lang_viewname(&quot;archive&quot;)+&quot;&quot;&quot;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;
                                &amp;lt;td class=&quot;meta&quot; align=&quot;center&quot;&amp;gt;|&amp;lt;/td&amp;gt;
                                &amp;lt;td class=&quot;meta&quot; align=&quot;left&quot;&amp;gt;&amp;lt;a href=&quot;$.view_url{&quot;archive&quot;}&quot;&amp;gt;journal archive&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
                                &amp;lt;td class=&quot;meta&quot;&amp;gt;]&amp;lt;/td&amp;gt;
                              &amp;lt;/tr&amp;gt;
                            &amp;lt;/table&amp;gt;
                          &amp;lt;/td&amp;gt;
                        &amp;lt;/tr&amp;gt;
                      &amp;lt;/table&amp;gt;
                    &amp;lt;/td&amp;gt;
                  &amp;lt;/tr&amp;gt;
                &amp;lt;/table&amp;gt;
              &amp;lt;/td&amp;gt;
            &amp;lt;/tr&amp;gt;
          &amp;lt;/table&amp;gt;
  &quot;&quot;&quot;;

  if (size $.linklist &amp;gt; 0 and $*linklist_support) {
    $this-&amp;gt;print_linklist();
  }

  &quot;&quot;&quot;
          &amp;lt;p&amp;gt;&quot;&quot;&quot;;

  $this-&amp;gt;print_body();

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

  if (viewer_sees_ads()) {
    &quot;&quot;&quot;
      &amp;lt;/td&amp;gt;
      &amp;lt;td valign=&quot;top&quot; align=&quot;right&quot; width=&quot;20%&quot;&amp;gt;
        &amp;lt;table cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot;&amp;gt;
          &amp;lt;tr&amp;gt;
            &amp;lt;td bgcolor=&quot;$*stronger_back&quot; align=&quot;center&quot;&amp;gt;
              &amp;lt;table width=&quot;100%&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot;&amp;gt;
                &amp;lt;tr&amp;gt;
                  &amp;lt;td class=&quot;shadowed&quot; align=&quot;center&quot;&amp;gt;
                    &amp;lt;table cellspacing=&quot;5&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; summary=&quot;&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&amp;gt;
                      &amp;lt;tr&amp;gt;
                        &amp;lt;td&amp;gt;
                          &amp;lt;div align=&quot;center&quot;&amp;gt;
  &quot;&quot;&quot;;
  $this-&amp;gt;print_ad(&quot;Journal-Skyscraper&quot;);
  &quot;&quot;&quot;
                          &amp;lt;/div&amp;gt;
                        &amp;lt;/td&amp;gt;
                      &amp;lt;/tr&amp;gt;
                    &amp;lt;/table&amp;gt;
                  &amp;lt;/td&amp;gt;
                &amp;lt;/tr&amp;gt;
              &amp;lt;/table&amp;gt;
            &amp;lt;/td&amp;gt;
          &amp;lt;/tr&amp;gt;
        &amp;lt;/table&amp;gt;
      &amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
  &amp;lt;/table&amp;gt;
    &quot;&quot;&quot;;
  }
  &quot;&quot;&quot;
  &amp;lt;p&amp;gt;&quot;&quot;&quot;;

&lt;span style=&quot;color:green;font-weight:bold;&quot;&gt;  # put navigation strip at bottom&lt;/span&gt;
  $this-&amp;gt;print_control_strip();

  &quot;&quot;&quot;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://s2layers.livejournal.com/62881.html?view=comments#comments</comments>
  <category>function print</category>
  <category>entry navigation strip</category>
  <category>class page</category>
  <category>function print_custom_head</category>
  <category>layout generator</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>
