<?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>An Ex-Blog - Comments Are Closed &#187; Technology</title>
	<atom:link href="http://www.paulmc.org/whatithink/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paulmc.org/whatithink</link>
	<description>This Blog is Dead. It is an ex-Blog. It has shuffled off this mortal coil and joined the choir invisible.</description>
	<lastBuildDate>Tue, 05 Jan 2010 02:12:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Marcellus Wallace</title>
		<link>http://www.paulmc.org/whatithink/2009/12/08/marcellus-wallace/</link>
		<comments>http://www.paulmc.org/whatithink/2009/12/08/marcellus-wallace/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 11:58:54 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1172</guid>
		<description><![CDATA[
NSFW



]]></description>
			<content:encoded><![CDATA[<p>
NSFW
</p>
<p>
<!-- Smart Youtube --><span class="youtube"><object type="application/x-shockwave-flash" width="425" height="373" data="http://www.youtube.com/v/JNT5zvd3g2M&amp;rel=0&amp;color1=5d1719&amp;color2=cd311b&amp;border=1&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0"><param name="movie" value="http://www.youtube.com/v/JNT5zvd3g2M&amp;rel=0&amp;color1=5d1719&amp;color2=cd311b&amp;border=1&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0" /><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent" /></object></span><a href="http://www.youtube.com/watch?v=JNT5zvd3g2M"><img src="http://img.youtube.com/vi/JNT5zvd3g2M/default.jpg" width="130" height="97" border=0></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/12/08/marcellus-wallace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeekTool</title>
		<link>http://www.paulmc.org/whatithink/2009/12/05/geektool/</link>
		<comments>http://www.paulmc.org/whatithink/2009/12/05/geektool/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 12:22:37 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[geektool]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1170</guid>
		<description><![CDATA[
I&#8217;ve been playing around with GeekTool for a couple of days and I&#8217;ve finally gotten everything I want on my desktop.


Here&#8217;s what my desktop looks like at the moment:



For reference, here&#8217;s my list of GeekTool Scripts:


Computer Name: hostname -s
Login Name: whoami
Day: date &#8220;+%A&#8221;
Month: date &#8220;+%b&#8221;
Day (numerical): date &#8220;+%e&#8221;
Time: date +&#8221;%I:%M&#8221;
AM/PM: date +&#8221;%p&#8221;
Mac OS X Version: [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;ve been playing around with GeekTool for a couple of days and I&#8217;ve finally gotten everything I want on my desktop.
</p>
<p>
Here&#8217;s what my desktop looks like at the moment:
</p>

<div id="attachment_1171" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.paulmc.org/whatithink/wp-content/uploads/2009/12/cap.png"><img src="http://www.paulmc.org/whatithink/wp-content/uploads/2009/12/cap-500x312.png" alt="My GeekTool Desktop" title="GeekTool Desktop" width="500" height="312" class="size-medium wp-image-1171" /></a><p class="wp-caption-text">My GeekTool Desktop</p></div>

<p>
For reference, here&#8217;s my list of GeekTool Scripts:
</p>
<ul>
<li>Computer Name: hostname -s</li>
<li>Login Name: whoami</li>
<li>Day: date &#8220;+%A&#8221;</li>
<li>Month: date &#8220;+%b&#8221;</li>
<li>Day (numerical): date &#8220;+%e&#8221;</li>
<li>Time: date +&#8221;%I:%M&#8221;</li>
<li>AM/PM: date +&#8221;%p&#8221;</li>
<li>Mac OS X Version: sw_vers | awk -F&#8217;:\t&#8217; &#8216;{print $2}&#8217; | paste -d &#8216; &#8216; &#8211; - &#8211; ;</li>
<li>Disk Usage: df -H | grep disk0s2 | awk &#8216;{print &#8220;Disk:&#8221;, $3, &#8220;/&#8221;, $2, &#8220;-&#8221;, $4, &#8220;available&#8221;}&#8217;</li>
<li>Uptime: uptime | awk &#8216;{print &#8220;Up: &#8221; $3 &#8221; days&#8221;}&#8217;</li>
<li>Airport Network Name: airport -I | grep -e &#8220;\bSSID:&#8221; | awk &#8216;{print $2}&#8217;</li>
<li>Airport Channel: airport -I | grep -e &#8220;channel:&#8221; | awk &#8216;{print &#8220;Channel: &#8221; $2}&#8217;</li>
<li>Airport Max Rate: airport -I | grep -e &#8220;maxRate:&#8221; | awk &#8216;{print &#8220;Max Rate: &#8221; $2}&#8217;</li>
<li>Airport Link Authorisation: airport -I | grep -e &#8220;link auth:&#8221; | awk &#8216;{print &#8220;Auth: &#8221; $3}&#8217;</li>
<li>External IP: echo `curl -s http://checkip.dyndns.org/ | sed &#8217;s/[a-zA-Z<>/ :]//g&#8217;`</li>
<li>Running Processes: ps -c -U pmac -o command,%cpu,%mem -r</li>
<li>Airport IP: ipconfig getifaddr en1</li>
<li>Calendar: cal</li>
<li>Network Location: scselect 2>&#038;1 | grep &#8216;^ \*&#8217; | sed -e &#8217;s:^[^(]*(\([^)]*\))$:\1:g&#8217;</li>
</ul>
<p>
Most of these commands were culled from various websites, while I came up with the rest myself.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/12/05/geektool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;custom_domain is null&#8221; error message in Firefox</title>
		<link>http://www.paulmc.org/whatithink/2009/07/09/custom_domain-is-null-error-message-in-firefox/</link>
		<comments>http://www.paulmc.org/whatithink/2009/07/09/custom_domain-is-null-error-message-in-firefox/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 22:16:05 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1152</guid>
		<description><![CDATA[
Problem: When opening a &#8220;localhost&#8221; address using Firefox, a JavaScript error message is displayed with the error message &#8220;current_domain is null&#8221;.


Description: Using Firefox version 3.0.11. Error message only appears when connecting to a site hosted on the local machine. Disabling all add-ons resolves the problem. Re-enabled add-ons one by one. Re-enabling LongURL Expander causes the [...]]]></description>
			<content:encoded><![CDATA[<p>
<strong>Problem:</strong> When opening a &#8220;localhost&#8221; address using Firefox, a JavaScript error message is displayed with the error message &#8220;current_domain is null&#8221;.
</p>
<p>
<strong>Description:</strong> Using Firefox version 3.0.11. Error message only appears when connecting to a site hosted on the local machine. Disabling all add-ons resolves the problem. Re-enabled add-ons one by one. Re-enabling <a href="https://addons.mozilla.org/en-US/firefox/addon/8636">LongURL Expander</a> causes the problem to re-appear. Error message is known issue with version 2.0.0 of the add-on.
</p>
<p>
<strong>Solution:</strong> As per the comments on the the add-on page, edit the <em>longurlmobileexpander.js</em> file to make the requirement for the second part of the domain name optional.
</p>
<ul>
<li>On Mac OS X, open home folder and browse to <em>Library/Application Support/Firefox/Profiles/[profile].default/extension/{a7101e54-830c-4d33-a3ed-bedc17ec44da}/content</em></li>
<li>Open <em>longurlmobileexpander.js</em> in TextEdit.</li>
<li>Edit line 78 to read:</li>
</ul>
<p>
<code><br />
var current_domain = document.location.href.match(/^https?:\/\/(?:www\.)?([^\.]+(\.[^\/]+)?)/i);<br />
</code>
</p>
<ul>
<li>Save changes.</li>
</ul>
<p>
Thanks to <a href="http://www.jansen-systems.de/">Mathias Jansen</a> for the solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/07/09/custom_domain-is-null-error-message-in-firefox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disabling Ethernet Prevents Mac OS X From Waking</title>
		<link>http://www.paulmc.org/whatithink/2009/07/07/disabling-ethernet-prevents-mac-os-x-from-waking/</link>
		<comments>http://www.paulmc.org/whatithink/2009/07/07/disabling-ethernet-prevents-mac-os-x-from-waking/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 19:57:30 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[fan]]></category>
		<category><![CDATA[mac sleep]]></category>
		<category><![CDATA[network]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1143</guid>
		<description><![CDATA[
Problem: When MacBook lid is closed, fan continues to spin and MacBook becomes very hot.


Description: When in use the MacBook fan behaves as expected. On closing the lid to put the MacBook sleep, the fan continues to spin and the base of the machine becomes very hot.


Opening the lid displays a black screen. No mouse [...]]]></description>
			<content:encoded><![CDATA[<p>
<strong>Problem:</strong> When MacBook lid is closed, fan continues to spin and MacBook becomes very hot.
</p>
<p>
<strong>Description:</strong> When in use the MacBook fan behaves as expected. On closing the lid to put the MacBook sleep, the fan continues to spin and the base of the machine becomes very hot.
</p>
<p>
Opening the lid displays a black screen. No mouse or login screen displayed. Fan continues to spin at what seems to be maximum RPM. Closing the lid again does not stop the fan from spinning.
</p>
<p>
Only available option is to hold the power button to shut down the system.
</p>
<p>
On pressing the power button to restart the system, the MacBook starts, displays grey start up screen for a second or two and then restarts automatically. MacBook then starts normally.
</p>
<p>
Once the user logins, the system works as normal again. Putting the system to sleep, causes the problem to reoccur.
</p>
<p>
<strong>Solution:</strong> The user deactivated the Ethernet interface within System Preferences -> Network. Reactivating the Ethernet interface and restarting the machine resolved the problem.
</p>
<p>
(Who&#8217;d have thought that disabling the Ethernet interface would prevent the system from sleeping? Certainly not me when I decided to do so.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/07/07/disabling-ethernet-prevents-mac-os-x-from-waking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Dump</title>
		<link>http://www.paulmc.org/whatithink/2009/06/05/image-dump/</link>
		<comments>http://www.paulmc.org/whatithink/2009/06/05/image-dump/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 10:36:18 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Humour]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[atheism]]></category>
		<category><![CDATA[image dump]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1127</guid>
		<description><![CDATA[
For my enjoyment. And maybe yours:



]]></description>
			<content:encoded><![CDATA[<p>
For my enjoyment. And maybe yours:
</p>

<div id="attachment_1128" class="wp-caption aligncenter" style="width: 509px"><a href="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/high_energy_biology.png"><img src="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/high_energy_biology-499x381.png" alt="Abstruse Goose: Biologists" title="Abstruse Goose: Biologists" width="499" height="381" class="size-medium wp-image-1128" /></a><p class="wp-caption-text">Abstruse Goose: Biologists</p></div>


<div id="attachment_1129" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/atheism.jpg"><img src="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/atheism-500x400.jpg" alt="Atheism Motivational" title="Atheism Motivational" width="500" height="400" class="size-medium wp-image-1129" /></a><p class="wp-caption-text">Atheism Motivational</p></div>


<div id="attachment_1130" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/troll_slayer.png"><img src="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/troll_slayer-500x329.png" alt="Troll Slayer" title="Troll Slayer" width="500" height="329" class="size-medium wp-image-1130" /></a><p class="wp-caption-text">Troll Slayer</p></div>


<div id="attachment_1131" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/software-engineering-explained.png"><img src="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/software-engineering-explained-500x375.png" alt="Software Engineering Explained" title="Software Engineering Explained" width="500" height="375" class="size-medium wp-image-1131" /></a><p class="wp-caption-text">Software Engineering Explained</p></div>


<div id="attachment_1132" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/breastfeeding.jpg"><img src="http://www.paulmc.org/whatithink/wp-content/uploads/2009/06/breastfeeding-500x400.jpg" alt="Breastfeeding" title="Breastfeeding" width="500" height="400" class="size-medium wp-image-1132" /></a><p class="wp-caption-text">Breastfeeding</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/06/05/image-dump/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Should Apple Ban an iPhone App for this?</title>
		<link>http://www.paulmc.org/whatithink/2009/06/04/should-apple-ban-an-iphone-app-for-this/</link>
		<comments>http://www.paulmc.org/whatithink/2009/06/04/should-apple-ban-an-iphone-app-for-this/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 00:41:49 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[downfall]]></category>
		<category><![CDATA[eff]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1125</guid>
		<description><![CDATA[



Via El Reg.
]]></description>
			<content:encoded><![CDATA[<p>
<!-- Smart Youtube --><span class="youtube"><object type="application/x-shockwave-flash" width="425" height="373" data="http://www.youtube.com/v/PzUoWkbNLe8&amp;rel=0&amp;color1=5d1719&amp;color2=cd311b&amp;border=1&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0"><param name="movie" value="http://www.youtube.com/v/PzUoWkbNLe8&amp;rel=0&amp;color1=5d1719&amp;color2=cd311b&amp;border=1&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0" /><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent" /></object></span><a href="http://www.youtube.com/watch?v=PzUoWkbNLe8"><img src="http://img.youtube.com/vi/PzUoWkbNLe8/default.jpg" width="130" height="97" border=0></a>
</p>
<p>
Via <a href="http://www.theregister.co.uk/2009/06/03/iphone_apple_eff/">El Reg</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/06/04/should-apple-ban-an-iphone-app-for-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogging &amp; Social Media for Business Seminar</title>
		<link>http://www.paulmc.org/whatithink/2009/06/04/blogging-social-media-for-business-seminar/</link>
		<comments>http://www.paulmc.org/whatithink/2009/06/04/blogging-social-media-for-business-seminar/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 23:44:08 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1119</guid>
		<description><![CDATA[
Absolute Hotel, Limerick. June 13th. 9:30 am.


If you run a business and are interested in creating a proper online presence, then sign up now.
]]></description>
			<content:encoded><![CDATA[<p>
Absolute Hotel, Limerick. June 13th. 9:30 am.
</p>
<p>
If you run a business and are interested in creating a proper online presence, then <a href="http://greenhouselimerick.com/events/%E2%80%9Cblogging-social-media-for-business%E2%80%9D-seminar-absolute-hotel-limerick-june-13th/">sign up now</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/06/04/blogging-social-media-for-business-seminar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugin Review &#8211; Add Twitter RSS</title>
		<link>http://www.paulmc.org/whatithink/2009/04/16/plugin-review-add-twitter-rss/</link>
		<comments>http://www.paulmc.org/whatithink/2009/04/16/plugin-review-add-twitter-rss/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 19:29:19 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[add twitter rss]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1104</guid>
		<description><![CDATA[
It&#8217;s proving to be a great week for my plugin&#8217;s. Following on from WordCast PodCast mentioning WP Frame Breaker, Weblog Tools Collection have just posted a review of another one of my plugins &#8211; Add Twitter RSS.


If you use Add Twitter RSS, head on over and let them know what you think.


Add as always, feedback [...]]]></description>
			<content:encoded><![CDATA[<p>
It&#8217;s proving to be a great week for my plugin&#8217;s. Following on from <a href="http://www.paulmc.org/whatithink/2009/04/15/wordcast-pod-cast/">WordCast PodCast mentioning WP Frame Breaker</a>, Weblog Tools Collection have just posted a <a href="http://weblogtoolscollection.com/archives/2009/04/15/wordpress-add-twitter-rss-plugin-review/">review</a> of another one of my plugins &#8211; <a href="http://www.paulmc.org/whatithink/wordpress/plugins/add-twitter-rss/">Add Twitter RSS</a>.
</p>
<p>
If you use Add Twitter RSS, head on over and let them know what you think.
</p>
<p>
Add as always, feedback and requests for more options are always welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/04/16/plugin-review-add-twitter-rss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordCast Pod Cast</title>
		<link>http://www.paulmc.org/whatithink/2009/04/15/wordcast-pod-cast/</link>
		<comments>http://www.paulmc.org/whatithink/2009/04/15/wordcast-pod-cast/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 13:44:41 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[wordcast]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1103</guid>
		<description><![CDATA[
My WP Frame Breaker plugin gets a mention on this weeks WordCast PodCast: WordCast 51: Big-Wheeled Sedan. How cool is that?


You can hear more at about the 49:35 mark.


Thanks to the guys at WordCast PodCast for the mention.
]]></description>
			<content:encoded><![CDATA[<p>
My <a href="http://www.paulmc.org/whatithink/wordpress/plugins/wp-frame-breaker/">WP Frame Breaker</a> plugin gets a mention on this weeks <a href="http://wordcastpodcast.com/2009/04/wordcast-51-big-wheeled-sedan/comment-page-1/#comment-603">WordCast PodCast: WordCast 51: Big-Wheeled Sedan</a>. How cool is that?
</p>
<p>
You can hear more at about the 49:35 mark.
</p>
<p>
Thanks to the guys at <a href="http://wordcastpodcast.com/">WordCast PodCast</a> for the mention.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/04/15/wordcast-pod-cast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.8 &#8211; New Widget API</title>
		<link>http://www.paulmc.org/whatithink/2009/04/14/wordpress-28-new-widget-api/</link>
		<comments>http://www.paulmc.org/whatithink/2009/04/14/wordpress-28-new-widget-api/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 00:52:25 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[2.8]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.paulmc.org/whatithink/?p=1100</guid>
		<description><![CDATA[WordPress 2.8 and the new Widget API

WordPress 2.8 is due sometime this month, and one of the major changes is the new Widget API.


Hand in hand comes the new Widget Panel which uses AJAX to update your sidebars. The latest beta has the new Widget Panel included:



Still very much a work in progress, the Panel [...]]]></description>
			<content:encoded><![CDATA[<h3>WordPress 2.8 and the new Widget API</h3>
<p>
WordPress 2.8 is due sometime this month, and one of the major changes is the new Widget API.
</p>
<p>
Hand in hand comes the new Widget Panel which uses AJAX to update your sidebars. The latest beta has the new Widget Panel included:
</p>

<div id="attachment_1101" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.paulmc.org/whatithink/wp-content/uploads/2009/04/wp28-widget-panel.png"><img src="http://www.paulmc.org/whatithink/wp-content/uploads/2009/04/wp28-widget-panel-500x352.png" alt="WordPress 2.8 Widget Panel" title="WordPress 2.8 Widget Panel" width="500" height="352" class="size-medium wp-image-1101" /></a><p class="wp-caption-text">WordPress 2.8 Widget Panel</p></div>

<p>
Still very much a work in progress, the Panel doesn&#8217;t fully work yet and there&#8217;s a bit of work to be doen on the presentation side.
</p>
<h3>Multi Widgets</h3>
<p>
The biggest change is going to be for plugin writers. The new Widget API is designed to make the process of writing widgets, especially multi widgets easier.
</p>
<p>
As anyone who has ever written a multi-widget will tell you, the documentation is virtually non-existent and what tutorials are available are cryptic.<sup>[1]</sup>
</p>
<h3>The Widget API</h3>
<p>
As 2.8 will be released in the near future, now is the time to start thinking about updating your widgets to take advantage of the new API. As the Widget API isn&#8217;t fully documented yet, I decided to have a look at the source files to see what&#8217;s involved in writing a widget using the API.
</p>
<p>
The relevant files are:
</p>
<ul>
<li>/wp-includes/widgets.php</li>
<li>/wp-includes/default-widgets</li>
</ul>
<h3>Using the Widget API</h3>
<p>
The new Widget API provides a WP_Widget class and it&#8217;s by extending this class that you create your own widget. Your widget then over-rides 3 three methods within WP_Widget:
</p>
<ol>
<li>widget()</li>
<li>update()</li>
<li>form()</li>
</ol>
<p>
The easiest way to demonstrate this is by creating a basic text widget. So we&#8217;ll build a WordPress 2.8 Text Widget.
</p>
<h3>Building Your Widget</h3>
<p>
As with the current version of WordPress, your widget needs to contain the some basic information so that WordPress will recognise it as a plugin:
</p>
<p>
<code><br />
&lt;?php<br />
/*<br />
Plugin Name: New Widget API<br />
Plugin URI: http://www.paulmc.org/whatithink/<br />
Description: Demonstration of the WordPress 2.8 Widget API<br />
Version: 1.0<br />
Author: Paul McCarthy<br />
Author URI: http://www.paulmc.org/whatithink<br />
*/<br />
</code>
</p>
<p>
The first step is to create your widget class by extending WP_Widget:
</p>
<p>
<code><br />
class WP_My_Widget extends WP_Widget {<br />
</code>
</p>
<p>
Your widget needs a constructor, that is, a function that will be called when the widget is loaded. Your constructor must have the same name as your widget. Within the constructor, specify an array to hold your widget options, control options and call the WP_Widget constructor.
</p>
<p>
<code><br />
function WP_My_Widget() {</p>
<p>$widget_ops = array ('classname' => 'my_widget', 'description' => __('The description for your Widget') );<br />
$control_ops = array ('width' => '300', 'height' => '400');</p>
<p>$this->WP_Widget('my_widget', __('My Widget'), $widget_ops, $control_ops);</p>
<p>}<br />
</code>
</p>
<p>
Once you&#8217;ve created your constructor, it&#8217;s time to over-ride the methods needed to make your widget work. The first method to over-ride is widget().
</p>
<p>
The widget() method is where your widget does it&#8217;s work. The widget() method takes two parameters. The first provides you with access to the widget display settings and the second provides access to that particular instance settings.
</p>
<p>
As this is a simple text widget, we&#8217;ll use just two settings &#8211; title and text.
</p>
<p>
<code><br />
function widget($args, $instance) {</p>
<p>extract ($args);</p>
<p>$title = empty($instance['title']) ? __('My Widget Title') : apply_filters('widget_title', $instance['title']);<br />
$text = apply_filters('widget_text', $instant['text']);</p>
<p>echo $before_widget . $before_title . $title . $after_title;<br />
echo $text;<br />
echo $after_widget;<br />
}<br />
</code>
</p>
<p>
The next method that we&#8217;ll over-ride is the update() method. This method provides us with the means to update and save our widget settings. It takes two parameters, the first is an array that contains the settings provided by the user via the widget form, and the second is an array containing the old settings for the widget.
</p>
<p>
<code><br />
function update ($new_instance, $old_instance) {</p>
<p>$instance = $old_instance;</p>
<p>$instance['title'] = strip_tags($new_instance['title']);<br />
$instance['text'] = $new_instance['text'];</p>
<p>return $instance;<br />
}<br />
</code>
</p>
<p>
That&#8217;s it. All the method does is store the old settings in an array, update the array with the new settings and then pass the new settings back to the WP_Widget class. The WP_Widget class handles the actual updating and saving.
</p>
<p>
Our next method to over-ride is form(). This method is used to display the widget control form. It takes one parameter, an array with the current settings.
</p>
<p>
<code><br />
function form ($instance) {</p>
<p>$instance = wp_parse_args( (array) $instance, array('title' => '', 'text' => ''));</p>
<p>$title = strip_tags($instance['title']);<br />
$text = format_to_edit($instance['text']);</p>
<p>?&gt;</p>
<p>&lt;p&gt;<br />
&lt;label for="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;"&gt;&lt;?php _e('Title:'); ?&gt;<br />
&lt;input class="widefat" id="&lt;?php echo $this-&gt;get_field_id('title'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('title'); ?&gt;" type="text" value="&lt;?php echo attribute_escape($title); ?>" /&gt;<br />
&lt;/label&gt;<br />
&lt;textarea class="widefat" rows="16" cols="20" id="&lt;?php echo $this-&gt;get_field_id('text'); ?&gt;" name="&lt;?php echo $this-&gt;get_field_name('text'); ?&gt;"&gt;&lt;?php echo $text ?&gt;&lt;/textarea&gt;<br />
		&lt;/p&gt;</p>
<p>&lt;?php<br />
	}<br />
}<br />
</code>
</p>
<p>
That&#8217;s it. A simple text widget written using the WordPress 2.8 Widget API.
</p>
<p>
If you&#8217;d like to review the full code, with comments, then you can download it here:
</p>
<p style="padding: 10px; background-color: #660000; margin: 20px 0; font-size: 2em; text-align: center;">
<a style="color: white;" href='http://www.paulmc.org/whatithink/wp-content/uploads/2009/04/new-widget-api.zip'>New Widget API Plugin File</a></p>
<ol class="footnotes"><li id="footnote_0_1100" class="footnote">I&#8217;ve been looking into transforming one of my widgets into a multi-widget, but given the hassle involved, I&#8217;m just going to hold off until 2.8 is released.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.paulmc.org/whatithink/2009/04/14/wordpress-28-new-widget-api/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
