<?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>Dev Tips &#124; Become a Better Developer, One Tip at a Time. &#187; Plugins</title>
	<atom:link href="http://dev-tips.com/category/wordpress/plugins/feed" rel="self" type="application/rss+xml" />
	<link>http://dev-tips.com</link>
	<description>Become a Better Developer, One Tip at a Time.</description>
	<lastBuildDate>Sun, 07 Mar 2010 02:19:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Showing Code on WordPress Posts with Snipplr!</title>
		<link>http://dev-tips.com/featured/showing-code-on-wordpress-posts-with-snipplr</link>
		<comments>http://dev-tips.com/featured/showing-code-on-wordpress-posts-with-snipplr#comments</comments>
		<pubDate>Sun, 12 Jul 2009 05:03:31 +0000</pubDate>
		<dc:creator>Drew Douglass</dc:creator>
				<category><![CDATA[Client Side]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://dev-tips.com/?p=471</guid>
		<description><![CDATA[If you haven't used Snipplr yet, or are unsure what Snipplr is, it is basically a code pasting/sharing site on the surface. I recently signed up for an account, after looking at a lot of different places to store small snippets (bigger projects get stored GitHub) and found Snipplr to be a really excellent application. [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven't used <a href='http://snipplr.com' title='Snipplr Home Page'>Snipplr</a> yet, or are unsure what Snipplr is, it is basically a code pasting/sharing site on the surface. I recently signed up for an account, after looking at a lot of different places to store small snippets (bigger projects get stored GitHub) and found Snipplr to be a really excellent application. Today, I'm going to go over how to display code on your WordPress site using a Snipplr plugin and a snippet of your choice, I'll also be talking about some of the cooler features of Snipplr. </p>
<p><span id="more-471"></span></p>
<h2>A Quick Note</h2>
<p>Before I continue, I want to note that I am in no way shape or form in business with or getting paid at all by snipplr or anyone else for this post. I just found Snipplr to be a cool application and decided to share some things with you all <img src='http://dev-tips.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  /end disclaimer</p>
<h2>What does Snipplr do?</h2>
<div><img src='http://dev-tips.com/post_img/snipplr_home.jpg' alt='Snipplr Home Page Screenshot' /></div>
<p>A simple look at the about page will answer that question for you:</p>
<p>
<blockquote>With Snipplr you can keep all of your frequently used code snippets in one place that's accessible from any computer. You can share your code with other visitors and use what they post, too. Did we mention that Snipplr works with TextMate? Yeah, we rock.</p></blockquote>
<h2>Notable Features</h2>
<ul>
<li>Tons of programming languages to choose from, all with slightly different syntax highlighting.</li>
<li>The ability to add the original URL you found the snippet (if one exsists), you can also add the original author and any comments about the source code. Giving credit where it's due FTW!</li>
<li>Ability to tag and favorite any snippet you wish for easy organization.</li>
<li>Features integrate into TextMate. Furthermore, there are quite a few applications Snipplr integrates with.</li>
<li>Ability to download a backup copy of all of your snippets. I thought this was an especially cool feature.</li>
<li>Add others to your 'watchlist', which is other peoples snippets that interest you (much like Twitter, if you find someones snippets to be awesome, you can follow and keep track of them). By the way, <a href='http://snipplr.com/users/DrewDouglass/' title='Watch me on Snipplr'>you guys can follow me on snipplr anytime</a> <img src='http://dev-tips.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </li>
<li>An API key and available API. In addition, a Snipplr WordPress plugin that we will be using later in this article</li>
</ul>
<p>Hopefully, the above features will convince you to give Snipplr a look. Let's move on and get to displaying code snippets on our blog using the Snipplr plugin.</p>
<h2>Download the plugin</h2>
<div><img src='http://dev-tips.com/post_img/snipplr_plugin.jpg' alt='Snipplr Plugin Page' /></div>
<p>The first thing you will need to do is <a href='http://snipplr.com/developer/wordpress/' title='Download the Snipplr Plugin'>download the WordPress Snipplr plugin</a>, which will allow you to display any snippet you want, anywhere on your blog using WordPress short codes.</p>
<h2>Grab your API key</h2>
<div><img src='http://dev-tips.com/post_img/settings.jpg' alt='Settings Page' /></div>
<p>Next, you will need to grab your API key on the settings page. You will need to register an account to receive an API key, which should take all of 3 seconds or so. Navigate to the bottom of the settings page and copy your API key to your clipboard.</p>
<h2>Add a snippet</h2>
<p>Add whatever code it is you are wanting to display on your blog by clicking new snippet. Fill in the appropriate fields and click 'Post'. Now you can forever go back to that snippet if you need quick access to it or have any issues with your blog. Moving on...</p>
<h2>Activate the plugin</h2>
<p>After installing the plugin, activate the plugin and go to the Snipplr configuration page in your admin panel. Paste in your API key and set your Snipplr preferences.</p>
<h2>Using the shortcode</h2>
<p>We're nearly there. Now when you go to write a new post, use the snipplr shortcode <code>[ snippet = id ]</code> without spaces and replace id with the snippets ID number. You can find the snippet ID number in the URL of the snippet you wish to share.</p>
<h2>Example below</h2>
<p>Below you will find an example of the Snipplr plugin in use. The snippet is getting pulled from my Snipplr account and displayed according to the settings I have set for the plugin.</p>
<p></p><p><strong><a href='http://snipplr.com/view/16892/gpc-magic-quotes-runtime-stripping'>GPC Magic Quotes Runtime Stripping</a></strong><br/><small>Posted by <a href='http://snipplr.com/users/DrewDouglass'>DrewDouglass</a> on July 11th, 2009</small><br/><small>All credit for this code goes to the all mighty Fou-Lou of codingforums.com (link given).</small></p><div class='code' style='border: 1px dotted; overflow: auto; white-space:nowrap;'><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #000066;">function_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'get_magic_quotes_gpc'</span><span style="color: #66cc66;">&#41;</span> &amp;&amp; <a href="http://www.php.net/get_magic_quotes_gpc"><span style="color: #000066;">get_magic_quotes_gpc</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> GPCStrip<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/is_array"><span style="color: #000066;">is_array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span> <span style="color: #b1b100;">AS</span> <span style="color: #0000ff;">$arrKey</span> =&gt; <span style="color: #0000ff;">$arrVal</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$arrKey</span><span style="color: #66cc66;">&#93;</span> = GPCStrip<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arrVal</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/is_string"><span style="color: #000066;">is_string</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$arr</span> = <a href="http://www.php.net/stripslashes"><span style="color: #000066;">stripslashes</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$arr</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$_GET</span> = GPCStrip<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">$_POST</span> = GPCStrip<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_POST</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #0000ff;">$_COOKIE</span> = GPCStrip<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_COOKIE</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/is_array"><span style="color: #000066;">is_array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_FILES</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_FILES</span> <span style="color: #b1b100;">AS</span> <span style="color: #0000ff;">$key</span> =&gt; <span style="color: #0000ff;">$val</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$_FILES</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$key</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'tmp_name'</span><span style="color: #66cc66;">&#93;</span> = <a href="http://www.php.net/str_replace"><span style="color: #000066;">str_replace</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span>, <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\\</span>'</span>, <span style="color: #0000ff;">$val</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'tmp_name'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$_FILES</span> = GPCStrip<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_FILES</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #000066;">function_exists</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'set_magic_quotes_runtime'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/set_magic_quotes_runtime"><span style="color: #000066;">set_magic_quotes_runtime</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div><p></p>
<h2>Check out the functions links!</h2>
<p>I didn't even notice this until I was previewing this post, but if you hover over the functions in the above code, you will see that they all link to the functions in the php manual! That's a very user friendly feature of this plugin.</p>
<h2>Follow me on Snipplr!</h2>
<p>Feel free to <a href='http://snipplr.com/users/DrewDouglass/'>follow me on Snipplr</a>. If you're already on, leave your Snipplr link in the comments and I'll try to keep you on my watch list if I find it interesting. Have fun and use it responsibly, always give credit where it is due!</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tips.com/featured/showing-code-on-wordpress-posts-with-snipplr/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Plugin: Envato Recent Items, Updated!</title>
		<link>http://dev-tips.com/featured/wordpress-plugin-envato-recent-items-updated</link>
		<comments>http://dev-tips.com/featured/wordpress-plugin-envato-recent-items-updated#comments</comments>
		<pubDate>Sun, 26 Apr 2009 22:37:20 +0000</pubDate>
		<dc:creator>Drew Douglass</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Server Side]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://dev-tips.com/?p=348</guid>
		<description><![CDATA[Howdy folks! In case you missed it, I recently wrote an article for the ThemeForest Blog entitled display your recent items with WordPress and the Envato API. This post showed you how to display items from markets like ThemeForest and Flashden on your blog, along with their thumbnails and links. Well, the plugin has been [...]]]></description>
			<content:encoded><![CDATA[<p>Howdy folks! In case you missed it, I recently wrote an article for the <a href='http://blog.themeforest.net' title='In The Woods-ThemeForest Blog'>ThemeForest Blog</a> entitled <a href='http://blog.themeforest.net/general/display-your-recent-envato-items-with-wordpress-and-the-envato-api/' title='display-your-recent-envato-items-with-wordpress'>display your recent items with WordPress and the Envato API</a>. This post showed you how to display items from markets like ThemeForest and Flashden on your blog, along with their thumbnails and links. Well, the plugin has been updated with some new features and is now available on the <a href='http://wordpress.org/extend/plugins/envato-recent-items/' title='Envato WordPress Plugin'>WordPress plugin directory</a>. Read on to find out about the features and how to use the plugin!</p>
<p><span id="more-348"></span></p>
<h2>Features of the Envato Recent Items Plugin</h2>
<p>In short, the plugin allows you to easily show and style your recent items from Envato, from any market place (FlashDen, ThemeForest, AudioJungle, GraphicRiver etc). The plugin comes with the following features as of version 1.0:</p>
<ul>
<li>Thumbnails of item are shown and also link to your item.</li>
<li>Any number of items can be shown, depending on your preference.</li>
<li>You can choose to display the price of each item if you wish, the price does <em>not</em> display by default.</li>
<li>The title, thumbnail, and link are all wrapped in custom classes so you can easily style however you desire.</li>
<li>You can now add a referrer ID (username) in case you want to take part of the referral program.</li>
</ul>
<h2>How to use and install</h2>
<ol>
<li> Upload <code>envato_recent_items</code> folder to the <code>/wp-content/plugins/</code> directory.</li>
<li> Activate the plugin through the 'Plugins' menu in WordPress.</li>
<li> Place
<pre class="brush: php">&lt;?php echo envato_recent_items(&#039;collis&#039;, &#039;themeforest&#039;, 5, true, $ref=&#039;collis&#039;); ?&gt;</pre>
<p> in your template file(s) where you wish the items to be displayed.</li>
</ol>
<ul>
<li>The first argument is your username and is required.</li>
<li> The second argument is the marketplace and is required.</li>
<li> The third argument is the number of items to display and is required.</li>
<li> The fourth argument is wether or not to show the price and is not required. Defaults to false.</li>
<li> The fifth argument is your referral id (your username) and is not required. Defaults to null. </li>
</ul>
<p>Now, you may be wondering, why not just have the referral id be the same as the username? Good question. I wanted to keep this plugin as flexible as possible, and there may be cases when the items you are displaying (maybe a buddy or a co workers) would not be the same as your username.</p>
<h2>Screenshots</h2>
<p>Below is a screenshot of the plugin without any styling, also note that the price here is being shown, which is off by default:</p>
<p><img src='http://dev-tips.com/post_img/screenshot-1.jpg' alt='Envato Items Screenshot' /></p>
<p>Below is an excellent use of the plugin by <a href='http://themolitor.com/' title='The Molitor'>The Molitor</a>:</p>
<p><img src='http://dev-tips.com/post_img/screenshot-2.jpg' alt='TheMolitor Envato Screenshot' /></p>
<h2>Download the Plugin!</h2>
<p>You can download the plugin from the <a href='http://wordpress.org/extend/plugins/envato-recent-items/'>WordPress plugin index</a>. If you have any questions, please be sure to read the FAQ and installation instr unctions on the plugin homepage. Any suggestions or comments are always welcome, enjoy!</p>
<h2>Donate</h2>
<p>If you have found this plugin to be helpful, I ask you to consider making a donation of any amount. Donations keep me motivated and allow me to continue to build and enhance WordPress plugins. Any donations are greatly appreciated!</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="5020674">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://dev-tips.com/featured/wordpress-plugin-envato-recent-items-updated/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Use the Twitter and TinyURL APIs to Create a WordPress Plugin</title>
		<link>http://dev-tips.com/featured/use-the-twitter-and-tinyurl-apis-to-create-a-wordpress-plugin</link>
		<comments>http://dev-tips.com/featured/use-the-twitter-and-tinyurl-apis-to-create-a-wordpress-plugin#comments</comments>
		<pubDate>Mon, 20 Apr 2009 09:09:25 +0000</pubDate>
		<dc:creator>Drew Douglass</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://dev-tips.com/?p=321</guid>
		<description><![CDATA[After the success of the release of our first WordPress plugin, Are You Sure?, we've decided to show you how to make a super simple WordPress plugin that uses the TinyURL and Twitter API. The plugin we will create will add a little link to the end of each individual post, this link will allow [...]]]></description>
			<content:encoded><![CDATA[<p>After the success of the release of our first WordPress plugin, <a href='http://dev-tips.com/featured/wordpress-plugin-are-you-sure' title='Wordpress Plugin Are You Sure'>Are You Sure?</a>, we've decided to show you how to make a super simple WordPress plugin that uses the TinyURL and Twitter API. The plugin we will create will add a little link to the end of each individual post, this link will allow the users to send the title of the page they are reading, along with a tinyurl link to the page. Lets get coding!</p>
<p><span id="more-321"></span></p>
<h3>The Basics</h3>
<p>The first thing we need to do is create a new folder, I will call mine 'tiny_tweet'. Next, inside the directory, create a file named 'tiny_tweet.php'. Inside tiny_tweet.php we need to put some basic comments at the top to let WordPress properly recognize our plugin. So far our plugin looks like this:</p>
<pre class="brush: php">
&lt;?php
/*
Plugin Name: Tiny Tweet
Plugin URI: http://dev-tips.com
Description: Allows users to tweet the current page with a tinyurl of the page in the tweet.
Author: Drew Douglass
Version: 1.0
Author URI: http://dev-tips.com
*/
?&gt;
</pre>
<h3>Defining our function</h3>
<p>Now we need to setup the function that will do all of the work for us. We want to make sure that the function does not already exists, so we will put this check into place.</p>
<pre class="brush: php">
if(!function_exists(&#039;dd_tiny_tweet_init&#039;)){

function dd_tiny_tweet_init($content){

  }
}
</pre>
<h3>Twitter and TinyURL</h3>
<p>Lastly, we need to setup our variables and create the TinyURL of the current article so that we can put a link to the page when the user sends the page to their Twitter status. Lets look at the final code and then discuss it.</p>
<pre class="brush: php">
&lt;?php
/*
Plugin Name: Tiny Tweet
Plugin URI: http://dev-tips.com
Description: Allows users to tweet the current page with a tinyurl of the page in the tweet.
Author: Drew Douglass
Version: 1.0
Author URI: http://dev-tips.com
*/
if(!function_exists(&#039;dd_tiny_tweet_init&#039;)){

function dd_tiny_tweet_init($content){
	//Thanks to http://briancray.com for the one line $tiny_tweet_url solution.
	$tiny_tweet_url = file_get_contents(&#039;http://tinyurl.com/api-create.php?url=&#039; . urlencode(&#039;http://&#039; . $_SERVER[&#039;HTTP_HOST&#039;]  . &#039;/&#039; . $_SERVER[&#039;REQUEST_URI&#039;]));
	$tiny_tweet_title = get_the_title();
	$tiny_tweet_title = substr($tiny_tweet_title, 0,100);
	$tiny_tweet_title .=&#039;...&#039;;
	$tiny_tweet_status_url = &#039;http://twitter.com/home?status=Currently reading &quot;&#039;.$tiny_tweet_title.&quot;\&quot; &quot;.$tiny_tweet_url;
	if(is_single()){
	$content .=  &#039;&lt;div class=\&#039;tiny_tweet\&#039;&gt;Enjoy this post? &lt;a href=\&#039;&#039;.$tiny_tweet_status_url.&#039;\&#039;&gt;The give it a tweet!&lt;/a&gt;&lt;/div&gt;&#039;;
	}
	return $content;
  }
  add_filter(&#039;the_content&#039;, &#039;dd_tiny_tweet_init&#039;);
}
?&gt;
</pre>
<p>Most of the variables should explain themselves, but lets walk through some of the important steps in our function.</p>
<ul>
<li>First, we store the TinyURL url of the page inside a variable for later use. Please note that the technique to get the TinyURL was brought to my attention by my friend and Dev-Tips author <a href='http://briancray.com'>Brian Cray</a> in his post titled '<a href='http://briancray.com/2009/02/10/generate-tinyurls-with-1-line-of-php/'>Generate TinyURLS with one line of php</a>'. <strong>It is also important to note our server needs to support <code>file_get_contents</code>. If you host doesn't, tell them to get with the times!</strong></li>
<li>Next up we get the title of the current post and grab the first 100 characters of that title (to leave room for the link in the status).</li>
<li>Moving on we store the status Twitter link in a variable with the appropriate message in the status query.</li>
<li>Lastly, we check if the current page is a single article, if it is we append the twitter link to the bottom of the content with a custom div class (so it may be styled).</li>
</ul>
<p>Now, when the user goes to read an individual article, they willl see 'Enjoy this post? Then give it a tweet!'. Upon clicking the link, they will be brought to twitter with their status already filled out. Now, they simply press the 'Update' button, and voila!</p>
<h3>Demo Screenshots</h3>
<p>Below is the default, unstyled link and text produced:</p>
<div><img src='http://dev-tips.com/post_img/tt_screenshot.jpg' alt='Tiny Tweet Screenshot' /></div>
<p>Below is what the user will see once they click the link. For those of you that will inevitably type the tinyurl in the screenshot below into your browser, that is a free hosing account I have setup for WordPress development and plugin testing <img src='http://dev-tips.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div><img src='http://dev-tips.com/post_img/tt_screenshot_twitter.jpg' alt='Tiny Tweet Twitter Screenshot' /></div>
<p>It isn't the most complex Twitter plugin, but it works just like it should and gets the job done. Feel free to use this plugin if you like. We will be making some final changes to it and will officially release it for download shortly in a new blog post.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tips.com/featured/use-the-twitter-and-tinyurl-apis-to-create-a-wordpress-plugin/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>WordPress Plugin: Are You Sure?</title>
		<link>http://dev-tips.com/featured/wordpress-plugin-are-you-sure</link>
		<comments>http://dev-tips.com/featured/wordpress-plugin-are-you-sure#comments</comments>
		<pubDate>Sun, 22 Feb 2009 08:26:55 +0000</pubDate>
		<dc:creator>Drew Douglass</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Server Side]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://dev-tips.com/?p=208</guid>
		<description><![CDATA[Today we are releasing a new and very simple WordPress plugin we think you will all enjoy. The plugin is named Are You Sure? and it was created to prevent any accidental postings. If you have used WordPress for any amount of time, I am sure you have accidentally pressed the 'Publish' button before you [...]]]></description>
			<content:encoded><![CDATA[<p>Today we are releasing a new and very simple WordPress plugin we think you will all enjoy. The plugin is named <strong>Are You Sure?</strong> and it was created to prevent any accidental postings. If you have used WordPress for any amount of time, I am sure you have accidentally pressed the 'Publish' button before you were ready to publish. Sure, you can go back and change it, but chances are your RSS readers and anyone browsing the site already have seen it. Are You Sure? uses some simple Javascript when the Publish button is clicked and confirms that you do indeed wish to publish the current content. Read on to download and for instructions.</p>
<p><span id="more-208"></span></p>
<div class='download_orange'><a class="downloadlink" href="http://dev-tips.com/wp-content/plugins/download-monitor/download.php?id=2" title="Version 1.0 downloaded 786 times" >Are You Sure?  (786) - 1.67 KB</a></div>
<h3>Features</h3>
<p>Upon clicking the 'Publish' or 'Update post/page' button, a simple Javascript box confirms that you wish to publish the current content. You may cancel the publishing and go back and continue editing.</p>
<ul>
<li>Extremely small file size, less than 1.7 KB total.</li>
<li>Simple to use, just activate and your done.</li>
<li>Saves you from accidental posting.</li>
<li>Works on any 'Publish' button, including pages, posts, and quickpress.</li>
<li>Tested and Compatible with WordPress 2.7+</li>
</ul>
<h3>Screenshot</h3>
<div><img src='http://dev-tips.com/post_img/ays_screenshot1.jpg' alt='Are You Sure Plugin Screenshot' /></div>
<h3>Installation and Usage</h3>
<p>If you have never used a WordPress Plugin, you may consider reading <a href='http://codex.wordpress.org/Plugins' title='Codex Plugins Intro'>the introduction to plugins on the WordPress Codex</a>.</p>
<ul>
<li>Upload the 'areyousure' folder to 'wp-content/plugins/' directory on your server.</li>
<li>Go to the plugins link in the WordPress sidebar in your WordPress admin panel.</li>
<li>Find the plugin and click activate.</li>
<li>Your done!</li>
</ul>
<h3>Download</h3>
<div class='download_orange'><a class="downloadlink" href="http://dev-tips.com/wp-content/plugins/download-monitor/download.php?id=2" title="Version 1.0 downloaded 786 times" >Are You Sure?  (786) - 1.67 KB</a></div>
<p><strong>WP Version:</strong>Tested and working up to WP 2.9+<br />
<strong>Current Version</strong>: 1.0<br />
<strong>Download:</strong> <a class="downloadlink" href="http://dev-tips.com/wp-content/plugins/download-monitor/download.php?id=2" title="Version 1.0 downloaded 786 times" >Are You Sure?  (786) - 1.67 KB</a><br />
<strong>GitHub URL:</strong> <a href='http://github.com/DrewDouglass/Are-You-Sure-' title='Are You Sure GitHub URL'>http://github.com/DrewDouglass/Are-You-Sure-</a><br />
<strong>GitHub Clone:</strong> <code>git://github.com/DrewDouglass/Are-You-Sure-.git</code></p>
<h3>Buy Me Some Chinese Food?</h3>
<p>If you enjoy this plugin and have found it helpful, I encourage you to consider making a donation of any amount. Donations keep me motivated and help cover a tiny percent of the time and costs that go into developing plugins for the WordPress Community</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="3440419">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
<h3>Feedback and Requests</h3>
<p>We'd love to hear any feedback or requests you might have, let us know in the comments below! If you need support you can shoot us an email via our <a href='http://dev-tips.com/contact'>contact page</a>. If you enjoy WordPress and WordPress plugins, you might also enjoy our article titled '<a href='http://dev-tips.com/featured/use-the-twitter-and-tinyurl-apis-to-create-a-wordpress-plugin'>Use the twitter API to create a wordpress plugin</a>'.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tips.com/featured/wordpress-plugin-are-you-sure/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>
