<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?>
<rss 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
	<channel>
		<title>Cool PHP Tools</title>
		<link>http://www.coolphptools.com</link>
		<description>News from Cool PHP Tools</description>
		<pubDate>Fri, 18 May 2012 21:00:26 -0400</pubDate>
		<generator>Neighbor Webmaster CMS v1.0</generator>
		<language>en</language>
		<item>
			<title>Smarty 3.x Missing Template Variable error</title>
			<link>http://www.coolphptools.com/news/detail/Smarty_3_x_Missing_Template_Variable_error</link>
			<pubDate>Thu, 05 May 2011 23:36:19 -0400</pubDate>
			<dc:creator> Kepler Gelotte</dc:creator>
			<author>coolphptools@neighborwebmaster.com</author>
			<category><![CDATA[News]]></category>
			<category><![CDATA[PHP]]></category>
			<guid isPermaLink="true">http://www.coolphptools.com/news/detail/Smarty_3_x_Missing_Template_Variable_error</guid>
			<description><![CDATA[This is a solution I came up with to get rid of the annoying error messages. It has the advantage of not turning off all error messages.]]></description>
			<content:encoded><![CDATA[<p>In the Smarty 3.0 release, for some odd reason the developer decided undefined variables in the template are errors. In Smarty 2.x undefined variables were treated as empty strings. This made a lot more sense to me. The whole reason I use Smarty is so I don't have to sweat details like this.&nbsp;</p>
<p>I decided to find where in the code the error was coming from and make it work like it used to. My solution (and it may not be optimal as I didn't dig that deeply) is as follows:</p>
<p>1) Edit smarty/libs/sysplugins/smarty_internal_data.php and change the getVariable() function to:</p>
<p><pre><code>    /**
     * gets the object of a Smarty variable
     * 
     * @param string $variable the name of the Smarty variable
     * @param object $_ptr optional pointer to data object
     * @param boolean $search_parents search also in parent data
     * @return object the object of the variable
     */
    public function getVariable($_variable, $_ptr = null, $search_parents = true, $error_enable = true)
    {
        if ($_ptr === null) {
            $_ptr = $this;
        } while ($_ptr !== null) {
            if (isset($_ptr->tpl_vars[$_variable])) {
                // found it, return it
                return $_ptr->tpl_vars[$_variable];
            } 
            // not found, try at parent
            if ($search_parents) {
                $_ptr = $_ptr->parent;
            } else {
                $_ptr = null;
            } 
        } 
        if (isset(Smarty::$global_tpl_vars[$_variable])) {
            // found it, return it
            return Smarty::$global_tpl_vars[$_variable];
        } 
        if ($this->smarty->error_unassigned && $error_enable) {
            throw new SmartyException('Undefined Smarty variable "' . $_variable . '"');
        } else {
			if (! $this->smarty->error_unassigned) {
            	return new Smarty_variable(null, false);
			} else {
        		if ($error_enable) {
					// force a notice
					$x = $$_variable;
        		}
            	return new Undefined_Smarty_Variable;
        	} 
        } 
    }</code></pre></p>
<p>2) Now in your code, before calling the template, add this line:</p>
<p><pre><code>  $smarty-&gt;error_unassigned = false; </code></pre></p>
<p>This assumes your instance of Smarty is called $smarty.  The beauty of this method is that you don't have to turn off ALL error messages just to suppress the missing var message.</p>]]></content:encoded>
		</item>
		<item>
			<title>Error 324 (ERR_EMPTY_RESPONSE)</title>
			<link>http://www.coolphptools.com/news/detail/Error_324_ERR_EMPTY_RESPONSE</link>
			<pubDate>Wed, 12 Jan 2011 16:10:12 -0500</pubDate>
			<dc:creator></dc:creator>
			<author>coolphptools@neighborwebmaster.com</author>
			<category><![CDATA[News]]></category>
			<category><![CDATA[PHP]]></category>
			<guid isPermaLink="true">http://www.coolphptools.com/news/detail/Error_324_ERR_EMPTY_RESPONSE</guid>
			<description><![CDATA[After upgrading to a new version of PHP (5.2.9), I got the above error.]]></description>
			<content:encoded><![CDATA[<p>I just upgraded my server since I needed to rebuild my PHP/Apache to include a missing library. CPanel makes this easy, however they allow only a few versions of PHP to choose from. The earliest available was still after my current version. I decided to go ahead anyway. Everything worked fine for all my web sites except one. That web site was running Moodle 1.9. When I went to that web site I got the mystersious &quot;Error 324 (ERR_EMPTY_RESPONSE)&quot; error.</p>
<p>Six hours later (might be a slight exaggeration) I finally found the problem. The culprit was the following line in lib/setup.php:</p>
<p><span class="Apple-style-span" style="font-family: monospace; ">&nbsp;&nbsp;raise_memory_limit('96M'); &nbsp; &nbsp;// We should never NEED this much but just in case...</span></p>
<p>&nbsp;</p>
<div>After commenting out this line everything was fine. Hopefully this will help anyone with a similar problem.&nbsp;</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
		</item>
		<item>
			<title>New Version of the Dynamic CSS library</title>
			<link>http://www.coolphptools.com/news/detail/New_Version_of_the_Dynamic_CSS_library</link>
			<pubDate>Mon, 16 Feb 2009 19:55:22 -0500</pubDate>
			<dc:creator>Kepler Gelotte</dc:creator>
			<author>coolphptools@neighborwebmaster.com</author>
			<category><![CDATA[News]]></category>
			<category><![CDATA[PHP]]></category>
			<guid isPermaLink="true">http://www.coolphptools.com/news/detail/New_Version_of_the_Dynamic_CSS_library</guid>
			<description><![CDATA[Added some enhancements to this library]]></description>
			<content:encoded><![CDATA[<p>&nbsp;I have a new version of my CSS filter library. Here are the highlights of what has changed:</p>
<ul>
    <li>Fixed a bug when applying the alpha filter for IE5.5 and IE6</li>
    <li>Added code to generate the indexed image (.gif/.png8) when it doesn't exist for browsers that don't support .png images</li>
    <li>Allow conditional statements to be separated using semicolons (the statements used to be required to be on a line by themselves).</li>
</ul>
<p>To clarify the last bullet, I will give an example of the old syntax (which still works):</p>
<pre>
    body
    {
        color: #000;
        if ($_GET[‘theme’] == ‘blue’)
            background‐color: #03C;
        else
            background‐color: #CCC;
        endif
    }
</pre>
<p>&nbsp;Now can be written on a single line:</p>
<pre>
    body {
        color: #000;
        if ($_GET[‘theme’] == ‘blue’); background‐color: #03C; else; background‐color: #CCC; endif;
    }
</pre>
<p>You can <a href="http://www.coolphptools.com/dynamic_css">download the latest version here.</a></p>]]></content:encoded>
		</item>
		<item>
			<title>Will Code for Food</title>
			<link>http://www.coolphptools.com/news/detail/will-code-for-food</link>
			<pubDate>Tue, 27 Jan 2009 01:31:16 -0500</pubDate>
			<dc:creator> Kepler Gelotte</dc:creator>
			<author>coolphptools@neighborwebmaster.com</author>
			<category><![CDATA[News]]></category>
			<category><![CDATA[PHP]]></category>
			<guid isPermaLink="true">http://www.coolphptools.com/news/detail/will-code-for-food</guid>
			<description><![CDATA[Has the open source movement turned programmers into panhandlers?]]></description>
			<content:encoded><![CDATA[<p>Just for the record, I love open source. Like most good programmers I have a bit of a lazy streak. If someone has already coded what I need, or at least close to what I need, I will use it. I don't want to reinvent the wheel.</p>
<p>The other nice thing about open source is, well, you get the source. Being a hands on type of programmer I get suspicious of &quot;black box&quot; solutions. I always suspect there is some programming bug lurking in there waiting to rise up and bite me. When my program isn't working is it because I did something wrong or am I hitting one of those nasty bugs in a vendor's package? I have done my share of &quot;alpha testing&quot; of a vendor's supposedly &quot;production&quot; code. Of course the burden of proof is always on you. Create your simple test case showing the bug and wait on the tech support hotline listening to Kenny G for hours only to end up talking to someone who just joined the company a week ago. I would much rather have all the code in front of me to dive in and fix whatever problem arises.</p>
<p>Ok, so now you are probably thinking &quot;What's the problem&quot;? The basic issue is that Open Source projects are also free. Believe me I love free. I am addicted to free. And therein lies the problem. There is so much Open Source code out there - and a lot of it really good quality, that people think all code should be free. The idea that I may want to charge for my time programming puts me into the greedy money grubbing capatilist ranks of Bill Gates. To see an extreme example of this sentiment, watch the movie &quot;Antitrust&quot; where an evil Tim Robbins resorts to murder to protect his investment in code. The message from the movie is &quot;all code should be free&quot;! So instead, many programmers decide to give away their code and add a &quot;donate&quot; button in hopes someone will realize the time and effort they put into developing the code and will compensate them for their time. Forget the fact you have bills to pay and mouths to feed.</p>
<p>This article is more of an expression of my frustration at how devalued programming skills have become.&nbsp;I guess this may be payback for the years of excessive fees paid to average or below average consultants.&nbsp;I have no great solution to this issue. I see some open soure projects have been adopting different approaches like &quot;free for the basic functionality and then pay for either services or additional functionality&quot;. Time will tell approach works best.&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
		</item>
		<item>
			<title>Color Extract Utility</title>
			<link>http://www.coolphptools.com/news/detail/color-extract-utility</link>
			<pubDate>Wed, 03 Sep 2008 14:55:09 -0400</pubDate>
			<dc:creator> Kepler Gelotte</dc:creator>
			<author>coolphptools@neighborwebmaster.com</author>
			<category><![CDATA[News]]></category>
			<category><![CDATA[PHP]]></category>
			<guid isPermaLink="true">http://www.coolphptools.com/news/detail/color-extract-utility</guid>
			<description><![CDATA[An enhanced version of a class I found on phpclasses.org]]></description>
			<content:encoded><![CDATA[<p>I came across a useful class on phpclasses.org. It extracts colors from an image file. I enhanced it a little and created an online test area where you can try it out. You can see it and download it <a href="/color_extract">here</a>.</p>
<p>Credit must be given to Csongor Zalatnai of Hungary for creating the original class.</p>]]></content:encoded>
		</item>
		<item>
			<title>New version of Dynamic CSS library</title>
			<link>http://www.coolphptools.com/news/detail/new-version-of-dynamic-css-library</link>
			<pubDate>Tue, 13 May 2008 01:54:45 -0400</pubDate>
			<dc:creator> Kepler Gelotte</dc:creator>
			<author>coolphptools@neighborwebmaster.com</author>
			<category><![CDATA[News]]></category>
			<category><![CDATA[PHP]]></category>
			<guid isPermaLink="true">http://www.coolphptools.com/news/detail/new-version-of-dynamic-css-library</guid>
			<description><![CDATA[Version 1.1 is now available]]></description>
			<content:encoded><![CDATA[<p>This version has an updated User Manual. It also:</p>
<ul>
    <li>Fixes a silent failure when an included css file did not exist.</li>
    <li>Allows overriding of the state variables using parameters on the CSS Url.</li>
    <li>Fixed a bug where @include statements ignored the if block they were in.</li>
</ul>
<p>You can download version 1.1 <a href="/dynamic_css">here</a>.</p>]]></content:encoded>
		</item>
		<item>
			<title>Welcome to my technical site</title>
			<link>http://www.coolphptools.com/news/detail/welcome</link>
			<pubDate>Tue, 29 Apr 2008 02:11:42 -0400</pubDate>
			<dc:creator>Kepler Gelotte</dc:creator>
			<author>webmaster@neighborwebmaster.com</author>
			<category><![CDATA[News]]></category>
			<category><![CDATA[PHP]]></category>
			<guid isPermaLink="true">http://www.coolphptools.com/news/detail/welcome</guid>
			<description><![CDATA[This is where I plan on placing tools and utilities.]]></description>
			<content:encoded><![CDATA[<p>Just created this web site. Hopefully more will be added in the near future.</p>]]></content:encoded>
		</item>
	</channel>
</rss>
