<?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; work related</title>
	<atom:link href="http://www.marvinmarcelo.com/category/work-related/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marvinmarcelo.com</link>
	<description>Anything about programming, and a little about me.</description>
	<lastBuildDate>Thu, 22 Jul 2010 06:27:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<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 less, and really short attributes i.e. volumes in 8, 12 or 16 oz. strength like [...]]]></description>
			<content:encoded><![CDATA[<p>This <a href="http://tr.im/MCz1">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 src="http://www.marvinmarcelo.com/wp-content/uploads/2010/02/Screenshot.png" alt="" title="Screenshot" width="319" height="111" class="alignnone size-full wp-image-1602" /></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;</span>
<span style="color: #009900;">&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;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cart.php?product=28|33825&amp;amp;as=14&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;e&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><span style="color: #ddbb00;">&amp;raquo;</span> ITEM: 33825<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: #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;"><span style="color: #cc66cc;">98</span>%</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 src="http://www.marvinmarcelo.com/wp-content/uploads/2010/02/Screenshot1.png" alt="" title="Screenshot" width="348" height="222" class="alignnone size-full wp-image-1610" /></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 href=&quot;cart.php?product={$results[r].id}|{if $results[r].sku &amp;&amp; !$attr[at].sku}{$results[r].sku}{elseif $attr[at].sku}{$attr[at].sku}{/if}&amp;amp;as={$attr[at].pas_id}&quot; class=&quot;e&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>&amp;raquo; 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; <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;</span>
<span style="color: #009000;">&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>List of Philippine Holidays for 2010</title>
		<link>http://www.marvinmarcelo.com/list-of-philippine-holidays-for-2010/</link>
		<comments>http://www.marvinmarcelo.com/list-of-philippine-holidays-for-2010/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 01:00:15 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[not about code]]></category>
		<category><![CDATA[work related]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1533</guid>
		<description><![CDATA[Regular Holidays New Year’s Day – January 1 (Friday) Maundy Thursday / Good Friday – April 1 / 2 (Thursday / Friday) Araw ng Kagitingan – April 9 (Friday) Labor Day – May 1 (Saturday) Independence Day – June 14 (Monday), moved from June 12 National Heroes Day – August 30 (Monday) Bonifacio Day – [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Regular Holidays</strong></p>
<ul>
<li>New Year’s Day – January 1 (Friday)</li>
<li>Maundy Thursday / Good Friday – April 1 / 2 (Thursday / Friday)</li>
<li>Araw ng Kagitingan – April 9 (Friday)</li>
<li>Labor Day – May 1 (Saturday)</li>
<li>Independence Day – June 14 (Monday), moved from June 12</li>
<li>National Heroes Day – August 30 (Monday)</li>
<li>Bonifacio Day – November 29 (Monday), moved from November 30</li>
<li>Christmas Day – December 25 (Saturday)</li>
<li>Rizal Day – December 27 (Monday), moved from December 30</li>
</ul>
<p><strong>Special (non-working) holidays</strong></p>
<ul>
<li>Ninoy Aquino Day – August 23 (Monday), moved from August 21</li>
<li>All Saints’ Day – November 1 (Monday)</li>
<li>Christmas Eve – December 24 (Friday)</li>
<li>New Year’s Eve – December 31 (Friday)</li>
</ul>
<p><strong>Others</strong></p>
<ul>
<li>1986 EDSA People Power Revolution anniversary – Special holiday for schools – February 22 (Monday), moved from February 25</li>
<li>Eid’l Fitr and Eid’l Adha 2010 &#8211; To be announced later</li>
<li>Founding Anniversary of Iglesia ni Cristo – July 27, 2010 – Special national working holiday</li>
</ul>
<p>Source : <a href="http://www.pinoymoneytalk.com/philippine-holidays-2008/">http://www.pinoymoneytalk.com/philippine-holidays-2008/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/list-of-philippine-holidays-for-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>If Windows, Linux and OSX Opened Cafes</title>
		<link>http://www.marvinmarcelo.com/if-windows-linux-and-osx-opened-cafes/</link>
		<comments>http://www.marvinmarcelo.com/if-windows-linux-and-osx-opened-cafes/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 03:58:10 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[me stuff]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[funky]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1395</guid>
		<description><![CDATA[What if really&#8230; LOL! I found this from DaniWeb, it&#8217;s short and entertaining! Read on&#8230; The New York Times reported today that Apple has opened its first Apple Store in Paris, underneath the Louvre no less, and just two weeks after Microsoft opened up a Windows 7 cafe in Paris in another location. The idea [...]]]></description>
			<content:encoded><![CDATA[<p>What if really&#8230; LOL! I found <a href="http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title">this</a> from <a href="http://www.daniweb.com">DaniWeb</a>, it&#8217;s short and entertaining! Read on&#8230;</p>
<p>The New York Times <a href="http://www.nytimes.com/reuters/2009/11/06/technology/tech-us-france-apple-louvre.html" target="_blank">reported today</a> that Apple has opened its first Apple Store in Paris, underneath the Louvre no less, and just two weeks after Microsoft opened up a <a href="http://www.engadget.com/2009/10/22/microsofts-windows-cafe-opens-its-doors-in-paris/" target="_blank">Windows 7 cafe</a> in Paris in another location. The idea of these two companies competing in a retail environment, and especially a Windows-themed cafe, got me thinking about what would happen if three cafes opened each run in the same style of the operating system it was named for. I figure it might look something like this:</p>
<h4>Windows Cafe</h4>
<p>The Windows Cafe is in a bland store front. The furniture consists of straight wooden chairs with tables with sharp angles. Unfortunately, every so often when you sit in a chair it crashes the to the floor, but you get used to this and figure it&#8217;s just part of the experience of going to the Windows Cafe. (To be fair they have been testing chairs from a new manufacturer and they are reportedly less prone to breaking in this fashion.) Pictures of a smiling Bill Gates and Windows logos adorn the walls. The coffee tastes fine most of the time, but a surprising number of patrons get sick there, so that it&#8217;s become standard practice to use <a href="http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title" target="_blank">hand sanitizer</a> before you go in to protect yourself. The coffee is expensive, and refills are definitely not free, but it&#8217;s a known quantity, and many people are comfortable going there.</p>
<h4>Linux Cafe</h4>
<p>The Linux Cafe is a funky place in an artsy neighborhood with eclectic furniture donated by the patrons. It doesn&#8217;t match, but it&#8217;s comfortable and the walls are covered with donated pictures and paintings by local artists. The coffee is free, served in black cups (or you can just bring your own), but you need to make it yourself. If you can&#8217;t do it yourself, the cafe has consultants available to help you for a fee. It&#8217;s great for people who know about coffee brewing, but many people are intimidated by the idea of making their own coffee and stay away, even though very few people ever get sick who go there.</p>
<h4>Apple Cafe</h4>
<p>The Apple Cafe is a modern, state-of-the-art facility. The tables are stainless steel and the chairs are ultra-contemporary. Shrines to Apple CEO <a href="http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title#" target="_blank">Steve Jobs</a> are dotted around the wide space. The cups are cool and come in a variety of bright colors. The coffee is well made by a highly trained staff, and even though it costs a lot more, people line up around the block for a chance to drink it. Just don&#8217;t ask the staff about their coffee-making techniques because they are extremely tight lipped about this. People occasionally get sick there, but it&#8217;s rare enough for the cafe to brag about its safety record.</p>
<p>So there you have it. Three cafes with three distinct personalities just like the operating systems they represent</p>
<p>Source: <a href="http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title">http://www.daniweb.com/news/story236836.html?urlhash=yp4q&amp;trk=nus_ritm-title</a> by <a href="http://www.daniweb.com/news/writer313540.html">Ron Miller</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/if-windows-linux-and-osx-opened-cafes/feed/</wfw:commentRss>
		<slash:comments>0</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 there 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [...]]]></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>Windows Social, didn&#8217;t complain</title>
		<link>http://www.marvinmarcelo.com/windows-social-didnt-complain/</link>
		<comments>http://www.marvinmarcelo.com/windows-social-didnt-complain/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 00:55:56 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[win7]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1366</guid>
		<description><![CDATA[Ok, this is actually the first post I did about Windows. I haven&#8217;t used it as my working platform for more than 2 years, though honestly, it&#8217;s also where I started, back in Windows 95 in my school years. Even if that&#8217;s the only available version we had in 1999, it was huge then! I [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-thumbnail wp-image-1380" title="2qa6yp0" src="http://www.marvinmarcelo.com/wp-content/uploads/2009/10/2qa6yp0-150x150.png" alt="2qa6yp0" width="150" height="150" />Ok, this is actually the first post I did about <a href="http://www.microsoft.com/windows/">Windows</a>. I haven&#8217;t used it as my working platform for more than 2 years, though honestly, it&#8217;s also where I started, back in Windows 95 in my school years. Even if that&#8217;s the only available version we had in 1999, it was huge then! I am now more in the FOSS community, and have been enjoying doing my stuff in <a href="http://www.ubuntu.com/products/WhatIsUbuntu/desktopedition">Ubuntu Desktop</a>. But what I really wanted to point out in this post is the new <a href="http://www.microsoft.com/windows/social/">Windows Social</a>, it is just like any social media but it runs real time feeds, &#8220;popping in&#8221; every second into the stream area with streams coming from different major social media out there &#8211; Facebook, Flickr, Twitter, etc. And that is a &#8220;WOW&#8221;, I admit. That&#8217;s the feature Facebook Developers haven&#8217;t really implemented in full capacity. But Facebook already rolled out their version with that feature, sort of saying &#8220;we&#8217;re on the way!&#8221;, as they had also announced in that release.</p>
<p><a href="http://www.microsoft.com/windows/social/"><img class="alignnone size-full wp-image-1371" title="Screenshot" src="http://www.marvinmarcelo.com/wp-content/uploads/2009/10/Screenshot1.png" alt="Windows Social" width="670" height="419" /></a></p>
<p>I still remember way back the upgrade of MSN&#8217;s Hotmail (or not exactly sure if older versions work smoothly on Firefox), it was always complaining that it&#8217;s not compatible with my browser. But this one, this one is really good, so Kudo&#8217;s to <a href="http://www.microsoft.co/windows/social/">Windows Social</a> team. When I found this in the Twitter&#8217;s box in popurls, posts just started popping in, sweet! Though I suppose it would do the same as on MS and IE platform. But if someone knew of a &#8220;flaw&#8221;, &#8220;fail&#8221; or &#8220;weak link&#8221;, complain about it properly to their support, and if you can bother to let me know <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  LOL</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/windows-social-didnt-complain/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 don&#8217;t want to bother him for new passwords, and I guess he setup new ones [...]]]></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>Mastering CSS Coding: Getting Started (Smashing Magazine)</title>
		<link>http://www.marvinmarcelo.com/mastering-css-coding-getting-started/</link>
		<comments>http://www.marvinmarcelo.com/mastering-css-coding-getting-started/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 00:30:35 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[me stuff]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1333</guid>
		<description><![CDATA[I&#8217;ve been practicing strict CSS rules for years now, but it was only this year that I changed the way I fix floated containers inside another container, to stretch the height down to the bottom of the floated inner container. I guess almost everyone started with &#60;br /&#62; with &#8216;clear&#8217; or the next element with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been practicing strict CSS rules for years now, but it was only this year that I changed the way I fix floated containers inside another container, to stretch the height down to the bottom of the floated inner container. I guess almost everyone started with &lt;br /&gt;  with &#8216;clear&#8217; or the next element with CSS &#8216;clear&#8217; in it to fix the issue, but we all know it&#8217;s &#8216;dirty&#8217;.</p>
<p>I found this <a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/">great tutorial</a> that would make a &#8216;css nobody&#8217; become a &#8216;big guy&#8217; on CSS, and I myself is going to keep this page available when needed.</p>
<p><img class="alignnone size-full wp-image-1334" title="6_b" src="http://www.marvinmarcelo.com/wp-content/uploads/2009/10/6_b.jpg" alt="6_b" width="500" height="254" /></p>
<p><a href="http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/">Mastering CSS Coding: Getting Started covers:</a></p>
<ol>
<li>Padding vs. Margin
<ul>
<li>What Is Padding and Margin?</li>
<li>Margin and Padding Values</li>
<li>Quick Tip</li>
</ul>
</li>
<li>Floats</li>
<li>Center Alignment
<ul>
<li>Horizontal Alignment</li>
<li>Vertical Alignment</li>
</ul>
</li>
<li>Ordered vs. Unordered Lists
<ul>
<li>Customizing Unordered Lists</li>
<li>Using Unordered Lists for Navigation</li>
</ul>
</li>
<li>Styling Headings</li>
<li>Overflow
<ul>
<li>What Is Overflow?</li>
</ul>
</li>
<li>Position
<ul>
<li>Adding Flavor With CSS</li>
</ul>
</li>
<li>Background Images
<ul>
<li>Using Large Backgrounds</li>
<li>Text Replacement</li>
<li>CSS Sprites</li>
</ul>
</li>
<li>Image Enhancement</li>
<li>PSD to HTML</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/mastering-css-coding-getting-started/feed/</wfw:commentRss>
		<slash:comments>0</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 a year/month links from the present to the oldest published image sets. Sounds easy, and [...]]]></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>Variable, variables and lots of variables</title>
		<link>http://www.marvinmarcelo.com/variable-variables-and-lots-of-variables/</link>
		<comments>http://www.marvinmarcelo.com/variable-variables-and-lots-of-variables/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 03:17:34 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[me stuff]]></category>
		<category><![CDATA[work related]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.marvinmarcelo.com/?p=1232</guid>
		<description><![CDATA[List of variable names, oddly named and other stuff I&#8217;m glad I bumped into . Found them in project about 5 or 6 yrs old that needs modification and I believe optimization too, yes really. So why glad? Because I realized the way I named my variables isn&#8217;t that bad at all. /** * This [...]]]></description>
			<content:encoded><![CDATA[<p>List of variable names, oddly named and other stuff I&#8217;m glad I bumped into <img src='http://www.marvinmarcelo.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  . Found them in project about 5 or 6 yrs old that needs modification and I believe optimization too, yes really. So why glad? Because I realized the way I named my variables isn&#8217;t that bad at all.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * This one is on top of a movie player page. Maybe 'he' wasn't so sure 
 * that the parameters passed on to this page is for a 'video'. Just making
 * sure for the nth time I guess.
 */</span>
<span style="color: #000088;">$videoistrue</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #009933; font-style: italic;">/**
 * I think 'he' hate lines. And this one is good, page title is saved 
 * in a session variable, so if another programmer writes a new page
 * and forgot to assign $_SESSION['pagetitle'] a new value for an FAQ
 * page, say faq.php, it'd show up &lt;title&gt;Show Series&lt;/title&gt;
 */</span>
<span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pagetitle'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Show Series&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009933; font-style: italic;">/**
 * ... and it went on and on
 * $_SESSION['pagetitle'] = &quot;Calendar&quot;;
 * session_start();$_SESSION['pagetitle'] = &quot;Browse Model&quot;;
 *
 * Hmmmm, $ii as iteration variable, struggling with names? I often 
 * use $i, $n or $x, sometime $c, hehehe! I've seen $i for many. And 
 * have you noticed the class name 'smalleditnoline', can it be any 
 * longer? Yes! and if he had enough time, it may have look like 
 * 'smalleditnolinewitharialbold' or 'smalleditnolineFFFbgcolor333fgcolor'
 * crazy! This is CSS anyway, will surely post one for that, hahaha!
 */</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ii</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><span style="color: #000088;">$ii</span><span style="color: #339933;">&lt;</span> <span style="color: #339933;">=</span><span style="color: #000088;">$totalpages</span><span style="color: #339933;">;</span><span style="color: #000088;">$ii</span><span style="color: #339933;">++</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;">$ii</span><span style="color: #339933;">==</span><span style="color: #000088;">$page</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;font class='smallediton'&gt;[<span style="color: #006699; font-weight: bold;">$ii</span>]&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>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href='?sort=&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sort'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&amp;page=<span style="color: #006699; font-weight: bold;">$ii</span>' class='smalleditnoline'&gt;[<span style="color: #006699; font-weight: bold;">$ii</span>]&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009933; font-style: italic;">/**
 * more variables with default values, note that this is set just
 * before a loop starts
 */</span>
<span style="color: #000088;">$thisCat</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$firstrun</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$firstrow</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$rowcount</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #009933; font-style: italic;">/**
 * &quot;NO QUOTES&quot; for key names in square brackets :( 
 * if only my IDE could complain
 */</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span>catadded<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span>keywordadded<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span>modeladded<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009933; font-style: italic;">/**
 * Consistent! Maybe 'He' doesn't want anybody to easily understand 
 * the script that's why no new lines after semi-colon at least.
 */</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$seriesRow</span><span style="color: #009900;">&#91;</span>seriesNo<span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$seriesNoTxt</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$seriesRow</span><span style="color: #009900;">&#91;</span>seriesNo<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span> <span style="color: #000088;">$seriesNoTxt</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$seriesRow</span><span style="color: #009900;">&#91;</span>seriesNo<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

</pre>
<p>Ok, enough of grumbling here. I have released my frustration for today, going back to work. But if I am to start a project or even a simple script, I follow formatting conventions, consistent quotes and escapes, logical variable names and useful comments with links and samples. It doesn't only make your code readable, it helps a lot for the next programmer to just add-in the stuff he needs to and keeping his sanity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marvinmarcelo.com/variable-variables-and-lots-of-variables/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 web based free Integrated Development Environment or IDE for the PHP language, in other words [...]]]></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>1</slash:comments>
		</item>
	</channel>
</rss>
