<?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>A Testing Journal</title>
  <link>https://murklinstest.livejournal.com/</link>
  <description>A Testing Journal - LiveJournal.com</description>
  <lastBuildDate>Mon, 10 Nov 2008 06:36:07 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>murklinstest</lj:journal>
  <lj:journalid>6664132</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://l-userpic.livejournal.com/34394095/6664132</url>
    <title>A Testing Journal</title>
    <link>https://murklinstest.livejournal.com/</link>
    <width>100</width>
    <height>100</height>
  </image>

  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/30111.html</guid>
  <pubDate>Mon, 10 Nov 2008 06:36:07 GMT</pubDate>
  <title>Flexible Squares: GMT in entries</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/30111.html</link>
  <description>Sometimes it&apos;s useful to know the exact time a post was made to LJ, especially on your flist. Here&apos;s a snippet of code to show the date &amp; time in GMT that the server recorded when the post was made.&lt;br /&gt;&lt;br /&gt;1. Make sure you have &lt;a href=&quot;http://community.livejournal.com/s2flexisquares/914.html&quot; target=&quot;_blank&quot;&gt;created a theme layer&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;2. If you don&apos;t have a &lt;code&gt;function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor)&lt;/code&gt; in your theme layer yet, go to the &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=4472608&quot; target=&quot;_blank&quot;&gt;Flexible Squares source&lt;/a&gt;, find the function, and copy it to your theme layer.&lt;br /&gt;&lt;br /&gt;3. Add the two segments of blue code below to your theme layer&apos;s &lt;code&gt;print_entry&lt;/code&gt; function:&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;&lt;pre&gt;&lt;code&gt;function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor)
{
    &quot;&quot;&quot;&amp;lt;a name=&quot;$e.journal.username$e.itemid&quot;&amp;gt;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
    $e-&amp;gt;print_linkbar();


    # Userpic

    var string userpic = &quot;&quot;;
    if ($*show_entry_userpic)
    {
        if ($p.view == &quot;friends&quot; or $p.view == &quot;entry&quot; or $p.view == &quot;reply&quot;)
        {
            if (defined $e.userpic)
                 {
                $userpic = $userpic + &quot;&quot;&quot;&amp;lt;img src=&quot;$e.userpic.url&quot; width=&quot;$e.userpic.width&quot; height=&quot;$e.userpic.height&quot;  alt=&quot;$e.poster.name&quot; title=&quot;$e.poster.name&quot;&quot;&quot;;
                    if ($e.poster.username != $e.journal.username)
                        {
                            $userpic = $userpic + &quot; in $e.journal.name&quot;;
                        }
                    $userpic = $userpic + &quot;\&quot;&amp;gt;&quot;;
                }
        }
        elseif ($p.journal_type == &quot;C&quot; and $p.view == &quot;recent&quot;)
        {
            if (defined $e.userpic)
                 {
                $userpic = $userpic + &quot;&quot;&quot;&amp;lt;img src=&quot;$e.userpic.url&quot; width=&quot;$e.userpic.width&quot; height=&quot;$e.userpic.height&quot;  alt=&quot;$e.poster.name&quot; title=&quot;$e.poster.name&quot; /&amp;gt;&quot;&quot;&quot;;
                }
        }
    else
        {
            if (defined $e.userpic)
                {
                 $userpic = $userpic + &quot;&quot;&quot;&amp;lt;div class=&quot;userpic&quot;&amp;gt;&amp;lt;img src=&quot;$e.userpic.url&quot; width=&quot;$e.userpic.width&quot; height=&quot;$e.userpic.height&quot; alt=&quot;$e.poster.name&quot; title=&quot;$e.poster.name&quot; /&amp;gt;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
                }
    }
    }
    print &quot;&quot;&quot;
        &amp;lt;div class=&quot;subcontent&quot;&amp;gt;
        &quot;&quot;&quot;;
        if (($p.view == &quot;recent&quot; and $p.journal_type != &quot;C&quot; ) or $p.view == &quot;day&quot;)
        {
            print &quot;&quot;&quot;$userpic&quot;&quot;&quot;;
        }
        else
        {
            if ($p.view == &quot;recent&quot; and $p.journal_type == &quot;C&quot; )
            {
                &quot;&quot;&quot;&amp;lt;div class=&quot;userpicfriends&quot; style=&quot;background-color: $*entry_bgcolor;&quot;&amp;gt;&quot;&quot;&quot;;
            }
            else
            {
                &quot;&quot;&quot;&amp;lt;div class=&quot;userpicfriends&quot; style=&quot;background-color: $bgcolor;&quot;&amp;gt;&quot;&quot;&quot;;
            }
            print &quot;&quot;&quot;$userpic&quot;&quot;&quot;;


    # Poster

            if ($p.view == &quot;friends&quot; or $p.view == &quot;entry&quot; or $p.view == &quot;reply&quot;)
            {
                var UserLite linkto;
                $linkto = $e.poster;
                #print &quot;$e.poster.username&quot;;
                &quot;&quot;&quot;&amp;lt;br /&amp;gt;&amp;lt;a href=\&quot;&quot;&quot;&quot; + $linkto-&amp;gt;base_url() + &quot;\&quot;&amp;gt;&quot;;
                 &quot;&amp;lt;font color=\&quot;$fgcolor\&quot;&amp;gt;$linkto.username&amp;lt;/font&amp;gt;&amp;lt;/a&amp;gt;&quot;;
            }
            elseif ($p.journal_type == &quot;C&quot; and $p.view == &quot;recent&quot;)
            {
                var UserLite linkto;
                $linkto = $e.poster;
                #print &quot;$e.poster.username&quot;;
                &quot;&quot;&quot;&amp;lt;br /&amp;gt;&amp;lt;a href=\&quot;&quot;&quot;&quot; + $linkto-&amp;gt;base_url() + &quot;\&quot;&amp;gt;&quot;;
                 &quot;$linkto.username&amp;lt;/a&amp;gt;&quot;;
            }
            if (($p.view == &quot;friends&quot; or $p.view == &quot;entry&quot; or $p.view == &quot;reply&quot;) and $e.poster.username != $e.journal.username)
            {
                    var UserLite linkto;
                $linkto = $e.journal;
                &quot;&quot;&quot;&amp;lt;br /&amp;gt;[&amp;lt;a href=\&quot;&quot;&quot;&quot; + $linkto-&amp;gt;base_url() + &quot;\&quot;&amp;gt;&quot;;
                 &quot;&amp;lt;font color=\&quot;$fgcolor\&quot;&amp;gt;$linkto.username&amp;lt;/font&amp;gt;&amp;lt;/a&amp;gt;]&quot;;
            }
            if ($p.view == &quot;recent&quot; and $p.journal_type == &quot;C&quot;)
            {
                print &quot;&amp;lt;/div&amp;gt;&quot;;
            }
            if ($p.view != &quot;recent&quot; and $p.view != &quot;day&quot;)
            {
                print &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
            }
        }



    # Date, time, subject

            &lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;# Show the system time in GMT
            var DateTime gmt = $e.system_time;
            var string gmtstr = &quot;&quot;;
            if ($p.view == &quot;friends&quot;) {
                $gmtstr = &quot;&quot;&quot; &amp;lt;span class=&quot;gmtdatetiem&quot;&amp;gt;[&quot;&quot;&quot; + $gmt-&amp;gt;date_format(&quot;%%mon%%. %%dayord%%&quot;) + &quot; &quot; + $gmt-&amp;gt;time_format() + &quot; GMT]&amp;lt;/span&amp;gt;&quot;;
            }&lt;/span&gt;

            var string time = &quot;&quot;;
            $time = $time + &quot;&quot;&quot; @ &quot;&quot;&quot;;
            $time = $time + $e.time-&amp;gt;time_format(&quot;short&quot;);
            var string date = &quot;&quot;;
            $date = $date + $e.time-&amp;gt;date_format(&quot;long_day&quot;);
            &quot;&quot;&quot;
            &amp;lt;div class=&quot;datesubject&quot;&amp;gt;&amp;lt;div class=&quot;date&quot;&amp;gt;&quot;&quot;&quot;;
                print $e.time-&amp;gt;date_format(&quot;%%dd%% %%month%% %%yyyy%%&quot;);
                &quot;$time &lt;span style=&quot;color: blue; font-weight: bold;&quot;&gt;$gmtstr&lt;/span&gt;
               &amp;lt;/div&amp;gt;&quot;;
            &quot;&quot;&quot;
            &amp;lt;div class=&quot;subject&quot;&amp;gt;&quot;&quot;&quot;;
                if ($e.security != &quot;&quot;)
                {
                    $e.security_icon-&amp;gt;print();
                }        
                if ($p.view != &quot;entry&quot;) {
                   &quot;&quot;&quot;&amp;lt;a href=&quot;$e.permalink_url&quot;&amp;gt;$e.subject&amp;lt;/a&amp;gt; &amp;amp;nbsp;&quot;&quot;&quot;;
                }
                else { print &quot;$e.subject &amp;amp;nbsp;&quot;; }
            &quot;&quot;&quot;&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
        &quot;&quot;&quot;;

         &quot;&quot;&quot;
         &amp;lt;div class=&quot;entry&quot;&amp;gt;
              &amp;lt;div class=&quot;entry_text&quot;&amp;gt;&quot;&quot;&quot;;

                        $e-&amp;gt;print_text();
                        print &quot;&amp;lt;/div&amp;gt; &quot;;

            # Currents

            var string currents =&quot;&quot;;
            $e-&amp;gt;print_metadata();

            # Comments

            &quot;&quot;&quot;
            &amp;lt;div class=&quot;clear&quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;
            &amp;lt;div class=&quot;comments&quot;&amp;gt;&quot;&quot;&quot;;
             if ($p.view != &quot;entry&quot; or $p.view != &quot;reply&quot;)
            {
                 $e.comments-&amp;gt;print();
            }
            elseif ($e.comments.enabled)
            {
                $e.comments-&amp;gt;print_postlink();
            }
            else
            {
                &quot;&amp;amp;nbsp;&quot;;
            }
            &quot;&quot;&quot;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

    &amp;lt;div class=&quot;separator&quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&quot;clear&quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;4. If you only want to show the system datetime in GMT on your Friends Page entries, hit Save &amp; Compile and you&apos;re done! If you prefer to have the system datetime show on ALL entries in your journal, go on to step 5.&lt;br /&gt;&lt;br /&gt;5. In the first segment of blue code that you added to the &lt;code&gt;print_entry&lt;/code&gt; function, find and delete these two highlighted lines:&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;            # Show the system time in GMT
            var DateTime gmt = $e.system_time;
            var string gmtstr = &quot;&quot;;
            &lt;span style=&quot;background-color: yellow;&quot;&gt;if ($p.view == &quot;friends&quot;) {&lt;/span&gt;
                $gmtstr = &quot;&quot;&quot; &amp;lt;span class=&quot;gmtdatetime&quot;&amp;gt;[&quot;&quot;&quot; + $gmt-&amp;gt;date_format(&quot;%%mon%%. %%dayord%%&quot;) + &quot; &quot; + $gmt-&amp;gt;time_format() + &quot; GMT]&amp;lt;/span&amp;gt;&quot;;
            &lt;span style=&quot;background-color: yellow;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;Now hit Save &amp; Compile and you&apos;re done!&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/30111.html?view=comments#comments</comments>
  <category>layout:flexiblesquares</category>
  <category>code:gmt</category>
  <lj:security>public</lj:security>
  <lj:reply-count>21</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/29836.html</guid>
  <pubDate>Thu, 10 May 2007 23:18:03 GMT</pubDate>
  <title>Style Contest: Multi-Level Tags with Abbreviations and Menu Links</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/29836.html</link>
  <description>This is code for when you have a lot of tag tiers, with long names, and you want to use a lot of abbreviations in the tags themselves, but have the Tags Page and sidebar tags box show the full tier names. This code also includes internal anchors to the first and second level tiers, and prints above the tiered list some menu links that point to those anchors. All top level tiers are in one group, and then you can customize which second level tiers you would like to have menu links for. Each second level tier you select will have its own group of links.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 1&lt;/b&gt;&lt;br /&gt;First, add this code near the top of your theme layer, just after all your &lt;code&gt;set&lt;/code&gt; lines. Here you are setting up the long form tier names and the abbreviations they map to. These will be used both on the Tags Page and in the sidebar box. Replace the example tags and abbreviations with your own. Notice that if you have built spaces into your tags after the delimiter character, you need to include that space here as well.&lt;br /&gt;&lt;pre style=&quot;color: black; background-color: #ffefbf;&quot;&gt;&lt;code&gt;class TagAliases {
  var string{} tag_aliases;
  function init();
}

&lt;span style=&quot;color: green;&quot;&gt;#### CONFIGURE THE TAG ALIASES ####&lt;/span&gt;

function TagAliases::init() {
    $this.tag_aliases = {
      &quot;&lt;span style=&quot;color: blue;&quot;&gt;[fandom wips]&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt;01&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt;[rps wips]&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt;02&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt;[other wips]&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt;03&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt; smallville&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt; sv&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt; cw network&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt; cw&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt; character&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt; ch&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt; slash&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt; sl&lt;/span&gt;&quot;
    };
}

&lt;span style=&quot;color: green;&quot;&gt;###################################&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Step 2&lt;/b&gt;&lt;br /&gt;Now add to your theme layer the sidebar box code and configure the blue values as desired:&lt;br /&gt;&lt;pre style=&quot;color: black; background-color: #ffefbf;&quot;&gt;&lt;code&gt;function print_module_tags(string title) {

&lt;span style=&quot;color: green;&quot;&gt;#####   Config   #####&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts? Set to true or false.&lt;/span&gt;
  var bool show_count = &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just before the use count, if any.&lt;/span&gt;
  var string pre_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;[&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just after the use count, if any.&lt;/span&gt;
  var string post_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;]&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Which secondary menus do you want to show? Use long form names, not abbreviations.
  # Separate each one by a comma. Only include spaces if they are used in the tag itself.&lt;/span&gt;
  var string secondary_menus = &quot;&lt;span style=&quot;color: blue;&quot;&gt;fanfiction,length&lt;/span&gt;&quot;;

&lt;span style=&quot;color: green;&quot;&gt;##### End Config #####&lt;/span&gt;

  var Page p = get_page();
  var string list = &quot;&quot;;
  var string menuone = &quot;&quot;;
  var string{} menutwo = {&quot;&quot; =&amp;gt; &quot;&quot;};
  var TagAliases ta = new TagAliases;
  $ta-&amp;gt;init();
  var string{} tag_aliases = $ta.tag_aliases;

  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);
    } 

    # mt:20070501
    var string{} tag_aliases_short;
    # Reindex tag alias hash using the values as keys to make lookups easier
    foreach var string k ($tag_aliases) {
      var string new_key = $tag_aliases{$k};
      $tag_aliases_short{$new_key} = $k;
    } 

    # mt:20070502
    # Reindex the tags so that we can quickly look up which tiers are true tags, not just labels
    var TagDetail{} truetags;
    foreach var TagDetail t ($p-&amp;gt;visible_tag_list()) {
      $truetags{$t.name} = $t;            
    }

    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;
        var bool show_all_tiers = false;
        var string menulink = &quot;&quot;;
        var string menuheader = &quot;&quot;;
        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:20070503
          # Find out if this tier is an alias for a longer tag name
          var string longname = $tier;
          if ($tag_aliases_short{$tier}) {
            $longname = $tag_aliases_short{$tier};
          }

          # mt:20070503
          # Find out if this tier has a longer form tag later or earlier in the list
          var string parenttiers  = &quot;&quot;;
          if ($pos &amp;gt; 0) {
            foreach var int i (0 .. ($pos - 1)) {
              $parenttiers  = $parenttiers + ($parenttiers == &quot;&quot; ? &quot;&quot; : $delimiter) + $tags[$i];
            }
          }
          var string realtagname = $parenttiers + ($parenttiers == &quot;&quot; ? &quot;&quot; : $delimiter) + $longname;
          var TagDetail realtag;
          if ($truetags{$realtagname}) {
            $realtag = $truetags{$realtagname};
          }
          else {
            $realtagname = &quot;&quot;;
          }

          # mt:20070509
          # Add anchors to first and second level tiers and generate menu links
          var string anchor = &quot;&quot;;
          $menulink = &quot;&quot;;
          if (($pos == 0) or ($pos == 1)) {
            $anchor = &quot;&quot;&quot;&amp;lt;a name=&quot;taganchor$delimiter$tags[0]&quot;&quot;&quot;;
            $anchor =  ($pos == 1) ? $anchor + $delimiter + $tags[1] : $anchor;
            $anchor = $anchor + &quot;&quot;&quot;&quot;&amp;gt;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;

            if ($pos == 0) {
              $menulink = &quot;&quot;&quot;&amp;lt;a href=&quot;#taganchor$delimiter$tags[0]&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }
            elseif ($pos == 1) {
              $menuheader = $tags[0];
              if ($tag_aliases_short{$tags[0]}) {
                $menuheader = $tag_aliases_short{$tags[0]};
              }
              $menulink = &quot;&quot;&quot;&amp;lt;a href=&quot;#taganchor$delimiter$tags[0]$delimiter$tags[1]&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }
          } 

          # mt:20070503
          # If we&apos;re on a tag&apos;s last tier, or if this tier (plus parent tiers) maps to a longer form real tag 
          # we need to return a link to the tag, otherwise plain text is returned.
          if ((size $tags == ($pos + 1)) or (defined $realtag)) {
            # mt:20070503
            # Find out if this tag is the longer form tag of an alias (in which case we need to hide it, since
            # it will be displayed instead of the alias, and shouldn&apos;t be repeated).
            var bool hasalias = false;
            if ($tag_aliases{$tier}) {
              $hasalias = true;
            }
            if ($hasalias and (size $tags == ($pos + 1))) {
              $tier_code = &quot;&quot;;              
            }
            elseif (defined $realtag) {
              $tier_code = &quot;&quot;&quot;$anchor&amp;lt;a href=&quot;$realtag.url&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }
            else {
              $tier_code = &quot;&quot;&quot;$anchor&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }

            if ($show_count and ($tier_code != &quot;&quot;)) {
              var int c = $t.use_count;
              if (defined $realtag) {
                $c = $realtag.use_count;
              }
              $tier_code = $tier_code + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}$c${post_count}&quot;&quot;&quot;;
            }
          }
          else {
            $tier_code = &quot;$anchor$longname&quot;;
          }

          # mt:20070503
          # If we&apos;ve decided that this tag needs to be skipped, do nothing on this loop
          if ($tier_code != &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 so omit it from this stage.
              $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;module-list-item&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;module-list-item&quot;&amp;gt;$tier_code&quot;&quot;&quot;;                  
              $closing_html[$pos] = &quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&quot;;
            }

            # mt:20070509
            # Add this as a menu link at the top of the page
            if ($pos == 0) {
              $menuone = $menuone + (($menuone == &quot;&quot;) ? &quot;&quot; : &quot; | &quot;) + $menulink;
            }
            elseif ($pos == 1) {
              $menutwo{$menuheader} = $menutwo{$menuheader} + (($menutwo{$menuheader} == &quot;&quot;) ? &quot;&quot; : &quot; | &quot;) +  $menulink;
            }  
          }
          elseif (($tags[$pos] != $prev_tags[$pos]) or ($show_all_tiers)) {  
            if ($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--;
              }   
              # mt:20070507
              # If we just closed some lists, that means that any lower tiers in this tag need to 
              # be explicitly displayed, even if they match the same-level tier of the previous tag
              $show_all_tiers = true;                 
            } 

            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;module-list-item&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;module-list-item&quot;&amp;gt;$tier_code&quot;&quot;&quot;;
            }      
     
            # mt:20070509
            # Add this as a menu link at the top of the page
            if ($pos == 0) {
              $menuone = $menuone + (($menuone == &quot;&quot;) ? &quot;&quot; : &quot; | &quot;) + $menulink;
            }
            elseif ($pos == 1) {
              $menutwo{$menuheader} = $menutwo{$menuheader} + (($menutwo{$menuheader} == &quot;&quot;) ? &quot;&quot; : &quot; | &quot;) +  $menulink;
            }                   
          }
          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;      
        $show_all_tiers = false;       
      }        
      # 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 = &quot;&quot;&quot;&amp;lt;ul class=&quot;module-list&quot;&amp;gt;&quot;&quot;&quot; + $list + $remaining_html + &quot;&amp;lt;/ul&amp;gt;&quot;;

    # mt:20070510
    # Add bracketing commas to the secondary menu links
    if ($secondary_menus-&amp;gt;ends_with(&quot;,&quot;) == false) { 
      $secondary_menus = $secondary_menus + &quot;,&quot;;
    }
    if ($secondary_menus-&amp;gt;starts_with(&quot;,&quot;) == false) {
      $secondary_menus = &quot;,&quot; + $secondary_menus;
    }

    open_module(&quot;categories&quot;, $title, &quot;&quot;);

    # mt:20070510
    # Print the primary menu links
    print ($menuone == &quot;&quot;) ? &quot;&quot; : &quot;&quot;&quot;&amp;lt;p class=&quot;topmenuone&quot;&amp;gt;[ $menuone ]&amp;lt;/p&amp;gt;&quot;&quot;&quot;;

    # mt:20070510
    # Print the secondary menu links
    foreach var string toplevel ($menutwo) {
      if ($toplevel != &quot;&quot;) {
        if ($secondary_menus-&amp;gt;contains(&quot;,&quot; + $toplevel + &quot;,&quot;)) {
          print ($menutwo{$toplevel} == &quot;&quot;) ? &quot;&quot; : &quot;&quot;&quot;&amp;lt;p class=&quot;topmenutwo&quot;&amp;gt;&amp;lt;span class=&quot;topmenuheader&quot;&amp;gt;$toplevel&amp;lt;/span&amp;gt; [ $menutwo{$toplevel} ]&amp;lt;/p&amp;gt;&quot;&quot;&quot;;
        }
      }
    }

    println $list;
    close_module();
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Step 3&lt;/b&gt;&lt;br /&gt;Finally, add this function for the Tags Page, again altering the blue configuration variables:&lt;br /&gt;&lt;pre style=&quot;color: black; background-color: #ffefbf;&quot;&gt;&lt;code&gt;function TagsPage::print_body() {

