<?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>Narnio&#187; Webdevelopment</title>
	<atom:link href="http://www.narnio.com/category/development/webdevelopment/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.narnio.com</link>
	<description>A day in the life of a software engineer</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:31:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>PHP and browser detection</title>
		<link>http://www.narnio.com/2011/07/22/php-and-browser-detection/</link>
		<comments>http://www.narnio.com/2011/07/22/php-and-browser-detection/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 20:28:46 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=580</guid>
		<description><![CDATA[One of the things you might encounter as a web developer is detection of the browser that a visitor is using. In my specific case this was needed since I wanted to use some CSS3 styling, but only if the browser was capable. In all other cases the visitor had to see the CSS2 optimized [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things you might encounter as a web developer is detection of the browser that a visitor is using. In my specific case this was needed since I wanted to use some CSS3 styling, but only if the browser was capable. In all other cases the visitor had to see the CSS2 optimized page.</p>
<p>So I started looking into a way to let my web application determine what browser was visiting and what capabilities it had. Since this was for the new WordPress theme I&#8217;m developing it had to be in PHP and be sorta light-weight.</p>
<p>First thing was to figure out the basic browser that was visiting. This can be done by doing a simple <a  title="strpos documentation" href="http://www.php.net/manual/en/function.strpos.php" target="_blank">strpos</a> call in PHP on the user agent property. Having a list of the various user agents helped, I found just such a list at <a  title="User Agent Strings" href="http://www.useragentstring.com/pages/useragentstring.php" target="_blank">UserAgentString</a>. A brief summary for some common browsers is below.</p>
<pre class="brush: php">  $user_agent = $_SERVER['HTTP_USER_AGENT'];
  $IE        = strpos($this-&gt;_user_agent, 'MSIE') &gt; -1;
  $IPad      = strpos($this-&gt;_user_agent, 'iPad') &gt; -1;
  $Firefox   = strpos($this-&gt;_user_agent, 'Firefox/') &gt; -1;
  $Chrome    = strpos($this-&gt;_user_agent, 'Chrome/') &gt; -1;
  $Opera     = strpos($this-&gt;_user_agent, 'Opera/') &gt; -1;
  $Android = strpos($this-&gt;_user_agent, 'Android') &gt; -1;</pre>
<p>As you can see determining the basic browser type is pretty simple. But to be able to determine if CSS3 is supported you will also need to locate the version of the browser. Keeping in mind that IE9+, Firefox 4+, Opera 10+ and Chrome are the only versions that support CSS3. The check for this is slightly different for each version. But you can do it easily with a regular expresion.</p>
<pre class="brush: php"> // For all non IE browsers
 $locator;
 if ($Firefox) $locator = "Firefox\/";
 if ($Android) $locator = "Android\s";
 if ($Chrome) $locator = "Chrome\/";
 if ($Opera) $locator = "Version\/";
 preg_match('/'.$locator.'([0-9]{1,4}(.[0-9]{1,3})+)/', $user_agent, $version);

 // For IE
 preg_match('/MSIE\s([0-9]{1,2}.[0-9]{1,2})/', $user_agent, $version);
 if (count($version) &gt; 1) $version = $version[1];
 else $version = 0;</pre>
<p>Having the version and the type of browser allows us to do all kinds of fancy browser specific stuff. Mostly introduce hacks for IE7 (yes many are needed), or add CSS3 support.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/07/22/php-and-browser-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing for mobile devices</title>
		<link>http://www.narnio.com/2011/06/09/testing-for-mobile-devices/</link>
		<comments>http://www.narnio.com/2011/06/09/testing-for-mobile-devices/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 08:09:00 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=571</guid>
		<description><![CDATA[As you might know this blog is also available through an own developed mobile edition, at http://m.narnio.com. It&#8217;s based on a plugin that I developed. But how do you go about with the testing for mobile platforms, when you don&#8217;t have all of them. I mean who has the money to buy every possible phone [...]]]></description>
			<content:encoded><![CDATA[<p>As you might know this blog is also available through an own developed mobile edition, at <a  href="http://m.narnio.com">http://m.narnio.com</a>. It&#8217;s based on a plugin that I developed. But how do you go about with the testing for mobile platforms, when you don&#8217;t have all of them.</p>
<p>I mean who has the money to buy every possible phone out there, or every tablet.  Well there are some ways to do this without having all of the devices. Here is a short list:</p>
<ul>
<li>Run it through the validator at <a  href="http://validator.w3.org/mobile/">http://validator.w3.org/mobile/</a></li>
<li>Use a simulator for testing like:
<ul>
<li><a  href="http://www.marketcircle.com/iphoney/">iPhoney</a>, for iPhone testing</li>
<li><a  href="http://labs.blackbaud.com/NetCommunity/article?artid=662">iBBDemo2</a>, for iPad testing</li>
</ul>
</li>
<li>Doing a simple resolution check, for IE this can be done by hitting F12 and selecting <strong>Tools</strong> -&gt; <strong>Resize</strong></li>
<li>Checking the load times on different connection speeds, using <a  href="http://www.fiddler2.com/fiddler2/">Fiddler 2</a> by changing <strong>Rules </strong>-&gt; <strong>Performance -&gt; Simulate modem speeds</strong></li>
</ul>
<p>So what are resolutions to check for with mobile devices, well here is a short list.</p>
<ul>
<li>480 x 800 (default Android 1.5 &#8211; 2.2)</li>
<li>540 x 960 (newer Android phones 2.3.3)</li>
<li>640 x 960 (iPhone4)</li>
<li>1280 x 800 (various Android 3 tablets)</li>
</ul>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/06/09/testing-for-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New WordPress skin, Ajax loading vs. Google</title>
		<link>http://www.narnio.com/2011/06/08/new-wordpress-skin-ajax-loading-vs-google/</link>
		<comments>http://www.narnio.com/2011/06/08/new-wordpress-skin-ajax-loading-vs-google/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 18:37:33 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=573</guid>
		<description><![CDATA[As a major remodeling of this blog is on the way I&#8217;m going to try to build it more dynamic and more up to the Web 2.0 standards. So that includes usage of Ajax, JQuery and a more dynamically filled website. But how to build this and keep the Google Analytics working, as well as [...]]]></description>
			<content:encoded><![CDATA[<p>As a major remodeling of this blog is on the way I&#8217;m going to try to build it more dynamic and more up to the Web 2.0 standards. So that includes usage of Ajax, JQuery and a more dynamically filled website. But how to build this and keep the Google Analytics working, as well as the search engine indexing. This will be one of my biggest challenges I&#8217;m afraid.</p>
<p>Developing a website with JQuery / Ajax and advanced JavaScript prototypes isn&#8217;t anything new to me. But having all of these features and still make the site indexable is! So far I&#8217;m stuck at the simple point that crawlers don&#8217;t support JavaScript, so no go for that part. It looks like I will have to create a module for the WordPress plugin to detect what type of user is visiting the website. Serving the search engines a version that will not use any of the advanced features that normal browsers will support.</p>
<p>Besides the issue with the indexing there is still the task of getting all the pages on the website to be tracked with Google Analytics. Currently that is easy, though the website is dynamic each page is a new request to the server. But using advanced features like Ajax stops that in its tracks. Currently I don&#8217;t even know if it is possible to track pages when the actual URL doesn&#8217;t change, just the content of the page. If it is possible to do this I would have to build a module to do so.</p>
<p>So after just ranting and brain storming for a few seconds I already found to nice features that would have to be build. Another person might call them serious issues, but I prefer good challenges. At least for the moment I do. Not even mentioning the fact that I have to build a complete new template for WordPress too.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/06/08/new-wordpress-skin-ajax-loading-vs-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working on a new layout</title>
		<link>http://www.narnio.com/2011/06/08/working-on-a-new-layout/</link>
		<comments>http://www.narnio.com/2011/06/08/working-on-a-new-layout/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 06:02:54 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=567</guid>
		<description><![CDATA[It&#8217;s been some time since my last post here, and there are several very good reasons for that. I&#8217;m currently rather busy trying to rebuild the skin for this blog, as well as several other development projects I&#8217;ve got going on right now. One might say I&#8217;m taking on more work then I can handle, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been some time since my last post here, and there are several very good reasons for that. I&#8217;m currently rather busy trying to rebuild the skin for this blog, as well as several other development projects I&#8217;ve got going on right now. One might say I&#8217;m taking on more work then I can handle, but I love to be busy I guess. So what am I working on, and what can you be expecting in the time to come here:</p>
<ul>
<li>Redesigning this blog, to bring it up to speed with the latest possibilities from <a  title="Official WordPress website" href="http://wordpress.org">WordPress</a></li>
<li>Building of the UML Design tool that I started on some months ago</li>
<li>Defining the specs of a neural algorithm to build a user centric database (more on this to come in the future here)</li>
<li>Continued development on the <a  title="Synchronizer web page" href="http://www.jong-soft.com/en/Products/Synchronizer.html">Synchronizer </a>tool, hoping to release version 3.0 soon</li>
</ul>
<p>And that&#8217;s just the work that I do in my rare spare time next to a full-time job.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/06/08/working-on-a-new-layout/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IE framesets and printing</title>
		<link>http://www.narnio.com/2011/03/22/ie-framesets-and-printing/</link>
		<comments>http://www.narnio.com/2011/03/22/ie-framesets-and-printing/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 21:12:15 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=550</guid>
		<description><![CDATA[So I recently encountered a weird problem with printing in Internet Explorer. To ease the usability of a website we opened a new window that had a frame-set in it with 2 frames. The first frame contained a button to close the pop up and the second frame a clone of the page to be [...]]]></description>
			<content:encoded><![CDATA[<p>So I recently encountered a weird problem with printing in Internet Explorer. To ease the usability of a website we opened a new window that had a frame-set in it with 2 frames. The first frame contained a button to close the pop up and the second frame a clone of the page to be printed. This was done to apply a slightly different lay-out to the print version.</p>
<p>For some reason some of our customers reported that the print-out font size was bigger then it was supposed to be. And in some cases the tables didn&#8217;t even fit the page anymore. Surprisingly everything worked normally in Firefox, and only the customers using IE7 and above reported the issue.</p>
<p>After a couple of hours debugging it turned out that IE jumped into some weird rendering mode that caused the content not to fit a normal A4 page anymore. Appearantly adding the DOCTYPE definition to set it to compatability mode helped solving the problem. So I included the below to fix the issue:<br />
<code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</code></p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/03/22/ie-framesets-and-printing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Started work on a Calendar plugin</title>
		<link>http://www.narnio.com/2011/02/25/started-work-on-a-calendar-plugin/</link>
		<comments>http://www.narnio.com/2011/02/25/started-work-on-a-calendar-plugin/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 07:06:20 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=543</guid>
		<description><![CDATA[Since my last work on a custom combobox went so smooth I decided that it is time to try and build yet another custom plugin for JQuery. This time round I&#8217;m building a custom calendar object. Now I know these already exists, but this is mostly an experiment to build more experience in developing for [...]]]></description>
			<content:encoded><![CDATA[<p>Since my last work on a custom combobox went so smooth I decided that it is time to try and build yet another custom plugin for <a  title="JQuery website" href="http://www.jquery.org" target="_blank">JQuery</a>. This time round I&#8217;m building a custom calendar object. Now I know these already exists, but this is mostly an experiment to build more experience in developing for JQuery.</p>
<p>As this plugin will require a bit more work then the combobox I have no idea as to when I can release a first usable version. But as soon as I do I will publish it here <img src='http://www.narnio.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/02/25/started-work-on-a-calendar-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image effects NextGen gallery failing</title>
		<link>http://www.narnio.com/2011/02/14/image-effects-nextgen-gallery-failing/</link>
		<comments>http://www.narnio.com/2011/02/14/image-effects-nextgen-gallery-failing/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 06:00:10 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=534</guid>
		<description><![CDATA[It was recently brought to my attention that the WordPress plugin I use for posting images on this website was not working properly anymore, thanks for warning me of this issue. Well not working properly in the sense that images would get opened in the same window, with no options to navigate back to the [...]]]></description>
			<content:encoded><![CDATA[<p>It was recently brought to my attention that the <a  href="http://www.wordpress.org">WordPress </a>plugin I use for posting images on this website was not working properly anymore, thanks for warning me of this issue. Well not working properly in the sense that images would get opened in the same window, with no options to navigate back to the post.</p>
<p>Initially I thought that this was caused by the plugin I use for this called <a  title="Official plugin page for NextGen Gallery" href="http://wordpress.org/extend/plugins/nextgen-gallery/" target="_blank">NextGen Gallery</a>. After all this plugin failed to do its job properly, but unfortunately that was a bit stupid thinking on my part. I should have realised that the plugin stopped working after an upgrade of the WordPress blog powering the website. For some reason the thickbox JQuery extension produced JavaScript exceptions.</p>
<p>I don&#8217;t know exactly why it doesn&#8217;t work like expected and I don&#8217;t really care either. Suffice it to say that changing a small piece of code in the &#8216;wp-includes/js/thickbox/thickbox.js&#8217; fixed the issue. All I had to do is modify the tb_init function into the following:</p>
<pre class="brush:javascript">
function tb_init(domChunk)
{
     jQuery(domChunk).bind("click", tb_click);
}
</pre>
<p>I think it must have been some conflict in the JQuery versions or something, since it used to call the &#8216;.<a  title="API documention on .live" href="http://api.jquery.com/live/" target="_blank">live</a>&#8216; method on JQuery. But this was what was causing the exceptions. If anyone knows a more permanent fix for this issue please let me know.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/02/14/image-effects-nextgen-gallery-failing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP autoloader continued</title>
		<link>http://www.narnio.com/2011/02/13/php-autoloader-continued/</link>
		<comments>http://www.narnio.com/2011/02/13/php-autoloader-continued/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 01:09:40 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=532</guid>
		<description><![CDATA[A couple of days back I wrote something about some huge issues I had with the PHP autoloader technology. After reading up some more on the autoloader and some help from the PHP developers I finally tracked down the issue. As it turns out the autoloader functionality is called when PHP is unable to find [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days back I wrote something about some huge issues I had with the PHP autoloader technology. After reading up some more on the autoloader and some help from the PHP developers I finally tracked down the issue.</p>
<p>As it turns out the autoloader functionality is called when PHP is unable to find the class you are using automatically itself as a last effort. Though that wasn&#39;t the issue I encountered. It took me about 3 hours of debugging the function to find out there was a problem with the logic of the autoloader function I wrote myself, doh!</p>
<p>Something with breaking out of a loop to early <img src='http://www.narnio.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> . After fixing this issue my autoloader was working beautifully. So I am happy to say that it is possible to write a modular PHP web application after all.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/02/13/php-autoloader-continued/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skinable drop down box, first release</title>
		<link>http://www.narnio.com/2011/02/11/skinable-drop-down-box-first-release/</link>
		<comments>http://www.narnio.com/2011/02/11/skinable-drop-down-box-first-release/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 10:48:10 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=529</guid>
		<description><![CDATA[Just a few days ago I posted that I started working on a better looking drop down box to replace the select element on webpages. Today the first version is released under the GPL license. You can download it by visiting the plugin page under Plugins - Custom Combobox. This first version includes: Custom drop [...]]]></description>
			<content:encoded><![CDATA[<p>Just a few days ago I <a  href="http://www.narnio.com/2011/02/05/started-work-on-a-skinnable-drop-down-box-in-jquery/">posted </a>that I started working on a better looking drop down box to replace the select element on webpages. Today the first version is released under the <a  href="http://www.gnu.org/licenses/gpl.html">GPL license</a>. You can download it by visiting the plugin page under <a  href="http://www.narnio.com/plugins/"><strong>Plugins </strong></a>- <a  href="http://www.narnio.com/plugins/custom-combobox/"><strong>Custom Combobox</strong></a>.</p>
<p>This first version includes:</p>
<ol>
<li>Custom drop down arrows for disabled / mouse over and default combobox states</li>
<li>Ability to change the border styles of the drop down part as well as the combobox itself</li>
<li>Supports translating the following elements in comboboxes:
<ol>
<li>select element</li>
<li>ul &amp; ol element</li>
</ol>
</li>
</ol>
<p><strong>Please note: </strong>as this is the first release there may still be some bugs in the code, please feel free to contact me if you find any and I will attempt to solve them as quickly as possible.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/02/11/skinable-drop-down-box-first-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP autoloader issues</title>
		<link>http://www.narnio.com/2011/02/10/php-autoloader-issues/</link>
		<comments>http://www.narnio.com/2011/02/10/php-autoloader-issues/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 21:59:34 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=527</guid>
		<description><![CDATA[Since PHP 5.x we are encouraged to develop in a more object oriented way. This is why they developed class support for us . Now to make our web applications even more modular you might consider putting each class in a seperate PHP file, just like Java and C++ developers have been doing for years [...]]]></description>
			<content:encoded><![CDATA[<p>Since PHP 5.x we are encouraged to develop in a more object oriented way. This is why they developed class support for us <img src='http://www.narnio.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . Now to make our web applications even more modular you might consider putting each class in a seperate PHP file, just like Java and C++ developers have been doing for years now. But here is where it becomes tricky, how does PHP know which files to load automatically.</p>
<p>Of course you could include every single file that you might need manually at the top of your index.php. But what if you don&#39;t need every single class every time a page is loaded, do you really want to create that kind of an overhead in loading un-needed files? I didn&#39;t, so I started looking into the <a  href="http://php.net/manual/en/language.oop5.autoload.php" target="_blank">autoloader </a>functionality of PHP. What this feature does is allow you to&nbsp;scan through files in the <a  href="http://php.net/manual/en/function.set-include-path.php" target="_blank">predefined include directories </a>and attempts to locate the class.</p>
<p>So what I did was build a simple autoloader function to scan each file in predefined directories to find the classes, and if found to stop. To my surprise this was working rather well. All classes that where needed would automatically get loaded by my little autoloader function. However somehow one particular class was not able to be loaded for some reason. The setup was something simple, something like:</p>
<ul>
<li>A predefined class A</li>
<li>A class B which extended class A</li>
<li>A class C which extended class B</li>
<li>A class D which extended class C, and was located in a separate directory as it was specific for the website</li>
</ul>
<p>All of the classes loaded beautifully, except for class D. For some reason when I tried using it I got exceptions that class&nbsp;C was undefined. When I added some debugging to find out which files where loaded I did see every file for classes A, B and C being loaded, but the actual classes defined inside where not added to PHP. Somehow I have magically created a black whole in PHP that would include files and then forget to create the class definitions internally. To this day I still haven&#39;t figured out why PHP refused to store the actual classes in its memory.</p>
<p>The quick fix I applied was ugly and stupid, just manually load the classes and build a big <em>if</em> statement around them to prevent duplicate declarations using the <a  href="http://php.net/manual/en/function.class-exists.php" target="_blank">class_exists </a>function.</p>
<hr/>Copyright &copy; 2012 <strong><a  href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2011/02/10/php-autoloader-issues/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

