<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Simple widgets. Widgets 101.</title>
	<atom:link href="http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/</link>
	<description>Hacking WordPress. Keeping the bits together.</description>
	<lastBuildDate>Wed, 23 Dec 2009 20:12:27 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Useful WordPress Resources &#124; Bui4Ever &#124; Bui4Ever.com</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-3115</link>
		<dc:creator>Useful WordPress Resources &#124; Bui4Ever &#124; Bui4Ever.com</dc:creator>
		<pubDate>Wed, 23 Dec 2009 20:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-3115</guid>
		<description>[...] Simple Widgets. Widget 101. &#8211; I used this tutorial to create my &#8216;Simple Archives&#8217; sidebar widget. It&#8217;s very straight to the point and perfect for adding a widget in which you&#8217;re trying to display some php queries or results. [...]</description>
		<content:encoded><![CDATA[<p>[...] Simple Widgets. Widget 101. &#8211; I used this tutorial to create my &#8216;Simple Archives&#8217; sidebar widget. It&#8217;s very straight to the point and perfect for adding a widget in which you&#8217;re trying to display some php queries or results. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ElMehdi</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-2966</link>
		<dc:creator>ElMehdi</dc:creator>
		<pubDate>Sat, 29 Nov 2008 18:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-2966</guid>
		<description>Thank you for your article : clean and clear :)
Regards;</description>
		<content:encoded><![CDATA[<p>Thank you for your article : clean and clear :)<br />
Regards;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bored and blogging</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-2079</link>
		<dc:creator>bored and blogging</dc:creator>
		<pubDate>Tue, 11 Dec 2007 05:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-2079</guid>
		<description>&lt;strong&gt;Creating AdSense Widgets in WordPress&lt;/strong&gt;

Recently I attempted to create a WordPress widget for an AdSense Firefox referral image ad in a widget-ready theme. I was quite surprised how easy it was. It may not be the best code ever, but it got the job done. Here is a quick run-down of how I did ...</description>
		<content:encoded><![CDATA[<p><strong>Creating AdSense Widgets in WordPress</strong></p>
<p>Recently I attempted to create a WordPress widget for an AdSense Firefox referral image ad in a widget-ready theme. I was quite surprised how easy it was. It may not be the best code ever, but it got the job done. Here is a quick run-down of how I did &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonid Mamchenkov</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-1463</link>
		<dc:creator>Leonid Mamchenkov</dc:creator>
		<pubDate>Fri, 05 Oct 2007 09:51:57 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-1463</guid>
		<description>Thunder,

I think the widgets that you want to create already exist.  Check the http://wp-plugins.net ...</description>
		<content:encoded><![CDATA[<p>Thunder,</p>
<p>I think the widgets that you want to create already exist.  Check the <a href="http://wp-plugins.net" rel="nofollow">http://wp-plugins.net</a> &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thunder</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-1462</link>
		<dc:creator>Thunder</dc:creator>
		<pubDate>Fri, 05 Oct 2007 09:41:27 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-1462</guid>
		<description>How crate widget that list blog directory in my blog, add static link in code in widget script ???
Pleas simple example !!! :)</description>
		<content:encoded><![CDATA[<p>How crate widget that list blog directory in my blog, add static link in code in widget script ???<br />
Pleas simple example !!! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OpinionBug.com &#187; Designing Simple WordPress Widgets</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-1375</link>
		<dc:creator>OpinionBug.com &#187; Designing Simple WordPress Widgets</dc:creator>
		<pubDate>Fri, 28 Sep 2007 22:20:25 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-1375</guid>
		<description>[...] special thanks to Leonid at WordPress Bits for his excellent tutorial on creating simple [...]</description>
		<content:encoded><![CDATA[<p>[...] special thanks to Leonid at WordPress Bits for his excellent tutorial on creating simple [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Fox &#187; Blog Archive &#187; News Widget Plugin</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-322</link>
		<dc:creator>Ryan Fox &#187; Blog Archive &#187; News Widget Plugin</dc:creator>
		<pubDate>Fri, 10 Aug 2007 05:19:51 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-322</guid>
		<description>[...] from the Exec-PHP widget to its own widget plugin. This too proved to be more complicated than some people made it seem. Perhaps it was because I also had to requirement of the widget being a plugin, rather [...]</description>
		<content:encoded><![CDATA[<p>[...] from the Exec-PHP widget to its own widget plugin. This too proved to be more complicated than some people made it seem. Perhaps it was because I also had to requirement of the widget being a plugin, rather [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonid Mamchenkov</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-34</link>
		<dc:creator>Leonid Mamchenkov</dc:creator>
		<pubDate>Thu, 21 Jun 2007 14:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-34</guid>
		<description>Once again I am convinced that a screenshot of my editor looks by far better than text code in this blog. :)</description>
		<content:encoded><![CDATA[<p>Once again I am convinced that a screenshot of my editor looks by far better than text code in this blog. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonid Mamchenkov</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-33</link>
		<dc:creator>Leonid Mamchenkov</dc:creator>
		<pubDate>Thu, 21 Jun 2007 14:35:58 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-33</guid>
		<description>Michel,

yes, plugins that create widgets work in the same way.  Just instead of having a widget file with PHP code, you use plugin&#039;s file.  You can have some additional logic in the plugin too.

As a rough example consider this:

&lt;code&gt;
# we will use one of this functions for our 
# widget depending on the circumstances

function a () {
 ...
}

function b () {
 ...
}

function c () {
 ...
}

# Choose which function to use
if ($something) {
  $widget_function = &#039;a&#039;;
}
elseif ($something_else) {
  $widget_function = &#039;b&#039;;
}
else {
  $widget_function = &#039;c&#039;;
}

# Create widget
register_sidebar_widget(&#039;My widget&#039;,$widget_function);
&lt;/code&gt;

As a result of this code, we will always have the widget with the same name (&#039;My widget&#039;).  But the functionality of this widget will vary depending on our conditions.

There are many practical applications for this.  One which comes to mind is an advertising/banner management solution.  I can have Google Analytics, Yahoo, MSN, and local ads.  And I can easily switch and combine them, depending on the provided options or on service license/agreement.

Moving this functionality between sites becomes very easy.  And an additional layer of fun comes from widgets having their own configuration and plugins having their own configuration.  And ... I&#039;ll stop here, because the potential blows my mind ;)</description>
		<content:encoded><![CDATA[<p>Michel,</p>
<p>yes, plugins that create widgets work in the same way.  Just instead of having a widget file with PHP code, you use plugin&#8217;s file.  You can have some additional logic in the plugin too.</p>
<p>As a rough example consider this:</p>
<p><code><br />
# we will use one of this functions for our<br />
# widget depending on the circumstances</p>
<p>function a () {<br />
 ...<br />
}</p>
<p>function b () {<br />
 ...<br />
}</p>
<p>function c () {<br />
 ...<br />
}</p>
<p># Choose which function to use<br />
if ($something) {<br />
  $widget_function = 'a';<br />
}<br />
elseif ($something_else) {<br />
  $widget_function = 'b';<br />
}<br />
else {<br />
  $widget_function = 'c';<br />
}</p>
<p># Create widget<br />
register_sidebar_widget('My widget',$widget_function);<br />
</code></p>
<p>As a result of this code, we will always have the widget with the same name (&#8216;My widget&#8217;).  But the functionality of this widget will vary depending on our conditions.</p>
<p>There are many practical applications for this.  One which comes to mind is an advertising/banner management solution.  I can have Google Analytics, Yahoo, MSN, and local ads.  And I can easily switch and combine them, depending on the provided options or on service license/agreement.</p>
<p>Moving this functionality between sites becomes very easy.  And an additional layer of fun comes from widgets having their own configuration and plugins having their own configuration.  And &#8230; I&#8217;ll stop here, because the potential blows my mind ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michel</title>
		<link>http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-32</link>
		<dc:creator>Michel</dc:creator>
		<pubDate>Thu, 21 Jun 2007 14:16:26 +0000</pubDate>
		<guid isPermaLink="false">http://wpbits.wordpress.com/2007/06/16/simple-widgets-widgets-101/#comment-32</guid>
		<description>PS Staying tuned! ;-)</description>
		<content:encoded><![CDATA[<p>PS Staying tuned! ;-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