&lt;span style=&quot;color: green;&quot;&gt;#####   Config   #####&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts? Set to true or false.&lt;/span&gt;
  var bool show_count = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the page title. Defaults to the core layer&apos;s value for&lt;/span&gt;
  &lt;span style=&quot;color: green;&quot;&gt;# the Tags Page title. Change to your text, surrounded by quotes, eg:&lt;/span&gt;
  &lt;span style=&quot;color: green;&quot;&gt;# var string page_title = &quot;My Tags List&quot;;&lt;/span&gt;
  var string page_title = &lt;span style=&quot;color: blue;&quot;&gt;$*text_tags_page_header&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Which secondary menus do you want to show? Use long form names, not abbreviations.
  # Separate each one by a comma. Only include spaces if they are used in the tag itself.&lt;/span&gt;
  var string secondary_menus = &quot;&lt;span style=&quot;color: blue;&quot;&gt;fanfiction,length&lt;/span&gt;&quot;;

&lt;span style=&quot;color: green;&quot;&gt;##### End Config #####&lt;/span&gt;

  var Page p = $this;
  var string list = &quot;&quot;;
  var string menuone = &quot;&quot;;
  var string{} menutwo = {&quot;&quot; =&amp;gt; &quot;&quot;};
  var TagAliases ta = new TagAliases;
  $ta-&amp;gt;init();
  var string{} tag_aliases = $ta.tag_aliases;

  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);
    } 

    # mt:20070501
    var string{} tag_aliases_short;
    # Reindex tag alias hash using the values as keys to make lookups easier
    foreach var string k ($tag_aliases) {
      var string new_key = $tag_aliases{$k};
      $tag_aliases_short{$new_key} = $k;
    } 

    # mt:20070502
    # Reindex the tags so that we can quickly look up which tiers are true tags, not just labels
    var TagDetail{} truetags;
    foreach var TagDetail t ($p-&amp;gt;visible_tag_list()) {
      $truetags{$t.name} = $t;            
    }

    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;
        var bool show_all_tiers = false;
        var string menulink = &quot;&quot;;
        var string menuheader = &quot;&quot;;
        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:20070503
          # Find out if this tier is an alias for a longer tag name
          var string longname = $tier;
          if ($tag_aliases_short{$tier}) {
            $longname = $tag_aliases_short{$tier};
          }

          # mt:20070503
          # Find out if this tier has a longer form tag later or earlier in the list
          var string parenttiers  = &quot;&quot;;
          if ($pos &amp;gt; 0) {
            foreach var int i (0 .. ($pos - 1)) {
              $parenttiers  = $parenttiers + ($parenttiers == &quot;&quot; ? &quot;&quot; : $delimiter) + $tags[$i];
            }
          }
          var string realtagname = $parenttiers + ($parenttiers == &quot;&quot; ? &quot;&quot; : $delimiter) + $longname;
          var TagDetail realtag;
          if ($truetags{$realtagname}) {
            $realtag = $truetags{$realtagname};
          }
          else {
            $realtagname = &quot;&quot;;
          }

          # mt:20070509
          # Add anchors to first and second level tiers and generate menu links
          var string anchor = &quot;&quot;;
          $menulink = &quot;&quot;;
          if (($pos == 0) or ($pos == 1)) {
            $anchor = &quot;&quot;&quot;&amp;lt;a name=&quot;taganchor$delimiter$tags[0]&quot;&quot;&quot;;
            $anchor =  ($pos == 1) ? $anchor + $delimiter + $tags[1] : $anchor;
            $anchor = $anchor + &quot;&quot;&quot;&quot;&amp;gt;&amp;lt;/a&amp;gt;&quot;&quot;&quot;;

            if ($pos == 0) {
              $menulink = &quot;&quot;&quot;&amp;lt;a href=&quot;#taganchor$delimiter$tags[0]&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }
            elseif ($pos == 1) {
              $menuheader = $tags[0];
              if ($tag_aliases_short{$tags[0]}) {
                $menuheader = $tag_aliases_short{$tags[0]};
              }
              $menulink = &quot;&quot;&quot;&amp;lt;a href=&quot;#taganchor$delimiter$tags[0]$delimiter$tags[1]&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }
          }  

          # mt:20070503
          # If we&apos;re on a tag&apos;s last tier, or if this tier (plus parent tiers) maps to a longer form real tag 
          # we need to return a link to the tag, otherwise plain text is returned.
          if ((size $tags == ($pos + 1)) or (defined $realtag)) {
            # mt:20070503
            # Find out if this tag is the longer form tag of an alias (in which case we need to hide it, since
            # it will be displayed instead of the alias, and shouldn&apos;t be repeated).
            var bool hasalias = false;
            if ($tag_aliases{$tier}) {
              $hasalias = true;
            }
            if ($hasalias and (size $tags == ($pos + 1))) {
              $tier_code = &quot;&quot;;              
            }
            elseif (defined $realtag) {
              $tier_code = &quot;&quot;&quot;$anchor&amp;lt;a href=&quot;$realtag.url&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }
            else {
              $tier_code = &quot;&quot;&quot;$anchor&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }

            if ($show_count and ($tier_code != &quot;&quot;)) {
              var string uses = get_plural_phrase($t.use_count, &quot;text_tag_uses&quot;);
              if (defined $realtag) {                
                $uses = get_plural_phrase($realtag.use_count, &quot;text_tag_uses&quot;);
              }
              $tier_code = $tier_code + &quot;&quot;&quot; - $uses&quot;&quot;&quot;;
            }
          }
          else {
            $tier_code = &quot;$anchor$longname&quot;;
          }

          # mt:20070503
          # If we&apos;ve decided that this tag needs to be skipped, do nothing on this loop
          if ($tier_code != &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 so omit it from this stage.
              $list = $list + &quot;&quot;&quot;&amp;lt;li&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&amp;gt;$tier_code&quot;&quot;&quot;;                  
              $closing_html[$pos] = &quot;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&quot;;
            }

            # mt:20070509
            # Add this as a menu link at the top of the page
            if ($pos == 0) {
              $menuone = $menuone + (($menuone == &quot;&quot;) ? &quot;&quot; : &quot; | &quot;) + $menulink;
            }
            elseif ($pos == 1) {
              $menutwo{$menuheader} = $menutwo{$menuheader} + (($menutwo{$menuheader} == &quot;&quot;) ? &quot;&quot; : &quot; | &quot;) +  $menulink;
            }  
          }
          elseif (($tags[$pos] != $prev_tags[$pos]) or ($show_all_tiers)) {   
            if ($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--;
              }   
              # mt:20070507
              # If we just closed some lists, that means that any lower tiers in this tag need to 
              # be explicitly displayed, even if they match the same-level tier of the previous tag
              $show_all_tiers = true;   
            }                  
 
            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&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&amp;gt;$tier_code&quot;&quot;&quot;;
            }    
     
            # mt:20070509
            # Add this as a menu link at the top of the page
            if ($pos == 0) {
              $menuone = $menuone + (($menuone == &quot;&quot;) ? &quot;&quot; : &quot; | &quot;) + $menulink;
            }
            elseif ($pos == 1) {
              $menutwo{$menuheader} = $menutwo{$menuheader} + (($menutwo{$menuheader} == &quot;&quot;) ? &quot;&quot; : &quot; | &quot;) +  $menulink;
            }  
          }
          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; 
        $show_all_tiers = false;      
      }        
      # 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;
  }

  print &quot;&quot;&quot;&amp;lt;div class=&quot;entry&quot;&amp;gt;&quot;&quot;&quot;;
  print &quot;&quot;&quot;&amp;lt;h3 class=&quot;entry-header&quot;&amp;gt;$page_title&amp;lt;/h3&amp;gt;&amp;lt;div class=&quot;entry-content&quot;&amp;gt;&amp;lt;div class=&quot;entry-body&quot;&amp;gt;&quot;&quot;&quot;;
  print ($menuone == &quot;&quot;) ? &quot;&quot; : &quot;&quot;&quot;&amp;lt;p class=&quot;topmenuone&quot;&amp;gt;[ $menuone ]&amp;lt;/p&amp;gt;&quot;&quot;&quot;;

  if ($secondary_menus-&amp;gt;ends_with(&quot;,&quot;) == false) { 
    $secondary_menus = $secondary_menus + &quot;,&quot;;
  }
  if ($secondary_menus-&amp;gt;starts_with(&quot;,&quot;) == false) {
    $secondary_menus = &quot;,&quot; + $secondary_menus;
  }
  foreach var string toplevel ($menutwo) {
    if ($toplevel != &quot;&quot;) {
      if ($secondary_menus-&amp;gt;contains(&quot;,&quot; + $toplevel + &quot;,&quot;)) {
        print ($menutwo{$toplevel} == &quot;&quot;) ? &quot;&quot; : &quot;&quot;&quot;&amp;lt;p class=&quot;topmenutwo&quot;&amp;gt;&amp;lt;span class=&quot;topmenuheader&quot;&amp;gt;$toplevel&amp;lt;/span&amp;gt; [ $menutwo{$toplevel} ]&amp;lt;/p&amp;gt;&quot;&quot;&quot;;
      }
    }
  } 
  
  print &quot;&quot;&quot;&amp;lt;ul class=&quot;ljtaglist&quot;&amp;gt;&quot;&quot;&quot;;
  print $list;
  print &quot;&amp;lt;/ul&amp;gt;&quot;;
  print &quot;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/29836.html?view=comments#comments</comments>
  <category>code:tagsbox:multi with abbreviations</category>
  <category>layout:style contest</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/29256.html</guid>
  <pubDate>Sat, 05 May 2007 21:19:06 GMT</pubDate>
  <title>Style Contest: Multi-Level Tags Box and Tags Page with Abbreviations</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/29256.html</link>
  <description>This is code for when you have a lot of tag tiers, with long names, and you want to use a lot of abbreviations in the tags themselves, but have the Tags Page and sidebar tags box show the full tier names.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 1&lt;/b&gt;&lt;br /&gt;First, add this code near the top of your theme layer, just after all your &lt;code&gt;set&lt;/code&gt; lines. Here you are setting up the long form tier names and the abbreviations they map to. These will be used both on the Tags Page and in the sidebar box. Replace the example tags and abbreviations with your own. Notice that if you have built spaces into your tags after the delimiter character, you need to include that space here as well.&lt;br /&gt;&lt;pre style=&quot;color: black; background-color: #ffefbf;&quot;&gt;&lt;code&gt;class TagAliases {
  var string{} tag_aliases;
  function init();
}

&lt;span style=&quot;color: green;&quot;&gt;#### CONFIGURE THE TAG ALIASES ####&lt;/span&gt;

function TagAliases::init() {
    $this.tag_aliases = {
      &quot;&lt;span style=&quot;color: blue;&quot;&gt;[fandom wips]&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt;01&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt;[rps wips]&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt;02&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt;[other wips]&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt;03&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt; smallville&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt; sv&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt; cw network&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt; cw&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt; character&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt; ch&lt;/span&gt;&quot;,
      &quot;&lt;span style=&quot;color: blue;&quot;&gt; slash&lt;/span&gt;&quot; =&amp;gt; &quot;&lt;span style=&quot;color: blue;&quot;&gt; sl&lt;/span&gt;&quot;
    };
}

&lt;span style=&quot;color: green;&quot;&gt;###################################&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Step 2&lt;/b&gt;&lt;br /&gt;Now add to your theme layer the sidebar box code and configure the blue values as desired:&lt;br /&gt;&lt;pre style=&quot;color: black; background-color: #ffefbf;&quot;&gt;&lt;code&gt;function print_module_tags(string title) {

&lt;span style=&quot;color: green;&quot;&gt;#####   Config   #####&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts? Set to true or false.&lt;/span&gt;
  var bool show_count = &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just before the use count, if any.&lt;/span&gt;
  var string pre_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;[&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just after the use count, if any.&lt;/span&gt;
  var string post_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;]&lt;/span&gt;&quot;;

&lt;span style=&quot;color: green;&quot;&gt;##### End Config #####&lt;/span&gt;

  var Page p = get_page();
  var string list = &quot;&quot;;
  var TagAliases ta = new TagAliases;
  $ta-&amp;gt;init();
  var string{} tag_aliases = $ta.tag_aliases;

  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);
    } 

    # mt:20070501
    var string{} tag_aliases_short;
    # Reindex tag alias hash using the values as keys to make lookups easier
    foreach var string k ($tag_aliases) {
      var string new_key = $tag_aliases{$k};
      $tag_aliases_short{$new_key} = $k;
    } 

    # mt:20070502
    # Reindex the tags so that we can quickly look up which tiers are true tags, not just labels
    var TagDetail{} truetags;
    foreach var TagDetail t ($p-&amp;gt;visible_tag_list()) {
      $truetags{$t.name} = $t;            
    }

    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;
        var bool show_all_tiers = false;
        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:20070503
          # Find out if this tier is an alias for a longer tag name
          var string longname = $tier;
          if ($tag_aliases_short{$tier}) {
            $longname = $tag_aliases_short{$tier};
          }

          # mt:20070503
          # Find out if this tier has a longer form tag later or earlier in the list
          var string parenttiers  = &quot;&quot;;
          if ($pos &amp;gt; 0) {
            foreach var int i (0 .. ($pos - 1)) {
              $parenttiers  = $parenttiers + ($parenttiers == &quot;&quot; ? &quot;&quot; : $delimiter) + $tags[$i];
            }
          }
          var string realtagname = $parenttiers + ($parenttiers == &quot;&quot; ? &quot;&quot; : $delimiter) + $longname;
          var TagDetail realtag;
          if ($truetags{$realtagname}) {
            $realtag = $truetags{$realtagname};
          }
          else {
            $realtagname = &quot;&quot;;
          }

          # mt:20070503
          # If we&apos;re on a tag&apos;s last tier, or if this tier (plus parent tiers) maps to a longer form real tag 
          # we need to return a link to the tag, otherwise plain text is returned.
          if ((size $tags == ($pos + 1)) or (defined $realtag)) {
            # mt:20070503
            # Find out if this tag is the longer form tag of an alias (in which case we need to hide it, since
            # it will be displayed instead of the alias, and shouldn&apos;t be repeated).
            var bool hasalias = false;
            if ($tag_aliases{$tier}) {
              $hasalias = true;
            }
            if ($hasalias and (size $tags == ($pos + 1))) {
              $tier_code = &quot;&quot;;              
            }
            elseif (defined $realtag) {
              $tier_code = &quot;&quot;&quot;&amp;lt;a href=&quot;$realtag.url&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }
            else {
              $tier_code = &quot;&quot;&quot;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }

            if ($show_count and ($tier_code != &quot;&quot;)) {
              var int c = $t.use_count;
              if (defined $realtag) {
                $c = $realtag.use_count;
              }
              $tier_code = $tier_code + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}$c${post_count}&quot;&quot;&quot;;
            }
          }
          else {
            $tier_code = &quot;$longname&quot;;
          }

          # mt:20070503
          # If we&apos;ve decided that this tag needs to be skipped, do nothing on this loop
          if ($tier_code != &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 so omit it from this stage.
              $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;module-list-item&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;module-list-item&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]) or ($show_all_tiers)) {  
            if ($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--;
              }   
              # mt:20070507
              # If we just closed some lists, that means that any lower tiers in this tag need to 
              # be explicitly displayed, even if they match the same-level tier of the previous tag
              $show_all_tiers = true;                 
            } 

            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;module-list-item&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;module-list-item&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;      
        $show_all_tiers = false;       
      }        
      # 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 = &quot;&quot;&quot;&amp;lt;ul class=&quot;module-list&quot;&amp;gt;&quot;&quot;&quot; + $list + $remaining_html + &quot;&amp;lt;/ul&amp;gt;&quot;;

    open_module(&quot;categories&quot;, $title, &quot;&quot;);
    println $list;
    close_module();
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Stpe 3&lt;/b&gt;&lt;br /&gt;Finally, add this fucntion for the Tags Page, again altering the blue configuration variables:&lt;br /&gt;&lt;pre style=&quot;color: black; background-color: #ffefbf;&quot;&gt;&lt;code&gt;function TagsPage::print_body() {

&lt;span style=&quot;color: green;&quot;&gt;#####   Config   #####&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts? Set to true or false.&lt;/span&gt;
  var bool show_count = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the page title. Defaults to the core layer&apos;s value for&lt;/span&gt;
  &lt;span style=&quot;color: green;&quot;&gt;# the Tags Page title. Change to your text, surrounded by quotes, eg:&lt;/span&gt;
  &lt;span style=&quot;color: green;&quot;&gt;# var string page_title = &quot;My Tags List&quot;;&lt;/span&gt;
  var string page_title = &lt;span style=&quot;color: blue;&quot;&gt;$*text_tags_page_header&lt;/span&gt;;

