<?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>Dwight Jack Diary &#187; PHP</title>
	<atom:link href="http://www.dwightjack.com/diary/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dwightjack.com/diary</link>
	<description>Diary of music, design and code</description>
	<lastBuildDate>Wed, 25 Jan 2012 21:52:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Review: WordPress 3 Cookbook</title>
		<link>http://www.dwightjack.com/diary/2012/01/25/review-wordpress-3-cookbook/</link>
		<comments>http://www.dwightjack.com/diary/2012/01/25/review-wordpress-3-cookbook/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 21:52:14 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[cookbook]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress 3]]></category>
		<category><![CDATA[worpress review]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=333</guid>
		<description><![CDATA[What i like most in cookbooks, is their problem/solution approach which comes really handy when you find yourself facing a task with no clues on how to complete it. Here are my thoughts on WordPress 3 Cookbook.]]></description>
			<content:encoded><![CDATA[<p>What i like most in cookbooks, is their problem/solution approach which comes really handy when you find yourself facing a task with no clues on how to complete it.</p>
<p><a style="margin: 0 0 10px 10px; float: right;" href="http://www.packtpub.com/wordpress-3-cookbook/book" target="_blank"><img class="alignright size-full wp-image-325" title="WordPress 3 Cookbook" src="http://www.dwightjack.com/diary/wp-content/uploads/2012/01/4606OS_WordPress-3-Cookbook.jpg.png" alt="WordPress 3 Cookbook" width="125" height="151" /></a>Yep, there&#8217;s Internet, but having <em>someone</em> suggesting plugins and showing you the best solution feels less <em>DIY</em> development.</p>
<p><strong><a href="http://www.packtpub.com/wordpress-3-cookbook/book" target="_blank">WordPress 3 Cookbook</a></strong> by <strong>Ric Shreves</strong> and <strong>Jean-Baptiste Jung</strong> is just like that.</p>
<p>Even if i think of myself as a experienced WordPress developer, i&#8217;ve found many hints on new plugins to check out and some good advices on website development. This sounds great in the messed up sea of WordPress resources.</p>
<p>But let&#8217;s dig into it.</p>
<h3>Audience</h3>
<p>The book is mainly meant for <strong>beginner to intermediate</strong> WordPress developers. It steps you through the most basic installation and customization tasks.</p>
<p>The same approach is taken to explore those areas beside core functionalities, involving the installation of one or more plugins to make it really simple, even from novice developers, to setup an advanced installation.</p>
<p><strong>Marketing and SEO specialists</strong> may also be an interested audience, since last chapters of the book feature deep insights on SEO optimization and advertising (both with AdSense and custom ads systems).</p>
<h3>Contents</h3>
<p>During the last years WordPress development has become a huge subject, spanning from simple page-based websites to shopping, community and multisite. That said, the book covers most of the scenarios where WordPress get used, maybe even too many for the intended audience.</p>
<p>For example, I&#8217;ve really enjoyed the chapter about <strong>BuddyPress and social community building</strong>, but I think the plugin is so much more complex than how depicted by the author, and anyway it alters so much the theme and system behavior that novice users may get lost.</p>
<p>What i&#8217;ve found really interesting, instead, are those chapters about <strong>website marketing and SEO</strong>, covering features commonly requested by clients but still not provided by the WordPress&#8217;s core.</p>
<p>The author covers <strong>sitemaps, XML sitemaps and search engine</strong> related topics by providing excellent plugins and detailed howtos to 3rd party services (like AdSense).</p>
<p>Beside this, you&#8217;ll find detailed chapters on themes and widgets management which are main topics even if you prefer to buy themes from external providers instead of coding your owns.</p>
<p>There&#8217;s then an introduction to the WordPress&#8217;s <em>loop</em> system with basic informations on how to customize templates and lists of contents. It&#8217;s well done, but could have been more in-depth.</p>
<h3>Last words</h3>
<p>Again, I&#8217;m disappointed by the choice of the author to suggest plugins even for those little customizations which involve little coding, when the eccessive number of plugins is a known performance problem in WordPress.</p>
<p>Maybe reducing the number of topic, or reducing those chapters devoted to core functionalities (already covered by the official documentation) would have offered space to describe <em>coded</em> alternatives to plugins, in order to give a better development guideline to novice developers.</p>
<p>Despite this, <strong><a href="http://www.packtpub.com/wordpress-3-cookbook/book" target="_blank">WordPress 3 Cookbook</a></strong> is an interesting reading and a well crafted cookbook which may find a prime spot on many developer&#8217;s desk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2012/01/25/review-wordpress-3-cookbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the Bookshelf: WordPress 3 Cookbook</title>
		<link>http://www.dwightjack.com/diary/2012/01/04/preview-wordpress-3-cookbook/</link>
		<comments>http://www.dwightjack.com/diary/2012/01/04/preview-wordpress-3-cookbook/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 15:58:44 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress 3]]></category>
		<category><![CDATA[wordpress review]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=324</guid>
		<description><![CDATA[During this winter break I'm going to read "WordPress 3 Cookbook", here is a sneak peek.]]></description>
			<content:encoded><![CDATA[<p>Despite the large amount of tutorials and quick tips available over the Internet, I find cookbooks a most valuable resource to recap, collect and organize those most helpful tricks of a programming language / CMS / library.</p>
<p><a title="WordPress 3 Cookbook" href="http://www.packtpub.com/wordpress-3-cookbook/book" target="_blank"><img class="size-full wp-image-325 alignright" style="border-style: initial; border-color: initial; float: right; margin-left: 10px;" title="WordPress 3 Cookbook" src="http://www.dwightjack.com/diary/wp-content/uploads/2012/01/4606OS_WordPress-3-Cookbook.jpg.png" alt="WordPress 3 Cookbook" width="125" height="151" /></a> That&#8217;s why during this winter break I&#8217;m going to read the latest released cookbook about WordPress by Packtpub titled &#8220;<a title="WordPress 3 Cookbook" href="http://www.packtpub.com/wordpress-3-cookbook/book" target="_blank">WordPress 3 Cookbook</a>&#8220;.</p>
<p>As from other reviews and the table of contents, the book&#8217;s 9 chapters cover every aspect of WordPress 3 development, from basic installation and theme customization to plugins and widgets development.</p>
<p>I&#8217;ve also took a sneak peek at chapter 5 on &#8220;<strong>Building Interactivity and Community</strong>&#8221; which covers many fancy and now-so-cool topics as facebook/twitter integration. It also covers basic customization and development with <a href="http://buddypress.org/" target="_blank">BuddyPress</a> community plugin which i s a product I&#8217;ve lately used on one of my projects.</p>
<p>Since the book&#8217;s structure is of a classic tech cookbook (&#8220;I have a question, here is the answer&#8221;), <a title="WordPress 3 Cookbook" href="http://www.packtpub.com/wordpress-3-cookbook/book" target="_blank">WordPress 3 Cookbook</a> seems a good reading for both novice and expert developers as it stands as an excellent collection of the most important topics about WordPress development.</p>
<p>I&#8217;ll keep you posted for a more in-dept review of the book.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2012/01/04/preview-wordpress-3-cookbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review: WordPress 2.9 e-Commerce Guide</title>
		<link>http://www.dwightjack.com/diary/2010/07/13/review-wordpress-2-9-e-commerce-guide/</link>
		<comments>http://www.dwightjack.com/diary/2010/07/13/review-wordpress-2-9-e-commerce-guide/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 20:46:53 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[e-commerce review]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[wordpress e-commerce]]></category>
		<category><![CDATA[worpress review]]></category>
		<category><![CDATA[wp e-commerce]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=315</guid>
		<description><![CDATA[Ever imagined to use Wordpress as an e-commerce system? Well, after reading this highly recommended guide i'd give it a try!]]></description>
			<content:encoded><![CDATA[<p>As a user, i love the e-commerce era, since it offers good deals and virtually every product i&#8217;d need.</p>
<p>As a developer, though, i&#8217;ve always hated projects involving the setup of an e-commerce store mainly because of the <strong>complexity of available web applications</strong>. This is especially true when it comes to customize themes, logics and behaviors of the store.</p>
<p>In my experience i&#8217;ve worked on <strong>Virtuemart, OsCommerce and ZenCart</strong> finding them too complex and <em>large</em> for my client&#8217;s needs.</p>
<p>On this matter i&#8217;ve found really enlightening the <a href="http://www.packtpub.com/wordpress-2-9-e-commerce/book?utm_source=dwightjack.com&amp;utm_medium=link&amp;utm_content=blog&amp;utm_campaign=mdb_002982" target="_blank"><strong>WordPress 2.9 e-Commerce</strong></a> guide by Brian Bondani, which presents the<strong> <a href="http://getshopped.org/" target="_blank">WP e-Commerce</a> </strong>plugin for WordPress which is both a great solution for small e-stores owners and an affordable solution for expert and novice developers.</p>
<p>The guide isn&#8217;t intended just for developers, but also for persons with basic computer skills willing to setup their online store. Technical knowledge of WordPress, CSS and PHP will allow you to further customize the installation, theme and store&#8217;s styles even if a basic section of the guide explains the basics of customization for novice developers too.</p>
<h3>Contents</h3>
<p><a style="margin: 0 0 10px 10px; float: right;" href="http://www.packtpub.com/wordpress-2-9-e-commerce/book?utm_source=dwightjack.com&amp;utm_medium=link&amp;utm_content=blog&amp;utm_campaign=mdb_002982" target="_blank"><img class="alignright size-medium wp-image-300" title="WordPress 2.9 e-Commerce" src="http://www.dwightjack.com/diary/wp-content/uploads/2010/05/WordPress_2.9-243x300.jpg" alt="WordPress 2.9 e-Commerce" width="188" height="232" /></a>The most prominent aspect of the guide is that it covers not just the configuration and customization of the plugin, but even the installation and configuration of WordPress with a detailed step by step tutorial on compatible themes and <strong>options to convert the blog engine into a dedicated e-store system</strong>.</p>
<p>On the plugin side, you&#8217;ll be impressed of the different options and configurations available to customize and refine your store. Reading the guide you&#8217;ll be able to easily setup<strong> both digital and physical items</strong>, with flexible shipping rates and discounts.</p>
<p>Starting from a <em>vanilla</em> installation the author guides you on a detailed step by step tutorial on the various configuration&#8217;s options, like international shipping rates and product variations (different sizes, colors) using a clear language and<strong> many screenshots of the actual plugin interface</strong>. <br />
 This ends up in a no-surprises situation when you&#8217;ll be hands-on the plugin.</p>
<p>For more advanced users there&#8217;s also a chapter which covers the customization of themes, with technical but clear examples of CSS and PHP code.</p>
<p>What&#8217;s extremely useful about the guide is that many chapters move beyond technical explanations of WordPress and WP e-Commerce plugin, focusing on <strong>how to market your store</strong> to increase your income.</p>
<p>By covering tools as <strong>Google AdSense</strong>, the guide serves also as a <strong>basic web-marketing reference</strong> introducing the most relevant aspects of e-commerce&#8217;s promotion which is often an overlooked aspect both by clients and developers.</p>
<p>Whether you are building your own store or you are a developer with non-professional skill on web marketing you&#8217;d find these chapters really useful even for other kind of projects.</p>
<p>Another good section of the book <strong>covers the most important online payment gateways</strong> like <strong>PayPal </strong>and <strong>Google Checkout</strong> guiding the developer throughout each step needed to correctly setup and manage these novice-unfriendly systems.</p>
<p>Even if many of these systems are well integrated in the WP e-Commerce plugin, requiring little effort for activation, i&#8217;ve found it a good choice to explain their functionality and every step to manage customers&#8217; payments since that&#8217;s the most painful task for every online store owner.</p>
<p>The last chapters of the book are devoted to an insight of the <strong>plugin&#8217;s commercial addon</strong> and to <strong>alternative plugins</strong>. These are usually less powerful systems than WP e-Commerce but may be useful if you just need to sell some simple items.</p>
<h3>Last Words</h3>
<p>Before reading this guide i would have never thought to WordPress as an e-Commerce CMS, but the in depth explanation of WP e-Commerce by Brian Bondani <strong>showed me how simple and powerful is this platform for <em>every-day stores</em></strong> compared to big and mind-expensive systems like ZenCart.</p>
<p>This makes the overall feeling about this guide as of the <strong><em>discover of a new world</em></strong>, making it a good reading not just for WordPress developers, but also for others looking for good and affordable ways to build and promote their online stores without having to deal with unneeded complexity.</p>
<p>You may tak check out the <strong><a href="http://www.packtpub.com/wordpress-2-9-e-commerce/book?utm_source=dwightjack.com&amp;utm_medium=link&amp;utm_content=blog&amp;utm_campaign=mdb_002982" target="_blank">guide</a> page at Packt Publishing</strong>, as well as the <strong><a href="https://www.packtpub.com/toc/wordpress-29-e-commerce-table-contents" target="_blank">Table of Contents</a></strong>. Then you may also take a closer look at contents by reading the <a href="https://www.packtpub.com/sites/default/files/8501_WordPress%202.9%20E-Commerce_SampleChapter_0.pdf" target="_blank"><strong>sample chapter</strong></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2010/07/13/review-wordpress-2-9-e-commerce-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the Bookshelf: WordPress 2.9 e-Commerce</title>
		<link>http://www.dwightjack.com/diary/2010/05/29/on-the-bookshelf-wordpress-2-9-e-commerce/</link>
		<comments>http://www.dwightjack.com/diary/2010/05/29/on-the-bookshelf-wordpress-2-9-e-commerce/#comments</comments>
		<pubDate>Sat, 29 May 2010 16:43:41 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=298</guid>
		<description><![CDATA[I know: someone may be horrified by the idea of using WordPress as an e-commerce system, but i think that given its user friendly backend interface and the amount of developers using it, it&#8217;d be a mistake not to learn something about the WP &#8220;e-commerce way&#8221;. The guide i&#8217;m introducing here, and which i&#8217;m currently [...]]]></description>
			<content:encoded><![CDATA[<p>I know: someone may be horrified by the idea of using WordPress as an e-commerce system, but i think that given its user friendly backend interface and the amount of developers using it, it&#8217;d be a mistake not to learn something about the WP &#8220;e-commerce way&#8221;.</p>
<p><a href="http://www.packtpub.com/wordpress-2-9-e-commerce/book?utm_source=dwightjack.com&amp;utm_medium=link&amp;utm_content=blog&amp;utm_campaign=mdb_002982" target="_blank"><img class="size-medium wp-image-300 alignright" style="float: right; margin-left: 10px;" title="WordPress 2.9 e-Commerce" src="http://www.dwightjack.com/diary/wp-content/uploads/2010/05/WordPress_2.9-243x300.jpg" alt="WordPress 2.9 e-Commerce" width="146" height="179" /></a>The guide i&#8217;m introducing here, and which i&#8217;m currently reading, is <strong><a href="http://www.packtpub.com/wordpress-2-9-e-commerce/book?utm_source=dwightjack.com&amp;utm_medium=link&amp;utm_content=blog&amp;utm_campaign=mdb_002982" target="_blank">WordPress 2.9 e-Commerce</a></strong> and explores the WordPress plugin<strong> <a href="http://getshopped.org/" target="_blank">WP e-Commerce</a></strong> which is for sure a good choice for a small shopping website.</p>
<p>The book is intended for WordPress developers, but i think it&#8217;d be a good reading for every developer which is sick of too complex and messed up solutions as Magento and Virtuemart.</p>
<p>If you&#8217;d like to know something more on the book, just stay tuned!</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2010/05/29/on-the-bookshelf-wordpress-2-9-e-commerce/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix role attribute in WordPress Search Widget</title>
		<link>http://www.dwightjack.com/diary/2010/03/12/fix-role-attribute-in-wordpress-search-widget/</link>
		<comments>http://www.dwightjack.com/diary/2010/03/12/fix-role-attribute-in-wordpress-search-widget/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 10:20:47 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=264</guid>
		<description><![CDATA[A quick and clean fix to make wordpress' default search widget valid by removing the role attribute in form tag.]]></description>
			<content:encoded><![CDATA[<p>While validating a WordPress theme, I&#8217;ve  noticed that the default search widget outputted a <strong><code>role</code></strong> HTML attribute in the form tag that wasn&#8217;t valid in the XHTML 1.0 specification:</p>
<pre><code>&lt;form role="search" method="get" id="searchform" action=""&gt;
[...]
&lt;/form&gt;</code>
</pre>
<p>As for the spec, <code>role</code> is an attribute introduced in XHTML draft for accessibility, <strong>but still not valid</strong>.</p>
<p>If you need valid documents, the fastest way to get rid of this attribute is to edit the <code>get_search_form()</code> function in <code>general-template.php</code> core file, but<strong> for better compatibility and safer future upgrades </strong>you can target the issue from your theme&#8217;s <code>functions.php</code> file by adding the following lines:</p>
<pre><code>function valid_search_form ($form) {
    return str_replace('role="search" ', '', $form);
}
add_filter('get_search_form', 'valid_search_form');</code></pre>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2010/03/12/fix-role-attribute-in-wordpress-search-widget/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Using multiple templates&#8217; overrides in Joomla 1.5 modules</title>
		<link>http://www.dwightjack.com/diary/2009/09/20/multiple-templates-overrides-joomla-modules/</link>
		<comments>http://www.dwightjack.com/diary/2009/09/20/multiple-templates-overrides-joomla-modules/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 18:00:48 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[template override]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=227</guid>
		<description><![CDATA[Step by step tutorial on adding a custom joomla module parameter type to apply different template's overrides on a module in a per-instance style with minumum hacks.]]></description>
			<content:encoded><![CDATA[<p>One of most usefull feature in Joomla 1.5 is the ability to quickly customize the HTML output of a module by using <strong>template overrides</strong> (see <a href="http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core" target="_blank">here</a> for details).</p>
<p>The only problem is that, once you have coded an override for a module, it&#8217;ll be used for all module&#8217;s instances within the CMS. The issue here is that you might want to output one module in a column as just a simple list of links AND in the main body as a content-rich table.</p>
<p>This problem can be addressed <strong>with a module hack and the addition of a new backend parameter type</strong> (for 1.5 native modules only), both in a system wide or module specific way . Here is a step by step tutorial:</p>
<h3>Adding a new parameter to the module</h3>
<p>Joomla 1.5 features a native way to add backend parameter types beside the <a href="http://docs.joomla.org/Standard_parameter_types" target="_blank">native ones</a>. In our case i&#8217;ve realized a new element (parameter) file which will look if a template override folder exists for the spefic module and, if found, will list all PHP files whose name is prefixed with &#8220;<code>custom_</code>&#8221; . You can download the file <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=14>here</a>.</p>
<p>Now you&#8217;ll need to place this file inside a folder called element, then open the .xml configuration file of the module and search for the <code>&lt;params&gt;</code> opening tag. Replace it with the following code (<code>YOURMODULENAME</code> is the module name):</p>
<pre><code>&lt;params addpath="/modules/mod_YOURMODULENAME/element"&gt;</code></pre>
<p>Now place the new parameter as the last child of the <code>&lt;params&gt;</code> tag:</p>
<pre><code>&lt;param name="template" type="customtemplates" modulename="mod_YOURMODULENAME" default="default" label="Custom template" description="Use this custom template file" /&gt;</code></pre>
<h3>Hacking the main PHP module file</h3>
<p>To make the module fully aware of the new template you choose, you need to pass the customtemplates paramenter to the static method which retrieves the template. For instance let&#8217;s say your <code>mod_mymodule.php</code> file has a line like this:</p>
<pre><code>require( JModuleHelper::getLayoutPath( 'mod_mymodule') );</code></pre>
<p>Now provide the <code>customtemplates</code> parameter by changing the line to:</p>
<pre><code>require( JModuleHelper::getLayoutPath( 'mod_mymodule',<span style="color: #ff0000;">$params-&gt;get('template','default')</span> ) );</code></pre>
<h3>Done!</h3>
<p>Untill no custom template&#8217;s overrides are found, the default template (default for the module or the default override if present) will be used. Once you&#8217;ll create a <code>custom_whatever.php</code> template file it&#8217;ll show up in the select list.</p>
<h3>Adding the new parameter system-wide</h3>
<p>By adding the parameter as a native-like parameter, you&#8217;ll be able to use it on all module without calling it in the &lt;params&gt; tag.</p>
<p>To add the paramenter system-wide you just have to place the <code>customtemplates.php</code> element in the /libraries/joomla/html/parameter/element folder. Since this is a custom element you shouldn&#8217;t have any problem on CMS upgrades.</p>
<h3>The drawback</h3>
<p>There&#8217;s a major drawback for this solution: since you are going to modify some module&#8217;s file you&#8217;ll need to keep a copy of them to prevent future upgrades from removing your changes (and breaking your template).</p>
<h3>Further readings</h3>
<p>Joomla has a really flexible parameter system, underused by many developers. Here are a couple of further reading to understand how parameters can help your everyday Joomla coding:</p>
<ul>
<li><a href="http://docs.joomla.org/Component_parameters#Types_of_Component_parameter" target="_blank">Joomla Docs: Component parameters</a></li>
<li><a href="http://www.teachmejoomla.net/code/joomla-1.5/joomla-php-developer-extending-config.xml-with-plugins.html" target="_blank">Joomla PHP: extending config.xml with plugins</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/09/20/multiple-templates-overrides-joomla-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CRUDités: PHP5 class for MySQL database</title>
		<link>http://www.dwightjack.com/diary/2009/07/07/crudites-php5-class-for-mysql-database/</link>
		<comments>http://www.dwightjack.com/diary/2009/07/07/crudites-php5-class-for-mysql-database/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 07:00:05 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[CRUDités]]></category>
		<category><![CDATA[ezSQL]]></category>
		<category><![CDATA[MySQL class]]></category>
		<category><![CDATA[PHP database class]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=203</guid>
		<description><![CDATA[CRUDités is a set of handy methods to quickly manage many operations of writing, storing and deleting from and to MySQL databases]]></description>
			<content:encoded><![CDATA[<p>Even if nowadays many web developers prefer to use Frameworks such as Zend, CakePHP or CodeIgniter, we often have small coding tasks to do, that aren&#8217;t worth the cost of deploying a whole application structure.</p>
<h3>ezSQL</h3>
<p>When dealing with MySQL databases, one of the most used PHP class is <a href="http://www.woyano.com/jv/ezsql" target="_blank"><strong>ezSQL</strong></a>, by Justin Vincent. If you&#8217;ve never listen about it, just think that a slightly modified version of this class is used as the core of <strong>WordPress database library</strong>, and every time you query the database for a post, ezSQL comes in action.</p>
<p>Despite its effectiveness, ezSQL development seems to have stopped to version 2.04.</p>
<p>Since in my projects i often use this class to work with MySQL databases,<strong> i&#8217;ve written a small extension to the ezSQL_MySQL adapter</strong> to add shortcuts and more efficient functionalities to make further easier to manage databases&#8217; data with PHP. Here you are <strong>CRUDités</strong>.</p>
<h3>CRUDités: MySQL appetizer</h3>
<p><a title="CRUDités Homepage" href="http://www.dwightjack.com/projects/crudites/" target="_blank"><img class="alignright size-full wp-image-206" style="float:right;margin-left:10px" src="http://www.dwightjack.com/diary/wp-content/uploads/2009/07/logo.png" alt="CRUDités Logo" width="240" height="81" /></a></p>
<p><em>Crudités</em> are traditional French appetizers comprising sliced or whole raw vegetables. As of its name, CRUDités is just a set of <strong>handy methods</strong> to quickly manage many operations of writing, storing and deleting from and to MySQL databases.</p>
<p>Aside from the basic ezSQL methods, it adds some methods to <strong>build MySQL queries from strings and data arrays</strong>, new methods to retrieve datas from columns and rows, some utility methods and a whole <strong>new table binding system</strong>, to store table&#8217;s fields and quickly update and store new datas.<br />
For example you&#8217;ll be able to query a database and get a resulting array of rows just with this code:</p>
<pre><code>$rows = $db-&gt;get_data(array(
      'select' =&gt; 'id,name,surname',
      'from' =&gt; 'customer_names'
));
</code></pre>
<p>You can get more informations about the project by visiting its <strong><a href="http://www.dwightjack.com/projects/crudites/" target="_blank">main page</a></strong>, or you can directly download the class file by clicking here: <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=12>CRUDités (13.5 kB)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/07/07/crudites-php5-class-for-mysql-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Update: Use MooTools v1.2.x in Joomla! 1.5</title>
		<link>http://www.dwightjack.com/diary/2009/06/07/use-mootools-122-in-joomla-15/</link>
		<comments>http://www.dwightjack.com/diary/2009/06/07/use-mootools-122-in-joomla-15/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 14:39:40 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=167</guid>
		<description><![CDATA[This is an updated version of the code to switch Mootools from 1.11 to 1.2 in Joomla 1.5]]></description>
			<content:encoded><![CDATA[<p>Since i&#8217;ve fixed some bugs and issues on the files to switch core MooTools v1.11 to v1.2.x and following the release of version <span style="text-decoration: line-through;">1.2.2</span> 1.2.3 of <strong>MooTools Core and More</strong>, i&#8217;m posting here an updated version of<a title="Upgrade Mootools to v1.2.x in Joomla! 1.5" href="http://www.dwightjack.com/diary/2009/02/23/upgrade-mootools-to-v12x-in-joomla-15/"> <strong>this workaround</strong></a> to which you could refer for details on how this code works.</p>
<p>Changes in this new version are:</p>
<ol>
<li>Updated MooTools Core to<span style="text-decoration: line-through;"> <strong>1.2.2</strong></span><strong> 1.2.3</strong> and MooTools More to<span style="text-decoration: line-through;"> </span><strong><span style="text-decoration: line-through;">1.2.2.2</span> 1.2.3.1<br />
 </strong></li>
<li>Added <code>.getValue()</code> to the compatibility file</li>
<li>Added <code>.getSelected()</code> to the compatibility file to fix some issues under IE</li>
<li>Added <code>Json</code> support to the compatibility file</li>
<li>Added <code>window.onDomReady</code> shortcut for DOM ready event</li>
<li>Changed <code class="php">MY_Behavior::mootoolsFix();</code> to handle new MooTools files <code class="php"></code></li>
<li>Changed <code class="php">MY_Behavior::mootoolsFix();</code> to correctly render old tooltips format <code>title::text</code> for items with <code>hasTip</code> class (anyway, remember that classes to style the tooltip <a href="http://mootools.net/docs/more/Interface/Tips#Tips:constructor" target="_blank">have changed</a>!)</li>
<li><span style="text-decoration: line-through;">Added a <strong>validate.js</strong> replacement to fix an issue with <a href="http://www.dwightjack.com/diary/2009/02/23/upgrade-mootools-to-v12x-in-joomla-15/comment-page-1/#comment-167" target="_blank">changed namespaces</a>.</span> ( this replacement is no more needed)<span style="text-decoration: line-through;"><br />
 </span></li>
</ol>
<p>The source code is released in the form of patch: unzip it and upload files in your Joomla root, eventually overwriting files. MooTools library is uncompressed to allow for a quicker debug. Anyway you may minify it with your tool of choice.</p>
<p><span style="text-decoration: line-through;">Here is the code: <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=10>Mootools 1.11 to 1.2.2 (71.68 kB)</a></span></p>
<p><strong>Update (again):</strong> Sometimes i can&#8217;t get if MooTools team is too vital or library milestones are not well defined&#8230; anyway here is an update to use <strong>latest MooTools</strong><strong> 1.2.3</strong>. No major changes have been made to the fix library, anyway keep reporting compatibility issues. Here is the zipped  file: <span style="text-decoration: line-through;"><a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=13>Mootools 1.11 to 1.2.3 for Joomla 1.5 (72.06 kB)</a></span></p>
<p><strong>Update (09/20/09): </strong>New version available. Corrected some bugs in the compatibility file and added a loop check to replace MooTools 1.11 when called from a component as custom script. Now the validation core script doesn&#8217;t need to be replaced. Get source here (carries the original validate.js as in Joomla 1.5.14:  <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=15>MooTools 1.11 to 1.2.x (72.88 kB)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/06/07/use-mootools-122-in-joomla-15/feed/</wfw:commentRss>
		<slash:comments>63</slash:comments>
		</item>
		<item>
		<title>Joomla 1.5: Filter mambots and plugins&#8217; codes in PDF and print view</title>
		<link>http://www.dwightjack.com/diary/2009/05/19/joomla-filter-mambots-and-plugins-codes-in-pdf-print-view/</link>
		<comments>http://www.dwightjack.com/diary/2009/05/19/joomla-filter-mambots-and-plugins-codes-in-pdf-print-view/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:28:36 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[com_content]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[joomla plugin]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=156</guid>
		<description><![CDATA[Here is an effective and hack-free way to remove mambots and plugins' codes from your content in PDF and print view.]]></description>
			<content:encoded><![CDATA[<p>One of the coolest feature in Joomla content editor is the ability to insert specific modules&#8217; position whereaver you want. This is particularly usefull to load  inline banners or to add quick polls to an article/page just by inserting <code>{loadposition mypostion}</code> in your editor textarea.</p>
<p>In Joomla 1.5.x everything works fine when viewing the page as HTML, but in <strong>PDF and print friendly format</strong> view these shortcodes aren&#8217;t converted nor removed. Moreover displaying these contents could be unnecessary or unwanted.</p>
<p>This problem arise because in pdf and print view files in Joomla <code>com_content</code> component not all content plugins (those addons called <em>mambots</em>) are loaded. In PDF view file <code>components/com_content/views/article/view.pdf.php</code> there&#8217;s just one plugin (called <em>image</em>) loaded before the content is outputted (lines 68 -69):</p>
<pre><code>JPluginHelper::importPlugin('content', 'image');
$dispatcher-&gt;trigger('onPrepareContent', array (&amp; $article, &amp; $params, 0));</code></pre>
<h3>The (dirty) solution</h3>
<p>From a quick glance in the <code>plugins/content</code> folder i&#8217;ve noticed that there&#8217;s no any <code>image.php</code> plugin  file in a clean Joomla 1.5.10 installation. So i&#8217;ve decided to use this <em>hole</em> and create a custom plugin to clean my content without messing up the core <code>com_content</code> code.</p>
<p>After installing the plugin and activating it you are given (at the moment) two options:</p>
<ul>
<li> a radio to clean loadposition code (defaults to <code>Yes</code>)</li>
<li>a textarea for typing custom regular expressions (one per line).</li>
</ul>
<p>In this last field remember to omit backslashes (/) instead write curly brackets, for example <code>{code\s*[a-zA-Z]}</code></p>
<p>Here is the package for download: <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=8>plg_image (clean plugins code) (1.79 kB)</a></p>
<p>As always feedbacks and suggestions are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/05/19/joomla-filter-mambots-and-plugins-codes-in-pdf-print-view/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fixing PDF button error with SEF in Joomla 1.5</title>
		<link>http://www.dwightjack.com/diary/2009/04/17/fixing-pdf-button-error-sef-joomla/</link>
		<comments>http://www.dwightjack.com/diary/2009/04/17/fixing-pdf-button-error-sef-joomla/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 15:59:43 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[SH404SEF]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=143</guid>
		<description><![CDATA[One of the weirdest error in Joomla 1.5 is that just turning SEF on makes PDF button stop working in content articles.
This happens with both system and 3rd party components.]]></description>
			<content:encoded><![CDATA[<p>One of the weirdest error in Joomla 1.5 is that just turning SEF on makes PDF button stop working in content articles.<br />
This happens with both system and 3rd party components.</p>
<p>I&#8217;ve recently digged the problem and found that this could be related (kinda randomly) to a bunch of problems and conflicts with other Joomla feature (such as system cache).</p>
<p>In my own projects im using right now <strong>SH404SEF</strong> as SEF component and i&#8217;ve found it&#8217;s a really good piece of software, so here is a recap of the fix/patch for the problem.</p>
<p>First of all <a href="http://extensions.siliana.com/en/Table/sh404SEF-and-url-rewriting/" target="_blank">upgrade SH404</a> to the latest release by downloading it from <a href="http://joomlacode.org/gf/project/sh404sef/frs/" target="_blank">JoomlaCode</a>.</p>
<p>Now open <code>custom.sef.php</code> in <code>administrator/components/com_sh404sef/</code> and search for a line containing:</p>
<pre><code>$shDefaultParams['sh404SEF_PROTECT_AGAINST_DOCUMENT_TYPE_ERROR'] = 0;</code></pre>
<p>and set the paramenter to 1:</p>
<pre><code>$shDefaultParams['sh404SEF_PROTECT_AGAINST_DOCUMENT_TYPE_ERROR'] = 1;</code></pre>
<p>If this line is not present then add it at the end of the file.</p>
<p>Now go to the backend panel in Joomla and purge all SEF url by<em><strong>:</strong></em><strong><em><br />
Components -&gt; SH404SEF -&gt; Purge SEF Urls<br />
</em></strong>then clear the cache by:<br />
<strong><em>Tools -&gt; Clean Cache</em></strong></p>
<p>This will clear all current URLs, so that SH404SEF has to recreate them, anyway your PDF button should work again and the PDF URLs should be as the HTML one with an ending parameter <code>?format=pdf</code>.</p>
<p>Source: <a href="http://extensions.siliana.com/forums/index.php?topic=9509.0" target="_blank">http://extensions.siliana.com/forums/index.php?topic=9509.0</a></p>
<p><em>Note: As a side effect you shouldn&#8217;t problably be able to use the pdf folder feature to store custom PDFs!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/04/17/fixing-pdf-button-error-sef-joomla/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

