<?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>Jamie Huskisson &#187; code tidbits</title> <atom:link href="http://www.jhuskisson.com/tag/code-tidbits/feed" rel="self" type="application/rss+xml" /><link>http://www.jhuskisson.com</link> <description>Nottingham UK PHP, Magento, Wordpress freelance developer</description> <lastBuildDate>Mon, 19 Dec 2011 10:57:18 +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>Changing the default Mac screen shot image type</title><link>http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type</link> <comments>http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type#comments</comments> <pubDate>Thu, 29 Jan 2009 10:00:59 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[articles]]></category> <category><![CDATA[mac osx]]></category> <category><![CDATA[code tidbits]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/?p=440</guid> <description><![CDATA[I recently had the need to change the default Mac OSX takes it&#8217;s screen shots in. There&#8217;s some occasions where you need more quality than PNG and some occasions where you need a file anyone can open and simply don&#8217;t want PNG as your default. Well, in OSX 10.4 and onwards you can change the [...]]]></description> <content:encoded><![CDATA[<p>I recently had the need to change the default Mac OSX takes it&#8217;s screen shots in. There&#8217;s some occasions where you need more quality than PNG and some occasions where you need a file anyone can open and simply don&#8217;t want PNG as your default.</p><p>Well, in OSX 10.4 and onwards you can change the default screen shot format.</p><p>Start by opening Terminal, located in /Applications/Utilities/Terminal</p><p>Type in:</p><blockquote><p>defaults write com.apple.screencapture type <strong><em>image_format</em></strong><br
/> killall SystemUIServer</p></blockquote><p>Replace <strong><em>image_format</em></strong> with your selected format that you wish to change the default setting to. The second line reloads the default so that you don&#8217;t need to log out and back in again for the change to take effect. The next time you take a screen shot after executing both of these commands, it will be saved in the new format you have chosen.</p><p>Below is a list of several popular image types and their commands in full should you wish to paste them.</p><p>BMP</p><blockquote><p>defaults write com.apple.screencapture type bmp<br
/> killall SystemUIServer</p></blockquote><p>GIF</p><blockquote><p>defaults write com.apple.screencapture type gif<br
/> killall SystemUIServer</p></blockquote><p>JPG</p><blockquote><p>defaults write com.apple.screencapture type jpg<br
/> killall SystemUIServer</p></blockquote><p>PDF</p><blockquote><p>defaults write com.apple.screencapture type pdf<br
/> killall SystemUIServer</p></blockquote><p>PNG</p><blockquote><p>defaults write com.apple.screencapture type png<br
/> killall SystemUIServer</p></blockquote><p>TIFF</p><blockquote><p>defaults write com.apple.screencapture type tiff<br
/> killall SystemUIServer</p></blockquote><p>Tags: <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a
href="http://www.jhuskisson.com/tag/mac-osx" rel="tag">mac osx</a></p><p>Feel free <a
href="http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type/feed</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Adding an unsubscribe link to a Magento newsletter template</title><link>http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template</link> <comments>http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template#comments</comments> <pubDate>Sun, 25 Jan 2009 18:00:38 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[magento development]]></category> <category><![CDATA[code tidbits]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/?p=424</guid> <description><![CDATA[A quick tip for Magento developer&#8217;s here, in how to add an unsubscribe link into a newsletter template so that the person can unsubscribe from the newsletter if they chose to do so. Simply add {{var subscriber.getUnsubscriptionLink()}} into your template in order to output the link for the user to unsubscribe. This even works for [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://files.jhuskisson.com/blog/magento_logo.png" alt="magento logo Adding an unsubscribe link to a Magento newsletter template"  title="Adding an unsubscribe link to a Magento newsletter template" /></p><p>A quick tip for Magento developer&#8217;s here, in how to add an unsubscribe link into a newsletter template so that the person can unsubscribe from the newsletter if they chose to do so.</p><p>Simply add {{var subscriber.getUnsubscriptionLink()}} into your template in order to output the link for the user to unsubscribe. This even works for people who aren&#8217;t registered customers of the Magento installation but that you&#8217;ve imported into your system as subscribing to the newsletter.</p><p>Full example of a link in your template to unsubscribe:</p><blockquote><p> &lt;a href=&#8221;{{var subscriber.getUnsubscriptionLink()}}&#8221; title=&#8221;Click here to unsubscribe from this newsletter&#8221;&gt;Unsubscribe&lt;/a&gt;</p></blockquote><p>Tags: <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a
href="http://www.jhuskisson.com/tag/magento-development" rel="tag">magento development</a></p><p>Feel free <a
href="http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template/feed</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Share on Twitter link</title><link>http://www.jhuskisson.com/code-tidbits/share-on-twitter-link</link> <comments>http://www.jhuskisson.com/code-tidbits/share-on-twitter-link#comments</comments> <pubDate>Tue, 20 Jan 2009 12:02:29 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[code tidbits]]></category> <category><![CDATA[twitter]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/?p=429</guid> <description><![CDATA[Ever wanted to give your readers, or your client&#8217;s readers a chance to share the post quickly on Twitter? The code is straight forward: &#60;a href=&#8221;http://twitter.com/home?status=Currently reading &#8221; title=&#8221;Click to share this post on Twitter&#8221;&#62;Share on Twitter&#60;/a&#62; If you&#8217;re using WordPress and want to automate this, simply use the following to insert the link to [...]]]></description> <content:encoded><![CDATA[<p><a
title="Click here to follow me on Twitter" href="http://twitter.com/jhuskisson"><img
src="http://files.jhuskisson.com/blog/twitter_bird.jpg" alt="twitter bird Share on Twitter link"  title="Share on Twitter link" /></a></p><p>Ever wanted to give your readers, or your client&#8217;s readers a chance to share the post quickly on Twitter?</p><p>The code is straight forward:</p><blockquote><p>&lt;a href=&#8221;http://twitter.com/home?status=Currently reading &#8221; title=&#8221;Click to share this post on Twitter&#8221;&gt;Share on Twitter&lt;/a&gt;</p></blockquote><p>If you&#8217;re using WordPress and want to automate this, simply use the following to insert the link to the current post in the loop into your link:</p><blockquote><p>&lt;a href=&#8221;http://twitter.com/home?status=Currently reading &lt;?php the_permalink(); ?&gt;&#8221; title=&#8221;Click to share this post on Twitter&#8221;&gt;Share on Twitter&lt;/a&gt;</p></blockquote><p>Tags: <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a
href="http://www.jhuskisson.com/tag/twitter" rel="tag">twitter</a></p><p>Feel free <a
href="http://www.jhuskisson.com/code-tidbits/share-on-twitter-link#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/code-tidbits/share-on-twitter-link/feed</wfw:commentRss> <slash:comments>61</slash:comments> </item> <item><title>301 and 302 redirects with .htaccess</title><link>http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess</link> <comments>http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess#comments</comments> <pubDate>Fri, 26 Sep 2008 08:49:47 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[.htaccess]]></category> <category><![CDATA[articles]]></category> <category><![CDATA[code tidbits]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/?p=384</guid> <description><![CDATA[I&#8217;ve been asked this question time and time again, so here we are. How to redirect directories and old URL&#8217;s to new ones when moving your site from one domain to another, or launching a new version with re-structured URLs. Here&#8217;s a sample structure of a re-direct line: Redirect 301 /about.php /about.php here is the [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been asked this question time and time again, so here we are. How to redirect directories and old URL&#8217;s to new ones when moving your site from one domain to another, or launching a new version with re-structured URLs.</p><p>Here&#8217;s a sample structure of a re-direct line:</p><blockquote><p>Redirect 301 /about.php</p></blockquote><p><strong>/about.php</strong> here is the local URL relative to the core domain you&#8217;re redirecting from. If you&#8217;re redirecting from  then this will be /directory/about.php and if you are redirecting from  then it is simply /about.php.</p><p>The second part of this statement is the complete URL you are forwarding to.</p><p>The beauty of a 301 redirect with .htaccess is that if you have one big set of URL&#8217;s that have changed from one place to another with the filename/end URL staying the same it is still the same statement. For example:</p><blockquote><p>Redirect 301 /test/</p></blockquote><p>This redirects /test/about.php to  &#8211; anything after /test/ will be redirected to  and placed at the end of the URL. The same applies for all query URLs (i.e. about.php?variable=1&amp;this=that).</p><p><strong>Tip:</strong> Always priority order your redirects. The redirects you want done first should go up top. But you should also be careful not to place inherent statements above specific ones.</p><p>This won&#8217;t work:</p><blockquote><p>Redirect 301 /test/<br
/> Redirect 301 /test/about.php</p></blockquote><p>This will result in the first statement being processed and the second statement meaning nothing. The correct order is:</p><blockquote><p>Redirect 301 /test/about.php<br
/> Redirect 301 /test/</p></blockquote><p>This means the specific statement is applied first, and then the inherent statement is ran afterwards.</p><p>Here&#8217;s a sample of extensive re-directs for Twod.co.uk to JHuskisson.com:</p><blockquote><p>Redirect 301 /general-posts/ http://www.jhuskisson.com/general-news/<br
/> Redirect 301 /wp-content/uploads/11/ http://www.jhuskisson.com/wp-content/uploads/</p></blockquote><p>Here is what they do:</p><ul><li>Moves all posts in the /general-posts/ slugged category to show at /general-news/ on the new site. For example /general-posts/testing-post is now /general-news/testing-post on the new site as we changed the category.</li><li>All uploads from /wp-content/uploads/11/ are now linked to in /wp-content/uploads/. For examples /wp-content/uploads/11/test.jpg is now /wp-content/uploads/test.jpg on the new server.</li></ul><p>All of these lines can be applied to 302 (temporary) redirects too. Just switch the number 301 with 302 to achieve the result you need. 302 redirects should be used where the file is only moving there for a short while but will be put back eventually and 301 redirects are used to transfer the URL to the new URL permanently and work great for a site move or a URL restructuring.</p><p>I used these to transfer Twod.co.uk to JHuskisson.com and several other transfers and they have all retained by page rank and search engine strength from domain to domain with ease.</p><p>Have any other htaccess redirect tips or things to discuss? Feel free to leave a comment using the form below.</p><p>Tags: <a
href="http://www.jhuskisson.com/tag/htaccess" rel="tag">.htaccess</a>, <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p><p>Feel free <a
href="http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Force www. in your URL using .htaccess</title><link>http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess</link> <comments>http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess#comments</comments> <pubDate>Thu, 15 Mar 2007 14:17:01 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[code tidbits]]></category> <category><![CDATA[.htaccess]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess</guid> <description><![CDATA[Insert this into the top of your .htaccess file, making sure that &#8216;RewriteEngine On&#8217; comes before it: RewriteCond %{HTTP_HOST} !^www\.jhuskisson\.com [NC] RewriteRule ^(.*)$ [R=301,L] Replace jhuskisson.com with your chosen domain and make sure if you are placing any full stops within the first line to enter a backslash before each full stop. This will prevent [...]]]></description> <content:encoded><![CDATA[<p>Insert this into the top of your .htaccess file, making sure that &#8216;RewriteEngine On&#8217; comes before it:</p><blockquote><p>RewriteCond %{HTTP_HOST} !^www\.jhuskisson\.com [NC]<br
/> RewriteRule ^(.*)$  [R=301,L]</p></blockquote><p>Replace jhuskisson.com with your chosen domain and make sure if you are placing any full stops within the first line to enter a backslash before each full stop. This will prevent the code from not working.</p><p>Tags: <a
href="http://www.jhuskisson.com/tag/htaccess" rel="tag">.htaccess</a>, <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p><p>Feel free <a
href="http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess/feed</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>&#8216;Send me a message on AIM&#8217; link</title><link>http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link</link> <comments>http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link#comments</comments> <pubDate>Thu, 15 Mar 2007 13:56:51 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[code tidbits]]></category> <category><![CDATA[aim]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link</guid> <description><![CDATA[Here&#8217;s the code: &#60;a href=&#8221;aim:goim?screename=username&#038;message=hello&#8221;&#62;Send me a message on AIM&#60;/a&#62; Replace username with your required AIM username and &#8216;hello&#8217; with whatever message you wish to set for the user to send you. You can remove &#8216;hello&#8217; altogether if you don&#8217;t wish to pre-set a message for a user to send you upon clicking the link. [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://files.jhuskisson.com/blog/aim_logo.jpg" alt="aim logo Send me a message on AIM link"  title="Send me a message on AIM link" /></p><p>Here&#8217;s the code:</p><blockquote><p>&lt;a href=&#8221;aim:goim?screename=<strong>username</strong>&#038;message=hello&#8221;&gt;Send me a message on AIM&lt;/a&gt;</p></blockquote><p>Replace <strong>username</strong> with your required AIM username and &#8216;hello&#8217; with whatever message you wish to set for the user to send you. You can remove &#8216;hello&#8217; altogether if you don&#8217;t wish to pre-set a message for a user to send you upon clicking the link.</p><p>Tags: <a
href="http://www.jhuskisson.com/tag/aim" rel="tag">aim</a>, <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p><p>Feel free <a
href="http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Re-enabling error reporting in MAMP</title><link>http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp</link> <comments>http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp#comments</comments> <pubDate>Fri, 09 Feb 2007 13:01:00 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[code tidbits]]></category> <category><![CDATA[mac]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/code-tidbits/enabling-error-reporting-in-mamp</guid> <description><![CDATA[For some reason error reporting is turned off by default in MAMP.. So this is how to re-enable it to how it should be. 1. Find your &#8216;MAMP&#8217; directory in &#8216;Applications&#8217; 2. Find &#8216;conf&#8217; and open it up.. 3. Open up php4 or php5 (depending on your enabled version) 4. Line 270 should be something [...]]]></description> <content:encoded><![CDATA[<p>For some reason error reporting is turned off by default in MAMP.. So this is how to re-enable it to how it should be.</p><p>1. Find your &#8216;MAMP&#8217; directory in &#8216;Applications&#8217;</p><p>2. Find &#8216;conf&#8217; and open it up..</p><p>3. Open up php4 or php5 (depending on your enabled version)</p><p>4. Line 270 should be something like this:<br
/> error_reporting  =  E_ALL</p><p>5. Line 277 will be:<br
/> display_errors = Off</p><p>Change this to:<br
/> display_errors = On</p><p>6. Restart servers</p><p>And voila! We have PHP errors..</p><p>Tags: <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a
href="http://www.jhuskisson.com/tag/mac" rel="tag">mac</a></p><p>Feel free <a
href="http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp/feed</wfw:commentRss> <slash:comments>44</slash:comments> </item> <item><title>Track outbound links for Google Analytics automatically</title><link>http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically</link> <comments>http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically#comments</comments> <pubDate>Tue, 09 Jan 2007 14:41:28 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[code tidbits]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically</guid> <description><![CDATA[Place this code before the &#60;/body&#62; tag and it&#8217;ll track all outbound links that aren&#8217;t part of your website. &#60;script type=&#8221;text/javascript&#8221;&#62; if (document.getElementsByTagName) { var ahrefs = document.getElementsByTagName(&#8216;a&#8217;); for (var i=0; i&#60;ahrefs.length;i++) { if (ahrefs[i].href.indexOf(&#8216;http://www.jhuskisson.com&#8216;) == -1 &#038;&#038; !ahrefs[i].onclick) { ahrefs[i].onclick = function () { var track = this.href + &#8221;; urchinTracker (&#8216;/outgoing/&#8217;+track.substring(7)); } } [...]]]></description> <content:encoded><![CDATA[<p>Place this code before the &lt;/body&gt; tag and it&#8217;ll track all outbound links that aren&#8217;t part of your website.</p><blockquote><p> &lt;script type=&#8221;text/javascript&#8221;&gt;<br
/> if (document.getElementsByTagName) {<br
/> var ahrefs = document.getElementsByTagName(&#8216;a&#8217;);<br
/> for (var i=0; i&lt;ahrefs.length;i++) {<br
/> if (ahrefs[i].href.indexOf(&#8216;<strong>http://www.jhuskisson.com</strong>&#8216;) == -1 &#038;&#038; !ahrefs[i].onclick) {<br
/> ahrefs[i].onclick = function () { var track = this.href + &#8221;; urchinTracker (&#8216;/outgoing/&#8217;+track.substring(7)); }<br
/> }<br
/> }<br
/> }<br
/> &lt;/script&gt;</p></blockquote><p>Simply replace <strong>http://www.jhuskisson.com</strong> with your own site URL and hey presto &#8211; all outbound links that aren&#8217;t internal are being tracked by Google Analytics.</p><p>Tags: <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p><p>Feel free <a
href="http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically/feed</wfw:commentRss> <slash:comments>29</slash:comments> </item> <item><title>From PHP 4 to PHP 5.. PHP Fatal zlib error: imagepng()</title><link>http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng</link> <comments>http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng#comments</comments> <pubDate>Wed, 03 Jan 2007 13:52:37 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[code tidbits]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng</guid> <description><![CDATA[Getting this error? PHP Fatal error: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error in example.php on line 10 Fix it easily by changing your compression variable of imagepng, imagegif or imagejpg/imagejpeg into a 1-10 ranged number &#8211; instead of the PHP 4 1-100 standard. It should work smoothly now :) Tags: code tidbits Feel [...]]]></description> <content:encoded><![CDATA[<p>Getting this error?</p><blockquote><p>PHP Fatal error: imagepng() [<a
href="http://www.php.net/imagepng">function.imagepng</a>]: gd-png: fatal libpng error: zlib error in example.php on line 10</p></blockquote><p>Fix it easily by changing your compression variable of imagepng, imagegif or imagejpg/imagejpeg into a 1-10 ranged number &#8211; instead of the PHP 4 1-100 standard.</p><p>It should work smoothly now :)</p><p>Tags: <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p><p>Feel free <a
href="http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng/feed</wfw:commentRss> <slash:comments>11</slash:comments> </item> <item><title>Never lose visitors from old URLs again</title><link>http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again</link> <comments>http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again#comments</comments> <pubDate>Wed, 03 Jan 2007 10:56:52 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[wordpress development]]></category> <category><![CDATA[code tidbits]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/wordpress/never-lose-visitors-from-old-urls-again</guid> <description><![CDATA[Was coding a script for redirection of old URL&#8217;s into new ones for WordPress when I found this plugin. This plugin redirects the old ?p=1 ?page_id=1 URL structure as well as handling feedburner re-direction. Which saved me a lot of time and frustration. It also means converting sites not using permalinks into sites with permalink [...]]]></description> <content:encoded><![CDATA[<p>Was coding a script for redirection of old URL&#8217;s into new ones for WordPress when I found <a
href="http://fucoder.com/code/permalink-redirect/">this plugin</a>.</p><p>This plugin redirects the old ?p=1 ?page_id=1 URL structure as well as handling feedburner re-direction. Which saved me a lot of time and frustration. It also means converting sites not using permalinks into sites with permalink structures is a simple case of enabling this plugin. I love it!</p><p>Tags: <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p><p>Feel free <a
href="http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Easily insert a Xbox Live gamer card into your website</title><link>http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website</link> <comments>http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website#comments</comments> <pubDate>Tue, 02 Jan 2007 15:56:28 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[code tidbits]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website</guid> <description><![CDATA[Searched for about 30 minutes on how to do it earlier today as mygamercard.net is extremely slow and unreliable. Here&#8217;s how to do it yourself by using Xbox.com (which is very reliable and fast): &#60;iframe src=&#8221;http://gamercard.xbox.com/MyGamerTag.card&#8221; class=&#8221;gamercard&#8221; width=&#8221;204&#8243; height=&#8221;141&#8243; scrolling=&#8221;no&#8221; frameBorder=&#8221;0&#8243;&#62;&#60;/iframe&#62; Simply replace MyGamerTag with your own &#8211; and insert it where you would like [...]]]></description> <content:encoded><![CDATA[<p>Searched for about 30 minutes on how to do it earlier today as mygamercard.net is extremely slow and unreliable. Here&#8217;s how to do it yourself by using Xbox.com (which is very reliable and fast):</p><blockquote><p>&lt;iframe src=&#8221;http://gamercard.xbox.com/<strong>MyGamerTag</strong>.card&#8221; class=&#8221;gamercard&#8221; width=&#8221;204&#8243; height=&#8221;141&#8243; scrolling=&#8221;no&#8221; frameBorder=&#8221;0&#8243;&gt;&lt;/iframe&gt;</p></blockquote><p>Simply replace <strong>MyGamerTag</strong> with your own &#8211; and insert it where you would like your gamer card on your site &#8211; simple.</p><p>Tags: <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p><p>Feel free <a
href="http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Earthquake Effect: Shake the browser using JavaScript</title><link>http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser</link> <comments>http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser#comments</comments> <pubDate>Sat, 01 May 2004 15:55:32 +0000</pubDate> <dc:creator>Jamie Huskisson</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[code tidbits]]></category> <category><![CDATA[twod]]></category> <guid
isPermaLink="false">http://www.jhuskisson.com/?p=508</guid> <description><![CDATA[Note: This post was imported from the very old Twod.co.uk post archives. Please for the love of jeebus don&#8217;t use this script. Back in 2004 as a youngster this was fairly funny. Update: An updated and (actually) working version has been posted on StackOverflow This snippet of code will produce a JavaScript function which you [...]]]></description> <content:encoded><![CDATA[<p><strong>Note:</strong> This post was imported from the very old Twod.co.uk post archives. Please for the love of jeebus don&#8217;t use this script. Back in 2004 as a youngster this was fairly funny.</p><p><strong>Update:</strong> <a
href="http://stackoverflow.com/questions/5099141/javascript-browser-shake-on-firefox/5099453">An updated and (actually) working version has been posted on StackOverflow</a></p><p>This snippet of code will produce a JavaScript function which you can then attach via a JavaScript call and shake the user&#8217;s Internet browser.</p><p>Place this anywhere before you&#8217;re going to call the function, or remove the surrounding &lt;script&gt; tags and place it within an external JavaScript file.</p><blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br
/> function shake(n) {<br
/> if (parent.moveBy) {<br
/> for (i = 10; i > 0; i&#8211;) {<br
/> for (j = n; j > 0; j&#8211;) {<br
/> parent.moveBy(0,i);<br
/> parent.moveBy(i,0);<br
/> parent.moveBy(0,-i);<br
/> parent.moveBy(-i,0);<br
/> }<br
/> }<br
/> }<br
/> }<br
/> &lt;/script&gt;</p></blockquote><p>An example of this function being called using the onclick method would look as follows:</p><blockquote><p>&lt;input type=&#8221;button&#8221; onclick=&#8221;javascript:shake(200)&#8221; value=&#8221;Shake Me!&#8221; /&gt;</p></blockquote><p>This will produce (go ahead, click for an example of the effect):<br
/> <script type="text/javascript">function shake(n) {if (parent.moveBy) {for (i = 10; i > 0; i--) {for (j = n; j > 0; j--) {parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);}}}}</script><br
/> <input
type="button" onclick="javascript:shake(200);" value="Shake Me!" /><p>Tags: <a
href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a
href="http://www.jhuskisson.com/tag/javascript" rel="tag">javascript</a>, <a
href="http://www.jhuskisson.com/tag/twod" rel="tag">twod</a></p><p>Feel free <a
href="http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser#comments">to leave a comment on this post</a>, I'd love to hear your thoughts. <a
href="http://www.twitter.com/jhuskisson">Follow me on Twitter</a>, <a
href="http://www.facebook.com/jhuskissoncom">Like JHuskisson.com on Facebook</a></p> ]]></content:encoded> <wfw:commentRss>http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