&lt;span style=&quot;color: green;&quot;&gt;##### End Config #####&lt;/span&gt;

  var Page p = $this;
  var string list = &quot;&quot;;
  var TagAliases ta = new TagAliases;
  $ta-&amp;gt;init();
  var string{} tag_aliases = $ta.tag_aliases;

  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);
    } 

    # mt:20070501
    var string{} tag_aliases_short;
    # Reindex tag alias hash using the values as keys to make lookups easier
    foreach var string k ($tag_aliases) {
      var string new_key = $tag_aliases{$k};
      $tag_aliases_short{$new_key} = $k;
    } 

    # mt:20070502
    # Reindex the tags so that we can quickly look up which tiers are true tags, not just labels
    var TagDetail{} truetags;
    foreach var TagDetail t ($p-&amp;gt;visible_tag_list()) {
      $truetags{$t.name} = $t;            
    }

    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;
        var bool show_all_tiers = false;
        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:20070503
          # Find out if this tier is an alias for a longer tag name
          var string longname = $tier;
          if ($tag_aliases_short{$tier}) {
            $longname = $tag_aliases_short{$tier};
          }

          # mt:20070503
          # Find out if this tier has a longer form tag later or earlier in the list
          var string parenttiers  = &quot;&quot;;
          if ($pos &amp;gt; 0) {
            foreach var int i (0 .. ($pos - 1)) {
              $parenttiers  = $parenttiers + ($parenttiers == &quot;&quot; ? &quot;&quot; : $delimiter) + $tags[$i];
            }
          }
          var string realtagname = $parenttiers + ($parenttiers == &quot;&quot; ? &quot;&quot; : $delimiter) + $longname;
          var TagDetail realtag;
          if ($truetags{$realtagname}) {
            $realtag = $truetags{$realtagname};
          }
          else {
            $realtagname = &quot;&quot;;
          }

          # mt:20070503
          # If we&apos;re on a tag&apos;s last tier, or if this tier (plus parent tiers) maps to a longer form real tag 
          # we need to return a link to the tag, otherwise plain text is returned.
          if ((size $tags == ($pos + 1)) or (defined $realtag)) {
            # mt:20070503
            # Find out if this tag is the longer form tag of an alias (in which case we need to hide it, since
            # it will be displayed instead of the alias, and shouldn&apos;t be repeated).
            var bool hasalias = false;
            if ($tag_aliases{$tier}) {
              $hasalias = true;
            }
            if ($hasalias and (size $tags == ($pos + 1))) {
              $tier_code = &quot;&quot;;              
            }
            elseif (defined $realtag) {
              $tier_code = &quot;&quot;&quot;&amp;lt;a href=&quot;$realtag.url&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }
            else {
              $tier_code = &quot;&quot;&quot;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$longname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            }

            if ($show_count and ($tier_code != &quot;&quot;)) {
              var string uses = get_plural_phrase($t.use_count, &quot;text_tag_uses&quot;);
              if (defined $realtag) {                
                $uses = get_plural_phrase($realtag.use_count, &quot;text_tag_uses&quot;);
              }
              $tier_code = $tier_code + &quot;&quot;&quot; - $uses&quot;&quot;&quot;;
            }
          }
          else {
            $tier_code = &quot;$longname&quot;;
          }

          # mt:20070503
          # If we&apos;ve decided that this tag needs to be skipped, do nothing on this loop
          if ($tier_code != &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 so omit it from this stage.
              $list = $list + &quot;&quot;&quot;&amp;lt;li&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&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]) or ($show_all_tiers)) {   
            if ($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--;
              }   
              # mt:20070507
              # If we just closed some lists, that means that any lower tiers in this tag need to 
              # be explicitly displayed, even if they match the same-level tier of the previous tag
              $show_all_tiers = true;   
            }                  
 
            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&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&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; 
        $show_all_tiers = false;      
      }        
      # 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;
  }

  print &quot;&quot;&quot;&amp;lt;div class=&quot;entry&quot;&amp;gt;&quot;&quot;&quot;;
  print &quot;&quot;&quot;&amp;lt;h3 class=&quot;entry-header&quot;&amp;gt;$page_title&amp;lt;/h3&amp;gt;&amp;lt;div class=&quot;entry-content&quot;&amp;gt;&amp;lt;div class=&quot;entry-body&quot;&amp;gt;&amp;lt;ul class=&quot;ljtaglist&quot;&amp;gt;&quot;&quot;&quot;;
  print $list;
  print &quot;&amp;lt;/ul&amp;gt;&quot;;
  print &quot;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/29256.html?view=comments#comments</comments>
  <category>code:tagsbox:multi with abbreviations</category>
  <category>layout:style contest</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/28931.html</guid>
  <pubDate>Sat, 05 May 2007 21:03:33 GMT</pubDate>
  <title>Style Contest: Tag Filtered Recent Entries as Index Page</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/28931.html</link>
  <description>Show the Recent Entries page in more of an index style, with just excerpts of the entry text, not full entries, but only when viewing a tag subset of the entries.&lt;br /&gt;&lt;br /&gt;Paste this function into your theme layer, altering the blue configuration variables to suit you.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;# On the Recent Entries page, when filtering by tag, use an index style, not full entries #
