<?xml version="1.0" encoding="iso-8859-1"?><rss version="0.91">
    <channel>
        <title>phpguru.org - Richard Heyes' ramblings and code</title>
        <link>http://www.phpguru.org/</link>
        <description>
            Free PHP, Javascript and C# code, along with a mild smattering of humour.
        </description>

                    <item>
                <title>Displaying errors</title>
                <link>http://www.phpguru.org/#293</link>
                <pubDate>Wed, 07 May 2008 23:35:45 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">In reply to <a href="http://php100.wordpress.com/2008/05/07/displaying-errors/" target="_blank">this</a>, here's a technique for controlling your error reporting:

<br /><br />

<code><span style="color: #000000">
<span style="color: #007700">&lt;?</span><span style="color: #0000BB">php<br />&nbsp;&nbsp;&nbsp;&nbsp;$isDev&nbsp;&nbsp;</span><span style="color: #007700">= </span><span style="color: #0000BB">$_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'SERVER_NAME'</span><span style="color: #007700">] == </span><span style="color: #DD0000">'dev.phpguru.org'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$isLive </span><span style="color: #007700">= </span><span style="color: #0000BB">$_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'SERVER_NAME'</span><span style="color: #007700">] == </span><span style="color: #DD0000">'www.phpguru.org'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if (</span><span style="color: #0000BB">$isDev</span><span style="color: #007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">error_reporting</span><span style="color: #007700">(</span><span style="color: #0000BB">E_ALL</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'display_errors'</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;} elseif (</span><span style="color: #0000BB">$isLive</span><span style="color: #007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">error_reporting</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'display_errors'</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">?&gt;<br /></span>
</span>
</code>

<p>You don't have to create the $isDev/$isLive variables, but if you do you can reuse them elsewhere. I suppose you could if you wanted to use the Registry pattern I highlighted here some time ago, eg Config::$isDev

<p>You could even use this technique to hide content on your live server that's not quite ready to go live yet.]]>
                </description>
            </item>
                    <item>
                <title>Datagrid update</title>
                <link>http://www.phpguru.org/#292</link>
                <pubDate>Tue, 06 May 2008 13:04:29 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">Just "released" the latest version of the Datagrid. Updates include:

<ul>
  <li>You can disable sorting for a given column or columns.</li>
  <li>Paging now has a "paging" CSS class (the next/prev links only). The bit that tells you how many rows there (x of y results) has the "paging_results" CSS class
</li>
  <li>Order by links now preserve existing GET variables - thanks Tom</li>
  <li>Fixed hard coded perPage - thanks David</li>
  <li>Added NoSort() method which, unsurprisingly, disables sorting for a given column (or columns).</li>
</ul>

<a href="/static/datagrid.html">[Link]</a>]]>
                </description>
            </item>
                    <item>
                <title>Web based chat</title>
                <link>http://www.phpguru.org/#291</link>
                <pubDate>Sat, 03 May 2008 23:28:36 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">After an email (or two) on the <a href="http://www.php.net/mailing-lists.php" target="_blank">php-general</a> list, (of which I only read the subject), I've created a multi user web based chat system. <a href="http://www.phpguru.org/chat/chat.php" target="_blank">Here</a>.

<p>Oh the fun. The status bar is irritating though - in that it keeps flashing as it downloads the page (maybe this could be fixed by the use of toilet cleaner, I mean AJAX). Oh and like IRC it will track the converstaion from the time you enter the chat room. And because it refreshes every second, the load average on the server will not be thankful.]]>
                </description>
            </item>
                    <item>
                <title>Boris wins Landon mayoral election</title>
                <link>http://www.phpguru.org/#290</link>
                <pubDate>Sat, 03 May 2008 10:57:51 +0100</pubDate>
                <description>
                    <![CDATA[<img src="/images/boris.png" align="right" style="border: 1px solid black" width="263" height="131" alt="Boris Johnson" />

<p class="firstLetter">No not Karloff, our dear old Boris Johnson, pictured right. Am I the only one thinking that this will be the funniest four years ever? The gaffs that we're almost guaranteed will be priceless.

<p>Heck, I don't even live in Landon and I'm looking forward to it. Perhaps that's why...]]>
                </description>
            </item>
                    <item>
                <title>Garmin 200W sat nav doobry</title>
                <link>http://www.phpguru.org/#289</link>
                <pubDate>Fri, 02 May 2008 18:22:44 +0100</pubDate>
                <description>
                    <![CDATA[<a href="http://www.amazon.co.uk/Garmin-Widescreen-Satellite-Navigation-Mapping/dp/B000TUZVBY/ref=pd_sbs_ce_img_3" target="_blank">

<img src="http://ecx.images-amazon.com/images/I/41ISYs9UzIL._SL500_AA280_.jpg" align="right" border="0" />

</a>

<p class="firstLetter">Ok, so I'm thinking of buying a personal sat nav to help get around (since my sight isn't exactly a great help...). From what I've read (eg. the reviews on <a href="http://www.amazon.co.uk/Garmin-Widescreen-Satellite-Navigation-Mapping/dp/B000TUZVBY/ref=pd_sbs_ce_img_3" target="_blank">Amazon</a>), the Garmin Nuvi 200W looks like it could be the blighter. From what I can see the only difference from the 250 model is European mapping, which I would use soo much... (oh and it has a wide screen, which is nice.

<p>Anyone offer their opinions? TIA.]]>
                </description>
            </item>
                    <item>
                <title>Draggable images fun</title>
                <link>http://www.phpguru.org/#288</link>
                <pubDate>Thu, 01 May 2008 20:34:58 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">Been playing today with <a href="http://www.phpguru.org/collage/collage.html">this</a>. Somewhat buggy and I've only been using MSIE so far (ie It probably won't work in anything else). Ideas:

<ul>
  <li>A little control box that appears in the top right of each image when you select it which allows you to control the zoom and the stacking order.</li>
</ul>]]>
                </description>
            </item>
                    <item>
                <title>Datagrid update</title>
                <link>http://www.phpguru.org/?updates=1#287</link>
                <pubDate>Wed, 30 Apr 2008 21:49:10 +0100</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">Just made the datagrid class use real properties and not getters/setters. Fixes a bug (I hope - I haven't got access to the version of PHP in question) reported by Tom (sorry - can't remember your second name). It's not live yet but barring any more issues or requests, will be soon.

<h4>Oopsy...</h4>

Forgot to publicise the URL for this, which is <a href="http://www.phpguru.org/datagrid/">http://www.phpguru.org/datagrid/</a>]]>
                </description>
            </item>
            </channel>
</rss>