<?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>My Quick Fix &#187; Web Development</title>
	<atom:link href="http://myquickfix.co.uk/index.php/category/computers/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://myquickfix.co.uk</link>
	<description>Quick fixes for niggly problems...</description>
	<lastBuildDate>Thu, 24 Sep 2009 15:10:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Swap days and months in PHP &#8211; quick and dirty MM/DD/YY to DD/MM/YY.</title>
		<link>http://myquickfix.co.uk/index.php/2009/09/swap-days-and-months-in-php-quick-and-dirty-mmddyy-to-ddmmyy/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/09/swap-days-and-months-in-php-quick-and-dirty-mmddyy-to-ddmmyy/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 15:10:50 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=580</guid>
		<description><![CDATA[Problem
I have a ton of date strings in the stupid US style dd/mm/yy format. i.e. 12/24/09 being 24th September 2009. I need to convert them to the UK style dd/mm/yy.
Solution 1
As a string in PHP is really just an array of characters, the simplest fix was to address the individual number characters by their positions within the sting, and rearrange them into the format I wanted:

$d = "12/24/09";
$d = $d[3].$d[4]."/".$d[0].$d[1]."/".$d[6].$d[7];
echo $d; // displays "24/12/19".

Solution 2
I posted my solution on twitter (@hutchings) and asked for comments and @londonhackspace organiser Jonty came ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>I have a ton of date strings in the stupid US style dd/mm/yy format. i.e. 12/24/09 being 24th September 2009. I need to convert them to the UK style dd/mm/yy.</p>
<h2>Solution 1</h2>
<p>As a string in PHP is really just an array of characters, the simplest fix was to address the individual number characters by their positions within the sting, and rearrange them into the format I wanted:</p>
<pre name="code" class="php">
$d = "12/24/09";
$d = $d[3].$d[4]."/".$d[0].$d[1]."/".$d[6].$d[7];
echo $d; // displays "24/12/19".
</pre>
<h2>Solution 2</h2>
<p>I posted my solution on twitter (@hutchings) and asked for comments and @londonhackspace organiser Jonty came back with the following elegant (and much cleverer) suggestion:</p>
<pre name="code" class="php">
$d = "12/24/09";
$d = preg_replace('|(\d+)/(\d+)/(\d+)|', '$2/$1/$3', $d);
echo $d; // displays "24/12/19".
</pre>
<p>So provided you know that your original string is in US format, both these solutions can be used. In my testing I found solution 1 executed more quickly, but isn&#8217;t as pleasing to look at <img src='http://myquickfix.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Cheers Jonty.</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/09/swap-days-and-months-in-php-quick-and-dirty-mmddyy-to-ddmmyy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot set alpha on dynamic text in Flash / ActionScript 2</title>
		<link>http://myquickfix.co.uk/index.php/2009/08/cannot-set-alpha-on-dynamic-text-in-flash-actionscript-2/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/08/cannot-set-alpha-on-dynamic-text-in-flash-actionscript-2/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 22:16:21 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[dynamic]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=578</guid>
		<description><![CDATA[Problem
I&#8217;m doing some freelance Flash development, and it&#8217;s been a while. I have just created a dynamic text field that I wanted to fill via actionscript, then fade in via an alpha tween. This wasn&#8217;t working, even if I set _alpha = 0 on the movieclip containing the text field.
Solution
You can only set _alpha on a Dynamic Text field if the font has been embeded (with the embed button).
Works now! wohoo! Simple stuff that I&#8217;ve known in the past, but forgot.
]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>I&#8217;m doing some freelance Flash development, and it&#8217;s been a while. I have just created a dynamic text field that I wanted to fill via actionscript, then fade in via an alpha tween. This wasn&#8217;t working, even if I set _alpha = 0 on the movieclip containing the text field.</p>
<h2>Solution</h2>
<p>You can only set _alpha on a Dynamic Text field if the font has been embeded (with the embed button).</p>
<p>Works now! wohoo! Simple stuff that I&#8217;ve known in the past, but forgot.</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/08/cannot-set-alpha-on-dynamic-text-in-flash-actionscript-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&quot;JFolder::create: Could not create directory&quot; error in Joomla 1.5.* on IIS.</title>
		<link>http://myquickfix.co.uk/index.php/2009/07/jfolder-create-could-not-create-directory/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/07/jfolder-create-could-not-create-directory/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 09:46:14 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[temporary]]></category>
		<category><![CDATA[tmp]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=552</guid>
		<description><![CDATA[Problem
When trying to add a Plugin, Component or Module in Joomla&#8217;s Extension Manager, you might get the following error:
JFolder::create: Could not create directory
Warning! Failed to move file.
Shown here:

This is likely &#8211; but not definitely &#8211; to be after the site has been moved from location to another, a change of directory, or server.
Solution
When a Component, Plugin or Module is added, the Joomla system attempts to copy the installable zip to a temporary directory, called &#8216;tmp&#8216;. From there, PHP extracts the files and installs them. The error above usually occurs for ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>When trying to add a Plugin, Component or Module in Joomla&#8217;s Extension Manager, you might get the following error:</p>
<p><span style="color: #ff0000;">JFolder::create: Could not create directory<br />
Warning! Failed to move file.</span></p>
<p>Shown here:</p>
<p><img class="size-full wp-image-551 alignnone" title="Error showing in extension manager" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/07/joomla-Jfolder1.png" alt="Error showing in extension manager" width="300" height="300" /></p>
<p>This is likely &#8211; but not definitely &#8211; to be after the site has been moved from location to another, a change of directory, or server.</p>
<h2>Solution</h2>
<p>When a Component, Plugin or Module is added, the Joomla system attempts to copy the installable zip to a temporary directory, called &#8216;<strong>tmp</strong>&#8216;. From there, PHP extracts the files and installs them. The error above usually occurs for one or more of the following reasons (in order of likelihood):</p>
<p><strong>The path to the &#8216;tmp&#8217; directory is wrong in the Joomla configuration file</strong></p>
<p>In the Joomla installation root, find the file called &#8216;configuration.php&#8217;. In this file there should be a line with that says something like:</p>
<p><em>var $tmp_path = &#8216;C:\\path\\to\\your\\cms\\tmp&#8217;;</em></p>
<p>A masked live example is shown here:</p>
<p><img class="alignnone size-full wp-image-550" title="Correct path to tmp directory" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/07/joomla-Jfolder2.png" alt="Correct path to tmp directory" width="450" height="200" /></p>
<p>Check that this path is correct, and that the &#8216;tmp&#8217; directory truly does sit in that location. In this example, the directory would need to be here: d<em>:\clients\sites\[my client]\tmp.</em></p>
<p><strong>The temporary exists, but is not &#8216;writable&#8217;</strong></p>
<p>If the &#8216;tmp&#8217; directory has the wrong permissions, the web service won&#8217;t be able to copy the installer files to it. To check/correct this you will need  access to the server physically, or via a remote admin method like <a href="http://en.wikipedia.org/wiki/Remote_Desktop_Protocol">RDP</a> (terminal services), <a href="http://en.wikipedia.org/wiki/Vnc">VNC</a> or similar.</p>
<p>Find the &#8216;tmp&#8217; directory in the web root, and view the permissions. The IIS Guest account, called &#8216;IUSR_[machinename]&#8216;, needs to be given &#8216;modify&#8217; privileges. Example shown below:</p>
<p><img class="alignnone size-full wp-image-566" title="giving IUSR account modify permissions" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/07/joomla-Jfolder3.png" alt="giving IUSR account modify permissions" width="368" height="474" /></p>
<p><strong>The temporary directory doesn&#8217;t exist</strong></p>
<p>To check this, navigate to your web root (often wwwroot) and check that a directory called &#8216;<strong>tmp</strong>&#8216; exists. This directory should have been created when the Joomla was installed, but it&#8217;s conceivable that it might have been deleted&#8230; maybe? If it doesn&#8217;t exist, create it, and make sure its &#8216;writable&#8217; (see previous step).</p>
<p>If none of this works, or you spot a mistake,  post a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/07/jfolder-create-could-not-create-directory/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Set space between list item and bullet (HTML, CSS)&#8230;</title>
		<link>http://myquickfix.co.uk/index.php/2009/06/set-space-between-list-item-and-bullet-html-css/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/06/set-space-between-list-item-and-bullet-html-css/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 10:07:03 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=372</guid>
		<description><![CDATA[Problem
I&#8217;ve just had to convert a photoshop visual to a wordpress template. The designer wanted a bulleted list where the bullets themselves were very close to the list items, and were small dashes. Cross browser support for list item and bullet styling is ropey at best, and to make things perfect I&#8217;d have to resort to browser specific styles.
Solution
The solution I think I&#8217;ll be using for the rest of my &#8216;web&#8217; career will be this. JUST FORGET THE BULLET ITEM, and use positioned background images instead.
In the stylesheet, add styles ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>I&#8217;ve just had to convert a photoshop visual to a wordpress template. The designer wanted a bulleted list where the bullets themselves were very close to the list items, and were small dashes. Cross browser support for list item and bullet styling is ropey at best, and to make things perfect I&#8217;d have to resort to browser specific styles.</p>
<h2>Solution</h2>
<p>The solution I think I&#8217;ll be using for the rest of my &#8216;web&#8217; career will be this. JUST FORGET THE BULLET ITEM, and use positioned background images instead.</p>
<p>In the stylesheet, add styles for both the &#8216;ul&#8217; tag, and the &#8216;li&#8217; tag like so (explanations inline):</p>
<pre class="css">ul {
margin-left:0px; /* Set the indenting back to far left. */
padding-left:0px; /* Set the indenting back to far left. */
}

ul li {
list-style-type:none; /* Switch the list bullet off altogether. */
background-image:url(dashbullet.gif); /* The replacement bullet image */
background-position:0px 4px; /* Place bullet 0px from left and 4px from top */
background-repeat:no-repeat; /* Stops bullet tiling, important */
padding-left:7px; /* separation from li txt and bullet */
}</pre>
<p>Then just create the list as you usually would, with &#8216;ul&#8217; and &#8216;li&#8217; tags. Here&#8217;s what it looks like in use:</p>
<div id="attachment_400" class="wp-caption aligncenter" style="width: 210px"><img class="size-full wp-image-400" title="Fixed css image bullets" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/06/list-fix.gif" alt="Example of image bullet in use" width="200" height="150" /><p class="wp-caption-text">Example of image bullet in use</p></div>
<p>Here&#8217;s a bit more detail so you can get your head around the spacing. It&#8217;s incredibly simple, but still, nice to have a diagram or two sometimes.</p>
<div id="attachment_401" class="wp-caption aligncenter" style="width: 410px"><img class="size-full wp-image-401" title="Fixed css image bullets - detail" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/06/list-fix-detail.gif" alt="Detail showing some dimensions and spacing" width="400" height="174" /><p class="wp-caption-text">Detail showing some dimensions and spacing</p></div>
<p>This style works perfectly (by my testing, but I&#8217;m not perfect) on:</p>
<ul>
<li>Internet Explorer 6, 7 &amp; 8+</li>
<li>Firefox 2.*+</li>
<li>Opera 9+ (not tested 8, but bet it works!</li>
<li>Google Chrome (all versions)</li>
<li>Safari (Mac and PC versions)</li>
</ul>
<div>Any problems, please post a question or comment below.</div>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/06/set-space-between-list-item-and-bullet-html-css/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick &#039;Lorem Ipsum&#039; plugin / extension for IE</title>
		<link>http://myquickfix.co.uk/index.php/2009/04/lorem-ipsum-ie/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/04/lorem-ipsum-ie/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 12:09:16 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Registry]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=334</guid>
		<description><![CDATA[Problem
While doing web development, I frequently need to insert lorem ipsum into a text field or textarea. To do this &#8211; bearing in mind that I don&#8217;t really like or use bookmarks, too messy &#8211; I tend to google &#8220;lorem ipsum&#8221;, hit lipsum.com, select/copy the block of text, and then return to my form field and paste it.
I wanted a quicker solution, and as I find myself using IE more and more to develop in now (thanks to the excellent &#8216;Developer Tools&#8217; extension &#8211; never thought I&#8217;d say that!) my lorem ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>While doing web development, I frequently need to insert <a title="Lorem Ipsum explanation" href="http://en.wikipedia.org/wiki/Lorem_ipsum" target="_blank">lorem ipsum</a> into a text field or textarea. To do this &#8211; bearing in mind that I don&#8217;t really like or use bookmarks, too messy &#8211; I tend to google &#8220;lorem ipsum&#8221;, hit <a href="http://www.lipsum.com/">lipsum.com</a>, select/copy the block of text, and then return to my form field and paste it.</p>
<p>I wanted a quicker solution, and as I find myself using IE more and more to develop in now (thanks to the excellent &#8216;Developer Tools&#8217; extension &#8211; never thought I&#8217;d say that!) my lorem ipsum fix would have to be in the form of an IE toolbar button or menu item.</p>
<h2>Solution</h2>
<p>It turns out that adding a simple javascript based text field filler option to a context menu is really easy, so that&#8217;s what I did. Here are the steps:</p>
<p><strong>Firstly:</strong> Create the javascript to access the currently focused field, and insert the lorem ipsum text. Create a new html file in a location of your choice &#8211;  I used C:\Program Files\Internet Explorer\Plugins &#8211; and copy the following code into it:</p>
<pre name="code" class="js">&lt;script language="JavaScript"&gt;
var parentwin = external.menuArguments;
var doc = parentwin.document;
var rng = doc.selection.createRange();
rng.text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi \
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit \
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur \
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt \
mollit anim id est laborum.";
&lt;/script&gt;</pre>
<p>Save the file as loremipsum.htm.</p>
<p><strong>Secondly:</strong> Create the registry entry for the menu item:</p>
<ol>
<li>Open/run &#8216;regedit&#8217; (Start &gt; run&#8230; &gt; &#8220;regedit&#8221; &gt; &#8216;Ok&#8217;)</li>
<li>Use the tree to navigate to:<br />
<em>HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt</em><br />
using the tree view on the left of the Registry Editor.</li>
<li>Create a new key (Right click, &#8220;New&#8221; &gt; &#8220;Key&#8221;) and call it &#8220;Lorem Ipsum&#8221; or anything you like.</li>
<li>Inside the new key, open the &#8216;default&#8217; string value that&#8217;s already there (double click on it), and enter the path to the script you created just now. i.e. <em>C:\Program Files\Internet Explorer\Plugins\loremipsum.htm </em></li>
<li>Now create a new DWORD value (Right click, &#8220;New&#8221; &gt; &#8220;DWORD Value&#8221;) and rename it &#8220;Contexts&#8221;. Set the value to 0&#215;04 (hex) or 4 (decimal). <a title="Microsofts info on Contexts values" href="http://msdn.microsoft.com/en-us/library/aa753589.aspx" target="_blank">Here&#8217;s</a> an explanation of the different values.</li>
</ol>
<div id="attachment_365" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-365" title="lorem-reg" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/04/lorem-reg.png" alt="The new Key and values in RegEdit" width="500" height="250" /><p class="wp-caption-text">The new Key and values in RegEdit</p></div>
<p>That&#8217;s it! Now open IE, find a textarea or text field, right click, and you should see something like this:</p>
<div id="attachment_368" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-368" title="lorem-action" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/04/lorem-action.png" alt="Note the new highlighted option in the context menu" width="500" height="246" /><p class="wp-caption-text">Note the new highlighted option in the context menu</p></div>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/04/lorem-ipsum-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing JCE &#039;Browse&#039; path (File Directory Path)</title>
		<link>http://myquickfix.co.uk/index.php/2009/01/changing-jce-browse-path-file-directory-pathdirectory-path/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/01/changing-jce-browse-path-file-directory-pathdirectory-path/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 14:33:02 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[JCE]]></category>
		<category><![CDATA[joomla 1.5]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=309</guid>
		<description><![CDATA[Problem
A coleague wanted to change the default &#8216;browse&#8217; path that the JCE &#8216;Image Manager&#8217; and &#8216;File Browser&#8217; plugins use. By default when you use the plugins, the contents of the &#8216;Stories&#8217; directory will be displayed. It seems that even if you go into the plugin settings ( under &#8216;Components &#62; JCE Administration &#62; Plugins &#62; [plugin name]&#8216; ), and set the &#8216;File Directory Path&#8217; setting, it still doesn&#8217;t change the default path!
Solution
Navigate to Components &#62; JCE Administration &#62; Groups as shown below:
Choose Groups from the main menu...
Then select the group you want ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>A coleague wanted to change the default &#8216;browse&#8217; path that the JCE &#8216;Image Manager&#8217; and &#8216;File Browser&#8217; plugins use. By default when you use the plugins, the contents of the &#8216;Stories&#8217; directory will be displayed. It seems that even if you go into the plugin settings ( under &#8216;Components &gt; JCE Administration &gt; Plugins &gt; [plugin name]&#8216; ), and set the &#8216;File Directory Path&#8217; setting, it still doesn&#8217;t change the default path!</p>
<h2>Solution</h2>
<p>Navigate to <strong>Components &gt; JCE Administration &gt; Groups</strong> as shown below:</p>
<div id="attachment_310" class="wp-caption aligncenter" style="width: 310px"><img class="size-full wp-image-310" title="jce-groups" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/01/jce-groups.gif" alt="" width="300" height="240" /><p class="wp-caption-text">Choose Groups from the main menu...</p></div>
<p>Then select the group you want to edit. If you haven&#8217;t set up any groups, just click on the &#8216;Default&#8217; group to edit it&#8217;s properties. Once the settings are on display, from the right-hand side, under the &#8216;Editor Parameters&#8217; heading, expand the &#8216;Plugin Options&#8217; item, and enter your desired path in &#8216;File Directory Path&#8217;:</p>
<p> </p>
<div id="attachment_311" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.myquickfix.co.uk/wp-content/uploaded/2009/01/jce-groups-path.gif"><img class="size-full wp-image-311" title="jce-groups-path" src="http://www.myquickfix.co.uk/wp-content/uploaded/2009/01/jce-groups-path.gif" alt="Note: this must not be set to the Joomla root" width="300" height="240" /></a><p class="wp-caption-text">Note: this must not be set to the Joomla root</p></div>
<p><strong>Note:</strong> The path you enter must be at least one level above the Joomla! root. i.e [root]/myimages/.</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/01/changing-jce-browse-path-file-directory-pathdirectory-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving VirtueMart: Link path problem in admin console</title>
		<link>http://myquickfix.co.uk/index.php/2009/01/moving-virtuemart-link-path/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/01/moving-virtuemart-link-path/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 11:07:59 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[VirtueMart]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=301</guid>
		<description><![CDATA[Problem
Just now, I needed to move a website running Joomla 1.5 and VirtueMart 1.1.2 from the development server, to the live web space. After I had moved the data, and the files, and updated the path in Joomla&#8217;s &#8216;configuration.php&#8217; file, it seemed to work ok, but all the links in the VirtueMart Admin area still pointed to my development server.
Solution
After doing a &#8216;find in files&#8217; for my development server&#8217;s name, I found two more paths that need changing in VirtueMart&#8217;s own configuration file. This is the file:
/administrator/components/com_virtuemart/virtuemart.cfg.php
The following two paths ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>Just now, I needed to move a website running Joomla 1.5 and VirtueMart 1.1.2 from the development server, to the live web space. After I had moved the data, and the files, and updated the path in Joomla&#8217;s &#8216;configuration.php&#8217; file, it seemed to work ok, but all the links in the VirtueMart Admin area still pointed to my development server.</p>
<h2>Solution</h2>
<p>After doing a &#8216;find in files&#8217; for my development server&#8217;s name, I found two more paths that need changing in VirtueMart&#8217;s own configuration file. This is the file:</p>
<blockquote><p>/administrator/components/com_virtuemart/virtuemart.cfg.php</p></blockquote>
<p>The following two paths need editing to point to the new server location (URL):</p>
<pre name="code" class="php">
define( 'URL', 'http://my.devserver.com/joomla/' );
define( 'SECUREURL', 'https://secure.devserver.com/joomla/' );
</pre>
<p>A simple fix, but probably worth posting.</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/01/moving-virtuemart-link-path/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Select template by Section in Joomla 1.5</title>
		<link>http://myquickfix.co.uk/index.php/2009/01/select-template-by-sectiocategory-in-joomla-15/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/01/select-template-by-sectiocategory-in-joomla-15/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 23:27:16 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[joomla 1.5]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=281</guid>
		<description><![CDATA[Problem
In Joomla 1.5, at present, there is no way to set the template applied to an article or category  based on the section that article is in. Templates can be set by menu item, but not by the overall section they reside in. This means that if multiple templates are being used, each time a new article is added, changes have to be made to the template setup too &#8211; very tedious. All I wanted was to be able to create an article or category, add it to a certain ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>In Joomla 1.5, at present, there is no way to set the template applied to an article or category  based on the section that article is in. Templates can be set by menu item, but not by the overall section they reside in. This means that if multiple templates are being used, each time a new article is added, changes have to be made to the template setup too &#8211; very tedious. All I wanted was to be able to create an article or category, add it to a certain section, and know that it would be rendered/displayed using a particular template:</p>
<h2>Solution</h2>
<p>This took some searching and tweaking. I found a post in the Joomla developers forum about someone trying to do something similar, but their example code was broken. It was enough to get me started though.</p>
<p>What you need to do is: find and open application.php in the includes directory on the root of your Joomla 1.5 installation. Then find line 309 or thereabouts and look for this code:</p>
<blockquote><p><span style="color: #999999;">309</span> <span style="color: #ee7700;">// Allows for overriding the active template from the request</span><br />
<span style="color: #999999;">310</span> <span style="color: #0000ff;">$template = JRequest::getCmd(&#8216;template&#8217;, $template);</span><br />
<span style="color: #999999;">311</span> <span style="color: #0000ff;">$template = JFilterInput::clean($template, &#8216;cmd&#8217;);</span> <span style="color: #ee7700;">// need to filter the default value as well</span></p></blockquote>
<p>Insert <strong>AFTER</strong> the comment on line 309, but <strong>BEFORE</strong> line 310, add this code:</p>
<blockquote><p><span style="color: #ee7700;">// Templates by Section hack &#8211; Begin</span></p>
<p><span style="color: #0000ff;">$eItemView = JRequest::getVar(&#8216;view&#8217;);<br />
$eItemId = JRequest::getVar(&#8216;id&#8217;);</span></p>
<p><span style="color: #0000ff;">$sectionId = NULL;</span></p>
<p><span style="color: #0000ff;">$eItemId = (strpos($eItemId,&#8221;:&#8221;))? substr($eItemId,0,strpos($eItemId,&#8221;:&#8221;)) : $eItemId;</span></p>
<p><span style="color: #0000ff;">switch ($eItemView) {<br />
case &#8220;article&#8221;:<br />
$edb =&amp; JFactory::getDBO();<br />
$eQuery = &#8216;SELECT sectionid FROM #__content WHERE id LIKE &#8216;.$eItemId.&#8221;;<br />
$edb-&gt;setQuery($eQuery, 0, 1);<br />
$sectionId = $edb-&gt;loadResult();<br />
break;<br />
case &#8220;category&#8221;:<br />
$edb =&amp; JFactory::getDBO();<br />
$eQuery = &#8216;SELECT section FROM #__categories WHERE id LIKE &#8216;.$eItemId.&#8221;;<br />
$edb-&gt;setQuery($eQuery, 0, 1);<br />
$sectionId = $edb-&gt;loadResult();<br />
break;<br />
case &#8220;section&#8221;:<br />
$sectionId = $eItemId;<br />
break;<br />
}</span></p>
<p><span style="color: #ee7700;">// Edit the section id below, you can find it in the sections admin area.</span><br />
<span style="color: #0000ff;">if ($sectionId == &#8220;1&#8243;) {<br />
$template = &#8220;rhuk_milkyway_red&#8221;; <span style="color: #ee7700;">// Use the full template name.</span><br />
}</span><br />
<span style="color: #ee7700;">// Add more if clauses if there are other templates.</span></p>
<p><span style="color: #ee7700;">// Templates by Section hack &#8211; End</span></p></blockquote>
<p>Hopefully you can see what this does. It looks for the section id to use in 3 ways, depending on whether joomla is currently displaying a section root page, a category root page, or an article. It then looks to see whether that section id has had a specific template specified for it by name.</p>
<p>This hack works well for me, I only need to add the different template data once in application.php for a given site. Ideally someone needs to make an admin mod for this, so that sections and categories can be assigned different templates in the backend. Maybe one day I&#8217;ll make one, but not unless there&#8217;s demand <img src='http://myquickfix.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Any questions, corrections or thoughts, please comment below (no need to create an account or anything!)</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/01/select-template-by-sectiocategory-in-joomla-15/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress replaces double and tripple hyphens (&#8211; or &#8212;)</title>
		<link>http://myquickfix.co.uk/index.php/2009/01/wordpress-replaces-double-and-tripple-hyphens-or/</link>
		<comments>http://myquickfix.co.uk/index.php/2009/01/wordpress-replaces-double-and-tripple-hyphens-or/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 17:29:12 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[hyphens]]></category>
		<category><![CDATA[wptexturize]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=258</guid>
		<description><![CDATA[Problem
The other day I was trying to type two hypens (&#8211;) in a post, and when I saved/published the post, WordPress reformatted the hypens to display as an &#8216;en dash&#8216; (–).
More Info: After some searching about, and some helpful info provided in the WordPress Codex, I found out about a WP function called &#8216;wptexturize&#8217; which is applied each time a post is rendered. The function &#8211; which can be found in &#8216;wp-includes/formatting.php&#8217; &#8211; replaces quite a few things, like &#8482; to ™ etc.
Solution
You could stop this happening a number of ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>The other day I was trying to type two hypens (&#8211;) in a post, and when I saved/published the post, WordPress reformatted the hypens to display as an &#8216;<a href="http://en.wikipedia.org/wiki/Dash#En_dash">en dash</a>&#8216; (–).</p>
<p><strong>More Info:</strong> After some searching about, and some helpful info provided in the <a href="http://codex.wordpress.org">WordPress Codex</a>, I found out about a WP function called <a href="http://codex.wordpress.org/Function_Reference/wptexturize">&#8216;wptexturize&#8217;</a> which is applied each time a post is rendered. The function &#8211; which can be found in &#8216;wp-includes/formatting.php&#8217; &#8211; replaces quite a few things, like &#8482; to ™ etc.</p>
<h2>Solution</h2>
<p>You could stop this happening a number of ways i.e. editing the function to stop it doing the replace altogether, or install a plugin that does it (maybe <a href="http://wordpress.org/extend/plugins/wp-unformatted/">this one</a>, haven&#8217;t tried it!).<br />
I decided to use WordPress&#8217;s <a href="http://codex.wordpress.org/Function_Reference/remove_filter">remove_filter</a> function to stop the reformatting taking place.</p>
<p>To do this, open the &#8216;functions.php&#8217; file within your theme. If one does not exist, create it. In my installation the file was here:</p>
<blockquote><p>/wp-content/themes/[my-theme-name]/functions.php</p></blockquote>
<p>Add the following code to the bottom of the file, taking care not to end up with too many or too few <span style="color: #ff0000;">&lt;?php</span> tags:</p>
<blockquote><p><span style="color: #ff0000;">&lt;?php</span><br />
<span style="color: #0000ff;">remove_filter(&#8216;the_content&#8217;, &#8216;wptexturize&#8217;);<br />
remove_filter(&#8216;the_title&#8217;, &#8216;wptexturize&#8217;);</span><br />
<span style="color: #ff0000;">?&gt;</span></p></blockquote>
<p>Then save the file (or &#8216;update&#8217; if you&#8217;re doing this via the theme editor in WP admin) and view your post. That should do it!</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2009/01/wordpress-replaces-double-and-tripple-hyphens-or/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Format the footer [subscribe] link in AcaJoom newsletters</title>
		<link>http://myquickfix.co.uk/index.php/2008/12/format-the-footer-subscribe-link-in-acajoom-newsletters/</link>
		<comments>http://myquickfix.co.uk/index.php/2008/12/format-the-footer-subscribe-link-in-acajoom-newsletters/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 16:00:40 +0000</pubDate>
		<dc:creator>hutch</dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[acajoom]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.myquickfix.co.uk/?p=145</guid>
		<description><![CDATA[Problem
I&#8217;m using AcaJoom Plus as a newsletter component for Joomla, on behalf of a client. While testing the component I found that once the &#8220;Change your subscription&#8221; and &#8220;Unsubscribe&#8221; links were appended, it messed up my template and styling. The text is surrounded SPAN with a class called &#8216;subscriptionlink_nws&#8217; applied to it, but there is only so much you can do with styles in the newsletter itself.
Solution
The &#8221;Change your subscription&#8221; and &#8220;Unsubscribe&#8221; links can be found in the file &#8216;class.jmail.php&#8217; which sits in: [site root]/administrator/components/com_acajoom/classes/.
Open this file and at around line 76 ...]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>I&#8217;m using <a title="AcaJoom Website" href="http://www.acajoom.com/">AcaJoom Plus</a> as a newsletter component for Joomla, on behalf of a client. While testing the component I found that once the &#8220;Change your subscription&#8221; and &#8220;Unsubscribe&#8221; links were appended, it messed up my template and styling. The text is surrounded SPAN with a class called &#8216;subscriptionlink_nws&#8217; applied to it, but there is only so much you can do with styles in the newsletter itself.</p>
<h2>Solution</h2>
<p>The &#8221;Change your subscription&#8221; and &#8220;Unsubscribe&#8221; links can be found in the file &#8216;class.jmail.php&#8217; which sits in: [site root]/administrator/components/com_acajoom/classes/.</p>
<p>Open this file and at around line 76 you should see:</p>
<blockquote><p>$subscriptionstext = &#8216;&lt;p&gt;&#8217;. $subscriptionslink . &#8216;&lt;br /&gt;&#8217; . $unsubscribelink . &#8216;&lt;/p&gt;&#8217;;</p></blockquote>
<p>I found that simply removing the &lt;p&gt; tags made things instantly better, but you might want to add more custom html in there.</p>
<p>This works for the &#8216;News&#8217;, &#8216;Plus&#8217; and presumably &#8216;Pro&#8217; versions of AcaJoom.</p>
]]></content:encoded>
			<wfw:commentRss>http://myquickfix.co.uk/index.php/2008/12/format-the-footer-subscribe-link-in-acajoom-newsletters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