function RecentPage::print_body() {

&lt;span style=&quot;color: green;&quot;&gt;########## Configure the Excerpting ##########&lt;/span&gt;

&lt;span style=&quot;color: green;&quot;&gt;# Specify the termination character&lt;/span&gt;
var string stopchar = &quot;&lt;span style=&quot;color: blue;&quot;&gt;^&lt;/span&gt;&quot;;

&lt;span style=&quot;color: green;&quot;&gt;# Specify whether you want the termination character displayed in the excerpt or not&lt;/span&gt;
var bool showstopchar = &lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;;

&lt;span style=&quot;color: green;&quot;&gt;# Specify how many characters of the entry to search for a termination char before giving up and not including an excerpt&lt;/span&gt;
var int cutoff = &lt;span style=&quot;color: blue;&quot;&gt;500&lt;/span&gt;;

&lt;span style=&quot;color: green;&quot;&gt;###############################################&lt;/span&gt;

    if ($.nav.backward_url != &quot;&quot; or $.nav.forward_url != &quot;&quot;) {
        println &quot;&quot;&quot;&amp;lt;p class=&quot;content-nav&quot;&amp;gt;&quot;&quot;&quot;;
        if ($.nav.backward_url != &quot;&quot;) {
            println &quot;&quot;&quot;&amp;lt;a href=&quot;$.nav.backward_url&quot;&amp;gt;&quot;&quot;&quot;+get_plural_phrase($.nav.backward_count, &quot;text_skiplinks_back&quot;)+&quot;&amp;lt;/a&amp;gt;&quot;;
        }
        if ($.nav.backward_url != &quot;&quot; and $.nav.forward_url != &quot;&quot;) {
            print &quot; | &quot;;
        }
        if ($.nav.forward_url != &quot;&quot;) {
            println &quot;&quot;&quot;&amp;lt;a href=&quot;$.nav.forward_url&quot;&amp;gt;&quot;&quot;&quot;+get_plural_phrase($.nav.forward_count, &quot;text_skiplinks_forward&quot;)+&quot;&amp;lt;/a&amp;gt;&quot;;
        }
        println &quot;&quot;&quot;&amp;lt;/p&amp;gt;&quot;&quot;&quot;;
    }

    # This is a tag-filtered view, so show an index of the entries
    var bool done = false;
    if ((size $this.data_links_order) &amp;gt; 0) {
        if ($this.data_link{&quot;rss&quot;}) {
            var Link dlink = $this.data_link{&quot;rss&quot;};
            if ($dlink.url-&amp;gt;contains(&quot;?tag=&quot;)) {                
                print &quot;&quot;&quot;&amp;lt;div class=&quot;entry&quot;&amp;gt;&amp;lt;div class=&quot;entry-content&quot;&amp;gt;&amp;lt;div class=&quot;entry-body&quot;&amp;gt;&amp;lt;ul class=&quot;entry-index&quot;&amp;gt;&quot;&quot;&quot;;
                foreach var Entry e ($.entries) {
                    
                    print &quot;&amp;lt;li&amp;gt;&quot;;
                    if ($e.poster.username != $e.journal.username) {
                        $e.poster-&amp;gt;print(); &quot; &quot;;
                    }
                    &quot;$e.security_icon&quot;;
                    print &quot;&quot;&quot;&amp;lt;span class=&quot;index-link&quot;&amp;gt;&quot;&quot;&quot;;
                    if ($e.subject != &quot;&quot;) {
                        &quot;&quot;&quot; &amp;lt;a href=&quot;$e.permalink_url&quot;&amp;gt;$e.subject&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
                    } else {
                        print &quot;&quot;&quot; &amp;lt;a href=&quot;$e.permalink_url&quot; style=&quot;font-style: italic;&quot;&amp;gt;$*text_nosubject&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
                    }
                    print &quot;&amp;lt;/span&amp;gt;\n&quot;;

                    if ($e.text_must_print_trusted == false) {
                        var string t = $e.text-&amp;gt;substr(0, $cutoff);
                        var string summary = &quot;&quot;;
                        foreach var string c ($t) {
                            if ($c == $stopchar) {
                                break;
                            }
                            $summary = $summary + $c;
                            continue;
                        }
                        # Stop char never found, so assume this entry not formatted for excerpting
                        if ($summary == $t) {
                            $summary = &quot;&quot;;
                        }
                        if ($showstopchar and ($summary != &quot;&quot;)) {
                            $summary = $summary + $stopchar;
                        }
                        print &quot;&quot;&quot;&amp;lt;div class=&quot;index-summary&quot;&amp;gt;$summary&amp;lt;/div&amp;gt;\n&quot;&quot;&quot;;
                    }

                    print &quot;&quot;&quot;&amp;lt;div class=&quot;index-meta&quot;&amp;gt;[ &quot;&quot;&quot;;
                    if (size($e.tags) &amp;gt; 0) {
                        var int tcount = 0;
                        print &quot;&quot;&quot;&amp;lt;span class=&quot;index-tags&quot;&amp;gt;&amp;lt;span class=&quot;index-tags-title&quot;&amp;gt;tags:&amp;lt;/span&amp;gt; &quot;&quot;&quot;;
                        foreach var Tag t ($e.tags) {
                            print &quot;&quot;&quot;&amp;lt;a rel=&quot;tag&quot; href=&quot;$t.url&quot;&amp;gt;$t.name&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
                            $tcount++;
                            if ($tcount != size $e.tags) {
                                print &quot;, &quot;;
                            }
                        }
                        &quot;&quot;&quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;index-sep1&quot;&amp;gt;||&amp;lt;/span&amp;gt; &quot;&quot;&quot;;
                    }                    
                    var string edate = &quot;&quot;&quot;&amp;lt;span class=&quot;index-date&quot;&amp;gt;&quot;&quot;&quot; + $e.time-&amp;gt;date_format(&quot;%%yyyy%%-%%mm%%-%%dd%%&quot;) + &quot;&quot;&quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;index-sep2&quot;&amp;gt;|&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;index-time&quot;&amp;gt;&quot;&quot;&quot; + $e.time-&amp;gt;time_format(&quot;short&quot;);
                    print $edate;
                    if ($e.comments.show_readlink) {
                        print &quot;&quot;&quot; &amp;lt;span class=&quot;index-sep2&quot;&amp;gt;|&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;index-comments&quot;&amp;gt;&quot;&quot;&quot;;                        
                        $e.comments-&amp;gt;print_readlink();
                        print &quot;&amp;lt;/span&amp;gt;&quot;;
                    }
                    &quot; ]&amp;lt;/div&amp;gt;\n&quot;;                   
                    &quot;&amp;lt;/li&amp;gt;\n&quot;;
                }
                print &quot;&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&quot;;
                $done = true;
            }
        }
    }

    if ($done == false) {
    foreach var Entry e ($.entries) {
        if ($*opt_datehead and $e.new_day) {
            print &quot;&quot;&quot;&amp;lt;h2 class=&quot;date-header&quot;&amp;gt;&quot;&quot;&quot;+$e.time-&amp;gt;date_format(&quot;med&quot;)+&quot;&quot;&quot;&amp;lt;/h2&amp;gt;&quot;&quot;&quot;;
        }

        # Print the entry
        $this-&amp;gt;print_entry($e);
        if ($e-&amp;gt;viewer_sees_ebox()) {
            &quot;&quot;&quot;&amp;lt;div align=&quot;center&quot; style=&quot;margin-bottom: 20px;&quot;&amp;gt;&quot;&quot;&quot;;
            $e-&amp;gt;print_ebox();
            &quot;&amp;lt;/div&amp;gt;&quot;;
        }
    }
    }


    if ($.nav.backward_url != &quot;&quot; or $.nav.forward_url != &quot;&quot;) {
        println &quot;&quot;&quot;&amp;lt;p class=&quot;content-nav&quot;&amp;gt;&quot;&quot;&quot;;
        if ($.nav.backward_url != &quot;&quot;) {
            println &quot;&quot;&quot;&amp;lt;a href=&quot;$.nav.backward_url&quot;&amp;gt;&quot;&quot;&quot;+get_plural_phrase($.nav.backward_count, &quot;text_skiplinks_back&quot;)+&quot;&amp;lt;/a&amp;gt;&quot;;
        }
        if ($.nav.backward_url != &quot;&quot; and $.nav.forward_url != &quot;&quot;) {
            print &quot; | &quot;;
        }
        if ($.nav.forward_url != &quot;&quot;) {
            println &quot;&quot;&quot;&amp;lt;a href=&quot;$.nav.forward_url&quot;&amp;gt;&quot;&quot;&quot;+get_plural_phrase($.nav.forward_count, &quot;text_skiplinks_forward&quot;)+&quot;&amp;lt;/a&amp;gt;&quot;;
        }
        println &quot;&quot;&quot;&amp;lt;/p&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://murklinstest.livejournal.com/28931.html?view=comments#comments</comments>
  <category>layout:style contest</category>
  <category>code:tag-filtered index page</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/28859.html</guid>
  <pubDate>Mon, 05 Feb 2007 06:17:09 GMT</pubDate>
  <title>Flexible Squares: Multilevel Tags with Catch-All</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/28859.html</link>
  <description>&lt;b&gt;Sidebar&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function print_sidebar_tags() {

#####   Config   #####

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts? Set to true or false.&lt;/span&gt;
  var bool show_count = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just before the use count, if any.&lt;/span&gt;
  var string pre_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;[&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just after the use count, if any.&lt;/span&gt;
  var string post_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;]&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the name of your catch-all pseudo-category. If you set this to an empty
  # string, top-level tags that have no sub-tags get tagged on to the end of the list
  # and sit at the top level instead of sitting under a catch-all category.&lt;/span&gt;
  var string catchall_title = &quot;&lt;span style=&quot;color: blue;&quot;&gt;miscellaneous&lt;/span&gt;&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 TagDetail[] tag_list = $p-&amp;gt;visible_tag_list();
    var string[] closing_html;
    var string[] prev_tags;
    var int tag_list_pos = 0;
    var bool list_started = false;
    var string tier_code = &quot;&quot;;
    $closing_html[0] = &quot;&quot;;
    $prev_tags[0] = &quot;&quot;;

    # mt:20070204
    # vars for new catchall pseudo-category
    var TagDetail[] catchall;
    var int catch_count = 0;
    var string catchall_list = &quot;&quot;;

    foreach var TagDetail t ($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;

        # mt:20070204
        # Filter out all top-level tags that have no subtags so they can 
        # be placed in a catchall pseudo-category.
        var bool no_subtags = true;
        if ($tag_list_pos &amp;lt; (size $tag_list - 1)) {
          var string next_tag = $tag_list[$tag_list_pos + 1].name;  
          var string tag_top = $tags[0] + $delimiter;        
          $no_subtags = not ($next_tag-&amp;gt;starts_with($tag_top));
        }
 
        if (size $tags == 1 and $no_subtags) {
          $catchall[$catch_count] = $t;
          $catch_count = $catch_count + 1;
        }
        else {
  
        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 ($list_started == false) {
              # 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;;  
              $list_started = true;
            }
            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;

    # mt:20070204
    # Build the catchall list.
    foreach var TagDetail t ($catchall) {
      $catchall_list = $catchall_list + &quot;&quot;&quot;&amp;lt;li class=&quot;sbaritem&quot;&amp;gt;&amp;lt;a rel=&quot;tag&quot; href=&quot;$t.url&quot;&amp;gt;$t.name&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
      if ($show_count) {
        $catchall_list = $catchall_list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
      }
      $catchall_list = $catchall_list + &quot;&amp;lt;/li&amp;gt;&quot;;
    }
    if ($catchall_list != &quot;&quot; and $catchall_title != &quot;&quot;) {
      $catchall_list = &quot;&quot;&quot;&amp;lt;li class=&quot;sbaritem&quot;&amp;gt;$catchall_title&amp;lt;ul&amp;gt;&quot;&quot;&quot; + $catchall_list + &quot;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&quot;;
    }
    $list = $list + $catchall_list;

    var string list_title = ($*text_sidebar_tags != &quot;&quot;) ? &quot;&amp;lt;li class=&apos;sbartitle&apos;&amp;gt;$*text_sidebar_tags&amp;lt;/li&amp;gt;&quot; : &quot;&quot;;
    print_sidebar_box(&quot;&quot;&quot;$list_title&quot;&quot;&quot;, $list, &quot;sidebar_tags&quot;);

  }
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tags Page&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function TagsPage::print_body {

#####   Config   #####

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts? Set to true or false.&lt;/span&gt;
  var bool show_count = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the page title. Defaults to the core layer&apos;s value for
  # the Tags Page title. Change to your text, surrounded by quotes, eg:
  # var string page_title = &quot;My Tags List&quot;;&lt;/span&gt;
  var string page_title = &lt;span style=&quot;color: blue;&quot;&gt;$*text_tags_page_header&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the name of your catch-all pseudo-category. If you set this to an empty
  # string, top-level tags that have no sub-tags get tagged on to the end of the list
  # and sit at the top level instead of sitting under a catch-all category.&lt;/span&gt;
  var string catchall_title = &quot;&lt;span style=&quot;color: blue;&quot;&gt;miscellaneous&lt;/span&gt;&quot;;

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

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

    var TagDetail[] tag_list = $this-&amp;gt;visible_tag_list();
    var string[] closing_html;
    var string[] prev_tags;
    var int tag_list_pos = 0;
    var bool list_started = false;
    var string tier_code = &quot;&quot;;
    $closing_html[0] = &quot;&quot;;
    $prev_tags[0] = &quot;&quot;;

    # mt:20070204
    # vars for catchall pseudo-category
    var TagDetail[] catchall;
    var int catch_count = 0;
    var string catchall_list = &quot;&quot;;

    foreach var TagDetail t ($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;

        # mt:20070204
        # Filter out all top-level tags that have no subtags so they can 
        # be placed in a catchall pseudo-category.
        var bool no_subtags = true;
        if ($tag_list_pos &amp;lt; (size $tag_list - 1)) {
          var string next_tag = $tag_list[$tag_list_pos + 1].name;  
          var string tag_top = $tags[0] + $delimiter;        
          $no_subtags = not ($next_tag-&amp;gt;starts_with($tag_top));
        }
 
        if (size $tags == 1 and $no_subtags) {
          $catchall[$catch_count] = $t;
          $catch_count = $catch_count + 1;
        }
        else {
  
        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) {
              var string uses = get_plural_phrase($t.use_count, &quot;text_tag_uses&quot;);
              $tier_code = $tier_code + &quot;&quot;&quot; - $uses&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 so omit it from this stage.
              $list = $list + &quot;&quot;&quot;&amp;lt;li&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&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;
            $i = ($i &amp;lt;= 0) ? 0 : $i - 1;
            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&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&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;

    # mt:20070204
    # Build the catchall list.
    foreach var TagDetail t ($catchall) {
      $catchall_list = $catchall_list + &quot;&quot;&quot;&amp;lt;li&amp;gt;&amp;lt;a rel=&quot;tag&quot; href=&quot;$t.url&quot;&amp;gt;$t.name&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
      if ($show_count) {
        var string uses = get_plural_phrase($t.use_count, &quot;text_tag_uses&quot;);
        $catchall_list = $catchall_list + &quot;&quot;&quot; - $uses&quot;&quot;&quot;;
      }
      $catchall_list = $catchall_list + &quot;&amp;lt;/li&amp;gt;&quot;;
    }    
    if ($catchall_list != &quot;&quot; and $catchall_title != &quot;&quot;) {
      $catchall_list = &quot;&quot;&quot;&amp;lt;li class=&quot;sbaritem&quot;&amp;gt;$catchall_title&amp;lt;ul&amp;gt;&quot;&quot;&quot; + $catchall_list + &quot;&amp;lt;/ul&amp;gt;&amp;lt;/li&amp;gt;&quot;;
    }
    $list = $list + $catchall_list;
  }

#### Print the tag list in an entry-like post ####
			             
	print &quot;&quot;&quot;
	&amp;lt;div class=&quot;subcontent&quot;&amp;gt;
                &amp;lt;div class=&quot;datesubject&quot;&amp;gt;
				&amp;lt;div class=&quot;subject&quot;&amp;gt;
					$page_title
				&amp;lt;/div&amp;gt;
			&amp;lt;/div&amp;gt;
		&amp;lt;div class=&quot;entry&quot;&amp;gt;
			&amp;lt;div class=&quot;entry2&quot;&amp;gt;
			&amp;lt;div class=&quot;entry_text&quot;&amp;gt;
			&amp;lt;ul class=&quot;ljtaglist&quot;&amp;gt;$list&amp;lt;/ul&amp;gt;			
                        &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
		&amp;lt;/div&amp;gt;
		&amp;lt;div class=&quot;separator&quot;&amp;gt; &amp;amp;nbsp; &amp;lt;/div&amp;gt;
		&amp;lt;div class=&quot;clear&quot;&amp;gt; &amp;amp;nbsp; &amp;lt;/div&amp;gt;
	&amp;lt;/div&amp;gt;
	&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid2-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/28859.html?view=comments#comments</comments>
  <category>layout:flexiblesquares</category>
  <category>code:tagsbox:multi-level</category>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/28576.html</guid>
  <pubDate>Sat, 27 Jan 2007 07:36:55 GMT</pubDate>
  <title>[Flexible Squares] Diffs between old and new multilevel tags code</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/28576.html</link>
  <description>I released a &lt;a href=&quot;http://community.livejournal.com/s2flexisquares/525551.html&quot; target=&quot;_blank&quot;&gt;new version&lt;/a&gt; of the Flexible Squares Multilevel Tags tutorial, which is quite different from the &lt;a href=&quot;http://community.livejournal.com/s2flexisquares/44089.html&quot; target=&quot;_blank&quot;&gt;now obsolete original&lt;/a&gt;. Besides the addition of actual instructions, the code itself underwent some changes. They are detailed here in red comments for any interested parties.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code&lt;/b&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;
&lt;span style=&quot;color: red;&quot;&gt;# mt:20070126
# Use the tags-specific function instead of print_sidebar to print out the tags&lt;/span&gt;

function print_sidebar_tags() {

#####   Config   #####

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&quot;;
  
  &lt;span style=&quot;color: red;&quot;&gt;# mt:20070126
  # Some new configuration options to enable/disable the display of tag counts&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts? Set to true or false.&lt;/span&gt;
  var bool show_count = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just before the use count, if any.&lt;/span&gt;
  var string pre_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;[&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just after the use count, if any.&lt;/span&gt;
  var string post_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;]&lt;/span&gt;&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) {  
        &lt;span style=&quot;color: green;&quot;&gt;# mt:20050623
        # Split tags into array on delimiter. Oh god, my kingdom
        # for a function.  Stolen shamelessly from lj-user rane500.&lt;/span&gt;
        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) {
            &lt;span style=&quot;color: green;&quot;&gt;# 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.&lt;/span&gt;
            $closing_html[$pos] = &quot;&quot;;
          }   

          if (size $prev_tags &amp;lt;= $pos) {
            &lt;span style=&quot;color: green;&quot;&gt;# 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.&lt;/span&gt;
            $prev_tags[$pos] = &quot;&quot;;
          }
    
          &lt;span style=&quot;color: green;&quot;&gt;# 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.&lt;/span&gt;
          if (size $tags == ($pos + 1)) {
            &lt;span style=&quot;color: red;&quot;&gt;# mt:20070126
            # Add in the rel attribute, to match the layer&apos;s default display of the tags list&lt;/span&gt;
            $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;;
            &lt;span style=&quot;color: red;&quot;&gt;# mt:20070126
            # Include logic for showing the tag count, if enabled in the Config section&lt;/span&gt;
            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;;
          }
          
          &lt;span style=&quot;color: red;&quot;&gt;# mt:20070126
          # The list now uses standard Flexible Squares sidebar classes. The outermost container,
          # which used to be an &amp;lt;li&amp;gt; to fit with the layout&apos;s sidebar list system, is now a &amp;lt;ul&amp;gt;,
          # to match the layer&apos;s current sidebar code. That outermost container&apos;s class used to
          # be tagBox, but it now gets the standard sbarlist  and sbarcontent classes, 
          # added when the tags list gets printed via print_sidebar_box. The inner &amp;lt;ul&amp;gt;
          # tags used to be of class tagList, but that is no longer necessary and they go classless.
          # The &amp;lt;li&amp;gt; tags used to be of class tagItem, but they now use the standard sidebar list
          # item class, sbaritem.&lt;/span&gt;

          &lt;span style=&quot;color: green;&quot;&gt;# mt:20050625
          # $prev_tags stuffed with dummy empty string when it has fewer tiers than 
          # current tag.&lt;/span&gt;
          if ($prev_tags[$pos] == &quot;&quot;) {     
            &lt;span style=&quot;color: green;&quot;&gt;# mt:20050623
            # The current tag has more tiers than the previous tag, so a new
            # list must be opened.&lt;/span&gt;  
            if (($tag_list_pos == 0) and ($pos == 0)) {
              &lt;span style=&quot;color: red;&quot;&gt;# mt:20061216
              # The outermost ul is supplied later by print_sidebar_box,
              # so omit it from this stage.&lt;/span&gt;
              $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]) {   
            &lt;span style=&quot;color: green;&quot;&gt;# 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.&lt;/span&gt;
            &lt;span style=&quot;color: red;&quot;&gt;# mt:20070126
            # Iterate through the list backward, since this makes more logical sense,
            # considering we are popping off closing tags to match earlier opening tags.&lt;/span&gt;
            var int i = size $closing_html;
            foreach var string html ($closing_html) {
              if ($i &amp;gt; $pos) {
                $list = $list + $closing_html[$i];                                 
                &lt;span style=&quot;color: green;&quot;&gt;# mt:20050623: As we append the closing code, pop it off the array.&lt;/span&gt;
                $closing_html[$i] = &quot;&quot;;
              }
              $i--;
            }                    
 
            if ($closing_html[$pos] == &quot;&quot;) {          
              &lt;span style=&quot;color: green;&quot;&gt;# mt:20050623
              # This is the first tier at this level, so open list.&lt;/span&gt;
              $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 {              
              &lt;span style=&quot;color: green;&quot;&gt;# mt:20050623
              # There have already been tiers added at this level, so just close the previous
              # list item before adding the new tier.&lt;/span&gt;
              $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 {
            &lt;span style=&quot;color: green;&quot;&gt;# 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.&lt;/span&gt;
          }  
          &lt;span style=&quot;color: green;&quot;&gt;# mt:20050623: Moving on to next tier in this tag!&lt;/span&gt;
          $pos++;
        }
        $prev_tags = $tags;           
      }        
      # mt:20050623: Next tag in the list!
      $tag_list_pos++;
    }  

    &lt;span style=&quot;color: green;&quot;&gt;# mt:20050623
    # All the tags have been added so close all outstanding lists.&lt;/span&gt;
    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;
  }
  
  &lt;span style=&quot;color: red;&quot;&gt;# mt:20070126
  # No longer enclose the list in an &amp;lt;li&amp;gt;, it needs a &amp;lt;ul&amp;gt; now, which will be 
  # supplied by print_sidebar_box, the function used to print out sidebar boxes.&lt;/span&gt;
  
  var string list_title = ($*text_sidebar_tags != &quot;&quot;) ? &quot;&amp;lt;li class=&apos;sbartitle&apos;&amp;gt;$*text_sidebar_tags&amp;lt;/li&amp;gt;&quot; : &quot;&quot;;
  print_sidebar_box(&quot;&quot;&quot;$list_title&quot;&quot;&quot;, $list, &quot;sidebar_tags&quot;);

  &lt;span style=&quot;color: red;&quot;&gt;# mt:20070126
  # No longer print out all the sidebar boxes in this tags code. That gets done in print_sidebar.&lt;/span&gt;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/28576.html?view=comments#comments</comments>
  <category>layout:flexiblesquares</category>
  <category>code:tagsbox:multi-level</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/28193.html</guid>
  <pubDate>Wed, 10 Jan 2007 07:42:36 GMT</pubDate>
  <title>Bloggish: Multilevel Sidebar Tags</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/28193.html</link>
  <description>By naming your tags using a delimiter, for example animals:cats:tabbies or animals:cats:siamese, where the colon is the delimiter, this code allows you to display your tags as a hierarchical list.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Instructions&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. Make sure you have &lt;a href=&quot;http://community.livejournal.com/s2howto/25272.html&quot; target=&quot;_blank&quot;&gt;created a theme layer&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;2. Do you already have the &lt;code&gt;print_module_tags&lt;/code&gt; function in your layer? If so, then you need to delete that existing version from your layer. You can only have one version of a function in a layer, and keeping your old way of showing the sidebar tags list will prevent the multi-level list from showing up. If you need both styles of list to show up, or you are wary of deleting the existing function for some other reason, please &lt;a href=&quot;http://community.livejournal.com/s2flexisquares/224050.html&quot; target=&quot;_blank&quot;&gt;make your layer viewable&lt;/a&gt; and comment here with the layer id or a link to the layer.&lt;br /&gt;&lt;br /&gt;3. Copy and paste the following function into your layer:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;
function print_module_tags(string title) {

#####   Config   #####

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts? Set to true or false.&lt;/span&gt;
  var bool show_count = &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just before the use count, if any.&lt;/span&gt;
  var string pre_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;[&lt;/span&gt;&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just after the use count, if any.&lt;/span&gt;
  var string post_count = &quot;&lt;span style=&quot;color: blue;&quot;&gt;]&lt;/span&gt;&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 so omit it from this stage.
              $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;module-list-item&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;module-list-item&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;module-list-item&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;module-list-item&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 = &quot;&quot;&quot;&amp;lt;ul class=&quot;module-list&quot;&amp;gt;&quot;&quot;&quot; + $list + $remaining_html + &quot;&amp;lt;/ul&amp;gt;&quot;;

    open_module(&quot;categories&quot;, $title, &quot;&quot;);
    println $list;
    close_module();
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;4. Look in the &lt;b&gt;#####   Config   #####&lt;/b&gt; section of the code you just added. There are several configuration options listed in green:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The delimiter: &lt;code&gt;var string delimiter = &quot;&lt;span style=&quot;color:blue;&quot;&gt;:&lt;/span&gt;&quot;;&lt;/code&gt;&lt;br /&gt;By default, the code looks for colons in your tag names to figure out what the different tag levels are. You can change the blue text to a different character, such as | or ~. You must then use that character in your tag names, for instance the tag animals:cats:tabbies would become animals~cats~tabbies.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Showing the use counts: &lt;code&gt;var bool show_count = &lt;span style=&quot;color:blue;&quot;&gt;true&lt;/span&gt;;&lt;/code&gt;&lt;br /&gt;If you would like to show how many times a tag has been used beside each tag name, leave this set to true. To hide the count, change the blue text to &lt;code&gt;&lt;span style=&quot;color:blue;&quot;&gt;false&lt;/span&gt;&lt;/code&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Text before the use counts: &lt;code&gt;var string pre_count = &quot;&lt;span style=&quot;color:blue;&quot;&gt;[&lt;/span&gt;&quot;;&lt;/code&gt;&lt;br /&gt;If you chose to show use counts, this is the text that will display to the left of the count number. By default, the use count displays between square brackets. You can remove the blue text completely to get rid of the bracket, or replace it with other text of your choosing.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Text after the use counts: &lt;code&gt;var string post_count = &quot;&lt;span style=&quot;color:blue;&quot;&gt;]&lt;/span&gt;&quot;;&lt;/code&gt;&lt;br /&gt;If you chose to show use counts, this is the text that will display to the right of the count number. By default, the use count displays between square brackets. You can remove the blue text completely to get rid of the bracket, or replace it with other text of your choosing.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;5. Click the Save &amp; Compile button and go check out your journal. Your tags should show up in the sidebar in a multilevel list. If the list is there, but it has only one level, make sure your tags are named using the delimiter you set in the previous step. Also make sure that your theme layer is in fact being applied to your journal.&lt;br /&gt;&lt;br /&gt;6. You may want to decrease the default indentation of the list or make some other style changes. You can add style code to your journal in a variety of ways: in the Custom CSS section of &lt;a href=&quot;http://www.livejournal.com/customize/options.bml&quot; target=&quot;_blank&quot;&gt;Custom Options&lt;/a&gt; (the &lt;i&gt;» Custom stylesheet&lt;/i&gt; box), in an external style sheet, in the &lt;code&gt;Page::print_custom_head&lt;/code&gt; function. Pick one of these ways and then experiment with the CSS below, which affects the list indentation.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;.module-categories .module-list ul {	
	margin: 0px; padding: 0px;
	list-style-type: none;
	}

.module-categories .module-list-item  ul li {
	margin: 0px; 
	padding: 0px 0px 0px 15px;
	}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/28193.html?view=comments#comments</comments>
  <category>layout:bloggish</category>
  <category>code:tagsbox:multi-level</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/27659.html</guid>
  <pubDate>Tue, 31 Oct 2006 08:08:19 GMT</pubDate>
  <title>Expressive: Multi-Level Sidebar Tags</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/27659.html</link>
  <description>For &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;wistfuljane&quot; lj:user=&quot;wistfuljane&quot; &gt;&lt;a href=&quot;https://wistfuljane.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://wistfuljane.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;wistfuljane&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;Adapted from my earlier versions for Flexible Squares (&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/44089.html&quot; target=&quot;_blank&quot;&gt;tutorial&lt;/a&gt;) and Component (&lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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/component_help/757837.html&quot; target=&quot;_blank&quot;&gt;tutorial&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;This is code to display your tags in a sidebar box. By naming your tags using a delimiter, for example animals:cats:tabbies or animals:cats:siamese, where the colon is the delimiter, you can display a heirarchical list of tags.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Instructions&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. &lt;a href=&quot;http://community.livejournal.com/s2expressive/10467.html&quot; target=&quot;_blank&quot;&gt;Create a theme layer&lt;/a&gt;. See Section 3: Creating A Custom Theme and Section 5: Using Your Custom Theme or Layer.&lt;br /&gt;&lt;br /&gt;2. Make sure you&apos;ve included your colour theme in this new layer, as directed in the previous step&apos;s linked post. For example:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;set base_theme = &quot;urban-green&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Note that anytime you want to change the base colour scheme, you&apos;ll have to edit this line in your theme layer to make the change.&lt;br /&gt;&lt;br /&gt;3. Add the following code to your layer:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function print_module_tags(string title) {

#####   Config   #####

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;:&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts?&lt;/span&gt;
  var bool show_count = true;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just before the use count, if any&lt;/span&gt;
  var string pre_count = &quot;[&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just after the use count, if any&lt;/span&gt;
  var string post_count = &quot;]&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 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.                    
            $list = $list + &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&amp;lt;li class=&quot;tagItem&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 = 0;
            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 class=&quot;tagList&quot;&amp;gt;&amp;lt;li class=&quot;tagItem&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;tagItem&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;
  }
  
  open_module(&quot;categories&quot;, $title, &quot;&quot;);
  &quot;&quot;&quot;$list&quot;&quot;&quot;;
  var string tags_url = $p.journal-&amp;gt;base_url() + &quot;/tag/&quot;; # TODO: Need Page.view_url{&quot;tags&quot;} which doesn&apos;t exist yet.
  print &quot;&quot;&quot;&amp;lt;div class=&quot;widget-footer&quot;&amp;gt;&amp;lt;a href=&quot;$tags_url&quot; title=&quot;$*text_sidebar_tags&quot;&amp;gt;$*text_sidebar_tags&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;\n&quot;&quot;&quot;;
  close_module();
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;4. In the code you just added, look in the Config section and make any changes necessary.&lt;br /&gt;&lt;br /&gt;5. Click Save &amp; Compile and check your journal to see that your tags are displayed in your sidebar as a multi-level list.&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/27659.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>32</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/26990.html</guid>
  <pubDate>Wed, 21 Jun 2006 18:55:28 GMT</pubDate>
  <title>My draft for suggestions</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/26990.html</link>
  <description>&lt;b&gt;Edit 2006-06-28:&lt;/b&gt; Posted to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;suggestions&quot; lj:user=&quot;suggestions&quot; &gt;&lt;a href=&quot;https://suggestions.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://suggestions.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;suggestions&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;. Let the ridicule begin. (Well, if it makes it past the maintainers.)&lt;br /&gt;&lt;br /&gt;I made &lt;a href=&quot;http://community.livejournal.com/lj_style/391531.html&quot; target=&quot;_blank&quot;&gt;a post&lt;/a&gt; in &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-deleted  i-ljuser-type-C     &quot;  data-ljuser=&quot;lj_style&quot; lj:user=&quot;lj_style&quot; &gt;&lt;a href=&quot;https://lj-style.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://lj-style.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;lj_style&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; the other day to find out whether other people think the current behaviour of entries with disabled comment posting is logically flawed.  It was suggested that I take it to &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;suggestions&quot; lj:user=&quot;suggestions&quot; &gt;&lt;a href=&quot;https://suggestions.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://suggestions.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;suggestions&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;, and since that&apos;s rather a public forum, I thought I&apos;d draft it here first so that people can do a little criticizing and I can do a little tweaking, hopefully lessening my chances of being slaughtered when I post over there.  So comments much appreciated!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Title&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Do not hide pre-existing comments when disabling comment posting&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Short, concise description of the idea&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Right now, if you disable comment posting on an entry, none of the comments are shown when you view that entry in the bml entry page (aka simple comment page) and in many S2 layout entry pages.  The entry looks like it never received any comments, even if prior to the disabling it had received many.&lt;br /&gt;&lt;br /&gt;I propose that entries that have had comment posting disabled should still display all the comments that were made prior to the disabling.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Full description of the idea&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Entries that have had comment posting disabled should still display all the comments that were made prior to the disabling. Current behaviour is to hide all comments once comment posting is disabled.&lt;br /&gt;&lt;br /&gt;This is odd behaviour that has some problems.  First, it isn&apos;t really logical.  The comments still exist, and when you decide to disable comment posting, you don&apos;t necessarily want to prevent people from reading existing comments, you may simply not want to receive any more responses.  The assumption cannot really be made that everyone who disables comment posting also wants to hide all existing comments.  Those are two separate actions.  In fact, the second of those actions is generally done through comment screening.&lt;br /&gt;&lt;br /&gt;Second, it is misleading.  Right now, it is easy for people to assume that disabling comments is like screening comments, since the comments are not visible in most views; however, there are several S2 layouts (Bloggish, Dear Diary, Quite Lickable, Smooth Sailing, s1short) that display comments even on entries that have disabled comment posting.  So if you switch your style to one of those, you can view the entry with style=mine and reveal all comments. Additionally, with a little bit of S2 knowledge and a paid account, you can edit any existing layout to make it mimic that same behaviour.  This comment hiding is not really screening at all, and as such it is dangerously misleading.  Post authors may assume that they&apos;ve hidden comments from everyone, but there will still be people out there who can read them all.&lt;br /&gt;&lt;br /&gt;When you come right down to it, disabling comments on a post is very like freezing a comment thread -- you are preventing the addition of any more replies.  It should not have any kind of screening component, since that is a separate action entirely. If you want to hide comments, you should be screening them -- that&apos;s what screening is for.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;An ordered list of benefits&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. Disabling comment posting will have the more logical result of doing only that one thing, with no additional side effects.&lt;br /&gt;&lt;br /&gt;2. There will be more consistent behaviour between bml entry pages and custom S2 entry pages, as well as more consistent behaviour among the various S2 styles.&lt;br /&gt;&lt;br /&gt;3. People will no longer be misled into thinking that disabling comments is a secure way of hiding comments from view.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;An ordered list of problems/issues involved&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. I have been told that the original reason for this behaviour might be related to S1.  In S1 you must show the post and read comments links together or not at all -- you cannot remove the post link without also removing the read link.  Since disabling comments required removing the post link, then the read link had to go, too, and accordingly the comments were hidden on the entry page.  To me, this seems like we are now catering to a flaw in S1 that really ought to be fixed, but I know very little about the workings of S1, so I&apos;m not sure how feasible it would be to solve that.  It may be that the only way to resolve this in S1 is to always show the read and post link whenever there are comments on a post, regardless of whether comment posting has been disabled, and then when someone clicks the post link, they are given an error message that comments have been disabled.&lt;br /&gt;&lt;br /&gt;2. The usual issue exists, of course, of having someone go in and make all the necessary code changes.&lt;br /&gt;&lt;br /&gt;3. It&apos;s possible that some people may be upset by:&lt;br /&gt;&lt;br /&gt;a) Whatever is done to solve the S1 problem.&lt;br /&gt;b) The new behaviour, since they are used to having comments be invisible (to *most*) when comment posting is disabled.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;An organized list, or a few short paragraphs detailing suggestions for implementation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. On the entry bml page, show any existing comments even when comment posting has been disabled. Likely will require quite a few modifications to the comment display and reply link logic.&lt;br /&gt;&lt;br /&gt;2. In the S2 code, change the logic for setting the show_readlink variable so that it is set to true when public comments exist or when the viewer can see any screened comments -- remove the condition that comments must be enabled.&lt;br /&gt;&lt;br /&gt;3. In the S2 system layouts, ensure that all the layouts use the show_readlink and show_postlink variables to determine when to show the read and post comment links, and also ensure that in the code for the custom entry pages the comments get displayed even when commenting has been disabled.&lt;br /&gt;&lt;br /&gt;4. Deal with the S1 read and post links in some way.</description>
  <comments>https://murklinstest.livejournal.com/26990.html?view=comments#comments</comments>
  <category>animals:dogs:poodle</category>
  <lj:security>public</lj:security>
  <lj:reply-count>7</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/25923.html</guid>
  <pubDate>Fri, 19 May 2006 05:19:32 GMT</pubDate>
  <title>Flexible Squares: Smilies in Posts and Comments</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/25923.html</link>
  <description>A tutorial for adding smilie images to entries and comments in Flexible Squares.  Posted to &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/314241.html&quot; target=&quot;_blank&quot;&gt;[paid accounts] Smilies in Posts and Comments&lt;/a&gt;.</description>
  <comments>https://murklinstest.livejournal.com/25923.html?view=comments#comments</comments>
  <category>layout:flexiblesquares</category>
  <category>animals:dogs:poodle</category>
  <category>tutorial:emoticons</category>
  <category>animals:dogs:collie</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/25069.html</guid>
  <pubDate>Tue, 16 May 2006 05:31:07 GMT</pubDate>
  <title>The Boxer: Smilies in Posts and Comments</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/25069.html</link>
  <description>The code in this tutorial will cause simple punctuation smilies like :) and :( to be replaced with images of your choosing when they are displayed in posts and comments.  It is adapted (without permission) from &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;absolut&quot; lj:user=&quot;absolut&quot; &gt;&lt;a href=&quot;https://absolut.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://absolut.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;absolut&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;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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; tutorial &lt;a href=&quot;http://community.livejournal.com/component_help/537693.html&quot; target=&quot;_blank&quot;&gt;Adding Smilies to your post/comments&lt;/a&gt;.  As in that original tutorial, the code here uses some search and replace code by &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;mageboltrat&quot; lj:user=&quot;mageboltrat&quot; &gt;&lt;a href=&quot;https://mageboltrat.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://mageboltrat.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;mageboltrat&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; that can be found &lt;a href=&quot;http://www.livejournal.com/community/s2layers/11106.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.  This tutorial only works if you are viewing your journal in your own style. Your friends won&apos;t be able to see the images if they read your entry on their friend&apos;s list.&lt;br /&gt;&lt;br /&gt;1. Find a set of smilie images and load them to an online host site.&lt;br /&gt;&lt;br /&gt;2. Make sure you have created a theme layer.  See the &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2howto&quot; lj:user=&quot;s2howto&quot; &gt;&lt;a href=&quot;https://s2howto.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://s2howto.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2howto&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; tutorial &lt;a href=&quot;http://community.livejournal.com/s2howto/25272.html&quot; target=&quot;_blank&quot;&gt;Creating and Using a Theme Layer&lt;/a&gt; and follow the instructions under the &lt;b&gt;Creating a Theme Layer&lt;/b&gt; header.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding Smilies to your Posts&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3. Do you already have the &lt;code&gt;print_entry&lt;/code&gt; function in your theme layer? If not, go to &lt;a href=&quot;http://code.sixapart.com/svn/ljcom/trunk/bin/upgrading/s2layers/boxer/layout.s2&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;The Boxer layer source&lt;/a&gt;, copy the &lt;code&gt;print_entry&lt;/code&gt; function from there and paste it into your theme layer.&lt;br /&gt;&lt;br /&gt;4. Find this line in the &lt;code&gt;print_entry&lt;/code&gt; function:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$e-&amp;gt;print_text();&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Replace it with this code:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;if ($e.text_must_print_trusted) {
  $e-&amp;gt;print_text();
}
else {
  var string text = $e.text;
  var string value;
  var string{} emoticons =
  {
    &lt;span style=&quot;color: green;&quot;&gt;# for each smiley you want to add, add a new line 
    # the format for adding new smilies should be something like this:
    # &quot;[:smiley:]&quot; =&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;[url of the smiley image]&quot; alt=&quot;&quot; width=&quot;&quot; height=&quot;&quot; /&amp;gt;&quot;&quot;&quot;,
    # note: for each line, there should be a comma at the very end, EXCEPT for the last line&lt;/span&gt;
    &lt;span style=&quot;color: red;&quot;&gt;&quot;:)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/smile.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
    &quot;;-)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/wink.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
    &quot;:(&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/sad.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;&lt;/span&gt;
  };

  foreach var string key ($emoticons) {
    $value = $emoticons{$key};
		
    # from lj:mageboltrat&apos;s industrial nippon (id=533012)
    # see http://www.livejournal.com/community/s2layers/11106.html
    var string[] findarray;
    var int pos = 1;
    foreach var string findcharacter($key) {
      $findarray[$pos] = $findcharacter;
      $pos             = $pos + 1;
    }
    var int    place         = 1;
    var bool   found         = false;
    var string completedtext = &quot;&quot;;
    var string foundtext     = &quot;&quot;;
    foreach var string searchcharacter($text) {
      if  ($searchcharacter == $findarray[$place]) {
        if ($place == $key-&amp;gt;length()) {
          $foundtext =  $value;
          $place     = 1;
        } 
        else {
          $foundtext = $foundtext + $searchcharacter;
          $place     = $place + 1;
        }
      } 
      else {
        $completedtext = $completedtext + $foundtext + $searchcharacter;
        $foundtext     = &quot;&quot;;  
        $place         = 1;    
      }
    }
    $completedtext = $completedtext + $foundtext;
    $text = $completedtext;
  }
  &quot;&quot;&quot;$text&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;5. Customize the code in red to the emoticons and image urls that you want to use.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding Smilies to your Comments&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;6. Do you already have the &lt;code&gt;EntryPage::print_comment&lt;/code&gt; function in your theme layer? If not, go to &lt;a href=&quot;http://code.sixapart.com/svn/ljcom/trunk/bin/upgrading/s2layers/boxer/layout.s2&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;The Boxer layer source&lt;/a&gt;, copy it from there and paste it into your theme layer.&lt;br /&gt;&lt;br /&gt;7. Find these lines in the &lt;code&gt;EntryPage::print_comment&lt;/code&gt; function:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;
&amp;lt;p&amp;gt;&quot;&quot;&quot;; $c-&amp;gt;print_text(); &quot;&quot;&quot;&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Replace them with this code:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;if ($c.text_must_print_trusted) {
  &quot;&quot;&quot;&amp;lt;p&amp;gt;&quot;&quot;&quot;; $c-&amp;gt;print_text(); &quot;&quot;&quot;&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&quot;&quot;&quot;;
}
else {
  var string text = $c.text;
  var string value;
  var string{} emoticons =
  {
    &lt;span style=&quot;color: green;&quot;&gt;# for each smiley you want to add, add a new line 
    # the format for adding new smilies should be something like this:
    # &quot;[:smiley:]&quot; =&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;[url of the smiley image]&quot; alt=&quot;&quot; width=&quot;&quot; height=&quot;&quot; /&amp;gt;&quot;&quot;&quot;,
    # note: for each line, there should be a comma at the very end, EXCEPT for the last line&lt;/span&gt;
    &lt;span style=&quot;color: red;&quot;&gt;&quot;:)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/smile.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
    &quot;;-)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/wink.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
    &quot;:(&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/sad.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;&lt;/span&gt;
  };

  foreach var string key ($emoticons) {
    $value = $emoticons{$key};
		
    # from lj:mageboltrat&apos;s industrial nippon (id=533012)
    # see http://www.livejournal.com/community/s2layers/11106.html
    var string[] findarray;
    var int pos = 1;
    foreach var string findcharacter($key) {
      $findarray[$pos] = $findcharacter;
      $pos             = $pos + 1;
    }
    var int    place         = 1;
    var bool   found         = false;
    var string completedtext = &quot;&quot;;
    var string foundtext     = &quot;&quot;;
    foreach var string searchcharacter($text) {
      if  ($searchcharacter == $findarray[$place]) {
        if ($place == $key-&amp;gt;length()) {
          $foundtext =  $value;
          $place     = 1;
        } 
        else {
          $foundtext = $foundtext + $searchcharacter;
          $place     = $place + 1;
        }
      } 
      else {
        $completedtext = $completedtext + $foundtext + $searchcharacter;
        $foundtext     = &quot;&quot;;  
        $place         = 1;    
      }
    }
    $completedtext = $completedtext + $foundtext;
    $text = $completedtext;
  }
  &quot;&quot;&quot;&amp;lt;p&amp;gt;$text&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;8. Again, customize the code in red to the emoticons and image urls that you want to use.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding Smilies to your Reply Page and Outputting A List of Smilies&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;9. Do you already have the &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function in your theme layer? If not, copy the &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function from &lt;a href=&quot;http://code.sixapart.com/svn/ljcom/trunk/bin/upgrading/s2layers/boxer/layout.s2&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;The Boxer layer source&lt;/a&gt; and paste it into your theme layer.&lt;br /&gt;&lt;br /&gt;10. Paste this code into the very top of the &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function, in the line just after the first open curly brace, once again customizing the code in red to the emoticons and image urls that you want to use.&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;var string{} emoticons =
{
  &lt;span style=&quot;color: green;&quot;&gt;# for each smiley you want to add, add a new line 
  # the format for adding new smilies should be something like this:
  # &quot;[:smiley:]&quot; =&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;[url of the smiley image]&quot; alt=&quot;&quot; width=&quot;&quot; height=&quot;&quot; /&amp;gt;&quot;&quot;&quot;,
  # note: for each line, there should be a comma at the very end, EXCEPT for the last line&lt;/span&gt;
  &lt;span style=&quot;color: red;&quot;&gt;&quot;:)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/smile.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
  &quot;;-)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/wink.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
  &quot;:(&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/sad.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;&lt;/span&gt;
};&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;11. Find this line in the &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&lt;code&gt;print &quot;&amp;lt;p&amp;gt;&quot;; $.replyto-&amp;gt;print_text(); &quot;&amp;lt;/p&amp;gt;&quot;; print &quot;&amp;lt;p&amp;gt;$metadata&amp;lt;/p&amp;gt;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Replace it with this code:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;if ($.replyto.text_must_print_trusted) {
  print &quot;&amp;lt;p&amp;gt;&quot;; $.replyto-&amp;gt;print_text(); &quot;&amp;lt;/p&amp;gt;&quot;; print &quot;&amp;lt;p&amp;gt;$metadata&amp;lt;/p&amp;gt;&quot;;
}
else {
  var string text = $.replyto.text;
  var string value;

  foreach var string key ($emoticons) {
    $value = $emoticons{$key};
		
    # from lj:mageboltrat&apos;s industrial nippon (id=533012)
    # see http://www.livejournal.com/community/s2layers/11106.html
    var string[] findarray;
    var int pos = 1;
    foreach var string findcharacter($key) {
      $findarray[$pos] = $findcharacter;
      $pos             = $pos + 1;
    }
    var int    place         = 1;
    var bool   found         = false;
    var string completedtext = &quot;&quot;;
    var string foundtext     = &quot;&quot;;
    foreach var string searchcharacter($text) {
      if  ($searchcharacter == $findarray[$place]) {
        if ($place == $key-&amp;gt;length()) {
          $foundtext =  $value;
          $place     = 1;
        } 
        else {
          $foundtext = $foundtext + $searchcharacter;
          $place     = $place + 1;
        }
      } 
      else {
        $completedtext = $completedtext + $foundtext + $searchcharacter;
        $foundtext     = &quot;&quot;;  
        $place         = 1;    
      }
    }
    $completedtext = $completedtext + $foundtext;
    $text = $completedtext;
  }
  print &quot;&amp;lt;p&amp;gt;$text&amp;lt;/p&amp;gt;&quot;; print &quot;&amp;lt;p&amp;gt;$metadata&amp;lt;/p&amp;gt;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;12. Copy the below section of code, which is used to display your list of smilie images, so that people commenting in your journal can see what images will be displayed for the different emoticons.  If you would like this box to sit just above your reply text box, paste the following code just *before* the &lt;code&gt;$.form-&amp;gt;print();&lt;/code&gt; line in your theme layer&apos;s &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function.  If you would like this box to sit just below your reply text box, paste the following code just *after* the &lt;code&gt;$.form-&amp;gt;print();&lt;/code&gt; line in your theme layer&apos;s &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function.&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;	&quot;&quot;&quot;
	&amp;lt;div class=&quot;emoticon_box&quot;&amp;gt;
		&amp;lt;a name=&quot;smileys&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;b&amp;gt;Add a Smiley to your comment&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
		(Hover over each smiley to get the code)&amp;lt;br /&amp;gt;
	&quot;&quot;&quot;;

	foreach var string key ($emoticons) {
		var string value = $emoticons{$key};
		&quot;&quot;&quot;&amp;lt;a href=&quot;#smileys&quot; class=&quot;emoticoninfo&quot;&amp;gt;$value&amp;lt;span&amp;gt;$key&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt; &quot;&quot;&quot;;
	}
	&quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;13. Do you already have the &lt;code&gt;Page::print_custom_head&lt;/code&gt; function in your theme layer?  If not, add the following code to your layer:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function Page::print_custom_head() {
&quot;&quot;&quot;
&amp;lt;style type=&quot;text/css&quot;&amp;gt;

&amp;lt;/style&amp;gt;
&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;14. Now add this css to your theme layer&apos;s &lt;code&gt;Page::print_custom_head&lt;/code&gt; function, just before the &lt;code&gt;&amp;lt;/style&amp;gt;&lt;/code&gt; line:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;.emoticon_box {
  text-align: center;
  margin: 10px;
  padding: 10px;
  background-color: $*entry_bg;
  color: $*entry_font;
  border: 1px solid $*entry_font;
}

a.emoticoninfo {
  position: relative; /*this is the key*/
  z-index: 24;
  background-color: $*entry_bg;
  color: $*entry_font;
  text-decoration: none;
}

a.emoticoninfo:hover {
  z-index:25; 
  background-color: transparent !important;
}

a.emoticoninfo img {
  border: none;
}

a.emoticoninfo span {
  display: none;
}

a.emoticoninfo:hover span { /*the span will display just on :hover state*/
  display: block;
  position: absolute;
  top: 2em; 
  left: 2em;
  width: 15em;
  border:1px solid $*entry_font;
  background-color: $*entry_bg;
  color: $*entry_font;
  text-align: center;
  text-decoration: none;
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;15. Compile your layer and check your journal to see that emoticons are being replaced by the correct images and that on the reply page your list of available images is appearing.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Important Note:&lt;/b&gt;&lt;br /&gt;Avoid replacing &lt;code&gt;;)&lt;/code&gt; and &lt;code&gt;:/&lt;/code&gt; with images as doing so will screw up cut tags and all links and images.  Try using &lt;code&gt;;-)&lt;/code&gt; and &lt;code&gt;:-/&lt;/code&gt; instead.&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/25069.html?view=comments#comments</comments>
  <category>layout:boxer</category>
  <category>tutorial:emoticons</category>
  <category>animals:cats:siamese</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/24400.html</guid>
  <pubDate>Mon, 13 Mar 2006 17:23:44 GMT</pubDate>
  <title>Flexible Squares: Sorted Multi-Level Tags in Sidebar</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/24400.html</link>
  <description>This code is currently a disaster, but it does seem to sort of work (always a challenge for me when I&apos;m tossing around nested arrays).  It&apos;s still full of clumsy debugging stuff, even, but I wanted to post it before I accidentally delete the layer.  Basically allows you to specify a sort order for any levels of a multi-level tag list.  Any levels that aren&apos;t specified in the custom sort order fall into alphabetical order after the custom sorted levels.  Lord knows who would ever want to do this, but maybe one day someone will ask, and then at least I&apos;ll have some code to work with.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;class MyUtils {
  # Recursively assemble the tag list
  function get_tag_list(string tagfrag, string[]{} ordered, string[]{} unordered, string{}{} realsubtags, TagDetail{}{} visibletags, string delimiter, string pre_count, string post_count, bool show_count) : string;

  # Print the tag list
  function print_tag_list();
}

function MyUtils::get_tag_list(string tagfrag, string[]{} ordered, string[]{} unordered, string{}{} realsubtags, TagDetail{}{} visibletags, string delimiter, string pre_count, string post_count, bool show_count) : string {
  var string list = &quot;&quot;;
  # if there are no sub-tags of this tag level, return the accumulated list
  var bool no_ordered = true;
  var bool no_unordered = true;
  if ($ordered{$tagfrag}) {
    $no_ordered = false;
    if (size $ordered{$tagfrag} == 0) {
      $no_ordered = true;
    }
  }
  if ($unordered{$tagfrag}) {
    $no_unordered = false;
    if (size $unordered{$tagfrag} == 0) {
      $no_unordered = true;
    }
  }
  if ($no_unordered and $no_ordered) {
    return $list;
  }

  $list = $list + &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot;;
  
  if ($ordered{$tagfrag}) {
  # Add the manually sorted subtags
  foreach var string tag ($ordered{$tagfrag}) {
    var string tagkey = $tagfrag + $tag;
    # Ignore non-existing tag fragments
    if ($realsubtags{$tagfrag}) {
      if ($realsubtags{$tagfrag}{$tag} == $tag) {
        if ($visibletags{$tagkey}) {
          # This is a tag
          var TagDetail t = $visibletags{$tagkey}{$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;$tag&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
          if ($show_count) {
            $list = $list + &quot;&quot;&quot; ${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
          }
        }
        else {
          # Just a label      
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tag&quot;&quot;&quot;;
        }
        # Add the subtags
        $tagkey = $tagkey + $delimiter;
        $list = $list + $this-&amp;gt;get_tag_list($tagkey, $ordered, $unordered, $realsubtags, $visibletags, $delimiter, $pre_count, $post_count, $show_count);
        $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
      }
    }
  }
  }

  if ($unordered{$tagfrag}) {
  # Add the alphabetically sorted subtags
  foreach var string tag ($unordered{$tagfrag}) {
    var string tagkey = $tagfrag + $tag;
    if ($visibletags{$tagkey}) {
      # This is a real tag
      var TagDetail t = $visibletags{$tagkey}{$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;$tag&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
      if ($show_count) {
        $list = $list + &quot;&quot;&quot; ${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
      }
    }
    else {
      # Just a label      
      $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tag&quot;&quot;&quot;;
    }
    # Add the subtags
    $tagkey = $tagkey + $delimiter;
    $list = $list + $this-&amp;gt;get_tag_list($tagkey, $ordered, $unordered, $realsubtags, $visibletags, $delimiter, $pre_count, $post_count, $show_count);
    $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
  }
  }

  $list = $list + &quot;&amp;lt;/ul&amp;gt;&quot;;
  return $list;
}

function MyUtils::print_tag_list() {

#####   Config   #####

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

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

  # Specify your top-level sort order
  # Add the top-level labels that you want sorted to the 
  # top of the list in the order you want them to display.
  # Example Tags: birds:budgies, cats:abyssinian, cats:persian, dogs
  # Desired Order: dogs, cats, all others in alphabetical order
  # Format: var string[] tagorder = [&quot;dogs&quot;, &quot;cats&quot;];
  var string[] tagorder = [&quot;layout&quot;, &quot;tutorial&quot;, &quot;test&quot;];

  # Specify your subtag sort order
  # Add the sub tag fragments that you want sorted to the 
  # top of their sublist in the order you want them to display.
  # Example Tags: cats:abyssinian, cats:persian, cats:siamese, cats:tabbies
  # Desired Order: tabbies, siamese, all others in alphabetical order
  # Format: 
  # var string[]{} subtagorder = {
  #   &quot;cats&quot; =&amp;gt; [&quot;tabbies&quot;, &quot;siamese&quot;]
  # };
  var string[]{} subtagorder = {
    &quot;code:&quot; =&amp;gt; [&quot;hidingentries&quot;, &quot;tagsbox&quot;, &quot;stretchingentries&quot;],
    &quot;code:tagsbox:&quot; =&amp;gt; [&quot;multi-level&quot;, &quot;bundles&quot;],
    &quot;test:that:&quot; =&amp;gt; [&quot;other&quot;]
  };

  # Do you want to show the tag use counts?
  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, is any
  var string post_count = &quot;]&quot;;

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

  var Page p = get_page();
  var string list = &quot;&quot;;
    
  if (size $p-&amp;gt;visible_tag_list() &amp;gt; 0) { 

    # Turn the sort order into an associative array for easy access
    var string{} sorttoptags;
    var string{} realtoptags;
    foreach var string tagname ($tagorder) {
      $sorttoptags{$tagname} = $tagname;
    }
     
    # Turn the subtag sort order into an associative array for easy access
    var string{}{} sortsubtags;
    var string{}{} realsubtags;
    foreach var string toptagname ($subtagorder) {
      var string[] subtags = $subtagorder{$toptagname};
      var string{} subtag_hash;
      var bool{} realsubtag_hash;
      foreach var string tagname ($subtags) {
        $subtag_hash{$tagname} = $tagname;
        $realsubtag_hash{$tagname} = false;
      }
      $sortsubtags{$toptagname} = $subtag_hash;  
    }

    # 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 string prev_top_level = &quot;&quot;;
    var TagDetail{}{} visibletags;
    var string[] unordered;
    var string[]{} subunordered;
    var string{}{} subunordered_hash;
    foreach var TagDetail t ($p-&amp;gt;visible_tag_list()) { 
            
      if ($t.name) {      
        # Split on delimiter     
        var string[] tags;
        var string parent_tags = &quot;&quot;;
        var int array_counter = 0;
        var string buffer = &quot;&quot;;
        foreach var string char ($t.name) {
          if($char == $delimiter) {
            $tags[$array_counter] = $buffer;
            $parent_tags = $parent_tags + $buffer + $delimiter;
            $array_counter = $array_counter + 1;
            $buffer = &quot;&quot;;
          }
          else {
            $buffer = $buffer + $char;
          } 
        }  
        $tags[$array_counter] = $buffer;
                 
        # Add the tag to the asociative array of visible tags
        $visibletags{$t.name}{$tags[(size $tags) - 1]} = $t;

        # If tag is not in top-level sort order, add it to top unordered array
        if ($tags[0] != $prev_top_level) {
          if ($sorttoptags{$tags[0]} != $tags[0]) {
            $unordered[size $unordered] = $tags[0];
          }
          else {
            # This tag is in the sort array, so mark that sort array tag as being real
            $realtoptags{$tags[0]} = $tags[0];
          }
          $prev_top_level = $tags[0];
        }

        # If sub exists and is not in subtag sort order, add it to subtag unordered array
        var int next_level = 1;
        var string accumulated_level = &quot;&quot;;
        foreach var string level ($tags) {
          if ($next_level &amp;lt; size $tags) {
            $accumulated_level = $accumulated_level + $level + $delimiter;

            var bool notinlist = false;
            if ($subunordered_hash{$accumulated_level}) {
              if ($subunordered_hash{$accumulated_level}{$tags[$next_level]} != $tags[$next_level]) {
                $notinlist = true;
              }
            }
            else {
              $notinlist = true;
            }

            if ($notinlist) {
              if ($sortsubtags{$accumulated_level}) {
                # This level has some ordered subtags 
                if ($sortsubtags{$accumulated_level}{$tags[$next_level]} != $tags[$next_level]) {
                  # But this particualr subtag is not one of them
                  $subunordered{$accumulated_level}[size $subunordered{$accumulated_level}] = $tags[$next_level];
                  $subunordered_hash{$accumulated_level}{$tags[$next_level]} = $tags[$next_level];
                }
                else {
                  # This one was found in the ordered array, so mark it as real
                  $realsubtags{$accumulated_level}{$tags[$next_level]} = $tags[$next_level];
                }
              }
              else {
                # This level has no ordered subtags
                $subunordered{$accumulated_level}[size $subunordered{$accumulated_level}] = $tags[$next_level];
                $subunordered_hash{$accumulated_level}{$tags[$next_level]} = $tags[$next_level];
              }
            }
          }
          $next_level++;
        }
      }  
    } 

    # Now every single level is accounted for, either in the ordered arrays or in the
    # alphabetically sorted unordered arrays.

    if (size $subtagorder == 0) { 
      $subtagorder{&quot;1&quot;} = [&quot;hi&quot;];
    }
    if (size $subunordered == 0) { 
      $subunordered{&quot;2&quot;} = [&quot;hi&quot;];
    }
    if (size $realsubtags == 0) { 
      $realsubtags{&quot;1&quot;} = {&quot;1&quot; =&amp;gt; &quot;1&quot;};
    }
    if (size $visibletags == 0) { 
       var TagDetail td = new TagDetail;
      $visibletags{&quot;1&quot;} = {&quot;1&quot; =&amp;gt; $td};
    }

    # Start the list.
    $list = $list + &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot;; 

    # Add top-level sorted tags to list first
    foreach var string tagname ($tagorder) {
      # Ignore any tag names in sort array that aren&apos;t actual tag fragments
      if ($realtoptags{$tagname} == $tagname) {
        if ($visibletags{$tagname}) {
          # This is a tag
          var TagDetail t = $visibletags{$tagname}{$tagname};
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$tagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
          if ($show_count) {
            $list = $list + &quot;&quot;&quot; ${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
          }
        }
        else {
          # Just a label
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tagname&quot;&quot;&quot;;
        }

        # Add the subtags
        $list = $list + $this-&amp;gt;get_tag_list(&quot;&quot;&quot;$tagname$delimiter&quot;&quot;&quot;, $subtagorder, $subunordered, $realsubtags, $visibletags, $delimiter, $pre_count, $post_count, $show_count);

        $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
      }
    }       

    # Add top-level unordered tags to list
    foreach var string tagname ($unordered) {
      if ($visibletags{$tagname}) {
        # This is a tag
        var TagDetail t = $visibletags{$tagname}{$tagname};
        $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$tagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
        if ($show_count) {
          $list = $list + &quot;&quot;&quot; ${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
        }
      }
      else {
        # Just a label 
        $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tagname&quot;&quot;&quot;;
      }

      # Add the subtags
      $list = $list + $this-&amp;gt;get_tag_list(&quot;&quot;&quot;$tagname$delimiter&quot;&quot;&quot;, $subtagorder, $subunordered, $realsubtags, $visibletags, $delimiter, $pre_count, $post_count, $show_count);

      $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
    }
    
    # Close the tag list
    $list = $list + &quot;&amp;lt;/ul&amp;gt;&quot;;

    # Enclose the entire list in an li tag as required by the layout.
    $list = &quot;&quot;&quot;&amp;lt;li class=&quot;tagBox&quot;&amp;gt;&quot;&quot;&quot; + $list + &quot;&quot;&quot;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;

    # Add styling to box title.
    $tag_title = &quot;&quot;&quot;&amp;lt;li class=&quot;sbartitle&quot;&amp;gt;$tag_title&amp;lt;/li&amp;gt;&quot;&quot;&quot;;

    # Print out the tagsbox
    print_sidebar_box($tag_title, $list);
  }
}

function print_sidebar() {
    
    var MyUtils mu = new MyUtils;

    print_userpic();
    print_sidebar_blurb();
    $mu-&amp;gt;print_tag_list();
    print_sidebar_linklist();
    print_sidebar_calendar();

}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/24400.html?view=comments#comments</comments>
  <category>layout:flexiblesquares</category>
  <category>animals:cats:tabbies</category>
  <category>code:tagsbox:multi-level</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/24186.html</guid>
  <pubDate>Wed, 08 Mar 2006 17:15:47 GMT</pubDate>
  <title>Opal: Smilies in Posts and Comments</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/24186.html</link>
  <description>Adapted from &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;absolut&quot; lj:user=&quot;absolut&quot; &gt;&lt;a href=&quot;https://absolut.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://absolut.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;absolut&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;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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; tutorial &lt;a href=&quot;http://community.livejournal.com/component_help/537693.html&quot; target=&quot;_blank&quot;&gt;Adding Smilies to your post/comments&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;1. Review the &lt;b&gt;Getting Smilies&lt;/b&gt; section of the &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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/component_help/537693.html&quot; target=&quot;_blank&quot;&gt;Adding Smilies to your post/comments&lt;/a&gt; tutorial.&lt;br /&gt;&lt;br /&gt;2. Make sure you have created a theme layer.  See the &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2howto&quot; lj:user=&quot;s2howto&quot; &gt;&lt;a href=&quot;https://s2howto.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://s2howto.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2howto&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; tutorial &lt;a href=&quot;http://community.livejournal.com/s2howto/25272.html&quot; target=&quot;_blank&quot;&gt;Creating and Using a Theme Layer&lt;/a&gt; and follow the instructions under the &lt;b&gt;Creating a Theme Layer&lt;/b&gt; header.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding Smilies to your Posts&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3. Do you already have the &lt;code&gt;Page::print_entry&lt;/code&gt; function in your theme layer? If not, go to the &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=646411&quot; target=&quot;_blank&quot;&gt;Opal layer source&lt;/a&gt;, copy the &lt;code&gt;Page::print_entry&lt;/code&gt; function from there and paste it into your theme layer.&lt;br /&gt;&lt;br /&gt;4. Find this line in the &lt;code&gt;Page::print_entry&lt;/code&gt; function:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&quot;&amp;lt;p&amp;gt;&quot;; $e-&amp;gt;print_text(); &quot;&amp;lt;/p&amp;gt;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Replace it with this code:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;var string text = $e.text;
var string value;
var string{} emoticons =
{
	&lt;span style=&quot;color: green;&quot;&gt;# for each smiley you want to add, add a new line 
	# the format for adding new smilies should be something like this:
	# &quot;[:smiley:]&quot; =&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;[url of the smiley image]&quot; alt=&quot;&quot; width=&quot;&quot; height=&quot;&quot; /&amp;gt;&quot;&quot;&quot;,
	# note: for each line, there should be a comma at the very end, EXCEPT for the last line&lt;/span&gt;
	&lt;span style=&quot;color: red;&quot;&gt;&quot;:)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/smile.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
	&quot;;-)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/wink.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
	&quot;:(&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/sad.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;&lt;/span&gt;
};

foreach var string key ($emoticons) {
	$value = $emoticons{$key};
		
	# from lj:mageboltrat&apos;s industrial nippon (id=533012)
	# see http://www.livejournal.com/community/s2layers/11106.html
	var string[] findarray;
	var int pos = 1;
	foreach var string findcharacter($key) {
		$findarray[$pos] = $findcharacter;
		$pos             = $pos + 1;
	}
	var int    place         = 1;
	var bool   found         = false;
	var string completedtext = &quot;&quot;;
	var string foundtext     = &quot;&quot;;
	foreach var string searchcharacter($text) {
	if  ($searchcharacter == $findarray[$place]) {
		if ($place == $key-&amp;gt;length()) {
			$foundtext =  $value;
		        $place     = 1;
		} else {
			$foundtext = $foundtext + $searchcharacter;
		        $place     = $place + 1;
		}
		} else {
			$completedtext = $completedtext + $foundtext + $searchcharacter;
			$foundtext     = &quot;&quot;;  
			$place         = 1;    
		}
	}
	$completedtext = $completedtext + $foundtext;
	$text = $completedtext;
}
&quot;&quot;&quot;&amp;lt;p&amp;gt;$text&amp;lt;/p&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;5. Customize the code in red to the emoticons and image urls that you want to use.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding Smilies to your Comments&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;6. Do you already have the &lt;code&gt;EntryPage::print_comment&lt;/code&gt; function in your theme layer? If not, go to the &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=646411&quot; target=&quot;_blank&quot;&gt;Opal layer source&lt;/a&gt;, copy it from there and paste it into your theme layer.&lt;br /&gt;&lt;br /&gt;7. Find this line in the &lt;code&gt;EntryPage::print_comment&lt;/code&gt; function:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;p&amp;gt;$c.text&amp;lt;/p&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Replace it with this code:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;&quot;&quot;&quot;;
var string text = $c.text;
var string value;
var string{} emoticons =
{
	&lt;span style=&quot;color: green;&quot;&gt;# for each smiley you want to add, add a new line 
	# the format for adding new smilies should be something like this:
	# &quot;:smiley:&quot; =&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;&quot; alt=&quot;&quot; width=&quot;&quot; height=&quot;&quot; /&amp;gt;&quot;&quot;&quot;,
	# note: for each line, there should be a comma at the very end, EXCEPT for the last line&lt;/span&gt;
	&lt;span style=&quot;color: red;&quot;&gt;&quot;:)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/smile.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
	&quot;;-)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/wink.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
	&quot;:(&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/sad.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;&lt;/span&gt;
};

foreach var string key ($emoticons) {
	$value = $emoticons{$key};
		
	# from lj:mageboltrat&apos;s industrial nippon (id=533012)
	# see http://www.livejournal.com/community/s2layers/11106.html
	var string[] findarray;
	var int pos = 1;
	foreach var string findcharacter($key) {
		$findarray[$pos] = $findcharacter;
		$pos             = $pos + 1;
	}
	var int    place         = 1;
	var bool   found         = false;
	var string completedtext = &quot;&quot;;
	var string foundtext     = &quot;&quot;;
	foreach var string searchcharacter($text) {
	if  ($searchcharacter == $findarray[$place]) {
		if ($place == $key-&amp;gt;length()) {
			$foundtext =  $value;
		        $place     = 1;
		} else {
			$foundtext = $foundtext + $searchcharacter;
		        $place     = $place + 1;
		}
		} else {
			$completedtext = $completedtext + $foundtext + $searchcharacter;
			$foundtext     = &quot;&quot;;  
			$place         = 1;    
		}
	}
	$completedtext = $completedtext + $foundtext;
	$text = $completedtext;
}
&quot;&quot;&quot;
&amp;lt;p&amp;gt;$text&amp;lt;/p&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;8. Again, customize the code in red to the emoticons and image urls that you want to use.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding Smilies to your Reply Page and Outputting A List of Smilies&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;9. Do you already have the &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function in your theme layer? If not, copy the &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function from the &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=646411&quot; target=&quot;_blank&quot;&gt;Opal layer source&lt;/a&gt; and paste it into your theme layer.&lt;br /&gt;&lt;br /&gt;10. Find this line in the &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$e-&amp;gt;print_text();&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Replace it with this code:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;var string text = $e.text;
var string value;
var string{} emoticons =
{
	&lt;span style=&quot;color: green;&quot;&gt;# for each smiley you want to add, add a new line 
	# the format for adding new smilies should be something like this:
	# &quot;[:smiley:]&quot; =&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;[url of the smiley image]&quot; alt=&quot;&quot; width=&quot;&quot; height=&quot;&quot; /&amp;gt;&quot;&quot;&quot;,
	# note: for each line, there should be a comma at the very end, EXCEPT for the last line&lt;/span&gt;
	&lt;span style=&quot;color: red;&quot;&gt;&quot;:)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/smile.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
	&quot;;-)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/wink.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
	&quot;:(&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/sad.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;&lt;/span&gt;
};

foreach var string key ($emoticons) {
	$value = $emoticons{$key};
		
	# from lj:mageboltrat&apos;s industrial nippon (id=533012)
	# see http://www.livejournal.com/community/s2layers/11106.html
	var string[] findarray;
	var int pos = 1;
	foreach var string findcharacter($key) {
		$findarray[$pos] = $findcharacter;
		$pos             = $pos + 1;
	}
	var int    place         = 1;
	var bool   found         = false;
	var string completedtext = &quot;&quot;;
	var string foundtext     = &quot;&quot;;
	foreach var string searchcharacter($text) {
	if  ($searchcharacter == $findarray[$place]) {
		if ($place == $key-&amp;gt;length()) {
			$foundtext =  $value;
		        $place     = 1;
		} else {
			$foundtext = $foundtext + $searchcharacter;
		        $place     = $place + 1;
		}
		} else {
			$completedtext = $completedtext + $foundtext + $searchcharacter;
			$foundtext     = &quot;&quot;;  
			$place         = 1;    
		}
	}
	$completedtext = $completedtext + $foundtext;
	$text = $completedtext;
}
&quot;&quot;&quot;$text&quot;&quot;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;11. Again, customize the code in red to the emoticons and image urls that you want to use.&lt;br /&gt;&lt;br /&gt;12. Paste the following code just *before* the &lt;code&gt;$.form-&amp;gt;print();&lt;/code&gt; line in your theme layer&apos;s &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function:&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;	&quot;&quot;&quot;
	&amp;lt;div class=&quot;emoticon_box&quot;&amp;gt;
		&amp;lt;a name=&quot;smileys&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;b&amp;gt;Add a Smiley to your comment&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
		(Hover over each smiley to get the code)&amp;lt;br /&amp;gt;
	&quot;&quot;&quot;;

	foreach var string key ($emoticons) {
		$value = $emoticons{$key};
		&quot;&quot;&quot;&amp;lt;a href=&quot;#smileys&quot; class=&quot;info&quot;&amp;gt;$value&amp;lt;span&amp;gt;$key&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt; &quot;&quot;&quot;;
	}
	&quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;13. Do you already have the &lt;code&gt;Page::print_custom_head&lt;/code&gt; function in your theme layer?  If not, add the following code to your layer:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function Page::print_custom_head() {
&quot;&quot;&quot;
&amp;lt;style type=&quot;text/css&quot;&amp;gt;

&amp;lt;/style&amp;gt;
&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;14. Now add this css to your theme layer&apos;s &lt;code&gt;Page::print_custom_head&lt;/code&gt; function, just before the &lt;code&gt;&amp;lt;/style&amp;gt;&lt;/code&gt; line:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;.emoticon_box {
  text-align: center;
  margin: 10px;
  padding: 10px;
  background-color: $*color_fg;
  color: $*color_fg_font;
  border: 1px solid $*color_fg_font;
}

a.info {
  position: relative; /*this is the key*/
  z-index: 24;
  background-color: $*color_fg;
  color: $*color_fg_font;
  text-decoration: none;
}

a.info:hover {
  z-index:25; 
  background-color: transparent !important;
}

a.info img {
  border: none;
}

a.info span {
  display: none;
}

a.info:hover span { /*the span will display just on :hover state*/
  display: block;
  position: absolute;
  top: 2em; 
  left: 2em;
  width: 15em;
  border:1px solid $*color_fg_font;
  background-color: $*color_fg;
  color: $*color_fg_font;
  text-align: center;
  text-decoration: none;
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;15. Compile your layer and check your journal to see that emoticons are being replaced by the correct images and that on the reply page your list of available images is appearing.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Important Note:&lt;/b&gt;&lt;br /&gt;Avoid replacing &lt;code&gt;;)&lt;/code&gt; and &lt;code&gt;:/&lt;/code&gt; with images as doing so will screw up cut tags and all links and images.  Try using &lt;code&gt;;-)&lt;/code&gt; and &lt;code&gt;:-/&lt;/code&gt; instead.&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/24186.html?view=comments#comments</comments>
  <category>tutorial:emoticons</category>
  <category>layout:opal</category>
  <lj:security>public</lj:security>
  <lj:reply-count>8</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/23995.html</guid>
  <pubDate>Wed, 01 Mar 2006 21:47:49 GMT</pubDate>
  <title>Flexible Squares: Super-Sorted Bi-Level Tags in Sidebar</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/23995.html</link>
  <description>Urg.  Second attempt.  Allows for sorting of second level tags as well, which I think was &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;todeskun&quot; lj:user=&quot;todeskun&quot; &gt;&lt;a href=&quot;https://todeskun.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://todeskun.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;todeskun&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s actual &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/242763.html&quot; target=&quot;_blank&quot;&gt;request&lt;/a&gt;.  See how I miss the obvious.  Again, is this code any good?  I honestly can&apos;t tell anymore.  One thing I do know: it&apos;s horrendously long.&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;function print_sidebar() {

&lt;span style=&quot;color: green;&quot;&gt;#####   Config   #####&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.  One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;:&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the title of your tag box&lt;/span&gt;
  var string tag_title = &quot;Tags&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your top-level sort order
  # Add the top-level labels that you want sorted to the 
  # top of the list in the order you want them to display.
  # Example Tags: birdes:budgies, cats:abyssinian, cats:persian, dogs
  # Desired Order: dogs, cats, all others in alphabetical order
  # Format: var string[] tagorder = [&quot;dogs&quot;, &quot;cats&quot;];&lt;/span&gt;
  var string[] tagorder = [];

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your subtag sort order
  # Add the sub tag fragments that you want sorted to the 
  # top of their sublist in the order you want them to display.
  # Example Tags: cats:abyssinian, cats:persian, cats:siamese, cats:tabbies
  # Desired Order: tabbies, siamese, all others in alphabetical order
  # Format: 
  # var string[]{} subtagorder = {
  #   &quot;cats&quot; =&amp;gt; [&quot;tabbies&quot;, &quot;siamese&quot;]
  # };&lt;/span&gt;
  var string[]{} subtagorder;

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts?&lt;/span&gt;
  var bool show_count = true;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just before the use count, if any&lt;/span&gt;
  var string pre_count = &quot;[&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just after the use count, if any&lt;/span&gt;
  var string post_count = &quot;]&quot;;

&lt;span style=&quot;color: green;&quot;&gt;##### End Config #####&lt;/span&gt;

  var Page p = get_page();
  var string list = &quot;&quot;;
    
  if (size $p-&amp;gt;visible_tag_list() &amp;gt; 0) { 

    # Turn the sort order into an associative array for easy access
    var string{} sorttoptags;
    foreach var string tagname ($tagorder) {
      $sorttoptags{$tagname} = $tagname;
    }
     
    # Turn the subtag sort order into an associative array for easy access
    var string{}{} sortsubtags;
    foreach var string toptagname ($subtagorder) {
      var string[] subtags = $subtagorder{$toptagname};
      var string{} subtag_hash;
      foreach var string tagname ($subtags) {
        $subtag_hash{$tagname} = $tagname;
      }
      $sortsubtags{$toptagname} = $subtag_hash; 
    }

    # 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 string prev_top_level = &quot;&quot;;
    var TagDetail{}{} visibletags;
    var string[] unordered;
    var string[]{} subunordered;
    foreach var TagDetail t ($p-&amp;gt;visible_tag_list()) { 
            
      if ($t.name) {      
        # Split once on delimiter   
        var string[] tags;
        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;
                 
        if (size $tags == 1) {
          # This tag has no subtag
          $visibletags{$tags[0]}{$tags[0]} = $t;
        }
        else {
          var string subtag = $tags[0] + &quot;sub&quot;;
          $visibletags{$subtag}{$tags[1]} = $t;
        }

        # If tag is not in top-level sort order, add it to top unordered array
        if ($tags[0] != $prev_top_level) {
          if ($sorttoptags{$tags[0]} != $tags[0]) {
            $unordered[size $unordered] = $tags[0];
          }
          $prev_top_level = $tags[0];
        }

        # If sub exists and is not in subtag sort order, add it to subtag unordered array
        if (size $tags &amp;gt; 1) {
          if ($sortsubtags{$tags[0]}) {
            # This top-level tag has some ordered subtags 
            if ($sortsubtags{$tags[0]}{$tags[1]} != $tags[1]) {
              # But this particualr subtag is not one of them
              $subunordered{$tags[0]}[size $subunordered{$tags[0]}] = $tags[1];
            }
          }
          else {
            # This top-level tag has no ordered subtags
            $subunordered{$tags[0]}[size $subunordered{$tags[0]}] = $tags[1];
          }
        }

      }  
    } 

    # Start the list.
    $list = &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot;; 

    # Add top-level sorted tags to list first
    foreach var string tagname ($tagorder) {
      # Ignore any tag names in sort array that aren&apos;t in the visible tag list
      if ($visibletags{$tagname} or $visibletags{&quot;${tagname}sub&quot;}) {

        if ($visibletags{$tagname}) {
          # This is a top-level tag
          var TagDetail t = $visibletags{$tagname}{$tagname};
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$tagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
          if ($show_count) {
            $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
          }
        }
        else {
          # These subtags just have a top-level label
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tagname&quot;&quot;&quot;;
        }

        # Add the subtags
        if ($visibletags{&quot;${tagname}sub&quot;}) {
          $list = $list + &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot;;
   
          # Add ordered subtags first
          if ($subtagorder{$tagname}) {
            foreach var string subtagname ($subtagorder{$tagname}) {
              var TagDetail t = $visibletags{&quot;${tagname}sub&quot;}{$subtagname};
              $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$subtagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
              if ($show_count) {
                $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
              }
              $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
            }
          }
          # Now add unordered subtags
          if ($subunordered{$tagname}) {
            foreach var string subtagname ($subunordered{$tagname}) {
              var TagDetail t = $visibletags{&quot;${tagname}sub&quot;}{$subtagname};
              $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$subtagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
              if ($show_count) {
                $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
              }
              $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
            }
          }
          $list = $list + &quot;&amp;lt;/ul&amp;gt;&quot;;
        }

        # Close the top-level item
        $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
      }
    }

    # Add alphabetically sorted tags to the list
    foreach var string tagname ($unordered) {
      # Ignore any tag names in sort array that aren&apos;t in the visible tag list
      if ($visibletags{$tagname} or $visibletags{&quot;${tagname}sub&quot;}) {

        if ($visibletags{$tagname}) {
          # This is a top-level tag
          var TagDetail t = $visibletags{$tagname}{$tagname};
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$tagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
          if ($show_count) {
            $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
          }
        }
        else {
          # These subtags just have a top-level label
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tagname&quot;&quot;&quot;;
        }

        # Add the subtags
        if ($visibletags{&quot;${tagname}sub&quot;}) {
          $list = $list + &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot;;
   
          # Add ordered subtags first
          if ($subtagorder{$tagname}) {
            foreach var string subtagname ($subtagorder{$tagname}) {
              var TagDetail t = $visibletags{&quot;${tagname}sub&quot;}{$subtagname};
              $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$subtagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
              if ($show_count) {
                $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
              }
              $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
            }
          }
          # Now add unordered subtags
          if ($subunordered{$tagname}) {
            foreach var string subtagname ($subunordered{$tagname}) {
              var TagDetail t = $visibletags{&quot;${tagname}sub&quot;}{$subtagname};
              $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$subtagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
              if ($show_count) {
                $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
              }
              $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
            }
          }
          $list = $list + &quot;&amp;lt;/ul&amp;gt;&quot;;
        }

        # Close the top-level item
        $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
      }
    }

    
    # Close the tag list
    $list = $list + &quot;&amp;lt;/ul&amp;gt;&quot;;

    # mt:20050625: Enclose the entire list in an li tag as required by the layout.
    $list = &quot;&quot;&quot;&amp;lt;li class=&quot;tagBox&quot;&amp;gt;&quot;&quot;&quot; + $list + &quot;&quot;&quot;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;

    # mt:20050623: Add styling to box title.
    $tag_title = &quot;&quot;&quot;&amp;lt;li class=&quot;sbartitle&quot;&amp;gt;$tag_title&amp;lt;/li&amp;gt;&quot;&quot;&quot;;
  }

&lt;span style=&quot;color: green;&quot;&gt;##### Specify Box Order #####&lt;/span&gt;
 
    &lt;span style=&quot;color: green;&quot;&gt;# Print out all your sidebar boxes in the order you 
    # want, including a call for this one -- print_sidebar_box($tag_title, $list) --
    # nested within an if statement to prevent tags box from printing in the event 
    # of no visible tags.&lt;/span&gt;
    print_userpic();
    print_sidebar_blurb();  
    if ($list != &quot;&quot;){print_sidebar_box($tag_title, $list);}
    print_sidebar_linklist();
    print_sidebar_calendar();

&lt;span style=&quot;color: green;&quot;&gt;#####   End Box Order   #####&lt;/span&gt;

}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/23995.html?view=comments#comments</comments>
  <category>layout:flexiblesquares</category>
  <category>code:tagsbox:bi-level</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/23732.html</guid>
  <pubDate>Wed, 01 Mar 2006 19:19:44 GMT</pubDate>
  <title>Flexible Squares: Sorted Bi-Level Tags in Sidebar</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/23732.html</link>
  <description>This is a first effort towards answering &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;todeskun&quot; lj:user=&quot;todeskun&quot; &gt;&lt;a href=&quot;https://todeskun.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://todeskun.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;todeskun&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/242763.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;.  Not sure if it&apos;s the best way, and there may be some unecessary inefficiency in there.  Could interested parties please give it a once-over?  If you had better ideas for solving this problem, I&apos;d like to know about them, and implement those instead. I have been known to overlook the obvious. :)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ETA:&lt;/b&gt; I think this code doesn&apos;t allow enough sorting -- it only sorted top-level tags.  Please see &lt;a href=&quot;http://murklinstest.livejournal.com/23995.html&quot; target=&quot;_blank&quot;&gt;Attempt #2&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;function print_sidebar() {

&lt;span style=&quot;color: green;&quot;&gt;#####   Config   #####&lt;/span&gt;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your delimiter.
  # One char only -- extra chars get truncated.&lt;/span&gt;
  var string delimiter = &quot;:&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the title of your tag box&lt;/span&gt;
  var string tag_title = &quot;Tags&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify your sort order.
  # Add the top-level labels that you want to sort to the 
  # top of the list in the order you want them to display.
  # Format: var string[] tagorder = [&quot;dogs&quot;, &quot;cats&quot;, &quot;birds&quot;];&lt;/span&gt;
  var string[] tagorder = [];

  &lt;span style=&quot;color: green;&quot;&gt;# Do you want to show the tag use counts?&lt;/span&gt;
  var bool show_count = true;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just before the use count, if any&lt;/span&gt;
  var string pre_count = &quot;[&quot;;

  &lt;span style=&quot;color: green;&quot;&gt;# Specify the text to show just after the use count, is any&lt;/span&gt;
  var string post_count = &quot;]&quot;;

&lt;span style=&quot;color: green;&quot;&gt;##### End Config #####&lt;/span&gt;

  var Page p = get_page();
  var string list = &quot;&quot;;
    
  if (size $p-&amp;gt;visible_tag_list() &amp;gt; 0) { 
     
    # Turn the sort order into an associative array for easy access
    var string{} sorttags;
    foreach var string tagname ($tagorder) {
      $sorttags{$tagname} = $tagname;
    }

    # 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 string prev_top_level = &quot;&quot;;
    var TagDetail{}[]{} visibletags;
    var string[] unordered = [];
    foreach var TagDetail t ($p-&amp;gt;visible_tag_list()) { 
            
      if ($t.name) {      
        # Split once on delimiter   
        var string[] tags;
        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;
                 
        if (size $tags == 1) {
          # This tag has no subtag
          $visibletags{$tags[0]}[size $visibletags{$tags[0]}] = {$tags[0] =&amp;gt; $t};
        }
        else {
          var string subtag = $tags[0] + &quot;sub&quot;;
          $visibletags{$subtag}[size $visibletags{$subtag}] = {$tags[1] =&amp;gt; $t};
        }

        if ($tags[0] != $prev_top_level) {
          if ($sorttags{$tags[0]} != $tags[0]) {
            # If tag is not in sort order, add it to unsorted array
            $unordered[size $unordered] = $tags[0];
          }
          $prev_top_level = $tags[0];
        }
      }  
    } 

    # Start the list.
    $list = &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot;; 

    # Add sorted tags to list first
    foreach var string tagname ($tagorder) {
      # Ignore any tag names in sort array that aren&apos;t in the visible tag list
      if ($visibletags{$tagname} or $visibletags{&quot;${tagname}sub&quot;}) {

        if ($visibletags{$tagname}) {
          # This is a top-level tag
          var TagDetail t = $visibletags{$tagname}[0]{$tagname};
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$tagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
          if ($show_count) {
            $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
          }
        }
        else {
          # These subtags just have a top-level label
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tagname&quot;&quot;&quot;;
        }

        # Add the subtags
        if ($visibletags{&quot;${tagname}sub&quot;}) {
        $list = $list + &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot;;
        foreach var TagDetail{} subtag ($visibletags{&quot;${tagname}sub&quot;}) {
          foreach var string name ($subtag) {
            var TagDetail t =  $subtag{$name};
            $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$name&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            if ($show_count) {
              $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
            }
            $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
          }
        }
        $list = $list + &quot;&amp;lt;/ul&amp;gt;&quot;;
        }

        # Close the top-level item
        $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
      }
    }

    # Add alphabetically sorted tags to the list
    foreach var string tagname ($unordered) {
      # Ignore any tag names in sort array that aren&apos;t in the visible tag list
      if ($visibletags{$tagname} or $visibletags{&quot;${tagname}sub&quot;}) {

        if ($visibletags{$tagname}) {
          # This is a top-level tag
          var TagDetail t = $visibletags{$tagname}[0]{$tagname};
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$tagname&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
          if ($show_count) {
            $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
          }
        }
        else {
          # These subtags just have a top-level label
          $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;$tagname&quot;&quot;&quot;;
        }

        # Add the subtags
        if ($visibletags{&quot;${tagname}sub&quot;}) {
        $list = $list + &quot;&quot;&quot;&amp;lt;ul class=&quot;tagList&quot;&amp;gt;&quot;&quot;&quot;;
        foreach var TagDetail{} subtag ($visibletags{&quot;${tagname}sub&quot;}) {
          foreach var string name ($subtag) {
            var TagDetail t =  $subtag{$name};
            $list = $list + &quot;&quot;&quot;&amp;lt;li class=&quot;tagItem&quot;&amp;gt;&amp;lt;a href=&quot;$t.url&quot;&amp;gt;$name&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
            if ($show_count) {
              $list = $list + &quot;&quot;&quot;&amp;amp;nbsp;${pre_count}${t.use_count}${post_count}&quot;&quot;&quot;;
            }
            $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
          }
        }
        $list = $list + &quot;&amp;lt;/ul&amp;gt;&quot;;
        }

        # Close the top-level item
        $list = $list + &quot;&amp;lt;/li&amp;gt;&quot;;
      }
    }
    
    # Close the tag list
    $list = $list + &quot;&amp;lt;/ul&amp;gt;&quot;;

    # mt:20050625: Enclose the entire list in an li tag as required by the layout.
    $list = &quot;&quot;&quot;&amp;lt;li class=&quot;tagBox&quot;&amp;gt;&quot;&quot;&quot; + $list + &quot;&quot;&quot;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;

    # mt:20050623: Add styling to box title.
    $tag_title = &quot;&quot;&quot;&amp;lt;li class=&quot;sbartitle&quot;&amp;gt;$tag_title&amp;lt;/li&amp;gt;&quot;&quot;&quot;;
  }

&lt;span style=&quot;color: green;&quot;&gt;##### Specify Box Order #####&lt;/span&gt;
 
    &lt;span style=&quot;color: green;&quot;&gt;# Print out all your sidebar boxes in the order you 
    # want, including a call for this one -- print_sidebar_box($tag_title, $list) --
    # nested within an if statement to prevent tags box from printing in the event 
    # of no visible tags.&lt;/span&gt;
    print_userpic();
    print_sidebar_blurb();  
    if ($list != &quot;&quot;){print_sidebar_box($tag_title, $list);}
    print_sidebar_linklist();
    print_sidebar_calendar();

&lt;span style=&quot;color: green;&quot;&gt;#####   End Box Order   #####&lt;/span&gt;

}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/23732.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/23462.html</guid>
  <pubDate>Mon, 27 Feb 2006 23:50:21 GMT</pubDate>
  <title>Passing bool{} and bool[]</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/23462.html</link>
  <description>Am I crazy or does trying to declare a function that accepts an argument of type &lt;code&gt;bool{}&lt;/code&gt; or &lt;code&gt;bool[]&lt;/code&gt; always cause a compilation error?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ETA:&lt;/b&gt; No! Not crazy.  &lt;a href=&quot;http://rt.livejournal.org/Ticket/Display.html?id=936&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Ticket #936&lt;/a&gt;.</description>
  <comments>https://murklinstest.livejournal.com/23462.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/22820.html</guid>
  <pubDate>Thu, 16 Feb 2006 07:48:28 GMT</pubDate>
  <title>Semi-Threaded Comments</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/22820.html</link>
  <description>So a recent post in Flexible Squares got me to thinking once again about the problem of long comment threads either expanding too far to the right in Firefox, requiring lots of horizontal scrolling, or becoming terminally squished in IE since it doesn&apos;t understand min-width.  I was wondering if the primary format of long threads is a single long chain, where each comment has only one reply.  If that&apos;s the case, why does each comment in that chain need indentation?  If it isn&apos;t branching off into new threads, shouldn&apos;t it be just as easy to understand if no indentation were used at all?  Thus I created a semi-threaded comment display, which indents a comment only when it is not the only reply to its parent&lt;super&gt;&lt;a href=&quot;#murklinstest_footnote1&quot; target=&quot;_blank&quot;&gt;*&lt;/a&gt;&lt;/super&gt;.&lt;br /&gt;&lt;br /&gt;Hmm, reading this over, I find my own description entirely useless.  Best link to an example.  &lt;a href=&quot;http://murklinstest.livejournal.com/9804.html&quot; target=&quot;_blank&quot;&gt;This comment&lt;/a&gt; has some fairly long chains, leading to a bit of comment squish.  &lt;a href=&quot;http://murklinstest.livejournal.com/9804.html?s2id=8165715&quot; target=&quot;_blank&quot;&gt;Viewed with semi-threading&lt;/a&gt;, though, it exhibits far less squish.  But is the comment progression still understandable?&lt;br /&gt;&lt;br /&gt;&lt;a name=&quot;murklinstest_footnote1&quot; target=&quot;_blank&quot;&gt;&lt;/a&gt;&lt;super&gt;*&lt;/super&gt; &lt;small&gt;Actually, that is the slightly simplified logic.  It also always indents depth 2 comments to allow all the top level comments to be easily identified.&lt;/small&gt;</description>
  <comments>https://murklinstest.livejournal.com/22820.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>6</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/22566.html</guid>
  <pubDate>Sun, 12 Feb 2006 18:45:42 GMT</pubDate>
  <title>Smooth Sailing: Adaptation of c_h Smilies Tutorial</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/22566.html</link>
  <description>Over at &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;absolut&quot; lj:user=&quot;absolut&quot; &gt;&lt;a href=&quot;https://absolut.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://absolut.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;absolut&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; wrote the &lt;a href=&quot;http://community.livejournal.com/component_help/537693.html&quot; target=&quot;_blank&quot;&gt;Adding Smilies to your post/comments&lt;/a&gt; tutorial, which has code for translating typed smilies into custom images.  This tutorial here does not reproduce or improve on that code, it simply tells you how to adapt the steps in the tutorial to make the code work in a Smooth Sailing theme layer.&lt;br /&gt;&lt;br /&gt;1. Review the &lt;b&gt;Getting Smilies&lt;/b&gt; section of the &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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/component_help/537693.html&quot; target=&quot;_blank&quot;&gt;Adding Smilies to your post/comments&lt;/a&gt; tutorial.&lt;br /&gt;&lt;br /&gt;2. Make sure you have &lt;a href=&quot;http://community.livejournal.com/s2smoothsailing/810.html&quot; target=&quot;_blank&quot;&gt;created a theme layer&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding Smilies to your posts (theme layer)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3. Do you already have the &lt;code&gt;Entry::lay_print&lt;/code&gt; function in your theme layer? If not, go to the &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=4601331&quot; target=&quot;_blank&quot;&gt;Smooth Sailing layer source&lt;/a&gt;, copy the &lt;code&gt;Entry::lay_print&lt;/code&gt; function from there and paste it into your theme layer.&lt;br /&gt;&lt;br /&gt;4. Now look at the &lt;a href=&quot;http://community.livejournal.com/component_help/537693.html&quot; target=&quot;_blank&quot;&gt;Adding Smilies to your post/comments&lt;/a&gt; tutorial, in the section &lt;b&gt;Adding Smilies to your posts (theme layer)&lt;/b&gt;. There, it asks you to replace the following line in &lt;code&gt;print_entry&lt;/code&gt; with the emoticons code:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&quot;&quot;&quot; $e.text &quot;&quot;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In Smooth Sailing, find this line in &lt;code&gt;Entry::lay_print&lt;/code&gt; instead:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&quot;&quot;&quot;&amp;lt;div class=&quot;entryText&quot;&amp;gt;&quot;&quot;&quot;; print $.text; &quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Add in some new lines to make it look like this:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;&amp;lt;div class=&quot;entryText&quot;&amp;gt;&quot;&quot;&quot;;

print $.text;

&quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now replace the &lt;code&gt;print $.text;&lt;/code&gt; line with the emoticons code from the tutorial.   Customize the code in red to the emoticons and image urls that you want to use.&lt;br /&gt;&lt;br /&gt;5. The first line of the code you just added from the &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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; tutorial looks like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;var string text = $e.text;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You need to replace it with this line:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;var string text = $.text;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding Smilies to your comments (theme layer)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;6. Do you already have the &lt;code&gt;EntryPage::print_comment&lt;/code&gt; and the &lt;code&gt;EntryLite::lay_print&lt;/code&gt; functions in your theme layer? If not, go to the &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=4601331&quot; target=&quot;_blank&quot;&gt;Smooth Sailing layer source&lt;/a&gt;, copy them from there and paste them into your theme layer.&lt;br /&gt;&lt;br /&gt;7. Now look at the &lt;a href=&quot;http://community.livejournal.com/component_help/537693.html&quot; target=&quot;_blank&quot;&gt;Adding Smilies to your post/comments&lt;/a&gt; tutorial, in the section &lt;b&gt;Adding Smilies to your comments (theme layer)&lt;/b&gt;. There, it asks you to replace the following lines in &lt;code&gt;print_comment&lt;/code&gt; with the emoticons code:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;
&amp;lt;div style=&quot;margin-left: 5px&quot;&amp;gt;$comment.text&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;In Smooth Sailing, replace this line of &lt;code&gt;EntryPage::print_comment&lt;/code&gt; instead:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&quot;&quot;&quot;&amp;lt;div class=&quot;commentText&quot;&amp;gt;$comment.text&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;8. The last line of the code you just added from the &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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; tutorial looks like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;div style=&quot;margin-left: 5px&quot;&amp;gt;$text&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You need to replace it with this line:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;div class=&quot;commentText&quot;&amp;gt;$text&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;9. Again, customize the code in red to the emoticons and image urls that you want to use.&lt;br /&gt;&lt;br /&gt;10. Also replace this line of &lt;code&gt;EntryLite::lay_print&lt;/code&gt; with the emoticons code:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&quot;&quot;&quot;&amp;lt;div class=&quot;commentText&quot;&amp;gt;$.text&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;11. The first line of the code you just added from the &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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; tutorial looks like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;var string text = $comment.text;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You need to replace it with this line:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;var string text = $.text;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;12. The last line of the code you just added from the &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;component_help&quot; lj:user=&quot;component_help&quot; &gt;&lt;a href=&quot;https://component-help.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://component-help.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;component_help&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; tutorial looks like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;div style=&quot;margin-left: 5px&quot;&amp;gt;$text&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You need to replace it with this line:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;div class=&quot;commentText&quot;&amp;gt;$text&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;13. Again, customize the code in red to the emoticons and image urls that you want to use.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Outputting A List of Smilies (theme layer)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;14. Do you already have the &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function in your theme layer? If not, copy the &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function from the &lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=4601331&quot; target=&quot;_blank&quot;&gt;Smooth Sailing layer source&lt;/a&gt; and paste it into your theme layer.&lt;br /&gt;&lt;br /&gt;15. Paste the following code just *before* the &lt;code&gt;$.form-&amp;gt;print();&lt;/code&gt; line in your layer&apos;s &lt;code&gt;ReplyPage::print_body&lt;/code&gt; function:&lt;br /&gt;&lt;pre style=&quot;background-color: white; color: black;&quot;&gt;&lt;code&gt;        var string value;
	var string{} emoticons =
	{
		&lt;span style=&quot;color: green;&quot;&gt;# for each smiley you want to add, add a new line 
		# the format for adding new smilies should be something like this:
		# &quot;:smiley:&quot; =&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;&quot; alt=&quot;&quot; width=&quot;&quot; height=&quot;&quot; /&amp;gt;&quot;&quot;&quot;,
		# note: for each line, there should be a comma at the very end, EXCEPT for the last line&lt;/span&gt;
		&lt;span style=&quot;color: red;&quot;&gt;&quot;:)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/smile.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
		&quot;;-)&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/wink.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;,
		&quot;:(&quot;	=&amp;gt; &quot;&quot;&quot;&amp;lt;img src=&quot;http://stat.livejournal.com/img/mood/classic/sad.gif&quot; alt=&quot;&quot; width=&quot;15&quot; height=&quot;15&quot; /&amp;gt;&quot;&quot;&quot;&lt;/span&gt;
	};

	&quot;&quot;&quot;
	&amp;lt;div class=&quot;emoticon_box&quot;&amp;gt;
		&amp;lt;a name=&quot;smileys&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;b&amp;gt;Add a Smiley to your comment&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;
		(Hover over each smiley to get the code)&amp;lt;br /&amp;gt;
	&quot;&quot;&quot;;

	foreach var string key ($emoticons) {
		$value = $emoticons{$key};
		&quot;&quot;&quot;&amp;lt;a href=&quot;#smileys&quot; class=&quot;info&quot;&amp;gt;$value&amp;lt;span&amp;gt;$key&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt; &quot;&quot;&quot;;
	}
	&quot;&quot;&quot;&amp;lt;/div&amp;gt;&quot;&quot;&quot;;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;16. As before, you need to modify the red code to use your chosen emoticons and corresponding image urls.&lt;br /&gt;&lt;br /&gt;17. Do you already have the &lt;code&gt;Page::print_custom_head&lt;/code&gt; function in your theme layer?  If not, add the following code to your layer:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function Page::print_custom_head() {
&quot;&quot;&quot;
&amp;lt;style type=&quot;text/css&quot;&amp;gt;

&amp;lt;/style&amp;gt;
&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;18. Now add this css to your theme layer&apos;s &lt;code&gt;Page::print_custom_head&lt;/code&gt; function, just before the &lt;code&gt;&amp;lt;/style&amp;gt;&lt;/code&gt; line:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;.emoticon_box {
  text-align: center;
  margin: 10px;
  padding: 10px;
  background-color:$*color_body_background;
  color:$*color_body_text;
  border: 1px solid $*color_body_text;
}

a.info {
  position:relative; /*this is the key*/
  z-index:24;
  background-color:$*color_body_background;
  color:$*color_body_text;
  text-decoration:none;
}

a.info:hover {
  z-index:25; 
  background-color: transparent;
}

a.info img {
  border: none;
}

a.info span {
  display: none;
}

a.info:hover span { /*the span will display just on :hover state*/
  display:block;
  position:absolute;
  top:2em; 
  left:2em;
  width:15em;
  border:1px solid $*color_body_text;
  background-color:$*color_body_background;
  color:$*color_body_text;
  text-align: center;
  text-decoration: none;
}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;19. Compile your layer and check your journal to see that emoticons are being replaced by the correct images and that on the reply page your list of available images is appearing.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Important Note:&lt;/b&gt;&lt;br /&gt;Avoid replacing &lt;code&gt;;)&lt;/code&gt; and &lt;code&gt;:/&lt;/code&gt; with images as doing so will screw up cut tags and all links and images.  Try using &lt;code&gt;;-)&lt;/code&gt; and &lt;code&gt;:-/&lt;/code&gt; instead.&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://murklinstest.livejournal.com/22566.html?view=comments#comments</comments>
  <category>tutorial:emoticons</category>
  <category>layout:smooth sailing</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/22404.html</guid>
  <pubDate>Sat, 11 Feb 2006 18:06:40 GMT</pubDate>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/22404.html</link>
  <description>Does anyone else think it&apos;s funny that in light of the site-wide CSS changes made recently Flexible Squares layouts *benefited* from the bug that causes custom css to print out twice?  Hee.</description>
  <comments>https://murklinstest.livejournal.com/22404.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/22046.html</guid>
  <pubDate>Wed, 01 Feb 2006 18:33:17 GMT</pubDate>
  <title>IE 7 Beta 2 Preview</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/22046.html</link>
  <description>IE 7 Beta 2 Preview was released to the public yesterday.  Works on Win XP SP2.  Have done some &lt;strong&gt;very quick&lt;/strong&gt; tests with the as yet unreleased Flexible Squares code to see if there&apos;s much improvement over IE6.  Oh IE!  So close and yet... not really.  Still, much better than before.  At least wide content escapes divs rather than stretching them to accommodate:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://i15.photobucket.com/albums/a400/murklins/escapesdiv.jpg&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;https://i15.photobucket.com/albums/a400/murklins/resized_escapesdiv.jpg&quot; width=&quot;269px&quot; height=&quot;77px&quot; border=&quot;0&quot; fetchpriority=&quot;high&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately, that wide content still won&apos;t overlap an adjacent floated div, which in Flexible Squares forces the wide image down to where the sidebar ends:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://i15.photobucket.com/albums/a400/murklins/wontoverlap.jpg&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;https://i15.photobucket.com/albums/a400/murklins/resized_wontoverlap.jpg&quot; width=&quot;265px&quot; height=&quot;146px&quot; border=&quot;0&quot; loading=&quot;lazy&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ETA1:&lt;/b&gt; Just like in IE6, the gap happens whether the sidebar is on the left or the right.  But please tell me I&apos;m wrong about the disappearing text bug resurfacing in IE7:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://i15.photobucket.com/albums/a400/murklins/peekaboo_ie7.jpg&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;https://i15.photobucket.com/albums/a400/murklins/resized_peekaboo_ie7.jpg&quot; width=&quot;265px&quot; height=&quot;146px&quot; border=&quot;0&quot; loading=&quot;lazy&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ETA2:&lt;/b&gt; Ooo, but I think max-width works!  Not min-width, though?  Weird.</description>
  <comments>https://murklinstest.livejournal.com/22046.html?view=comments#comments</comments>
  <category>musings:peekaboo</category>
  <lj:security>public</lj:security>
  <lj:reply-count>8</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/21864.html</guid>
  <pubDate>Tue, 17 Jan 2006 19:38:47 GMT</pubDate>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/21864.html</link>
  <description>Huh.  I have not logged in as &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;murklinstest&quot; lj:user=&quot;murklinstest&quot; &gt;&lt;a href=&quot;https://murklinstest.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://murklinstest.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;murklinstest&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; in *two* days.  Some kind of record, considering I have had uninterrupted internet access.  I even had to &lt;strong&gt;go earlier&lt;/strong&gt; on my Friends page.  I still am not here for reals (Recent Comments will have to wait until later), but I did want to note, after reading &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-P     &quot;  data-ljuser=&quot;allsorts46&quot; lj:user=&quot;allsorts46&quot; &gt;&lt;a href=&quot;https://allsorts46.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://allsorts46.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;allsorts46&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&apos;s &lt;a href=&quot;http://www.livejournal.com/community/lj_style/379928.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt; in &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-deleted  i-ljuser-type-C     &quot;  data-ljuser=&quot;lj_style&quot; lj:user=&quot;lj_style&quot; &gt;&lt;a href=&quot;https://lj-style.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://lj-style.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;lj_style&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;, that if there is an up-to-date record somewhere of all S2&apos;s undocumented features, I would love to know about it.  And maybe link to it from somewhere in &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;, so that people interested in learning S2 can get the full story.  If such a record does not exist, someone should make one.  I&apos;m just sayin&apos;...</description>
  <comments>https://murklinstest.livejournal.com/21864.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/21737.html</guid>
  <pubDate>Fri, 02 Dec 2005 07:03:27 GMT</pubDate>
  <title>S2 is Love</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/21737.html</link>
  <description>&lt;code&gt;isa&lt;/code&gt; and &lt;code&gt;as&lt;/code&gt;!  O glorious day!&lt;br /&gt;&lt;br /&gt;*eyes knocking code menacingly*</description>
  <comments>https://murklinstest.livejournal.com/21737.html?view=comments#comments</comments>
  <category>musings</category>
  <lj:security>public</lj:security>
  <lj:reply-count>11</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/21248.html</guid>
  <pubDate>Wed, 30 Nov 2005 17:25:11 GMT</pubDate>
  <title>Commentbar (why won&apos;t you die?)</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/21248.html</link>
  <description>I was thinking about the new incarnation of the commentbar function and the associated get_link_array function, and wondering what a paid user would need to do to get image buttons working.  So I made a theme layer, since I can&apos;t work these things out sufficiently in my head, and I made some code that I like.  In this code, I theorize the possibility that while there are some links that have associated images, there could always be one or two that must be shown as text (especially given that new entry linkbar links can be displayed automatically but custom buttons might not be available for them yet).  In that case, I&apos;d stick all the buttons on one side of the comment bar and all the text links on the other side since that is the most visually appealing approach.&lt;br /&gt;&lt;br /&gt;Then I noticed that the buttons don&apos;t need separators but the text links do.  So I made a new version of &lt;code&gt;commentbar()&lt;/code&gt; that accepts an additional &lt;code&gt;$separator&lt;/code&gt; parameter, so that you can use different separators depending on the side.  In the layout layer, we would pass &lt;code&gt;$*comment_sep&lt;/code&gt; to both sides, but if a paid user wanted to have buttons without separators between them, that would be easy to implement without giving up the separator between text links.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.livejournal.com/customize/advanced/layersource.bml?id=5512133&quot; target=&quot;_blank&quot;&gt;Theme Layer&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.livejournal.com/users/murklinstest/?s2id=7617657&amp;amp;skip=20&quot; target=&quot;_blank&quot;&gt;Test Style&lt;/a&gt; -- &lt;a href=&quot;http://www.livejournal.com/users/murklinstest/9804.html?s2id=7617657&quot; target=&quot;_blank&quot;&gt;this entry&lt;/a&gt; should show the text link separator in action.</description>
  <comments>https://murklinstest.livejournal.com/21248.html?view=comments#comments</comments>
  <category>layout:flexiblesquares</category>
  <category>musings</category>
  <lj:security>public</lj:security>
  <lj:reply-count>5</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/21007.html</guid>
  <pubDate>Fri, 18 Nov 2005 19:52:10 GMT</pubDate>
  <title>Arg! Quickreply</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/21007.html</link>
  <description>Note to self: Quickreply box sits inside the commentbar div when you click the &quot;Leave a comment&quot; link.  Looks sort of strange.  Is it on purpose?</description>
  <comments>https://murklinstest.livejournal.com/21007.html?view=comments#comments</comments>
  <category>layout:flexiblesquares</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://murklinstest.livejournal.com/20886.html</guid>
  <pubDate>Thu, 17 Nov 2005 00:02:43 GMT</pubDate>
  <title>Thinking Out Loud (but also silently)</title>
  <author>murklinstest</author>
  <link>https://murklinstest.livejournal.com/20886.html</link>
  <description>On Reply page, Peekaboo bug was fixed by having the box that follows the entry &lt;strong&gt;not&lt;/strong&gt; clear the userpic.  Basically, it is the &lt;code&gt;clear: left&lt;/code&gt; on .box that causes the bug in the current system code.  Might want to consider adding the .clear and .seperator divs to the Reply page, to mimic the Entry page and make sure the reply box&apos;s border doesn&apos;t get overlapped by the userpic.  Actually, it is probably the presence of those divs on the Entry page that prevent Peekaboo, even though .box is still clearing left there.  So that would be another way to fix it, I guess.&lt;br /&gt;&lt;br /&gt;Why can&apos;t I remember how was it fixed on the Recent Entries page?  Or even how to trigger it there?</description>
  <comments>https://murklinstest.livejournal.com/20886.html?view=comments#comments</comments>
  <category>layout:flexiblesquares</category>
  <category>musings:peekaboo</category>
  <lj:security>public</lj:security>
  <lj:reply-count>9</lj:reply-count>
  </item>
</channel>
</rss>
