<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>... coding (the life) &#187; job</title>
	<atom:link href="http://www.marvinmarcelo.com/category/job/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marvinmarcelo.com</link>
	<description>Anything about programming, and a little about me.</description>
	<lastBuildDate>Mon, 09 Jan 2012 13:44:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>rvm libz.1.2.5.dylib and zlib on Mac</title>
		<link>http://www.marvinmarcelo.com/rvm-libz-1-2-5-dylib-and-zlib-on-mac/</link>
		<comments>http://www.marvinmarcelo.com/rvm-libz-1-2-5-dylib-and-zlib-on-mac/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 15:00:36 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[libz.dyld]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 3]]></category>
		<category><![CDATA[RoR]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rvm]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[upgrade rails app]]></category>
		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1861</guid>
		<description><![CDATA[Got stuck on this while following Setting up a fresh Rails 3.1 project safely and Upgrading to Rails 3 Part 1. Took the first tutorial&#8217;s tip on setting up rvm per project or per application, the latter is for the &#8230; <a href="http://www.marvinmarcelo.com/rvm-libz-1-2-5-dylib-and-zlib-on-mac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Got stuck on this while following <a href="http://andrewcox.org/post/6187261893/setting-up-a-fresh-rails-3-1-project-safely" target="_blank">Setting up a fresh Rails 3.1 project safely</a> and <a href="http://railscasts.com/episodes/225-upgrading-to-rails-3-part-1" target="_blank">Upgrading to Rails 3 Part 1</a>. Took the first tutorial&#8217;s tip on setting up rvm per project or per application, the latter is for the upgrade procedure.</p>
<p>I have 1.8.7 and 1.92 rubies installed, and the app I was upgrading is from 2.2.x. I&#8217;ve setup a new .rvmrc on the app folder so it automatically uses 1.9.2. Though in the upgrade tutorial you have to do it manually by calling <code>rvm 1.9.2</code> or <code>rvm system</code>, my setup already loads 1.9.2 and to switch to 1.8.7 I&#8217;ll just issue <code>rvm system</code>.</p>
<p>On the part where I run <code>gem install rails</code> from <a href="http://railscasts.com/episodes/225-upgrading-to-rails-3-part-1" target="_blank">upgrading to rails 3</a>, I get this error:</p>

<div class="wp_syntax"><div class="code"><pre class="awk" style="font-family:monospace;">$ Irb ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;font-weight:bold;">:</span> 001<span style="color:black;">&gt;</span>
  require 'zlib' LoadError<span style="color:black;font-weight:bold;">:</span> dlopen<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>lib<span style="color:black;">/</span>ruby<span style="color:black;">/</span>1.9.1<span style="color:black;">/</span>x86_64<span style="color:black;">-</span>darwin10.7.0<span style="color:black;">/</span>zlib.bundle, <span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color:black;font-weight:bold;">:</span> Library not loaded<span style="color:black;font-weight:bold;">:</span> libz.1.2.5.dylib
  Referenced from<span style="color:black;font-weight:bold;">:</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>lib<span style="color:black;">/</span>ruby<span style="color:black;">/</span>1.9.1<span style="color:black;">/</span>x86_64<span style="color:black;">-</span>darwin10.7.0<span style="color:black;">/</span>zlib.bundle
  Reason<span style="color:black;font-weight:bold;">:</span> image not found <span style="color:black;">-</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>lib<span style="color:black;">/</span>ruby<span style="color:black;">/</span>1.9.1<span style="color:black;">/</span>x86_64<span style="color:black;">-</span>darwin10.7.0<span style="color:black;">/</span>zlib.bundle
  from <span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>lib<span style="color:black;">/</span>ruby<span style="color:black;">/</span>site_ruby<span style="color:black;">/</span>1.9.1<span style="color:black;">/</span>rubygems<span style="color:black;">/</span>custom_require.rb<span style="color:black;font-weight:bold;">:</span> <span style="color: #000000;">36</span><span style="color:black;font-weight:bold;">:</span> <span style="color: #000000; font-weight: bold;">in</span> `require'
  from <span style="color: #7a0874; font-weight: bold;">&#40;</span>irb<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color:black;font-weight:bold;">:</span> <span style="color: #000000;">1</span> from <span style="color:black;">/</span>Users<span style="color:black;">/</span>user1<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p180<span style="color:black;">/</span>bin<span style="color:black;">/</span>irb<span style="color:black;font-weight:bold;">:</span> <span style="color: #000000;">16</span><span style="color:black;font-weight:bold;">:</span> <span style="color: #000000; font-weight: bold;">in</span>`<span style="color:black;">&lt;</span>main<span style="color:black;">&gt;</span>'</pre></div></div>

<p>I tried a lot of rvm docs, gem uninstall-install, gem update, switching apps and even sudo&#8217;ing (yeah I know, it defies the purpose of using rvm), but no dice. To cut the story short, the fix was <code>DYLD_FALLBACK_LIBRARY_PATH</code></p>
<p><code>export DYLD_FALLBACK_LIBRARY_PATH = $HOME/.rvm/usr/lib/</code></p>
<p>This can be in your bash profile or in .rvmrc, in case this only happens on one of you apps.</p>
<p><code>export DYLD_FALLBACK_LIBRARY_PATH = $rvm_path/usr/lib/</code></p>
<p>Found the answer here <a href="http://apribase.net/2010/11/13/macports-dyld_library_path/" target="_blank">http://apribase.net/2010/11/13/macports-dyld_library_path/</a> (it&#8217;s in Japanese though, just use G translate). Hope this helps.</p>
<p>Oh, I&#8217;ll update this as well for the Mac setup I use in the office plus the gem env.</p>
<p><em><strong>Update:</strong></em></p>
<p><code>System</code></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2011</span>-02-<span style="color: #000000;">18</span> patchlevel <span style="color: #000000;">334</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>i686-darwin10.4.0<span style="color: #7a0874; font-weight: bold;">&#93;</span>
  - INSTALLATION DIRECTORY: <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334
  - RUBY EXECUTABLE: <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>rubies<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby
  - EXECUTABLE DIRECTORY: <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334<span style="color: #000000; font-weight: bold;">/</span>bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-darwin-<span style="color: #000000;">10</span>
  - GEM PATHS:
     - <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334
     - <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ubertordev2<span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.7-p334<span style="color: #000000; font-weight: bold;">@</span>global
  - GEM CONFIGURATION:
     - :update_sources =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">true</span>
     - :verbose =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">true</span>
     - :benchmark =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">false</span>
     - :backtrace =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">false</span>
     - :bulk_threshold =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">1000</span>
  - REMOTE SOURCES:
     - http:<span style="color: #000000; font-weight: bold;">//</span>rubygems.org<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p><code>rvmrc</code></p>

<div class="wp_syntax"><div class="code"><pre class="awk" style="font-family:monospace;">RubyGems Environment<span style="color:black;font-weight:bold;">:</span>
  <span style="color:black;">-</span> RUBYGEMS VERSION<span style="color:black;font-weight:bold;">:</span> 1.8.10
  <span style="color:black;">-</span> RUBY VERSION<span style="color:black;font-weight:bold;">:</span> 1.9.2 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2011</span><span style="color:black;">-</span>07<span style="color:black;">-</span>09 patchlevel <span style="color: #000000;">290</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>x86_64<span style="color:black;">-</span>darwin10.4.0<span style="color: #7a0874; font-weight: bold;">&#93;</span>
  <span style="color:black;">-</span> INSTALLATION DIRECTORY<span style="color:black;font-weight:bold;">:</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>gems<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290
  <span style="color:black;">-</span> RUBY EXECUTABLE<span style="color:black;font-weight:bold;">:</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>rubies<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290<span style="color:black;">/</span>bin<span style="color:black;">/</span>ruby
  <span style="color:black;">-</span> EXECUTABLE DIRECTORY<span style="color:black;font-weight:bold;">:</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>gems<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290<span style="color:black;">/</span>bin
  <span style="color:black;">-</span> RUBYGEMS PLATFORMS<span style="color:black;font-weight:bold;">:</span>
    <span style="color:black;">-</span> ruby
    <span style="color:black;">-</span> x86_64<span style="color:black;">-</span>darwin<span style="color:black;">-</span><span style="color: #000000;">10</span>
  <span style="color:black;">-</span> GEM PATHS<span style="color:black;font-weight:bold;">:</span>
     <span style="color:black;">-</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>gems<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290
     <span style="color:black;">-</span> <span style="color:black;">/</span>Users<span style="color:black;">/</span>ubertordev2<span style="color:black;">/</span>.rvm<span style="color:black;">/</span>gems<span style="color:black;">/</span>ruby<span style="color:black;">-</span>1.9.2<span style="color:black;">-</span>p290@global
  <span style="color:black;">-</span> GEM CONFIGURATION<span style="color:black;font-weight:bold;">:</span>
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>update_sources =<span style="color:black;">&gt;</span> true
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>verbose =<span style="color:black;">&gt;</span> true
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>benchmark =<span style="color:black;">&gt;</span> false
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>backtrace =<span style="color:black;">&gt;</span> false
     <span style="color:black;">-</span> <span style="color:black;font-weight:bold;">:</span>bulk_threshold =<span style="color:black;">&gt;</span> <span style="color: #000000;">1000</span>
  <span style="color:black;">-</span> REMOTE SOURCES<span style="color:black;font-weight:bold;">:</span>
     <span style="color:black;">-</span> http<span style="color:black;font-weight:bold;">:</span><span style="color:black;">//</span>rubygems.org<span style="color:black;">/</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/rvm-libz-1-2-5-dylib-and-zlib-on-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting things done</title>
		<link>http://www.marvinmarcelo.com/getting-things-done/</link>
		<comments>http://www.marvinmarcelo.com/getting-things-done/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 13:29:17 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1854</guid>
		<description><![CDATA[This is just me, I need this book and use it in not only on my job, but also in my daily life. Oh, yeah, in case you&#8217;d want an epub copy. I fortunately found one.]]></description>
			<content:encoded><![CDATA[<p>This is just me, I need this book and use it in not only on my job, but also in my daily life.</p>
<p>Oh, yeah, in case you&#8217;d want an epub copy. I <a href="http://btjunkie.org/torrent/Getting-Things-Done-David-Allen-EPUB-format/36657faf00a5c136b25b51b25eb2963ac86d5d0753eb" title="fortunately found" target="_blank">fortunately found one</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/getting-things-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Murata in PH</title>
		<link>http://www.marvinmarcelo.com/murata-in-ph/</link>
		<comments>http://www.marvinmarcelo.com/murata-in-ph/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 15:27:18 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[not about code]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[charger]]></category>
		<category><![CDATA[iPad 2]]></category>
		<category><![CDATA[jobs]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/murata-in-ph/</guid>
		<description><![CDATA[This is just recently, Murata, the company who mass produce the first wireless charger for iPad 2 is venturing in the Philippines! I just read the news in GMANews feed. Here&#8217;s the link: http://www.gmanews.tv/story/233693/japans-murata-to-build-chip-plant-in-phl Isn&#8217;t that amazing?!]]></description>
			<content:encoded><![CDATA[<p>This is just recently, <a href="http://www.murata.com/">Murata</a>, the company who mass produce the first <a href="http://www.murata.com/products/wireless_power/index.html">wireless charger</a> for iPad 2 is venturing in the Philippines!</p>
<p>I just read the news in GMANews feed. Here&#8217;s the link:<br />
<a href="http://www.gmanews.tv/story/233693/japans-murata-to-build-chip-plant-in-phl">http://www.gmanews.tv/story/233693/japans-murata-to-build-chip-plant-in-phl</a></p>
<p>Isn&#8217;t that amazing?!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/murata-in-ph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gameloft &#8211; my new employer</title>
		<link>http://www.marvinmarcelo.com/gameloft-my-new-employer/</link>
		<comments>http://www.marvinmarcelo.com/gameloft-my-new-employer/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 01:35:20 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[not about code]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[career]]></category>
		<category><![CDATA[status]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1747</guid>
		<description><![CDATA[In theaters November 2010 Goodbye OffShoring, it&#8217;s been a while.]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center; text-decoration: underline;">In theaters November 2010</h3>
<div id="attachment_1748" class="wp-caption aligncenter" style="width: 550px"><a href="http://www.gameloft.com"><img class="size-full wp-image-1748 " title="gameloft-logo" src="http://www.marvinmarcelo.com/wp-content/uploads/2010/10/gameloft-logo.jpg" alt="Gameloft" width="540" height="268" /></a><p class="wp-caption-text">Gameloft</p></div>
<p style="text-align: center;">Goodbye <a href="http://www.offshoring.com">OffShoring</a>, it&#8217;s been a while.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/gameloft-my-new-employer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Back-end vs Front-end Dev</title>
		<link>http://www.marvinmarcelo.com/back-end-vs-front-end-dev/</link>
		<comments>http://www.marvinmarcelo.com/back-end-vs-front-end-dev/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 03:39:37 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[work related]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1718</guid>
		<description><![CDATA[So which one is better?]]></description>
			<content:encoded><![CDATA[<p>So which one is better? </p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/back-end-vs-front-end-dev/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Smarty&#8217;s count_words and count_characters in design</title>
		<link>http://www.marvinmarcelo.com/using-smartys-count_words-and-count_characters-in-design/</link>
		<comments>http://www.marvinmarcelo.com/using-smartys-count_words-and-count_characters-in-design/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 05:47:07 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[me stuff]]></category>
		<category><![CDATA[work related]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1590</guid>
		<description><![CDATA[This product page inspired me to write this post. It was launched around February last year (uh oh time flies!) and the first successful order was made around that time too. By then, there were only about 20 products or &#8230; <a href="http://www.marvinmarcelo.com/using-smartys-count_words-and-count_characters-in-design/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This <a href="http://bit.ly/3vlyM">product page</a> inspired me to write this post. It was launched around February last year (uh oh time flies!) and the first successful order was made around that time too. By then, there were only about 20 products or less, and really short attributes i.e. volumes in 8, 12 or 16 oz. strength like mild, regular, etc. Last monday, new products came in for addition to the site and they have quite longer attributes. It could have had a liquid width on the attribute and cart buttons but they had a really good design advisers and wanted to follow the design to the pixel.</p>
<p><img class="alignnone size-full wp-image-1602" title="Screenshot" src="http://www.marvinmarcelo.com/wp-content/uploads/2010/02/Screenshot.png" alt="" width="319" height="111" /></p>
<p>Initially, this html code composes the product attribute and cart button, notice that <tt>&lt;span class="c"&gt;Cherry&lt;/span&gt;</tt> is a one word attribute for <tt>scent</tt></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cartbutton&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-image: url(images/button-long-add-to-bag.gif);&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c&quot;</span>&gt;</span>Cherry<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c&quot;</span>&gt;</span>8 oz.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c&quot;</span>&gt;</span>$5.99<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;d&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cart.php?product=5|33404&amp;amp;as=5&quot;</span>&gt;</span>Add to bag<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&quot;</span>&gt;</span>» ITEM: 33404<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>And the new ones came with the colors &#8220;Casino Red&#8221;, &#8220;Golden Chestnut&#8221; and &#8220;Orchid Black&#8221; &#8211; long attributes, and two others &#8220;Copper&#8221; and &#8220;Spice&#8221; &#8211; short and manageable, as the column width will fit the entire word.</p>
<p>I was really planning to rewrite the whole attribute and cart button section, but I didn&#8217;t had much time. I figured I can make the font smaller and paddings or margins can go smaller than the regular so that two lines would fit in the box if the attribute value is a word longer. But I cannot be in PHP, its not really the way to go. So, if I can add another class that would override existing font-size and parent margin/padding, that would work. Here, I thought, word count doesn&#8217;t really need be in the PHP side and since I&#8217;m using <a href="http://www.smarty.net/">Smarty</a>, I found in it a variable modifier that can print the <a href="http://www.smarty.net/manual/en/language.modifier.count.words.php">number of words</a> in a variable, and that&#8217;s it. I can add another class in the column span like <tt>words-10</tt> or <tt>countwords-3</tt> in my template by the number of words that is present in the variable. Below is the generated code</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cartbutton&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-image: url(images/button-long-add-to-bag.gif);&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c col-color words-2&quot;</span>&gt;</span>Casino Red<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c col-volume&quot;</span>&gt;</span>8 oz.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;c&quot;</span>&gt;</span>$11.39<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;d&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cart.php?product=28|33825&amp;amp;as=14&quot;</span>&gt;</span>Add to bag<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&quot;</span>&gt;</span>» ITEM: 33825<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>CSS rules</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* default rules */</span>
<span style="color: #6666ff;">.cartbutton</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">23px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'/images/button-add-to-bag.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span<span style="color: #6666ff;">.c</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span<span style="color: #6666ff;">.d</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span<span style="color: #6666ff;">.d</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.cartbutton</span> span<span style="color: #6666ff;">.e</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* special rule for two word attribute */</span>
span<span style="color: #6666ff;">.words-2</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">98%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">9px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><img class="alignnone size-full wp-image-1610" title="Screenshot" src="http://www.marvinmarcelo.com/wp-content/uploads/2010/02/Screenshot1.png" alt="" width="348" height="222" /></p>
<p>And this is how it is setup in the template.</p>

<div class="wp_syntax"><div class="code"><pre class="smarty" style="font-family:monospace;"><span style="color: #009000;">&lt;div class=&quot;cartbutton&quot; style=&quot;background-image: url(images/button-long-add-to-bag.gif);&quot;&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">color</span><span style="color: #D36900;">&#125;</span>
  <span style="color: #009000;">&lt;span class=&quot;c col-color words-{$attr[at].color|count_words}&quot;&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">color</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">strength</span><span style="color: #D36900;">&#125;</span>
  <span style="color: #009000;">&lt;span class=&quot;c col-strength words-{$attr[at].strength|count_words}&quot;&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">strength</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">scent</span><span style="color: #D36900;">&#125;</span>
  <span style="color: #009000;">&lt;span class=&quot;c col-scent&quot;&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">scent</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">volume</span><span style="color: #D36900;">&#125;</span>
  <span style="color: #009000;">&lt;span class=&quot;c col-volume&quot;&gt;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">volume</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #009000;">&lt;span class=&quot;c&quot;&gt;</span>
  $ <span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #D36900;">!</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">amount</span><span style="color: #D36900;">&#125;</span> <span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$results</span><span style="color: #D36900;">&#91;</span>r<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">amount</span><span style="color: #D36900;">&#125;</span> <span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">else</span><span style="color: #D36900;">&#125;</span> <span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">math</span> equation<span style="color: #D36900;">=</span><span style="color: #ff0000;">&quot;x&quot;</span> x<span style="color: #D36900;">=</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">amount</span> format<span style="color: #D36900;">=</span><span style="color: #ff0000;">&quot;%.2f&quot;</span><span style="color: #D36900;">&#125;</span> <span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span>
<span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #009000;">&lt;span class=&quot;d&quot;&gt;</span>
  <span style="color: #009000;">&lt;a class=&quot;e&quot; href=&quot;cart.php?product={$results[r].id}|{if $results[r].sku &amp;amp;&amp;amp; !$attr[at].sku}{$results[r].sku}{elseif $attr[at].sku}{$attr[at].sku}{/if}&amp;amp;as={$attr[at].pas_id}&quot;&gt;</span>Add to bag<span style="color: #009000;">&lt;/a&gt;</span>
<span style="color: #009000;">&lt;/span&gt;</span>
<span style="color: #009000;">&lt;span class=&quot;e&quot;&gt;</span>» ITEM: <span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">if</span> <span style="color: #00aaff;">$results</span><span style="color: #D36900;">&#91;</span>r<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span> &amp;amp;&amp;amp; <span style="color: #D36900;">!</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span><span style="color: #D36900;">&#125;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$results</span><span style="color: #D36900;">&#91;</span>r<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span><span style="color: #D36900;">&#125;</span><span style="color: #D36900;">&#123;</span><span style="color: #0600FF;">elseif</span> <span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span><span style="color: #D36900;">&#125;</span><span style="color: #D36900;">&#123;</span><span style="color: #00aaff;">$attr</span><span style="color: #D36900;">&#91;</span>at<span style="color: #D36900;">&#93;</span>.<span style="color: #006600;">sku</span><span style="color: #D36900;">&#125;</span><span style="color: #D36900;">&#123;</span><span style="color: #D36900;">/</span><span style="color: #0600FF;">if</span><span style="color: #D36900;">&#125;</span><span style="color: #009000;">&lt;/span&gt;&lt;/div&gt;</span></pre></div></div>

<p>Those extra class names like <tt>col-volume</tt>, <tt>col-scent</tt> and <tt>col-strength</tt> are only for future use, who knows what other formatting and adjustments on the data and theme will happen. Its really fun working with MVC model. Hope it helps <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/using-smartys-count_words-and-count_characters-in-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quickie Visitors Country WP Plugin</title>
		<link>http://www.marvinmarcelo.com/quickie-visitors-country-wp-plugin/</link>
		<comments>http://www.marvinmarcelo.com/quickie-visitors-country-wp-plugin/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:14:54 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[me stuff]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1382</guid>
		<description><![CDATA[This plugin is dependent on WP/GeoTrack by Johannes Lietz, this is NOT a stand-alone plugin, it won&#8217;t work if WP/GeoTrack is not installed anyway, so it&#8217;s safe. And don&#8217;t look for it in WP Plugins repo, you won&#8217;t find it &#8230; <a href="http://www.marvinmarcelo.com/quickie-visitors-country-wp-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This plugin is dependent on <a title="Visit plugin site" href="http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin">WP/GeoTrack</a> by <a title="Visit author homepage" href="http://dadabase.de/">Johannes Lietz</a>, this is NOT a stand-alone plugin, it won&#8217;t work if <a title="Visit plugin site" href="http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin">WP/GeoTrack</a> is not installed anyway, so it&#8217;s safe.</p>
<p>And don&#8217;t look for it in <a href="http://wordpress.org/extend/plugins/">WP Plugins</a> repo, you won&#8217;t find it there <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
Plugin Name: Top Visitors Flag
Plugin URI: http://www.marvinmarcelo.com/
Description: This plugin displays visitors on sidebar as widget dependent on &lt;a href=&quot;http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin&quot;&gt;WP/GEO-Track plugin&lt;/a&gt;.
Author: Marvin Marcelo
Author URI: http://www.marvinmarcelo.com/
Version: 1.0.0
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> tvf_get_topvisits<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">,</span> <span style="color: #000088;">$table_prefix</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;select count(*) as `rows` , `country` , `flagname` from `&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$table_prefix</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;geotrack` group by `country` order by `rows` desc limit 0 , 12&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$flagstats</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;li id='top-country-flags'&gt;&lt;h2&gt;Top Visiting Countries&lt;/h2&gt;&lt;div&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/*  id string */</span>
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$flagstats</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$cf</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$cf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rows</span> <span style="color: #339933;">=</span> <span style="color: #990000;">number_format</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rows</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span> GEOTRACK_URL <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;flags/&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$cf</span><span style="color: #339933;">-/&gt;</span>flagname <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;.png<span style="color: #000099; font-weight: bold;">\&quot;</span> alt=<span style="color: #000099; font-weight: bold;">\&quot;</span>Flag of <span style="color: #006699; font-weight: bold;">$cf-&gt;country</span> with <span style="color: #006699; font-weight: bold;">$cf-&gt;rows</span> visits<span style="color: #000099; font-weight: bold;">\&quot;</span> title=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$cf-&gt;country</span> with <span style="color: #006699; font-weight: bold;">$cf-&gt;rows</span> visits<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$html</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> init_tvf_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	register_sidebar_widget<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Top Visitors Flags&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;tvf_get_topvisits&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'GT_NOT_INSTALLED'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;!-- You need <span style="color: #000099; font-weight: bold;">\&quot;</span>http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin<span style="color: #000099; font-weight: bold;">\&quot;</span> installed first--&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
  add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;plugins_loaded&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;init_tvf_init&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Also, you have to forgive the function, constants, and variables names, we all struggle for a better and sensible one <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/quickie-visitors-country-wp-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Login without password</title>
		<link>http://www.marvinmarcelo.com/ssh-login-without-password/</link>
		<comments>http://www.marvinmarcelo.com/ssh-login-without-password/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 02:01:37 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[work related]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1346</guid>
		<description><![CDATA[This is actually a repost from the tutorial I often ran onto when working with servers. Lately, the sys-ad I was working with changed users home directory and also changed their passwords, but gave me the root pass. However, I &#8230; <a href="http://www.marvinmarcelo.com/ssh-login-without-password/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is actually a repost from the tutorial I often ran onto when working with servers. Lately, the sys-ad I was working with changed users home directory and also changed their passwords, but gave me the root pass. However, I don&#8217;t want to bother him for new passwords, and I guess he setup new ones from password generator apps/scripts, which are of course, really really recommended nowadays. Since I have the root pass, and I don&#8217;t want to go back to chmod-chown each and every files/folders I created via root, I thought I can automate logging in with each account I need to work &#8216;as&#8217; their respective users. Or I can use <tt>cat /etc/passwd</tt> to know their home directories.</p>
<p>First log in on A as user a and generate a pair of authentication keys.  Do not enter a passphrase:</p>
<pre>a@A:~&gt; ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A</pre>
<p>Now use <tt>ssh</tt> to create a directory <tt>~/.ssh</tt> as user b on B. (The directory may already exist, which is fine):</p>
<pre>a@A:~&gt; ssh b@B mkdir -p .ssh
b@B's password:</pre>
<p>Finally append a&#8217;s new public key to <tt>b@B:.ssh/authorized_keys</tt> and enter b&#8217;s password one last time:</p>
<pre>a@A:~&gt; cat .ssh/id_rsa.pub | ssh b@B 'cat &gt;&gt; .ssh/authorized_keys'
b@B's password:</pre>
<p>Now I can work as &#8216;owner&#8217; and &#8216;user&#8217; within each user home directory.</p>
<pre>a@A:~&gt; ssh b@B hostname
B</pre>
<p>Some notes, depending on your version of SSH you might also have to do the following changes:</p>
<ul>
<li>Put the public key in <tt>.ssh/authorized_keys2</tt></li>
<li>Change the permissions of <tt>.ssh</tt> to <tt>700</tt></li>
<li>Change the permissions of <tt>.ssh/authorized_keys2</tt> to <tt>640</tt></li>
</ul>
<p>Source: <a href="http://linuxproblem.org/art_9.html">http://linuxproblem.org/art_9.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/ssh-login-without-password/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP code block &#8211; bringing order to chaos</title>
		<link>http://www.marvinmarcelo.com/php-code-block-bringing-order-to-chaos/</link>
		<comments>http://www.marvinmarcelo.com/php-code-block-bringing-order-to-chaos/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 02:00:48 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[me stuff]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[basic programming]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[ezsql]]></category>
		<category><![CDATA[grumble]]></category>
		<category><![CDATA[month-year]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[smarty]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1282</guid>
		<description><![CDATA[I had to come up with this post because I&#8217;ve been working on an old CMS about 3 years old (or even more) and I had been wondering why the calendar links cuts off from 2001 to 2003. Task: List &#8230; <a href="http://www.marvinmarcelo.com/php-code-block-bringing-order-to-chaos/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had to come up with this post because I&#8217;ve been working on an old CMS about 3 years old (or even more) and I had been wondering why the calendar links cuts off from 2001 to 2003.</p>
<p>Task: List a year/month links from the present to the oldest published image sets.</p>
<p>Sounds easy, and I believe it is.</p>
<p>But when I checked on the existing script, this is what I got.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000088;">$month_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'January'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'February'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'March'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;4&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'April'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'May'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;6&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'June'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;7&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'July'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;8&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'August'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;9&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'September'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;10&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'October'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;11&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'November'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;12&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'December'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'y2day'</span><span style="color: #339933;">,</span><span style="color: #000088;">$y2day</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$y</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$q</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">12</span><span style="color: #339933;">;</span> <span style="color: #000088;">$q</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$q</span><span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$month_array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$q</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>year<span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000ff;">'2000'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$m2day</span> <span style="color: #339933;">==</span><span style="color: #000088;">$q</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$w_string</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$week_string</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span>  <span style="color: #000088;">$w_string</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>year<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'2007'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>month<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$q</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$w_string</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$week_string</span><span style="color: #339933;">;</span>
&nbsp;
		  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$m2day</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$q</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$tmp_cal_month_now_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
					<span style="color: #0000ff;">'month'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'string'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$w_string</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'link'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$q</span>
					<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$date_month_now_array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$y</span><span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$tmp_cal_month_now_array</span><span style="color: #339933;">;</span>	 <span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//for</span>
&nbsp;
	 <span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'calendar_now_month'</span><span style="color: #339933;">,</span><span style="color: #000088;">$date_month_now_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$y</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>	<span style="color: #000088;">$c_yeartoday</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//echo $c_yeartoday;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$q</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$q</span> <span style="color: #339933;">&lt;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> <span style="color: #000088;">$q</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$tmp</span> <span style="color: #339933;">=</span><span style="color: #000088;">$c_yeartoday</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$q</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//echo $tmp;</span>
&nbsp;
		 <span style="color: #000088;">$tmp_cal_date_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
					  <span style="color: #0000ff;">'year'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$tmp</span>
&nbsp;
				 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #000088;">$date_year_array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$y</span><span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$tmp_cal_date_array</span><span style="color: #339933;">;</span>
	 <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//for</span>
&nbsp;
	<span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'calendar_year'</span><span style="color: #339933;">,</span><span style="color: #000088;">$date_year_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	    <span style="color: #000088;">$y</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$q</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">12</span><span style="color: #339933;">;</span> <span style="color: #000088;">$q</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$q</span><span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$month_array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$q</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>month<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$q</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$w_string</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$week_string</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$w_string</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$tmp_cal_month_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
					<span style="color: #0000ff;">'month'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'string'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$w_string</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'link'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$q</span>
					<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$date_month_array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$y</span><span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$tmp_cal_month_array</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">//for</span>
	 <span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'calendar_month'</span><span style="color: #339933;">,</span><span style="color: #000088;">$date_month_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	 <span style="color: #000088;">$y</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$q</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">12</span><span style="color: #339933;">;</span> <span style="color: #000088;">$q</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span> <span style="color: #000088;">$q</span><span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$month_array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$q</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>year<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'2000'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>month<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$q</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$w_string</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$week_string</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$w_string</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$tmp_cal_month_old_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
					<span style="color: #0000ff;">'month'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'string'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$w_string</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'link'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$q</span>
					<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$date_month_old_array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$y</span><span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$tmp_cal_month_old_array</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">//for</span>
	 <span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'calendar_month_old'</span><span style="color: #339933;">,</span><span style="color: #000088;">$date_month_old_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span id="more-1282"></span></p>
<p>Looking at the above script, it looks like they were grouped in to 4 sections, deriving the values of <code>$date_month_now_array</code>, <code>$date_year_array</code>, <code>$date_month_array</code> and <code>$date_month_old_array</code>. And the hardcoded values &#8217;2000&#8242; and &#8217;2007&#8242; will definitely set limit and obviously introduce bug, and so it did. Honestly, I would have coded it this way when I was moving into PHP 3 years ago, and perhaps even now if I&#8217;d have been coding for a whole day confronted with bugs.</p>
<p>Anyway, the main problem with the above code is, there was always a reference for dates and the original programmer didn&#8217;t use it, the date column in the content&#8217;s table. Instead, I&#8217;m guessing, he setup a start &#8216;year&#8217; which is probably he asked someone about the oldest possible year a content was published &#8211; there he arrived at using &#8217;2000&#8242; in the code. And if I&#8217;m not mistaken, this code was written in 2007, LOL, so there was a condition on year set to 2007.</p>
<p>Here&#8217;s how I modified it, optimized it as much (well I hope). The date column had a unix timestamp values, so it&#8217;s not in typical date format.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Calendar modification
 * @author marvin marcelo
 * @uses ez_sql
 * @link http://www.phpclasses.org/browse/package/790.html
 */</span>
<span style="color: #666666; font-style: italic;">/* present */</span>
<span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$y</span><span style="color: #339933;">,</span> <span style="color: #000088;">$m</span><span style="color: #339933;">,</span> <span style="color: #000088;">$d</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y n j&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;select distinct(from_unixtime(updateStartDate, '%Y')) year
          from series_table where updateStartDate &gt; 0 order by updateStartDate desc&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* ezSql stuff */</span>
<span style="color: #000088;">$years</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_results</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #339933;">,</span> ARRAY_A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$years</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$months</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">12</span><span style="color: #339933;">;</span> <span style="color: #000088;">$j</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #339933;">--</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$endofmonth</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;t&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;{<span style="color: #006699; font-weight: bold;">$years</span>[<span style="color: #006699; font-weight: bold;">$i</span>][&quot;</span>year<span style="color: #0000ff;">&quot;]}-<span style="color: #006699; font-weight: bold;">$j</span>-1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$years</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;year&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$y</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$j</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$m</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/* future year-month */</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$years</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;year&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$y</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$j</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$m</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">/* this day in this month of this year is also future, use current date instead */</span>
      <span style="color: #000088;">$endofmonth</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$d</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000088;">$ts0</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;{<span style="color: #006699; font-weight: bold;">$years</span>[<span style="color: #006699; font-weight: bold;">$i</span>][&quot;</span>year<span style="color: #0000ff;">&quot;]}-<span style="color: #006699; font-weight: bold;">$j</span>-1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/* unix timestamp start of month */</span>
    <span style="color: #000088;">$ts1</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;{<span style="color: #006699; font-weight: bold;">$years</span>[<span style="color: #006699; font-weight: bold;">$i</span>][&quot;</span>year<span style="color: #0000ff;">&quot;]}-<span style="color: #006699; font-weight: bold;">$j</span>-<span style="color: #006699; font-weight: bold;">$endofmonth</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/* unix timestamp last day or today of month */</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_row</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;select * from series_table where updateStartDate &gt; <span style="color: #006699; font-weight: bold;">$ts0</span> and updateStartDate &lt; = <span style="color: #006699; font-weight: bold;">$ts1</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$year</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$years</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;year&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$j</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$month</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$months</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;active&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;j&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$j</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;F&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;F&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ts0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #b1b100;">else</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$months</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;j&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$j</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;F&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;F&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ts0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$months</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$years</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;months&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$months</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">/* template */</span>
<span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'calendar'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$years</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009933; font-style: italic;">/**
 * Calendar modification end block
 */</span></pre></div></div>

<p>The process I did &#8230;</p>
<ol>
<li>Select distinct years from all published content by converting unix timestamp to readable year value, then iterate on them</li>
<li>Do a for loop from 12 (december) to 1 (january) to generate a unix timestamp for use in the next query</li>
<li>Query the table for a matching timestamp of the first day and the last day of month-year pair; Use current day of month if iterating year and month matches the present</li>
<li>Show the month link for the year in iteration if a match is found</li>
</ol>
<p>Couple of notes though, I didn&#8217;t name the table as &#8216;series_table&#8217; <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  , it&#8217;s been there years since. I also named my variables when referring to start and end as <code>$x0</code> and <code>$x1</code>, <code>$ts0</code> and <code>$ts1</code>. I got used to this when college years in physics &#8211; the start and end of a distance, I don&#8217;t know, I just like the thought <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  .</p>
<p>Hope it didn&#8217;t went order to chaos at all!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/php-code-block-bringing-order-to-chaos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHPAnywhere &#8211; edit PHP from browser</title>
		<link>http://www.marvinmarcelo.com/phpanywhere-edit-php-from-browser/</link>
		<comments>http://www.marvinmarcelo.com/phpanywhere-edit-php-from-browser/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 05:37:55 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[job]]></category>
		<category><![CDATA[me stuff]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[work related]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1224</guid>
		<description><![CDATA[Found this post from Smash!ng Apps PHPanywhere is a new online service that&#8217;s changing the way people develop on the web. They enable users to develop and maintain their php/html projects online using any standard web browser. This is a &#8230; <a href="http://www.marvinmarcelo.com/phpanywhere-edit-php-from-browser/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Found this post from <a href="http://tr.im/xLMy">Smash!ng Apps</a></p></blockquote>
<p><a href="http://phpanywhere.net/">PHPanywhere</a> is a new online service that&#8217;s changing the way people develop on the web. They enable users to develop and maintain their php/html projects online using any standard web browser.</p>
<p>This is a web based free Integrated Development Environment or IDE for the PHP language, in other words it is an application that gives developers all the code editing capabilities they need to develop PHP applications online. It includes a real-time syntax code editor with support for all web formats and a powerful FTP editor.</p>
<p><img class="alignnone" src="http://www.smashingapps.com/wp-content/uploads/2009/09/phpanywhere.jpg" alt="" width="500" height="360" /></p>
<p>Because it works in a browser you can start coding right away, no need for installing anything and best of all you can work from anywhere, all you need is an internet connection and a web browser and you&#8217;re ready to go.</p>
<p>You can develop and maintain multiple projects with ease using PHPanywhere, because as soon as you log in all your projects (FTP servers) are immediately accessible. PHPanywhere even remembers what files you were working on and reopens them as well.</p>
<p><strong>Real-time syntax code editor</strong></p>
<p>The real-time syntax code editor is really what PHPanywhere is all about, so here is a list of just some of the things it does:</p>
<ul type="disc">
<li>Syntax highlighting</li>
<li>Smart indentation for each language</li>
<li>Code folding</li>
<li>Full internationalization</li>
<li>Unlimited undo/redo (now handled on client (browser) side, no more waiting for server response)</li>
<li>Unlimited tabs</li>
<li>Find and replace feature (New Feature)</li>
<li>Displays line numbers (New Feature)</li>
<li>Code auto completion, snippets (New Feature)</li>
<li>Displays line numbers (New Feature)</li>
<li>Code indention  (TAB key) (New Feature)</li>
</ul>
<p><span id="more-1224"></span><br />
<strong>Projects (New Feature)</strong></p>
<p>Create and use projects to group files you commonly use together, so you can easily open them next time you need to work on the project.</p>
<p><strong>File permissions (New Feature)</strong></p>
<p>Change your file and folder permissions using PHPanywhere&#8217;s ftp explorer.</p>
<p><strong>Messages Window (New Feature)</strong></p>
<p>Your every action is now logged in the window at bottom of the screen, so you can now easily track changes you made using PHPanywhere.</p>
<p><strong>Skins (New Feature)</strong></p>
<p>Choose from different skins to change the look and feel of PHPanywhere.</p>
<p><strong>Welcome Screen (New Feature)</strong></p>
<p>Besides giving you a nice and warm welcome <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , it also displays shortcuts to your most common commands, and recently opened files and projects.</p>
<p><strong>Powerfull FTP explorer</strong></p>
<p>This is a full-blown FTP explorer. You can add as many servers as you like, edit files, create/delete files or folders and you can even edit the permissions on folders. It will definitely satisfy all you FTP needs.</p>
<p><strong>Work without restrictions</strong></p>
<p>PHPanywhere doesn&#8217;t install anything on your computer, so you can use it without asking your IT administrator for permission. Also since it isn&#8217;t on your computer, it works even if your corporate firewall is blocking the FTP port.</p>
<p><strong>Share your work</strong></p>
<p>Because all your projects are on our servers you can easily allow others to work on your project, without duplicating you files. Also PHPanywhere enables real-time document collaboration (**) which makes it the ideal work environment.</p>
<p>PHPanywhere can be comfortably run on Opera 9+ and Gecko-based browsers (Firefox, Camino, Seamonkey, &#8230;) on any OS. Support for IE and Safari/Chrome coming soon.</p>
<p>Source: <a href="http://tr.im/xLMy">http://www.smashingapps.com/2009/09/01/now-use-phpanywhere-to-code-directly-from-your-browser.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/phpanywhere-edit-php-from-browser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

