<?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>Re-Cycled Air &#187; jack</title>
	<atom:link href="http://www.re-cycledair.com/author/jack/feed" rel="self" type="application/rss+xml" />
	<link>http://www.re-cycledair.com</link>
	<description>Wordpress and PHP Tutorials</description>
	<lastBuildDate>Thu, 09 Sep 2010 01:44:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Search PDFs With PHP, MySQL, and PdfToText</title>
		<link>http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext</link>
		<comments>http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext#comments</comments>
		<pubDate>Thu, 09 Sep 2010 01:43:45 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdftotext]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=708</guid>
		<description><![CDATA[Being able to search a PDF is a very useful feature on any web site.  The problem is that there aren&#8217;t many languages that give you the tools to do so right out of the box.  PHP is no exception to this.  If you want to search PDF files you&#8217;ll need some third-party tools and [...]]]></description>
			<content:encoded><![CDATA[<p>Being able to search a PDF is a very useful feature on any web site.  The problem is that there aren&#8217;t many languages that give you the tools to do so right out of the box.  PHP is no exception to this.  If you want to search PDF files you&#8217;ll need some third-party tools and a little bit of ingenuity.</p>
<h2><strong>Pre-requisites</strong></h2>
<p>You&#8217;ll server will need to have the following configuration.</p>
<ul>
<li>PHP (&gt;=4)</li>
<li>MySQL (&gt;=4)</li>
<li>Linux (Distro of your choice)</li>
</ul>
<h2><strong>Step 1:  Download PdfToText</strong></h2>
<p>PdfToText is a program written in C that will quickly convert the contents of a PDF to text.  We&#8217;re going to use it just for that purpose.  You download the file at <a href="ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02pl4-linux.tar.gz">ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02pl4-linux.tar.gz</a>.  Once you have downloaded the file, go ahead and place it somewhere in your web site directory and extract it (on most linux systems &#8220;tar -xzf [file]&#8221; will do the trick).  Once it&#8217;s unzipped, you&#8217;ll see a program called &#8220;pdftotext&#8221;, which is what we&#8217;re after.</p>
<h2>Step 2:  Convert the PDF to Text</h2>
<p>As an astute reader, you&#8217;ve probably noticed by now that PdfToText is not a PHP file.  So how are we going to use it?  Well, we&#8217;re going to use the &#8220;backtick&#8221; (the ~ [tilda] key) operator.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> convert_to_text<span class="phpOperator">(</span>$pdf<span class="phpOperator">)</span> <span class="phpOperator">{</span>
$output <span class="phpOperator">=</span> `<span class="phpOperator">.</span>/pdftotext <span class="phpOperator">{</span>$pdf<span class="phpOperator">}</span> temp.txt`<span class="phpText">;</span>
<span class="phpKeyword">
return </span>$output
<span class="phpOperator">}</span>
</pre>
<p>The backtick operator will execute any command on the command line, trap it&#8217;s output, and return it to the caller.  It&#8217;s worth noting that the backtick operator will only return output from standard out.</p>
<p>This is probably the hardest part of this tutorial.  There may be problems with write permissions on the directory, or ownership problems, but if you can get it to work, you&#8217;re all set.</p>
<h2>Step 3:  Read the Text</h2>
<p>Now that the PDF has been converted to a text file, we need to get that information back in to PHP.  To do that, we use the <em>file_get_contents</em> functions.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> get_text<span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
$text <span class="phpOperator">=</span> <span class="phpFunction">file_get_contents</span><span class="phpOperator">(</span><span class="phpString">"temp.txt"</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpKeyword">
return </span>$text;
<span class="phpOperator">}</span>
</pre>
<h2>Step 4:  Store the Data</h2>
<p>This part of the tutorial assumes 2 things.  1) That you have a table named pdf_data, and 2) That the table has a column called pdf_contents that is <a href="http://dev.mysql.com/doc/refman/4.1/en/fulltext-search.html">full-text</a> searchable (If you need help setting this sort of thing up, leave a comment).</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> store_data<span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
$text <span class="phpOperator">=</span> mysql_real_escape_string<span class="phpOperator">(</span>get_text<span class="phpOperator">(</span><span class="phpOperator">)</span><span class="phpOperator">)</span><span class="phpText">;</span>
$query <span class="phpOperator">=</span> <span class="phpString">"INSERT INTO pdf_data <span class="phpOperator">(</span>pdf_contents<span class="phpOperator">)</span> VALUES <span class="phpOperator">(</span><span class="phpString">'<span class="phpOperator">{</span>$text<span class="phpOperator">}</span>'</span><span class="phpOperator">)</span>"</span><span class="phpText">;</span>
<span class="phpFunction">mysql_query</span><span class="phpOperator">(</span>$query<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
</pre>
<h2>Step 5:  Search the Data</h2>
<p>The final step is actually searching the data.  To do that, we&#8217;ll use the full-text searching capability of MySQL.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> search_data<span class="phpOperator">(</span>$term<span class="phpOperator">)</span> <span class="phpOperator">{</span>
$term <span class="phpOperator">=</span> mysql_real_escape_string<span class="phpOperator">(</span>$term<span class="phpOperator">)</span><span class="phpText">;</span>
$query <span class="phpOperator">=</span> <span class="phpString">"SELECT * FROM pdf_data MATCH<span class="phpOperator">(</span>pdf_contents<span class="phpOperator">)</span> AGAINST <span class="phpOperator">(</span><span class="phpString">'$term'</span><span class="phpOperator">)</span>"</span><span class="phpText">;</span>
$result <span class="phpOperator">=</span> <span class="phpFunction">mysql_query</span><span class="phpOperator">(</span>$query<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpKeyword">
while<span class="phpOperator">(</span></span>$row <span class="phpOperator">=</span> <span class="phpFunction">mysql_fetch_array</span><span class="phpOperator">(</span>$result<span class="phpOperator">)</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpComment">//Do stuff with returned data.
</span><span class="phpOperator">}</span>
<span class="phpOperator">}</span>
</pre>
<p>Where &#8220;Do stuff with returned data&#8221; is, you can do whatever you want.  MySQL is going to return the rows to you in order of relevance (descending).  The most relevant result will be first, followed by the second most, and third most, and so on.</p>
<h2>Other Notes</h2>
<ul>
<li>PdfToText may or may not be the best way to do this, but it is one of the simplest.  There are a handful of libraries out there for creating PDFs in PHP, but surprisingly few for something as common as reading a PDF.</li>
<li>There are binaries and source files available for PdfToText on their web site(<a href="http://www.foolabs.com/xpdf/download.html">here</a>).</li>
<li>This tutorial could be expanded a lot.  If you have questions or requests, please ask!</li>
</ul>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext&amp;title=Search+PDFs+With+PHP%2C+MySQL%2C+and+PdfToText" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext&amp;title=Search+PDFs+With+PHP%2C+MySQL%2C+and+PdfToText" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext&amp;title=Search+PDFs+With+PHP%2C+MySQL%2C+and+PdfToText&amp;desc=Being%20able%20to%20search%20a%20PDF%20is%20a%20very%20useful%20feature%20on%20any%20web%20site.%C2%A0%20The%20problem%20is%20that%20there%20aren%27t%20many%20languages%20that%20give%20you%20the%20tools%20to%20do%20so%20right%20out%20of%20the%20box.%C2%A0%20PHP%20is%20no%20exception%20to%20this.%C2%A0%20If%20you%20want%20to%20search%20PDF%20files%20you%27ll%20need%20some%20third-party%20tools%20and%20a%20little%20bit%20of%20ingenu" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext&amp;bm_description=Search+PDFs+With+PHP%2C+MySQL%2C+and+PdfToText&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext&amp;title=Search+PDFs+With+PHP%2C+MySQL%2C+and+PdfToText" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext&amp;title=Search+PDFs+With+PHP%2C+MySQL%2C+and+PdfToText" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext&amp;title=Search+PDFs+With+PHP%2C+MySQL%2C+and+PdfToText" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Search+PDFs+With+PHP%2C+MySQL%2C+and+PdfToText+-+http://b2l.me/aqeg42&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/search-pdf-php-mysql-pdftotext/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enhancing the WordPress Code Editor</title>
		<link>http://www.re-cycledair.com/enhancing-the-wordpress-code-editor</link>
		<comments>http://www.re-cycledair.com/enhancing-the-wordpress-code-editor#comments</comments>
		<pubDate>Wed, 08 Sep 2010 01:15:36 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=699</guid>
		<description><![CDATA[In all WordPress versions, there has been a severe dichotomy between text editors.  In one corner we have TinyMCE, which is a full-featured editor that is used when constructing pages and posts.  On the other hand we have what amounts to a text area, where you make changes to code in theme files.  I&#8217;ve always wondered why [...]]]></description>
			<content:encoded><![CDATA[<p>In all WordPress versions, there has been a severe dichotomy between text editors.  In one corner we have TinyMCE, which is a full-featured editor that is used when constructing pages and posts.  On the other hand we have what amounts to a text area, where you make changes to code in theme files.  I&#8217;ve always wondered why there isn&#8217;t some sort of syntax highlighting, tab support, or rudimentary auto-completion available in the default code editor.  As a developer, I realize how hard these features are to implement using nothing more than CSS and Javascript, but I thought some attempt may have been made by the core developers by version 3.</p>
<p>That has yet to materialize, but the community has come to the rescue.  A plugin called <strong>Power Code Editor</strong> exists that does simple syntax highlighting and improves font that is used in the editor.  After applying the plugin, your code editor will look like this.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/09/power_code.png" rel="lightbox[699]"><img class="aligncenter size-medium wp-image-701" title="Power Code Editor" src="http://www.re-cycledair.com/wp-content/uploads/2010/09/power_code-300x172.png" alt="Enhance WordPress Code Editor" width="300" height="172" /></a></p>
<p>If you&#8217;re interested, you can download the plugin <a href="http://wordpress.org/extend/plugins/power-code-editor/">here</a>.  Or, from within the WordPress plugin installation menu search for &#8220;<strong>power code editor</strong>&#8220;.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/enhancing-the-wordpress-code-editor/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/enhancing-the-wordpress-code-editor&amp;title=Enhancing+the+Wordpress+Code+Editor" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/enhancing-the-wordpress-code-editor&amp;title=Enhancing+the+Wordpress+Code+Editor" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/enhancing-the-wordpress-code-editor&amp;title=Enhancing+the+Wordpress+Code+Editor&amp;desc=In%20all%20Wordpress%20versions%2C%20there%20has%20been%20a%20severe%C2%A0dichotomy%C2%A0between%20text%20editors.%20%C2%A0In%20one%20corner%20we%20have%20TinyMCE%2C%20which%20is%20a%20full-featured%20editor%20that%20is%20used%20when%20constructing%20pages%20and%20posts.%20%C2%A0On%20the%20other%20hand%20we%20have%20what%20amounts%20to%20a%20text%20area%2C%20where%20you%20make%20changes%20to%20code%20in%20theme%20files" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/enhancing-the-wordpress-code-editor&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/enhancing-the-wordpress-code-editor&amp;bm_description=Enhancing+the+Wordpress+Code+Editor&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/enhancing-the-wordpress-code-editor&amp;title=Enhancing+the+Wordpress+Code+Editor" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/enhancing-the-wordpress-code-editor&amp;title=Enhancing+the+Wordpress+Code+Editor" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/enhancing-the-wordpress-code-editor&amp;title=Enhancing+the+Wordpress+Code+Editor" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/enhancing-the-wordpress-code-editor" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Enhancing+the+Wordpress+Code+Editor+-+http://b2l.me/aqd3qy&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/enhancing-the-wordpress-code-editor/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>$_SERVER Variables Are Unsafe For WordPress Plugins</title>
		<link>http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins</link>
		<comments>http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins#comments</comments>
		<pubDate>Mon, 06 Sep 2010 14:32:46 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=687</guid>
		<description><![CDATA[Sometimes a plugin developer might want to submit a form back to itself.  Or perhaps they want to link back to the current page, except with a variable in the query string.  Often enough, you&#8217;ll seem them do it this way. &#60;form method=POST action=&#039;&#60;?=$_SERVER[&#039;PHP_SELF&#039;]?&#62;&#039;&#62; or &#60;a href=&#039;&#60;?=$_SERVER[&#039;REQUEST_URI&#039;]?&#62;&#039;&#62;Click Here&#60;/a&#62; The problem with this code is that [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes a plugin developer might want to submit a form back to itself.  Or perhaps they want to link back to the current page, except with a variable in the query string.  Often enough, you&#8217;ll seem them do it this way.</p>
<pre class="php"><span class="htmlFormTag">&lt;form method=POST action=<span class="htmlAttributeValue">&#039;<span class="htmlOtherTag">&lt;?=$_SERVER[&#039;</span>PHP_SELF&#039;]?&gt;</span></span>&#039;&gt;</pre>
<p>or</p>
<pre class="php"><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&#039;<span class="htmlOtherTag">&lt;?=$_SERVER[&#039;</span>REQUEST_URI&#039;]?&gt;</span></span>&#039;&gt;Click Here<span class="htmlAnchorTag">&lt;/a&gt;</span></pre>
<p>The problem with this code is that it&#8217;s easily exploitable.  Remember, the behavior for REQUEST_URI and PHP_SELF are to take whatever the entrance URL was and return it to the caller.  So how can this effect your pages?  Since the user can append anything that they&#8217;d like to the initial entrance URL, it becomes the vector for attack.</p>
<p>So how can you submit forms and links back to themselves without these variables?  For forms, just leave the action blank or don&#8217;t include it at all.</p>
<pre class="html"><span class="htmlFormTag">&lt;form method=POST&gt;</span></pre>
<pre class="html"><span class="htmlFormTag">&lt;form method=POST action=<span class="htmlAttributeValue">&#039;&#039;</span>&gt;</span></pre>
<p>And for links, using the # sign will link back to your current page.</p>
<pre class="html"><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&#039;#&#039;</span>&gt;</span>Click here!<span class="htmlAnchorTag">&lt;/a&gt;</span></pre>
<p>If a plugin developer absolutely MUST use server variables, just make sure to escape them accordingly.   Use the WordPress function <a href="http://codex.wordpress.org/Data_Validation#URLs">esc_url()</a>.</p>
<pre class="php"><span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&#039;<span class="htmlOtherTag">&lt;?=esc_url($_SERVER[&#039;</span>PHP_SELF&#039;]?&gt;</span></span>&#039;&gt;Click Me!<span class="htmlAnchorTag">&lt;/a&gt;</span></pre>
<p>In reality, it&#8217;s bad practice to use the PHP $_SERVER variables at all.  So try to avoid doing it at all costs.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins&amp;title=%24_SERVER+Variables+Are+Unsafe+For+Wordpress+Plugins" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins&amp;title=%24_SERVER+Variables+Are+Unsafe+For+Wordpress+Plugins" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins&amp;title=%24_SERVER+Variables+Are+Unsafe+For+Wordpress+Plugins&amp;desc=Sometimes%20a%20plugin%20developer%20might%20want%20to%20submit%20a%20form%20back%20to%20itself.%C2%A0%20Or%20perhaps%20they%20want%20to%20link%20back%20to%20the%20current%20page%2C%20except%20with%20a%20variable%20in%20the%20query%20string.%C2%A0%20Often%20enough%2C%20you%27ll%20seem%20them%20do%20it%20this%20way.%0D%0A%0D%0A%7Bcode%20type%3Dphp%7D%26lt%3Bform%20method%3DPOST%20action%3D%27%26lt%3B%3F%3D%24_SERVER%5B%27PHP_SELF%27%5D%3F%26gt" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins&amp;bm_description=%24_SERVER+Variables+Are+Unsafe+For+Wordpress+Plugins&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins&amp;title=%24_SERVER+Variables+Are+Unsafe+For+Wordpress+Plugins" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins&amp;title=%24_SERVER+Variables+Are+Unsafe+For+Wordpress+Plugins" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins&amp;title=%24_SERVER+Variables+Are+Unsafe+For+Wordpress+Plugins" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=%24_SERVER+Variables+Are+Unsafe+For+Wordpress+Plugins+-+http://b2l.me/aqd4gq&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/server-variables-unsafe-for-wordpress-plugins/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress User Roles</title>
		<link>http://www.re-cycledair.com/wordpress-user-roles</link>
		<comments>http://www.re-cycledair.com/wordpress-user-roles#comments</comments>
		<pubDate>Mon, 06 Sep 2010 12:57:42 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[user roles]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=684</guid>
		<description><![CDATA[By default, WordPress 3 ships with 6 (5 in your aren&#8217;t using MU features) roles that can be assigned to individual users.  Unless you&#8217;re browsing the codex or have been using WordPress for ages, it&#8217;s sometimes hard to understand the differences between user roles.  Many bloggers run their site on their own, so roles really [...]]]></description>
			<content:encoded><![CDATA[<p>By default, WordPress 3 ships with 6 (5 in your aren&#8217;t using MU features) roles that can be assigned to individual users.  Unless you&#8217;re browsing the <a href="http://codex.wordpress.org">codex</a> or have been using WordPress for ages, it&#8217;s sometimes hard to understand the differences between user roles.  Many bloggers run their site on their own, so roles really don&#8217;t matter all that much.  However, for those who run sites with multiple contributing users, roles help keep the order.</p>
<p>The 6 default roles are Super Admin, Administrator, Editor, Author, Contributor, and Subscriber.</p>
<ul>
<li><strong>Super Admin </strong>- The Super Admin is a role only available in WordPress 3 when the multi-user (multi-site) features are turned on.  This role allows the super admin to administrate the entire network of sites.</li>
<li><strong>Administrator </strong>- This role allows the user to access all of the administration features of a site, including themes, plugins, and comment moderation.</li>
<li><strong>Editor </strong>- An editor can manage all pages, posts, and comments.  They don&#8217;t have to own them either, they can be authored by other users.</li>
<li><strong>Author </strong>- An author is a user that you trust to publish their own posts.</li>
<li><strong>Contributor </strong>- This is a user who is allowed to write posts, but they have to be approved by an editor before they get published.  This is handy if you have a guest that you would like to write an article, but want to review the content first.</li>
<li><strong>Subscriber </strong>- This user is only allowed to edit and maintain their profile on your site.</li>
</ul>
<p>If these roles aren&#8217;t enough to suit your needs (perhaps you need finer-grain permissions), there are plugins that exist in the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Repository</a> that can help.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/wordpress-user-roles/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/wordpress-user-roles&amp;title=Wordpress+User+Roles" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/wordpress-user-roles&amp;title=Wordpress+User+Roles" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/wordpress-user-roles&amp;title=Wordpress+User+Roles&amp;desc=By%20default%2C%20Wordpress%203%20ships%20with%206%20%285%20in%20your%20aren%27t%20using%20MU%20features%29%20roles%20that%20can%20be%20assigned%20to%20individual%20users.%20%C2%A0Unless%20you%27re%20browsing%20the%20codex%20or%20have%20been%20using%20Wordpress%20for%20ages%2C%20it%27s%20sometimes%20hard%20to%20understand%20the%20differences%20between%20user%20roles.%20%C2%A0Many%20bloggers%20run%20their%20site%20on%20" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/wordpress-user-roles&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/wordpress-user-roles&amp;bm_description=Wordpress+User+Roles&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/wordpress-user-roles&amp;title=Wordpress+User+Roles" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/wordpress-user-roles&amp;title=Wordpress+User+Roles" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/wordpress-user-roles&amp;title=Wordpress+User+Roles" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/wordpress-user-roles" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Wordpress+User+Roles+-+http://b2l.me/aqd4gr&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/wordpress-user-roles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Enable WordPress 3 Custom Menus</title>
		<link>http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus</link>
		<comments>http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus#comments</comments>
		<pubDate>Thu, 02 Sep 2010 23:58:47 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[custom menus]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=672</guid>
		<description><![CDATA[Prior to WordPress 3, if you wanted custom menus you had to code them yourself.  This generally involved editing your theme&#8217;s header.php file, knowledge of HTML, CSS, PHP, and probably SQL too.  Unsuprisingly, easy custom menus was a highly requested feature for WordPress 3 and it was delivered. Unfortunately, most themes don&#8217;t have support for [...]]]></description>
			<content:encoded><![CDATA[<p>Prior to WordPress 3, if you wanted custom menus you had to code them yourself.  This generally involved editing your theme&#8217;s <em>header.php</em> file, knowledge of HTML, CSS, PHP, and probably SQL too.  Unsuprisingly,<strong> </strong>easy custom menus was a highly requested feature for WordPress 3 and it was delivered.</p>
<p>Unfortunately, most themes don&#8217;t have support for custom menus yet.  Wordpress makes it easy to add them as widgets, but if you want real menus, they need to be enabled in your theme.</p>
<h2>Step 1:  Enable Custom Menus</h2>
<p>The first thing that you need to do in order to get custom menus working in WordPress 3 is enable them.  To do that, open up your theme&#8217;s <em>functions.php</em> file, and drop in the following code.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> register_custom_menu<span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
register_nav_menu<span class="phpOperator">(</span><span class="phpString">'custom_menu'</span>, __<span class="phpOperator">(</span><span class="phpString">'Custom Menu'</span><span class="phpOperator">)</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
add_action<span class="phpOperator">(</span><span class="phpString">'init'</span>, <span class="phpString">'register_custom_menu'</span><span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<p>Once you have done that, go to Appearance -&gt; Menus and you should see something like this.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/09/theme_locations.jpg" rel="lightbox[672]"><img class="aligncenter size-full wp-image-677" title="Wordpress Custom Menu Theme Locations" src="http://www.re-cycledair.com/wp-content/uploads/2010/09/theme_locations.jpg" alt="Wordpress Custom Menu Theme Locations" width="287" height="177" /></a></p>
<h2>Step 2:  Add the Menu to Your Theme</h2>
<p>Assuming that you&#8217;ve created a custom menu and want to display it, you&#8217;ll need to add the display function to your theme.  In most cases, you&#8217;ll need to open up the <em>header.php</em> file, and the area that looks like a menu.  This changes for every theme, but it should be fairly obvious.  Once you find it, insert the following code.</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span><span class="htmlText"> wp_nav_menu</span><span class="phpOperator">(</span><span class="phpFunction">array</span><span class="phpOperator">(</span><span class="phpString">'menu'</span> <span class="phpOperator"><span class="phpOperator">=</span><span class="phpOperator">&gt;</span></span> <span class="phpString">'custom_menu'</span><span class="phpOperator">)</span><span class="phpOperator">)</span><span class="phpText">;</span> <span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<p>After that, you&#8217;re menu should display in your navigation bar.  Good luck!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus&amp;title=How+to+Enable+Wordpress+3+Custom+Menus" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus&amp;title=How+to+Enable+Wordpress+3+Custom+Menus" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus&amp;title=How+to+Enable+Wordpress+3+Custom+Menus&amp;desc=Prior%20to%20Wordpress%203%2C%20if%20you%20wanted%20custom%20menus%20you%20had%20to%20code%20them%20yourself.%20%C2%A0This%20generally%20involved%20editing%20your%20theme%27s%20header.php%20file%2C%20knowledge%20of%20HTML%2C%20CSS%2C%20PHP%2C%20and%20probably%20SQL%20too.%20%C2%A0Unsuprisingly%2C%20easy%20custom%20menus%20was%20a%20highly%20requested%20feature%20for%20Wordpress%203%20and%20it%20was%20delivered.%0D%0A" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus&amp;bm_description=How+to+Enable+Wordpress+3+Custom+Menus&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus&amp;title=How+to+Enable+Wordpress+3+Custom+Menus" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus&amp;title=How+to+Enable+Wordpress+3+Custom+Menus" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus&amp;title=How+to+Enable+Wordpress+3+Custom+Menus" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+Enable+Wordpress+3+Custom+Menus+-+http://b2l.me/aqd4gt&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/how-to-enable-wordpress-3-custom-menus/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Exclude WordPress Plugins From Updates</title>
		<link>http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates</link>
		<comments>http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates#comments</comments>
		<pubDate>Mon, 30 Aug 2010 22:15:14 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=662</guid>
		<description><![CDATA[More often then we would like to admit, we are unwilling or unable to submit our WordPress plugins back to the repository for everyone to use.  But how do you exclude your plugin from WordPress updates?  As usual, the answer is with filters.  Check out the code below to see how. function exclude_my_plugin( $r, $url [...]]]></description>
			<content:encoded><![CDATA[<p>More often then we would like to admit, we are unwilling or unable to submit our WordPress plugins back to the repository for everyone to use.  But how do you exclude your plugin from WordPress updates?  As usual, the answer is with filters.  Check out the code below to see how.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> exclude_my_plugin<span class="phpOperator">(</span> $r, $url <span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpKeyword">
if </span><span class="phpOperator">(</span> <span class="phpNumber">0</span> <span class="phpOperator">!</span><span class="phpOperator"><span class="phpOperator">=</span>=</span> <span class="phpFunction">strpos</span><span class="phpOperator">(</span> $url, <span class="phpString">'http<span class="phpOperator">:</span><span class="phpComment">//api<span class="phpOperator">.</span>wordpress<span class="phpOperator">.</span>org/plugins/update-check'</span> <span class="phpOperator">)</span> <span class="phpOperator">)</span>
</span>>return $r<span class="phpText">;</span>
$plugins <span class="phpOperator">=</span> <span class="phpFunction">un<span class="phpFunction">serialize</span></span><span class="phpOperator">(</span> $r<span class="phpOperator">[</span><span class="phpString">'body'</span><span class="phpOperator">]</span><span class="phpOperator">[</span><span class="phpString">'plugins'</span><span class="phpOperator">]</span> <span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpFunction">unset</span><span class="phpOperator">(</span> $plugins<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>plugins<span class="phpOperator">[</span> plugin_basename<span class="phpOperator">(</span> <span class="phpConstant">__FILE__</span> <span class="phpOperator">)</span> <span class="phpOperator">]</span> <span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpFunction">unset</span><span class="phpOperator">(</span> $plugins<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>active<span class="phpOperator">[</span> <span class="phpFunction">array_search</span><span class="phpOperator">(</span> plugin_basename<span class="phpOperator">(</span> <span class="phpConstant">__FILE__</span> <span class="phpOperator">)</span>, $plugins<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>active <span class="phpOperator">)</span> <span class="phpOperator">]</span> <span class="phpOperator">)</span><span class="phpText">;</span>
$r<span class="phpOperator">[</span><span class="phpString">'body'</span><span class="phpOperator">]</span><span class="phpOperator">[</span><span class="phpString">'plugins'</span><span class="phpOperator">]</span> <span class="phpOperator">=</span> <span class="phpFunction">serialize</span><span class="phpOperator">(</span> $plugins <span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpKeyword">
return </span>$r<span class="phpText">;</span>
<span class="phpOperator">}</span>
add_filter<span class="phpOperator">(</span> <span class="phpString">'http_request_args'</span>, <span class="phpString">'exclude_my_plugin'</span>, <span class="phpNumber">5</span>, <span class="phpNumber">2</span><span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<p><span style="font-size: small"><em><span style="font-size: x-small">Attribute:  This code is originally from a lead WordPress Developer, <a href="http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/">Mark Jaquith </a>(thanks Mark!</span>)</em></span></p>
<p>But how does this exclude your plugin from the update?  First, it takes the HTTP Request args and unserializes the ['body']['plugins'] part of it.  From there, it&#8217;s as simple as unsetting your plugin from the array, then re-serializing the request args.  Also the first part checks to see if this is actually and update check.  If it&#8217;s not, you exit the function.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates&amp;title=How+to+Exclude+Wordpress+Plugins+From+Updates" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates&amp;title=How+to+Exclude+Wordpress+Plugins+From+Updates" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates&amp;title=How+to+Exclude+Wordpress+Plugins+From+Updates&amp;desc=More%20often%20then%20we%20would%20like%20to%20admit%2C%20we%20are%20unwilling%20or%20unable%20to%20submit%20our%20Wordpress%20plugins%20back%20to%20the%20repository%20for%20everyone%20to%20use.%C2%A0%20But%20how%20do%20you%20exclude%20your%20plugin%20from%20Wordpress%20updates%3F%C2%A0%20As%20usual%2C%20the%20answer%20is%20with%20filters.%C2%A0%20Check%20out%20the%20code%20below%20to%20see%20how.%0D%0A%0D%0A%7Bcode%20type%3Dphp" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates&amp;bm_description=How+to+Exclude+Wordpress+Plugins+From+Updates&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates&amp;title=How+to+Exclude+Wordpress+Plugins+From+Updates" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates&amp;title=How+to+Exclude+Wordpress+Plugins+From+Updates" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates&amp;title=How+to+Exclude+Wordpress+Plugins+From+Updates" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+Exclude+Wordpress+Plugins+From+Updates+-+http://b2l.me/aqd4gu&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/how-to-exclude-wordpress-plugins-from-updates/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Enable Custom Backgrounds in WordPress 3</title>
		<link>http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3</link>
		<comments>http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3#comments</comments>
		<pubDate>Sun, 29 Aug 2010 04:34:35 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=651</guid>
		<description><![CDATA[One of the smaller (yet still welcome) features that snuck it&#8217;s way into WordPress 3 was custom backgrounds.  In most cases, this allows you to change the background picture and color of your blog (Note:  This may not work if your theme has a background already).  This is great, because you don&#8217;t have to know [...]]]></description>
			<content:encoded><![CDATA[<p>One of the smaller (yet still welcome) features that snuck it&#8217;s way into WordPress 3 was <strong>custom backgrounds</strong>.  In most cases, this allows you to change the background picture and color of your blog (<em>Note:  This may not work if your theme has a background already</em>).  This is great, because you don&#8217;t have to know CSS to make it work.  Really, all you need to do is add the following code to your theme&#8217;s <em>functions.php</em> file.</p>
<pre class="php">
add_custom_background<span class="phpOperator">(</span><span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<p>After that, under the Appearance menu you should have a &#8220;Background&#8221; option link.  When clicked, it will look like this.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/custom_background.jpg" rel="lightbox[651]"><img class="aligncenter size-medium wp-image-652" title="Wordpress 3 Custom Backgrounds" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/custom_background-300x179.jpg" alt="Enable WordPress 3 Custom Backgrounds" width="300" height="179" /></a></p>
<p>From there, upload your custom background and bask in your own glory!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3&amp;title=How+to+Enable+Custom+Backgrounds+in+Wordpress+3" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3&amp;title=How+to+Enable+Custom+Backgrounds+in+Wordpress+3" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3&amp;title=How+to+Enable+Custom+Backgrounds+in+Wordpress+3&amp;desc=One%20of%20the%20smaller%20%28yet%20still%20welcome%29%20features%20that%20snuck%20it%27s%20way%20into%20Wordpress%203%20was%20custom%20backgrounds.%C2%A0%20In%20most%20cases%2C%20this%20allows%20you%20to%20change%20the%20background%20picture%20and%20color%20of%20your%20blog%20%28Note%3A%C2%A0%20This%20may%20not%20work%20if%20your%20theme%20has%20a%20background%20already%29.%C2%A0%20This%20is%20great%2C%20because%20you%20don%27t" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3&amp;bm_description=How+to+Enable+Custom+Backgrounds+in+Wordpress+3&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3&amp;title=How+to+Enable+Custom+Backgrounds+in+Wordpress+3" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3&amp;title=How+to+Enable+Custom+Backgrounds+in+Wordpress+3" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3&amp;title=How+to+Enable+Custom+Backgrounds+in+Wordpress+3" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to+Enable+Custom+Backgrounds+in+Wordpress+3+-+http://b2l.me/aqd4gv&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/how-to-enable-custom-backgrounds-wordpress-3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Keyword Tool</title>
		<link>http://www.re-cycledair.com/google-keyword-tool</link>
		<comments>http://www.re-cycledair.com/google-keyword-tool#comments</comments>
		<pubDate>Sat, 28 Aug 2010 14:00:06 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=645</guid>
		<description><![CDATA[It&#8217;s not easy knowing what to write about.  When you run a niche site like this, it&#8217;s even harder.  One of the tools I rely heavily on to tell whether I should invest the time writing a post or not is the Google Keyword Tool.  The Google Keyword Tool allows you enter key words, and [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not easy knowing what to write about.  When you run a niche site like this, it&#8217;s even harder.  One of the tools I rely heavily on to tell whether I should invest the time writing a post or not is the <a href="https://adwords.google.com/select/KeywordToolExternal"><strong>Google Keyword Tool</strong></a>.  The <a href="https://adwords.google.com/select/KeywordToolExternal"><strong>Google Keyword Tool</strong></a> allows you enter key words, and then it tells you the monthly search volume on those words, the competition, and even monthly local searches.  But it doesn&#8217;t stop there, it gives you other keywords that may be relevant to you and displays statistics on those as well.   By far though, the most important feature is the competition rating.  It lets you see if you should even bother trying to go after that niche or not.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/keywords.jpg" rel="lightbox[645]"><img class="aligncenter size-full wp-image-646" title="Google Keyword Tool" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/keywords.jpg" alt="Google Keyword Tool" width="408" height="126" /></a></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/google-keyword-tool/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/google-keyword-tool&amp;title=Google+Keyword+Tool" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/google-keyword-tool&amp;title=Google+Keyword+Tool" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/google-keyword-tool&amp;title=Google+Keyword+Tool&amp;desc=It%27s%20not%20easy%20knowing%20what%20to%20write%20about.%C2%A0%20When%20you%20run%20a%20niche%20site%20like%20this%2C%20it%27s%20even%20harder.%C2%A0%20One%20of%20the%20tools%20I%20rely%20heavily%20on%20to%20tell%20whether%20I%20should%20invest%20the%20time%20writing%20a%20post%20or%20not%20is%20the%20Google%20Keyword%20Tool.%C2%A0%20The%20Google%20Keyword%20Tool%20allows%20you%20enter%20key%20words%2C%20and%20then%20it%20tells%20" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/google-keyword-tool&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/google-keyword-tool&amp;bm_description=Google+Keyword+Tool&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/google-keyword-tool&amp;title=Google+Keyword+Tool" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/google-keyword-tool&amp;title=Google+Keyword+Tool" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/google-keyword-tool&amp;title=Google+Keyword+Tool" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/google-keyword-tool" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Google+Keyword+Tool+-+http://b2l.me/aqd4gx&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/google-keyword-tool/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Lightbox</title>
		<link>http://www.re-cycledair.com/wordpress-lightbox</link>
		<comments>http://www.re-cycledair.com/wordpress-lightbox#comments</comments>
		<pubDate>Sat, 28 Aug 2010 12:00:41 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=643</guid>
		<description><![CDATA[The default behavior in WordPress when an image is clicked is to open another page of your blog.  Sometimes though, you want a more elegant solution.  One of the more trendy ways to open an image of the past few years has been using something called a lightbox.  A lightbox dims the screen via a [...]]]></description>
			<content:encoded><![CDATA[<p>The default behavior in WordPress when an image is clicked is to open another page of your blog.  Sometimes though, you want a more elegant solution.  One of the more trendy ways to open an image of the past few years has been using something called a <strong>lightbox</strong>.  A lightbox dims the screen via a modal window, and then displays your image.  If you would like something of this nature to be your default image behavior, check out <strong>Lightbox 2 </strong>(<a href="http://wordpress.org/extend/plugins/lightbox-2/">http://wordpress.org/extend/plugins/lightbox-2/</a>).  Don&#8217;t just take my word for it though, try out this WordPress lightbox by clicking the image below.</p>
<div id="attachment_611" class="wp-caption aligncenter" style="width: 286px"><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/Screen-shot-2010-08-26-at-7.53.17-AM.png" rel="lightbox[643]"><img class="size-full wp-image-611" title="Digg Oregon Trail Error Page" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/Screen-shot-2010-08-26-at-7.53.17-AM.png" alt="Wordpress Lightbox Example" width="276" height="132" /></a><p class="wp-caption-text">Test Lightbox Image</p></div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/wordpress-lightbox/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/wordpress-lightbox&amp;title=Wordpress+Lightbox" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/wordpress-lightbox&amp;title=Wordpress+Lightbox" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/wordpress-lightbox&amp;title=Wordpress+Lightbox&amp;desc=The%20default%20behavior%20in%20Wordpress%20when%20an%20image%20is%20clicked%20is%20to%20open%20another%20page%20of%20your%20blog.%C2%A0%20Sometimes%20though%2C%20you%20want%20a%20more%20elegant%20solution.%C2%A0%20One%20of%20the%20more%20trendy%20ways%20to%20open%20an%20image%20of%20the%20past%20few%20years%20has%20been%20using%20something%20called%20a%20lightbox.%C2%A0%20A%20lightbox%20dims%20the%20screen%20via%20a%20m" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/wordpress-lightbox&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/wordpress-lightbox&amp;bm_description=Wordpress+Lightbox&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/wordpress-lightbox&amp;title=Wordpress+Lightbox" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/wordpress-lightbox&amp;title=Wordpress+Lightbox" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/wordpress-lightbox&amp;title=Wordpress+Lightbox" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/wordpress-lightbox" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Wordpress+Lightbox+-+http://b2l.me/aqd4gy&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/wordpress-lightbox/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Create and Code WordPress Widgets</title>
		<link>http://www.re-cycledair.com/create-and-code-wordpress-widgets</link>
		<comments>http://www.re-cycledair.com/create-and-code-wordpress-widgets#comments</comments>
		<pubDate>Sat, 28 Aug 2010 00:49:23 +0000</pubDate>
		<dc:creator>jack</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.re-cycledair.com/?p=630</guid>
		<description><![CDATA[Note:  The full source code for this plugin can be found here. Every time you go to WordPress blog and see items in the sidebar, it&#8217;s likely that they are widgets.  There are thousands of them for download on WordPress.org, but what if you want to create your own?  How would you code it? That&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div>
<p><em>Note:  The full source code for this plugin can be found <a href="../wp-content/uploads/2010/08/sweet_math_widget.zip">here.</a></em></p>
<p>Every time you go to WordPress blog and see items in the sidebar, it&#8217;s likely that they are widgets.  There are thousands of them for download on WordPress.org, but what if you want to create your own?  How would you code it? That&#8217;s what I will answer in this quick How-To.</p>
</div>
<div>
<h3><strong>Step 1:  Create The Plugin</strong></h3>
<p><strong> </strong>We&#8217;re going to start out by creating a simple plugin.  It&#8217;s only purpose is to initialize our widget.</p>
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span>
<span class="phpComment">/*
Plugin Name<span class="phpOperator">:</span> Sweet Math Widget
Plugin URI<span class="phpOperator">:</span><span class="htmlText"> http</span><span class="phpOperator">:</span><span class="phpComment">//www<span class="phpOperator">.</span>re-cycledair.com
</span><span class="htmlText">Description</span><span class="phpOperator">:</span><span class="htmlText"> A math widget that takes the post id and multiplies it by </span><span class="phpNumber">5</span><span class="phpOperator">.</span>
<span class="htmlText">
Author</span><span class="phpOperator">:</span> Jack Slingerland
Version<span class="phpOperator">:</span> <span class="phpNumber">0</span><span class="phpOperator">.</span><span class="phpNumber">1</span>
<span class="htmlText">
Author URI</span><span class="phpOperator">:</span><span class="htmlText"> http</span><span class="phpOperator">:</span><span class="phpComment">//www<span class="phpOperator">.</span>re-cycledair.com
</span>*/</span>
<span class="phpFunctionKeyword">function</span><span class="htmlText"> sweetMathWidget</span><span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpKeyword">
global </span>$post;
<span class="phpFunction">echo</span> <span class="phpString">"<span class="phpOperator">{</span>$post<span class="phpOperator">-<span class="phpOperator">&gt;</span></span><span class="htmlText">ID</span><span class="phpOperator">}</span><span class="htmlText"> x </span><span class="phpNumber">5</span> <span class="phpOperator">=</span> "</span><span class="phpText">;</span>
<span class="phpFunction">echo</span> $post<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>ID*<span class="phpNumber">5</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
<span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
<h3><strong>Step 2:  Add &amp; Register the Widget</strong></h3>
<p>The nex step is the add the widget to WordPress and then register it.  Add this code to the plugin that you already have going.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> sweetMathWidgetInit<span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpOperator">{</span>
register_sidebar_widget<span class="phpOperator">(</span>__<span class="phpOperator">(</span><span class="phpString">'Sweet Math Widget'</span><span class="phpOperator">)</span>, <span class="phpString">'sweetMathWidget'</span><span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpOperator">}</span>
add_action<span class="phpOperator">(</span><span class="phpString">"plugins_loaded"</span>, <span class="phpString">"sweetMathWidgetInit"</span><span class="phpOperator">)</span><span class="phpText">;</span>
</pre>
<h3><strong>Step 3:  Add Theme Compatibility</strong></h3>
<p>You want everyone you use your plugin right?  Well if it isn&#8217;t compatible with any themes nobody is going to use it.  To add theme compatibility we need to modify the first function we wrote to look like this.</p>
<pre class="php">
<span class="phpFunctionKeyword">function</span> sweetMathWidget<span class="phpOperator">(</span>$args<span class="phpOperator">)</span> <span class="phpOperator">{</span>
<span class="phpKeyword">
global </span>$post;
<span class="phpFunction">extract</span><span class="phpOperator">(</span>$args<span class="phpOperator">)</span><span class="phpText">;</span>
<span class="phpFunction">echo</span> $before_widget;
<span class="phpFunction">echo</span> $before_title<span class="phpText">;</span>
<span class="phpFunction">echo</span> <span class="phpString">"<span class="phpOperator">&lt;</span>h2<span class="phpOperator">&gt;</span> Sweet Math Widget <span class="phpOperator">&lt;</span>/h2<span class="phpOperator">&gt;</span>"</span><span class="phpText">;</span>
<span class="phpFunction">echo</span> $after_title<span class="phpText">;</span>
<span class="phpFunction">echo</span> <span class="phpString">"<span class="phpOperator">{</span>$post<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>ID<span class="phpOperator">}</span> x <span class="phpNumber">5</span> <span class="phpOperator">=</span> "</span><span class="phpText">;</span><span class="phpFunction">echo</span> $post<span class="phpOperator">-<span class="phpOperator">&gt;</span></span>ID*<span class="phpNumber">5</span><span class="phpText">;</span>
<span class="phpFunction">echo</span> $after_widget;
<span class="phpOperator">}</span>
</pre>
<h3><strong>Step 4:  Upload &amp; Add The Widget</strong></h3>
<p>Now that you&#8217;re done, save the file as sweet_math_widget.php and then zip the file using WinZip (or a similar tool).  Upload the plugin to your WordPress install and then activate.  If everything goes well, you&#8217;ll have a new widget in you Appearance -&gt; Widgets area.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/math_widget_picture.jpg" rel="lightbox[630]"><img class="aligncenter size-full wp-image-634" title="Sweet Math Widget" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/math_widget_picture.jpg" alt="How to Create / Code A WordPress Widget" width="489" height="248" /></a></p>
<p>Drag &#8220;Sweet Math Widget into your sidebar and you&#8217;re done.  Go to a post on your blog and you should see something like this.</p>
<p><a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/final_product.jpg" rel="lightbox[630]"><img class="aligncenter size-full wp-image-636" title="Final Product" src="http://www.re-cycledair.com/wp-content/uploads/2010/08/final_product.jpg" alt="How to Create / Code a WordPress Widget Final Product" width="298" height="117" /></a></p>
<p>You can download the full source code for this widget <a href="http://www.re-cycledair.com/wp-content/uploads/2010/08/sweet_math_widget.zip">here.</a></p>
</div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.re-cycledair.com/create-and-code-wordpress-widgets/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.re-cycledair.com/create-and-code-wordpress-widgets&amp;title=How+To+Create+and+Code+Wordpress+Widgets" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.re-cycledair.com/create-and-code-wordpress-widgets&amp;title=How+To+Create+and+Code+Wordpress+Widgets" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.re-cycledair.com/create-and-code-wordpress-widgets&amp;title=How+To+Create+and+Code+Wordpress+Widgets&amp;desc=%0D%0A%0D%0ANote%3A%C2%A0%20The%20full%20source%20code%20for%20this%20plugin%20can%20be%20found%20here.%0D%0A%0D%0AEvery%20time%20you%20go%20to%20Wordpress%20blog%20and%20see%20items%20in%20the%20sidebar%2C%20it%27s%20likely%20that%20they%20are%20widgets.%20%C2%A0There%20are%20thousands%20of%20them%20for%20download%20on%20Wordpress.org%2C%20but%20what%20if%20you%20want%20to%20create%20your%20own%3F%20%C2%A0How%20would%20you%20code%20it%3F%20T" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.re-cycledair.com/create-and-code-wordpress-widgets&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.re-cycledair.com/create-and-code-wordpress-widgets&amp;bm_description=How+To+Create+and+Code+Wordpress+Widgets&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.re-cycledair.com/create-and-code-wordpress-widgets&amp;title=How+To+Create+and+Code+Wordpress+Widgets" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.re-cycledair.com/create-and-code-wordpress-widgets&amp;title=How+To+Create+and+Code+Wordpress+Widgets" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.re-cycledair.com/create-and-code-wordpress-widgets&amp;title=How+To+Create+and+Code+Wordpress+Widgets" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.re-cycledair.com/create-and-code-wordpress-widgets" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+To+Create+and+Code+Wordpress+Widgets+-+http://b2l.me/aqd4gz&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.re-cycledair.com/create-and-code-wordpress-widgets/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.804 seconds -->
