<?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>FB Layers</title>
  <link>https://fblayers.livejournal.com/</link>
  <description>FB Layers - LiveJournal.com</description>
  <lastBuildDate>Tue, 14 Feb 2006 19:41:50 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>fblayers</lj:journal>
  <lj:journalid>5676671</lj:journalid>
  <lj:journaltype>community</lj:journaltype>
  <copyright>NOINDEX</copyright>
  <image>
    <url>https://l-userpic.livejournal.com/28641989/5676671</url>
    <title>FB Layers</title>
    <link>https://fblayers.livejournal.com/</link>
    <width>100</width>
    <height>100</height>
  </image>

  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/3023.html</guid>
  <pubDate>Tue, 14 Feb 2006 19:41:50 GMT</pubDate>
  <title>[theme] - [smoove] - [add link to journal in header]</title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/3023.html</link>
  <description>&lt;pre&gt;&lt;code&gt;function make_navbox (Page this, int top) {
  var string title = $this-&amp;gt;title();

  var string lj_text = &quot;my livejournal&quot;;
  var string lj_link = &quot;&quot;&quot;&amp;lt;a href=&quot;http://${this.user.user}.livejournal.com/&quot;&amp;gt;$lj_text&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
  &quot;&quot;&quot;
    &amp;lt;div class=&quot;navbox&quot;&amp;gt;&quot;&quot;&quot;;
  if ($top == 1) {
    &quot;&quot;&quot;
      &amp;lt;div class=&quot;header&quot;&amp;gt;
        &amp;lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&amp;gt;
          &amp;lt;tr&amp;gt;
            &amp;lt;td width=&quot;50%&quot; class=&quot;title&quot;&amp;gt;&quot;&quot;&quot;;
    print $this-&amp;gt;title();
    &quot;&quot;&quot;
            &amp;lt;/td&amp;gt;
            &amp;lt;td align=&quot;right&quot; valign=&quot;bottom&quot; width=&quot;50%&quot; class=&quot;pager&quot;&amp;gt;&quot;&quot;&quot;;
    $this-&amp;gt;lay_pager();
    print $lj_link;
    &quot;&quot;&quot;
            &amp;lt;/td&amp;gt;
          &amp;lt;/tr&amp;gt;
        &amp;lt;/table&amp;gt;
      &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
  }
  &quot;&quot;&quot;
      &amp;lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&amp;gt;
        &amp;lt;tr&amp;gt;
          &amp;lt;td width=&quot;50%&quot;&amp;gt;
            &amp;lt;p&amp;gt;
  &quot;&quot;&quot;;
  if ($top == 1) {
    $this-&amp;gt;lay_top_left_links();
  } else {
    $this-&amp;gt;lay_btm_left_links();
  }
  &quot;&quot;&quot;
            &amp;lt;/p&amp;gt;
          &amp;lt;/td&amp;gt;
          &amp;lt;td align=&quot;right&quot; width=&quot;50%&quot; valign=&quot;top&quot;&amp;gt;
            &amp;lt;p&amp;gt;&quot;&quot;&quot;;
  if ($top == 1) {
    $this-&amp;gt;lay_top_right_links();
  } else {
    $this-&amp;gt;lay_btm_right_links();
  }
  &quot;&quot;&quot;
            &amp;lt;/p&amp;gt;
          &amp;lt;/td&amp;gt;
        &amp;lt;/tr&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://fblayers.livejournal.com/3023.html?view=comments#comments</comments>
  <category>function make_navbox</category>
  <category>layout smoove</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>4</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/2576.html</guid>
  <pubDate>Tue, 24 Jan 2006 01:18:48 GMT</pubDate>
  <title>[theme] - [positive contact] - [remove other pictures sidebar box]</title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/2576.html</link>
  <description>&lt;pre&gt;&lt;code&gt;function PicturePage::lay_print_sidebar() {
  var string part_of;
  foreach var Link l ($.parent_links) {
    $part_of = $part_of + &quot;&quot;&quot;
                &amp;lt;li&amp;gt;&amp;lt;a href=&quot;$l.url&quot;&amp;gt;$l.caption&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot;&quot;&quot;;
  }
  print_sidebar_box(&quot;Related Galleries&quot;, &quot;&quot;&quot;
              &amp;lt;ul&amp;gt;$part_of
              &amp;lt;/ul&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://fblayers.livejournal.com/2576.html?view=comments#comments</comments>
  <category>layout posicont</category>
  <category>function lay_print_sidebar</category>
  <category>class picturepage</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/2542.html</guid>
  <pubDate>Tue, 24 Jan 2006 00:12:04 GMT</pubDate>
  <title>[theme] - [positive contact] - [add custom css]</title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/2542.html</link>
  <description>&lt;pre&gt;&lt;code&gt;function Page::print () {
var string title     = $this-&amp;gt;title();
var string logged_in = logged_in(&quot;You are not currently logged in, &amp;lt;a href=&apos;/login&apos;&amp;gt;Login now&amp;lt;/a&amp;gt;?&quot;);
&quot;&quot;&quot;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd&quot;&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;$title&amp;lt;/title&amp;gt;
    &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;$.stylesheeturl&quot; type=&quot;text/css&quot; /&amp;gt;
&quot;&quot;&quot;;

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

&quot;&quot;&quot;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;div id=&quot;Title&quot; style=&quot;text-align: $*title_align&quot;&amp;gt;
      &amp;lt;a name=&quot;top&quot;&amp;gt;&amp;lt;/a&amp;gt;
      &amp;lt;h1&amp;gt;$title&amp;lt;/h1&amp;gt;
      &amp;lt;div id=&quot;TitleNav&quot;&amp;gt;
        $logged_in
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div id=&quot;Main&quot; style=&quot;clear: both&quot;&amp;gt;
      &amp;lt;div id=&quot;Sidebar&quot; style=&quot;text-align: center&quot;&amp;gt;
        &amp;lt;div id=&quot;SidebarContents&quot;&amp;gt;&quot;&quot;&quot;;
var string navigation = &quot;&quot;&quot;
              &amp;lt;ul&amp;gt;
                &amp;lt;li&amp;gt;&amp;lt;a href=&quot;/$.user.user/&quot;&amp;gt;View all Galleries&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                &amp;lt;li&amp;gt;&quot;&quot;&quot; + logged_in(&quot;&amp;lt;a href=&apos;/login&apos;&amp;gt;Log in to ScrapBook&amp;lt;/a&amp;gt;&quot;) + &quot;&quot;&quot;&amp;lt;/li&amp;gt;&quot;&quot;&quot; +
                $this-&amp;gt;lay_sidebar_navigation() + &quot;&quot;&quot;
              &amp;lt;/ul&amp;gt;&quot;&quot;&quot;;

print_sidebar_box(&quot;Navigation&quot;, $navigation);
print_sidebar_box(&quot;Link Back&quot;, &quot;&quot;&quot;
              &amp;lt;p&amp;gt;Use this HTML to link back to this page:&amp;lt;/p&amp;gt;
              &amp;lt;textarea style=&quot;width: 100%;&quot; rows=&quot;5&quot; cols=&quot;5&quot;&amp;gt;&quot;&quot;&quot; + 
              ehtml($this-&amp;gt;lay_self_link()) +
              &quot;&quot;&quot;&amp;lt;/textarea&amp;gt;&quot;&quot;&quot;);

$this-&amp;gt;lay_print_sidebar();
&quot;&quot;&quot;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;div id=&quot;Viewer&quot;&amp;gt;
        &amp;lt;div style=&quot;left: -16em; height: 100%; position: absolute;&quot;&amp;gt; &amp;lt;/div&amp;gt;&quot;&quot;&quot;;
$this-&amp;gt;print_body();
&quot;&quot;&quot;
        &amp;lt;/div&amp;gt;
     &amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://fblayers.livejournal.com/2542.html?view=comments#comments</comments>
  <category>class page</category>
  <category>layout posicont</category>
  <category>function print</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>2</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/2055.html</guid>
  <pubDate>Thu, 08 Dec 2005 02:39:48 GMT</pubDate>
  <title>[theme] - [cornered] - [make Page::print() call Page::print_head()]</title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/2055.html</link>
  <description>&lt;pre&gt;&lt;code&gt;function Page::print() {
  var string title = $this-&amp;gt;title();
  &quot;&quot;&quot;&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;$title&amp;lt;/title&amp;gt;
    &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;$.stylesheeturl&quot; type=&quot;text/css&quot;&amp;gt;
&lt;span style=&quot;color:green; font-weight:bold;&quot;&gt;  &quot;&quot;&quot;:

  # like.  actually call this function.  and stuff.
  $this-&amp;gt;print_head();

  &quot;&quot;&quot;&lt;/span&gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
  &quot;&quot;&quot;;

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

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

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

  &quot;&quot;&quot;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&quot;&quot;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://fblayers.livejournal.com/2055.html?view=comments#comments</comments>
  <category>class page</category>
  <category>layout cornered</category>
  <category>function print</category>
  <media:title type="plain">Rayza - Sonic the Hedgehog 3 IceCap(FrozenKnuckles) OC ReMix</media:title>
  <lj:music>Rayza - Sonic the Hedgehog 3 IceCap(FrozenKnuckles) OC ReMix</lj:music>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/1849.html</guid>
  <pubDate>Sun, 13 Nov 2005 06:37:26 GMT</pubDate>
  <title>department of redundancy department</title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/1849.html</link>
  <description>in the new &quot;positive contact&quot; layout:&lt;pre&gt;&lt;code&gt;function logged_in(string login_text) : string {
  var Page p = get_page();
  if (viewer_logged_in()) {
    if (viewer_is_owner()) {
      return &quot;&quot;&quot;&amp;lt;a href=&quot;$p.manage_account.url&quot;&amp;gt;$p.manage_account.caption&amp;lt;/a&amp;gt;&quot;&quot;&quot;;
    }
  }
  return $login_text;
}&lt;/code&gt;&lt;/pre&gt;umm.  if we know that the viewer is the owner, we know that the viewer is logged in.  duh.</description>
  <comments>https://fblayers.livejournal.com/1849.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>2</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/1634.html</guid>
  <pubDate>Sun, 02 Oct 2005 20:58:11 GMT</pubDate>
  <title>[theme] - [apache] - [apache image downloader]</title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/1634.html</link>
  <description>install &lt;a href=&quot;http://downthemall.mozdev.org/&quot; target=&quot;_blank&quot;&gt;downTHEMall!&lt;/a&gt; extension.&lt;br /&gt;&lt;br /&gt;create new apache &lt;a href=&quot;http://pics.livejournal.com/manage/styles/advanced/layers&quot; target=&quot;_blank&quot;&gt;layer&lt;/a&gt;.&lt;br /&gt;create layout-specific layer.&lt;br /&gt;type: theme.&lt;br /&gt;layout: apache-style directory indexing.&lt;hr /&gt;&lt;pre&gt;&lt;code&gt;layerinfo &quot;type&quot; = &quot;theme&quot;;
layerinfo &quot;name&quot; = &quot;apache image downloader&quot;;

layerinfo &quot;source_viewable&quot; = 1;

function GalleryPage::print_body (){
&quot;&amp;lt;h1&amp;gt;Apache Image Downloader&amp;lt;/h1&amp;gt;&quot;;
  if (not $.pages.all_subitems_displayed) {
    if ($.pages.url_prev != &quot;&quot;) { 
      dir_item(&quot;left&quot;, $.pages.url_prev, &quot;Previous Page&quot;, $.gallery.dateupdate, &quot;&quot;, &quot;Page &quot; + ($.pages.current - 1) + &quot; of $.pages.total&quot;); 
    }
    if ($.pages.url_next != &quot;&quot;) { 
      dir_item(&quot;right&quot;, $.pages.url_next, &quot;Next Page&quot;, $.gallery.dateupdate, &quot;&quot;, &quot;Page &quot; + ($.pages.current + 1) + &quot; of $.pages.total&quot;); 
    }
  }
  &quot;&amp;lt;/pre&amp;gt;&quot;;

  if ((size $.pictures) == 0) { return; }

  &quot;&amp;lt;hr noshade align=\&quot;left\&quot; width=\&quot;80%\&quot; /&amp;gt;&quot;;

  &quot;&amp;lt;table cellpadding=&apos;2&apos;&amp;gt;&quot;;
  var bool tr = false;
  var int td = 0;
  var string desrow;
  var int rows = 0;
  foreach var Picture p ($.pictures) {
    if (not $tr) {
      &quot;&amp;lt;tr align=&apos;center&apos; valign=&apos;bottom&apos;&amp;gt;\n&quot;;
      $rows++;
      $tr = true;
    }
    var Image i = $p.thumbnails{&quot;norm&quot;};
    &quot;&amp;lt;td&amp;gt;&quot;;
    $i-&amp;gt;print({
      &quot;tint&quot; =&amp;gt; $*tint,
      &quot;href&quot; =&amp;gt; $p.fullimage.url,
      &quot;alt&quot; =&amp;gt; $p.title,
    });
    &quot;&amp;lt;/td&amp;gt;\n&quot;;
    $desrow = $desrow + &quot;&amp;lt;td&amp;gt;$p.title&amp;lt;/td&amp;gt;&quot;;
    $td++;
    if ($td == $*cols) {
      &quot;&amp;lt;/tr&amp;gt;\n&quot;;
      if ($*show_titles) {
        &quot;&amp;lt;tr valign=&apos;top&apos;&amp;gt;$desrow&amp;lt;/tr&amp;gt;\n&quot;;
      }
      $td = 0;
      $tr = false;
      $desrow = &quot;&quot;;
    }
  }
  if ($tr) {
    &quot;&amp;lt;/tr&amp;gt;\n&quot;;
    if ($*show_titles) {
      &quot;&amp;lt;tr valign=&apos;top&apos; align=&apos;center&apos;&amp;gt;$desrow&amp;lt;/tr&amp;gt;\n&quot;;
    }
  }
  &quot;&amp;lt;/table&amp;gt;&quot;;
}&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;create new &lt;a href=&quot;http://pics.livejournal.com/manage/styles/&quot; target=&quot;_blank&quot;&gt;style&lt;/a&gt;.&lt;br /&gt;template: (no base)&lt;br /&gt;edit style.&lt;br /&gt;name: apache image downloader.&lt;br /&gt;layout: apache-style directory indexing&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://pics.livejournal.com/manage/gals&quot; target=&quot;_blank&quot;&gt;manage gals&lt;/a&gt;.&lt;pre&gt;&lt;code&gt;foreach $gal ($gals) {

  choose a gal to download images from.

  if (size($images) &amp;gt; 0) {

    change style to &quot;apache image downloader.&quot;
    save gallery.
    click on &quot;view all pictures&quot; link on right.

    select &amp; copy gal title.

    right click -&amp;gt; downTHEMall!
    select &quot;links in the page&quot; tab.
    filter by &quot;all files.&quot;

    if (size($pages) &amp;gt; 1) {
      deselect any links to other pages.
    }

    set dir to download to.  (if you copied the gal title,
      you can use that to create a dir with that name)
    click &quot;start downloads!&quot; and watch them be grabbed.  and stuff.

    if (size($pages) &amp;gt; 1) {
      go to next page and perform above process for remaining pages.
    }

    hit the back button until you reach the manage gal page.

    change style back to what it was before you changed it to:
      &quot;apache image downloader.&quot;
    save changes.

  }

  if (size($images) == 0) {
    choose a subgal.
    perform above process.
  }

  if (size($remaining_subgals) == 0) {
    go to parent gal.
    perform above process.
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;hr /&gt;then use this php, running in a web server emulator on your computer (such as &lt;a href=&quot;http://www.xitami.com/&quot; target=&quot;_blank&quot;&gt;xitami&lt;/a&gt;), to append the correct filetype to each file.  this script is intended to run within each folder.&lt;pre&gt;&lt;code&gt;&amp;lt;?php
function image_type_to_extension($imagetype) {
  if(empty($imagetype)) return false;
  switch($imagetype) {
    case IMAGETYPE_GIF     : return &apos;gif&apos;;
    case IMAGETYPE_JPEG    : return &apos;jpg&apos;;
    case IMAGETYPE_PNG     : return &apos;png&apos;;
    case IMAGETYPE_SWF     : return &apos;swf&apos;;
    case IMAGETYPE_PSD     : return &apos;psd&apos;;
    case IMAGETYPE_BMP     : return &apos;bmp&apos;;
    case IMAGETYPE_TIFF_II : return &apos;tiff&apos;;
    case IMAGETYPE_TIFF_MM : return &apos;tiff&apos;;
    case IMAGETYPE_JPC     : return &apos;jpc&apos;;
    case IMAGETYPE_JP2     : return &apos;jp2&apos;;
    case IMAGETYPE_JPX     : return &apos;jpf&apos;;
    case IMAGETYPE_JB2     : return &apos;jb2&apos;;
    case IMAGETYPE_SWC     : return &apos;swc&apos;;
    case IMAGETYPE_IFF     : return &apos;aiff&apos;;
    case IMAGETYPE_WBMP    : return &apos;wbmp&apos;;
    case IMAGETYPE_XBM     : return &apos;xbm&apos;;
    default                : return false;
  }
}

$dir   = &quot;.&quot;;
$files = array();
$dir = opendir($dir);
while($file = readdir($dir)) {
  $files[] = $file;
}

foreach ($files as $file) {
  if(is_file($file)) {
    if(count(explode(&quot;.&quot;, $file)) == 1) {
      list($width, $height, $type, $attr) = getimagesize($file);
      $newfile = $file . &quot;.&quot; . image_type_to_extension($type);
      if(rename($file, $newfile)) {
        echo $file . &quot; -&amp;gt; &quot; . $newfile . &quot;&amp;lt;br /&amp;gt;&quot;;
      }
    }
  }
}
?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://fblayers.livejournal.com/1634.html?view=comments#comments</comments>
  <category>class gallerypage</category>
  <category>function print_body</category>
  <category>layout apache</category>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>0</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/1486.html</guid>
  <pubDate>Fri, 15 Apr 2005 02:22:25 GMT</pubDate>
  <title>userpics! </title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/1486.html</link>
  <description>check out &lt;a href=&quot;http://pics.livejournal.com/kunzite1/gallery/00032048&quot; target=&quot;_blank&quot;&gt;this gallery&lt;/a&gt; and vote on the userpics.&lt;br /&gt;x-posted to: &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;fblayers&quot; lj:user=&quot;fblayers&quot; &gt;&lt;a href=&quot;https://fblayers.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://fblayers.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;fblayers&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;, and &lt;span  class=&quot;ljuser  i-ljuser  i-ljuser-type-C     &quot;  data-ljuser=&quot;s2layers&quot; lj:user=&quot;s2layers&quot; &gt;&lt;a href=&quot;https://s2layers.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://s2layers.livejournal.com/&quot; class=&quot;i-ljuser-username&quot;   target=&quot;_self&quot;   &gt;&lt;b&gt;s2layers&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;.</description>
  <comments>https://fblayers.livejournal.com/1486.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>16</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/1276.html</guid>
  <pubDate>Thu, 14 Apr 2005 23:35:05 GMT</pubDate>
  <title>[Code snippets for layout layer] - [Parse &amp;lt;lj user=*&amp;gt; tags / make &quot;Add as User Icon&quot; buttons]</title>
  <author>dgriswold</author>
  <link>https://fblayers.livejournal.com/1276.html</link>
  <description>Two snippets. First, a function to parse strings for &amp;lt;lj user=*&amp;gt; and &amp;lt; comm=*&amp;gt; tags. Also includes a recursive function to find the earliest occurrence of a substring in a larger string using a binary search. These functions are useful for parsing picture or gallery descriptions.&lt;br /&gt;


&lt;pre&gt;
function find_earliest_instance (string input, string subs) : int
{
  #Finds the earliest instance of substring subs in in that occurs after character start
  if (not $input-&amp;gt;contains($subs)) {
    return -1;
  }
  var int sub_length = $subs-&amp;gt;length();
  var int input_length = $input-&amp;gt;length();
  
  if ($input_length == $sub_length) 
  {
    return 0;
  }
  
  var int mid2 = ($input_length / 2) + ($sub_length / 2);
  var int mid1 = $mid2 - $sub_length + 1;
  var int val;
  
  $val = find_earliest_instance($input-&amp;gt;substr(0, $mid2), $subs);
  if ($val != -1) {

    return $val;
  }
  $val = find_earliest_instance($input-&amp;gt;substr($mid1, $input_length), $subs);
  return $mid1 + $val;
}

function parse_lj_user (string input) : string
{ # FUNCTION BLOCK
  var string user_string = &quot;&amp;amp;lt;lj user=&quot;;
  var string comm_string = &quot;&amp;amp;lt;lj comm=&quot;;
  var string rep_base_1 = &quot;&amp;lt;span class=&apos;ljuser&apos; style=&apos;white-space: nowrap;&apos;&amp;gt;&amp;lt;&quot;
    +&quot;a href=&apos;http://www.livejournal.com/userinfo.bml?user=&quot;;
  var string rep_commbase_2 = &quot;&apos;&amp;gt;&amp;lt;img &quot; +
    &quot;src=&apos;http://stat.livejournal.com/img/community.gif&apos; &quot; +
    &quot;alt=&apos;[info]&apos; width=&apos;16&apos; height=&apos;16&apos; &quot; + 
    &quot;style=&apos;vertical-align: bottom; border: 0;&apos; &quot; +
    &quot;/&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;a href=&apos;http://www.livejournal.com/community/&quot;;
  var string rep_userbase_2 = &quot;&apos;&amp;gt;&amp;lt;img &quot; +
    &quot;src=&apos;http://stat.livejournal.com/img/userinfo.gif&apos; &quot; +
    &quot;alt=&apos;[info]&apos; width=&apos;16&apos; height=&apos;16&apos; &quot; +
    &quot;style=&apos;vertical-align: bottom; border: 0;&apos; &quot; +
    &quot;/&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;a href=&apos;http://www.livejournal.com/user/&quot;;
  var string rep_base_3 = &quot;/&apos;&amp;gt;&amp;lt;b&amp;gt;&quot;;
  var string rep_base_4 = &quot;&amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&quot;;
  
  var int beginning;
  var int end;
  var string string_to_rep;
  var string rep_string;
  var int rep_length;
  var string username;
  var string linktype;
  var string part1;
  var string part2;
  var string output;
   
  $beginning = find_earliest_instance($input, $user_string);
  if ($beginning != -1) {
    $linktype = &quot;user&quot;;
  } else {
    $beginning = find_earliest_instance($input, $comm_string);
    if ($beginning != -1) {
      $linktype = &quot;comm&quot;;
    } else {
      return $input;
    }
  }
  $end = find_earliest_instance($input, &quot;&amp;amp;gt;&quot;);
  if ($end == -1) { return $input;}
  
  # REPLACE THIS STRING
  $rep_length = $end - $beginning + 4;
  $string_to_rep = $input-&amp;gt;substr($beginning, $rep_length);
  $username = $string_to_rep-&amp;gt;substr(12, $rep_length - 16);
  var int userlength = $username-&amp;gt;length();
  var string userbegin = $username-&amp;gt;substr(0,6);
  var string userend = $username-&amp;gt;substr($userlength - 6, $userlength);
  if ($userbegin-&amp;gt;contains(&quot;&amp;amp;quot;&quot;)) 
  {
    if (not $userend-&amp;gt;contains(&quot;&amp;amp;quot;&quot;)) 
    { return $input; }
    $username = $username-&amp;gt;substr(6, $userlength - 12);
  }
   elseif ($userbegin-&amp;gt;contains(&quot;&amp;amp;#39;&quot;)) 
   {
     if (not $userend-&amp;gt;contains(&quot;&amp;amp;#39;&quot;)) 
     { return $input; }
     $username = $username-&amp;gt;substr(5, $userlength - 10);
   }
  if ($linktype-&amp;gt;contains(&quot;comm&quot;)) 
  {
    $rep_string = $rep_base_1 + $username + $rep_commbase_2 +
     $username + $rep_base_3 + $username + $rep_base_4;
  }
  else
  {
   $rep_string = $rep_base_1 + $username + $rep_userbase_2 +
     $username + $rep_base_3 + $username + $rep_base_4;
  }
  $part1 = $input-&amp;gt;substr(0, $beginning);
  $part2 = $input-&amp;gt;substr($end + 4, $input-&amp;gt;length());
  $output = $part1 + $rep_string + $part2;
  if ($output-&amp;gt;contains($input)) 
  { 
    return $output;
  } 
  else
  {
    return parse_lj_user($output);
  }
} #END FUNCTION BLOCK      
 
&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;&lt;br /&gt;

The second snippet is HTML (encased in strings) for a form button that lets any user add an image&apos;s thumbnail as their own LJ user icon, assuming they&apos;re logged in. The URL, Keywords, and Comments values assume you&apos;re in Gallery View on the Super Simple style (having run $this-&amp;gt;load_pict_descriptions()) but it&apos;s pretty simple to adapt to any view, just change $i.url, $p.title, and $p.des to the correct values for the image&apos;s thumbnail, title, and description respectively. &lt;br /&gt;&lt;br /&gt;


&lt;pre&gt;
&quot;&quot;&quot;&amp;lt;form action=&apos;http://livejournal.com/editpics.bml&apos; &quot;&quot;&quot; +
&quot;&quot;&quot;method=&apos;post&apos; enctype=&apos;multipart/form-data&apos;&amp;gt;\n&quot;&quot;&quot; +
&quot;&quot;&quot;&amp;lt;input type=&apos;hidden&apos; value=&quot;url&quot; name=&quot;src&quot; /&amp;gt;\n&quot;&quot;&quot; +
&quot;&quot;&quot;&amp;lt;input type=&quot;hidden&quot; name=&quot;urlpic&quot; value = &quot;$i.url&quot; /&amp;gt;\n&quot;&quot;&quot; +
&quot;&quot;&quot;&amp;lt;input type=&quot;hidden&quot; name=&quot;keywords&quot; value=&quot;$p.title&quot; /&amp;gt;\n&quot;&quot;&quot; +
&quot;&quot;&quot;&amp;lt;input type=&quot;hidden&quot; value=&quot;$p.des&quot; name=&quot;comments&quot; size=&quot;40&quot; /&amp;gt;\n&quot;&quot;&quot; +
&quot;&quot;&quot;&amp;lt;input type=&apos;submit&apos; value=&quot;Add as user icon&quot; /&amp;gt;&amp;lt;/form&amp;gt;\n&amp;lt;/td&amp;gt;\n&quot;&quot;&quot;;
&lt;/pre&gt;&lt;a name=&apos;cutid2-end&apos;&gt;&lt;/a&gt;&lt;br /&gt;

I recommend setting properties in your layout for the use of these snippets. You can see an example in my modified Super Simple style, number 14200. &lt;a href=&quot;http://pics.livejournal.com/dgriswold/gallery/0000a9hr&quot; target=&quot;_blank&quot;&gt;This gallery&lt;/a&gt; (and each of its subgalleries) is using the style right now, if you want to see an example.</description>
  <comments>https://fblayers.livejournal.com/1276.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:poster>dgriswold</lj:poster>
  <lj:posterid>3157937</lj:posterid>
  <lj:reply-count>5</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/935.html</guid>
  <pubDate>Fri, 07 Jan 2005 08:16:16 GMT</pubDate>
  <title>[snippet intended for layout layer] - [add to page::print()] - [add lj links to fb layout]</title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/935.html</link>
  <description>&lt;pre&gt;&lt;span style=&quot;color:green;&quot;&gt;# set the values of these variables&lt;/span&gt;
var string   journal_type           = &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;P&lt;/span&gt;&quot;; &lt;span style=&quot;color:green;&quot;&gt;# p = person/user, c = comm, y = syn # set journal type&lt;/span&gt;
var string[] views_order            = [&quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;recent&lt;/span&gt;&quot;, &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;friends&lt;/span&gt;&quot;, &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;archive&lt;/span&gt;&quot;, &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;userinfo&lt;/span&gt;&quot;]; &lt;span style=&quot;color:green;&quot;&gt;# set view order&lt;/span&gt;
var string   text_view_recent       = &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;recent&lt;/span&gt;&quot;;
var string   text_view_friends      = &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;friends&lt;/span&gt;&quot;;
var string   text_view_friends_comm = &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;members&lt;/span&gt;&quot;;
var string   text_view_archive      = &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;calendar&lt;/span&gt;&quot;;
var string   text_view_userinfo     = &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;user info&lt;/span&gt;&quot;;
var string   website_url            = &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;http://mal.mm1swebcreations.com/&lt;/span&gt;&quot;;
var string   website_name           = &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;mal&apos;s website&lt;/span&gt;&quot;;
var string   link_seperator         = &quot;&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt; | &lt;/span&gt;&quot;;

&lt;span style=&quot;color:green;&quot;&gt;# dont mess with these &apos;less you know what yer doing&lt;/span&gt;
var Page     p                      = get_page(); &lt;span style=&quot;color:green;&quot;&gt;# get page handle&lt;/span&gt;
var string   LJSITEROOT             = &quot;http://www.livejournal.com&quot;; &lt;span style=&quot;color:green;&quot;&gt;# set root for lj&lt;/span&gt;
var string   view_links             = &quot;&quot;;
&lt;span style=&quot;color:green;&quot;&gt;# build website url&lt;/span&gt;
var string   website                = (($website_url != &quot;&quot;) ? (&quot;&quot;&quot;$link_seperator&amp;lt;a href=&quot;$website_url&quot;&amp;gt;&quot;&quot;&quot; + (($website_name != &quot;&quot;) ? $website_name : $website_url) + &quot;&amp;lt;/a&amp;gt;&quot;) : &quot;&quot;);
var string   journal_dir            = $journal_type == &quot;C&quot; ? &quot;community&quot; : &quot;users&quot;; &lt;span style=&quot;color:green;&quot;&gt;# set journal directory&lt;/span&gt;
var string   base_url               = &quot;$LJSITEROOT/$journal_dir/$p.user.user&quot;; &lt;span style=&quot;color:green;&quot;&gt;# build base url to journal&lt;/span&gt;
var string{} view_url               = { &lt;span style=&quot;color:green;&quot;&gt;# set view urls&lt;/span&gt;
                                       &quot;recent&quot;   =&amp;gt; &quot;$base_url/&quot;,
                                       &quot;friends&quot;  =&amp;gt; &quot;$base_url/friends/&quot;,
                                       &quot;archive&quot;  =&amp;gt; &quot;$base_url/calendar/&quot;,
                                       &quot;userinfo&quot; =&amp;gt; &quot;$base_url/info/&quot;
                                      };
var string{} view_text              = { &lt;span style=&quot;color:green;&quot;&gt;# set view text&lt;/span&gt;
                                       &quot;recent&quot;   =&amp;gt; $text_view_recent,
                                       &quot;friends&quot;  =&amp;gt; $journal_type == &quot;C&quot; ? $text_view_friends_comm : $text_view_friends,
                                       &quot;archive&quot;  =&amp;gt; $text_view_archive,
                                       &quot;userinfo&quot; =&amp;gt; $text_view_userinfo
                                      };
&lt;span style=&quot;color:green;&quot;&gt;# add seperator before links&lt;/span&gt;
$view_links = $view_links + $link_seperator;
foreach var string v ($views_order) {
&lt;span style=&quot;color:green;&quot;&gt;  # add seperator after links&lt;/span&gt;
  $view_links = $view_links + &quot;&quot;&quot;&amp;lt;a href=&quot;$view_url{$v}&quot;&amp;gt;$view_text{$v}&amp;lt;/a&amp;gt;$link_seperator&quot;&quot;&quot;;
}
&lt;span style=&quot;color:green;&quot;&gt;# remove last seperator from links cuz website will add one if needed&lt;/span&gt;
$view_links = $view_links-&amp;gt;substr(0, $view_links-&amp;gt;length() - $link_seperator-&amp;gt;length()) + $website;&lt;/pre&gt;&lt;a name=&apos;cutid1-end&apos;&gt;&lt;/a&gt;&lt;br /&gt;&lt;img src=&quot;https://pics.livejournal.com/kunzite1/pic/00064edf&quot; alt=&quot;&quot; title=&quot;&quot; fetchpriority=&quot;high&quot; /&gt;&lt;a name=&apos;cutid2-end&apos;&gt;&lt;/a&gt;</description>
  <comments>https://fblayers.livejournal.com/935.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>3</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/550.html</guid>
  <pubDate>Fri, 07 Jan 2005 01:50:19 GMT</pubDate>
  <title>opening house</title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/550.html</link>
  <description>here&apos;s what i need:&lt;ul&gt;&lt;li style=&quot;text-decoration:line-through;&quot;&gt;categories for memories&lt;/li&gt;&lt;li&gt;ideas for rules about posting&lt;/li&gt;&lt;li&gt;responsible people who will not abuse maintainership&lt;/li&gt;&lt;li&gt;people who want to sort memories to the agreed upon specifications&lt;/li&gt;&lt;li&gt;people who want to take care of flame wars if they arise&lt;/li&gt;&lt;li&gt;which layout to use for the journal&lt;/li&gt;&lt;li&gt;what to add/change/delete on the userinfo page&lt;/li&gt;&lt;li&gt;people who have suggestions to this list&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;now... &lt;span style=&quot;font-weight:bold; font-style:italic;&quot;&gt;discuss!&lt;/span&gt;</description>
  <comments>https://fblayers.livejournal.com/550.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>2</lj:reply-count>
  </item>
  <item>
  <guid isPermaLink='true'>https://fblayers.livejournal.com/331.html</guid>
  <pubDate>Fri, 07 Jan 2005 01:47:08 GMT</pubDate>
  <title>first post</title>
  <author>kunzite1</author>
  <link>https://fblayers.livejournal.com/331.html</link>
  <description>&lt;span style=&quot;font-weight:bold;&quot;&gt;how to post&lt;/span&gt;&lt;br /&gt;post your layer code under a &lt;a href=&quot;http://www.livejournal.com/support/faqbrowse.bml?faqid=75&quot; target=&quot;_blank&quot;&gt;cut&lt;/a&gt; after converting all&lt;br /&gt;&lt;code&gt;&amp;amp;&lt;/code&gt; to &lt;code&gt;&amp;amp;amp;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;&lt;/code&gt; to &lt;code&gt;&amp;amp;lt;&lt;/code&gt;&lt;br /&gt;and&lt;br /&gt;&lt;code&gt;&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.simplebits.com/cgi-bin/simplecode.pl&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt; can help with the conversion.&lt;br /&gt;if you use the aforementioned tool, change the &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/code&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;pre&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/pre&amp;gt;&lt;/code&gt; respectively.&lt;br /&gt;if you dont use the aforementioned tool, please wrap your code with &lt;code&gt;&amp;lt;pre&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/pre&amp;gt;&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;the subject line should follow the following format:&lt;br /&gt;&lt;code&gt;[&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;layout name&lt;/span&gt;] - [&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;layer type&lt;/span&gt;] - [&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;mini description of what your code does&lt;/span&gt;] - [&lt;span style=&quot;color:maroon; font-style:italic;&quot;&gt;page number (if applicable)&lt;/span&gt;]&lt;/code&gt;&lt;br /&gt;layout name - apache, color hover, cornered, framed, porfoloroid, etc.&lt;br /&gt;layer type - layout, user, theme&lt;br /&gt;page number - page #/total pages&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;if your code is too long to place into a single post:&lt;/span&gt;&lt;br /&gt;put a comment in the code saying &lt;code&gt;# part 1 ends here&lt;/code&gt; and then in the next post put a comment in the code saying &lt;code&gt;# part 2 starts here&lt;/code&gt; ... lather, rinse, repeat.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;recommended coloring scheme (not required)&lt;/span&gt;&lt;br /&gt;if you have comments in the code, we suggest making it &lt;span style=&quot;color:green;&quot;&gt;green&lt;/span&gt; by doing something like:&lt;br /&gt;&lt;code&gt;&amp;lt;span style=&quot;color:green;&quot;&amp;gt;comment&amp;lt;/span&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;variable values: &lt;span style=&quot;color:maroon;&quot;&gt;maroon&lt;/span&gt;&lt;br /&gt;&lt;code&gt;var string moo = &quot;&amp;lt;span style=&quot;color:maroon;&quot;&amp;gt;variable&amp;lt;/span&amp;gt;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;code that is currently active but can be deactivated by commenting (putting a &lt;code&gt;#&lt;/code&gt; in front of it) it out.&lt;br /&gt;active code: &lt;span style=&quot;color:blue;&quot;&gt;blue&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&quot;&amp;lt;span style=&quot;color:blue;&quot;&amp;gt;if($active) { print &quot;make it blue&quot;; }&amp;lt;/span&amp;gt;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;code that is currently inactive but can be activated by decommenting (taking &lt;code&gt;#&lt;/code&gt; in front of it out) it.&lt;br /&gt;inactive code: &lt;span style=&quot;color:pink;&quot;&gt;pink&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&quot;&amp;lt;span style=&quot;color:pink;&quot;&amp;gt;# if($inactive) { print &quot;make it orange&quot;; }&amp;lt;/span&amp;gt;&quot;;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;screenshot of output&lt;/span&gt;&lt;br /&gt;we would also like to have a screenshot available that shows the results of the code.&lt;br /&gt;&lt;br /&gt;and finally, &lt;span style=&quot;font-weight:bold;&quot;&gt;select the don&apos;t auto-format option.&lt;/span&gt;  this makes the entry a lot easier to read.</description>
  <comments>https://fblayers.livejournal.com/331.html?view=comments#comments</comments>
  <lj:security>public</lj:security>
  <lj:poster>kunzite1</lj:poster>
  <lj:posterid>956023</lj:posterid>
  <lj:reply-count>0</lj:reply-count>
  </item>
</channel>
</rss>
