<?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>FiddyP &#187; HelloStumbler</title>
	<atom:link href="http://fiddyp.co.uk/tag/hellostumbler/feed/" rel="self" type="application/rss+xml" />
	<link>http://fiddyp.co.uk</link>
	<description>The personal blog of Andy Bailey</description>
	<lastBuildDate>Sun, 13 May 2012 15:28:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Animated DIV slide</title>
		<link>http://fiddyp.co.uk/animated-div-slide/</link>
		<comments>http://fiddyp.co.uk/animated-div-slide/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 11:36:35 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Blog News]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[HelloStumbler]]></category>
		<category><![CDATA[hidden]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[profit]]></category>
		<category><![CDATA[slide-div]]></category>
		<category><![CDATA[stumbleupon]]></category>

		<guid isPermaLink="false">http://www.fiddyp.co.uk/animated-div-slide/</guid>
		<description><![CDATA[I&#8217;ve been working with jQuery quite a lot over the past week to get the commentluv settings page up and running and get the new commentluv plugin working [..]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ffiddyp.co.uk%2Fanimated-div-slide%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ffiddyp.co.uk%2Fanimated-div-slide%2F&amp;source=commentluv&amp;style=normal&amp;service=bit.ly&amp;service_api=R_259b4e5679e2c431cca1f989e158bba4&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve been working with jQuery quite a lot over the past week to get the commentluv settings page up and running and get the new commentluv plugin working as promised. It always amazes me at how incredibly easy it is to get it to do cool things with a web page.</p>
<p>Not just Ajax things, simple effects that allow you to take a page from a digital piece of paper to a digital pop-up book! <a href="#">Click here for an example..</a></p>
<div id="first" style="border: 1px solid #000"><img>
<p style="color:white">Look at me!</p>
<h2><a href="#">Send me back up</a></h2>
</div>
<h3>Example explained</h3>
<p>(you should have the jQuery library loaded in the head of your document, my wordpress already does this but if yours doesn&#8217;t you&#8217;ll have to put a line like this in the head of your page)<span id="more-53"></span></p>
<p><strong>step 1:</strong> create a hidden div with an id of &#8220;first&#8221; and put something in it.</p>
<pre class="brush: xml; title: ; notranslate">&lt;div id=&quot;first&quot; style=&quot;border: 1px solid #000&quot;&gt;
&lt;img&gt;&lt;p style=&quot;color:white&quot;&gt;Look at me!&lt;/p&gt;</pre>
<p>You can set the style inline with the div or your could add something like this to your style sheet</p>
<pre class="brush: xml; title: ; notranslate">#first { display: none; } </pre>
<p>Something to note, an <strong>ID=</strong> is used if it is the ONLY one, a <strong>class=</strong> is when you have more than one. If you&#8217;d used <strong>class=&#8221;first&#8221;</strong> on the div above and had an entry in your stylesheet like this</p>
<pre class="brush: xml; title: ; notranslate">.first { display: none; } </pre>
<p>then every div or img or span you gave a class of &#8220;first&#8221; to would be initially invisible.</p>
<p><strong>step 2:</strong> Now you need to trigger an event to slide the div down. That&#8217;s as simple as putting a html link with an onclick attr and use a built in jQuery effect.<br />
onclick is an attribute you can put on html objects like &#8216;a href&#8217; links or images or other parts of your page. You put the javascript or function you want running in the quotes and whenever that object is clicked, the javascript gets run.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;a href=&quot;#&quot;&gt;Click here for an example..&lt;/a&gt;</pre>
<p>Here, the javascript we want to run is <em>jQuery(&#8216;#first&#8217;).slideDown(1000);</em></p>
<p>It&#8217;s this little bit that does the magic.</p>
<p>Sometimes people use $ instead of the word jQuery which will work in most cases but here on WordPress there is the prototype library too and that uses the $ symbol for it&#8217;s calls so to be safe and get it to work without clashing with other libraries we use jQuery.</p>
<p>We call jQuery and tell it what we are targeting in the brackets. Because we are using an ID, we use &#8216;#first&#8217;. Had we used a class then we would put &#8216;.first&#8217; and then we attach the slideDown event with a speed of 1000 ms by putting .slideDown (notice the captial &#8216;D&#8217;) on the end of the target and a speed 1000 in the brackets.</p>
<p><strong>step 3:</strong> slide it back up<br />
You should be able to guess how this was done, instead of using slideDown, we used slideUp</p>
<pre class="brush: xml; title: ; notranslate">&lt;a href=&quot;#&quot;&gt;Send me back up&lt;/a&gt;&lt;/h2&gt;</pre>
<p>That&#8217;s it, easy peasy!</p>
<p><a href="http://docs.jquery.com/Main_Page">You can find out all the commands available to jQuery here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fiddyp.co.uk/animated-div-slide/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How to make a WordPress plugin with less than 20 lines of code</title>
		<link>http://fiddyp.co.uk/how-to-make-a-wordpress-plugin-with-less-than-20-lines-of-code/</link>
		<comments>http://fiddyp.co.uk/how-to-make-a-wordpress-plugin-with-less-than-20-lines-of-code/#comments</comments>
		<pubDate>Fri, 07 Sep 2007 11:05:24 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HelloStumbler]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[profit]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.fiddyp.co.uk/2007/09/07/how-to-make-a-wordpress-plugin-with-less-than-20-lines-of-code/</guid>
		<description><![CDATA[I had a truckload of hits come to this site last night for my Hello Stumbler plugin, so I thought I would share with you how to make [..]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ffiddyp.co.uk%2Fhow-to-make-a-wordpress-plugin-with-less-than-20-lines-of-code%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ffiddyp.co.uk%2Fhow-to-make-a-wordpress-plugin-with-less-than-20-lines-of-code%2F&amp;source=commentluv&amp;style=normal&amp;service=bit.ly&amp;service_api=R_259b4e5679e2c431cca1f989e158bba4&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I had a truckload of hits come to this site last night for my <a href="http://www.fiddyp.co.uk/2007/09/06/hello-stumbler-wordpress-plugin-for-stumbleupon-visitors/">Hello Stumbler</a> plugin, so I thought I would share with you how to make a plugin so you can publish it, stumble it, digg it and bask in your coding glory as it generates hits to your site!</p>
<p>If you&#8217;re interested in making your own plugins you should read a book called <a class="easyazon-link"   href="http://www.amazon.com/dp/0470916222?tag=commentluv-20&linkCode=as2">Professional WordPress Plugin Development</a> to learn how to do it yourself</p>
<p><a title="hello stumbler code" href="http://fiddyp.co.uk/wp-content/uploads/2007/09/hellostumblercode.jpg"><img src="http://fiddyp.co.uk/wp-content/uploads/2007/09/hellostumblercode-150x150.jpg" alt="hello stumbler code" /></a></p>
<p><span id="more-44"></span><br />
I&#8217;ll use my Hello Stumbler plugin as a guide&#8230;(now re-done so you can see the code all proper like)</p>
<p>here&#8217;s the whole code</p>
<pre class="brush: php; title: ; notranslate">

/*
Plugin Name: Hello Stumbler
Version: 1.1
Plugin URI: http://www.fiddyp.co.uk/2007/09/06/hello-stumbler-wordpress-plugin-for-stumbleupon-visitors/
Author: Andy Bailey
Author URI: http://www.fiddyp.co.uk
Description: Adds a message to request a thumbs up if post is seen via Stumbleupon. Just place hellostumbler(); in your single post template
*/

function hellostumbler(){
	global $id;
	$refer=$_SERVER['HTTP_REFERER'];
	$title=the_title('','',false);
	if ($refer==&quot;http://www.stumbleupon.com/refer.php&quot; &amp;amp;&amp;amp; is_single()) {
		echo &quot;&lt;strong&gt; Thanks for Stumble-ing here!&lt;br /&gt;Please give me a &lt;a&gt;&lt;img&gt;thumbs up!&lt;/a&gt;&lt;/strong&gt;&quot;;
	}
}
?&amp;gt;</pre>
<p><strong>Step 1:</strong><br />
Add the comments to the top of your php file so WordPress knows it&#8217;s a plugin..</p>
<pre class="brush: php; title: ; notranslate">
/*
Plugin Name: Hello Stumbler
Version: 1.0
Plugin URI: http://www.fiddyp.co.uk/2007/09/06/hello-stumbler-wordpress-plugin-for-stumbleupon-visitors/
Author: Andy Bailey
Author URI: http://www.fiddyp.co.uk
Description: Adds a message to request a thumbs up if post is seen via Stumbleupon. Just place hellostumbler(); in your single post template
*/
</pre>
<p>The plugin URL is important, don&#8217;t be tempted to just put a link to the root of your site or blog, it&#8217;s really annoying when a plugin misbehaves and you click on the plugin name within wordpress only to be sent to a site where you can&#8217;t find the reference to the actual plugin.</p>
<p>With mine, I make the post about the plugin and then go back to the source code and add the permalink, zip, upload and finally edit the post with the link to the download.</p>
<p><strong>Step 2:</strong> Call the function a unique name</p>
<pre class="brush: php; title: ; notranslate">
function hellostumbler() {
</pre>
<p>Make sure your plugin has a unique name or it will misbehave if it&#8217;s used on a blog that has a duplicate named plugin.</p>
<p><strong>Step 3:</strong> Add the code that does the magic..</p>
<pre class="brush: php; title: ; notranslate">global $id;
	$refer=$_SERVER['HTTP_REFERER'];
	$title=the_title('','',false);
	if ($refer==&quot;http://www.stumbleupon.com/refer.php&quot; &amp;amp;&amp;amp; is_single()) {
		echo &quot;&lt;strong&gt; Thanks for Stumble-ing here!&lt;br /&gt;Please give me a &lt;a&gt;&lt;img&gt;thumbs up!&lt;/a&gt;&lt;/strong&gt;&quot;;
	}
}
?&amp;gt;</pre>
<p>This is a simple little bit of code, lets analyze it line by line&#8230;</p>
<pre class="brush: php; title: ; notranslate">$refer=$_SERVER['HTTP_REFERER'];</pre>
<p>all this does is find out what page the surfer came from and store it in the string <strong>$refer</strong></p>
<pre class="brush: php; title: ; notranslate">global $id;</pre>
<p>this assigns the variable <strong>$id</strong> as a global so you can use the value it has been given by the WordPress code</p>
<pre class="brush: php; title: ; notranslate">$title=the_title('','',false);</pre>
<p>this assigns the title of the post to the variable <strong>$title</strong> by using the internal function of WordPress, whatever is between the &#8221; , &#8221; is what gets put before and after the title of the post, the false bit means return the title instead of printing it out on the blog.</p>
<pre class="brush: php; title: ; notranslate">if ($refer==&quot;http://www.stumbleupon.com/refer.php&quot; &amp;amp;&amp;amp; is_single()) {</pre>
<p>a conditional check, if the value in <strong>$refer</strong> is the same as the one given (in this case the referring page of Stumbleupon) AND the post is a single post page (It&#8217;s better to Stumble a post on it&#8217;s own rather than when it&#8217;s on the front page). If BOTH cases are true, do whatever is in the &#8216;{&#8216; curly brackets</p>
<pre class="brush: php; title: ; notranslate">echo &quot;&lt;strong&gt; Thanks for Stumble-ing here!&lt;br /&gt;Please give me a &lt;a&gt;&lt;img&gt;thumbs up!&lt;/a&gt;&lt;/strong&gt;&quot;;</pre>
<p>echo means output to the page, putting html in the quotes writes html direct to the page. Then it&#8217;s a simple case of formatting the HTML so it works with the variables declared earlier. I&#8217;ll break this line down piece by piece..</p>
<ul>
<li>
<pre class="brush: php; title: ; notranslate">echo &quot;Thanks for Stumble-ing here! Please give me a </pre>
<p>Just output some text for the surfer to see</li>
<li>
<p>this is put into the source code so search engines and viewers of source can see where the next link comes from. Grabbed this from the Digg This plugin.</li>
<li>
<pre class="brush: php; title: ; notranslate">&lt;a href='http://www.stumbleupon.com/submit?url=&quot;.get_permalink($id).&quot;&amp;amp;title=$title'&gt;</pre>
<p>At the end of ?url= I close the echo quotes and use a dot (.) operator to add on the next bit that php sees, the get_permalink($id) just gets the link to the current post (it&#8217;s why we needed to have <strong>$id</strong> as global, WordPress has already declared what <strong>$id</strong> is) then we dot (.) a bit more echo output on to the end of that for the title name <strong>$title</strong> and close the html quotes with a single quote, and close the html a href bit with a &gt;</li>
<li>
<pre class="brush: php; title: ; notranslate">&lt;img&gt;thumbs up!&lt;/a&gt;&quot;;</pre>
<p>echo out html code for displaying the SU icon, close the img HTML and put what text to display as link and then close the html. Finally, close the echo quotes and add a semicolon (;) to tell php we have finsihed the command (echo).</li>
<li>
<pre class="brush: php; title: ; notranslate">}
}
?&amp;gt;</pre>
<p>close the &#8220;if&#8221; check, close the function and finally end the PHP</li>
</ul>
<p>Once you&#8217;ve done all that, upload the plugin to your wp-content/plugins/ directory and activate it, if all goes well, you should be able to add the output to anywhere on your page by calling the function name with</p>
<pre class="brush: php; title: ; notranslate"> if (function_exists(hellostumbler)){hellostumbler();}</pre>
<p>inserted into your template code.</p>
<p>This is what it looks like in action&#8230;<br />
<img src="http://fiddyp.co.uk/wp-content/uploads/2007/09/hellostumblerresult.jpg" alt="Hello Stumbler result" /></p>
<p>So, now there&#8217;s no reason why you can&#8217;t make a simple plugin to show a link to your facebook profile or add some code to show a Youtube video.</p>
<p>good luck, you&#8217;ll see that once you&#8217;ve made one plugin, you&#8217;ll want to make more and more! <img src='http://fiddyp.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>You can download all the source code here : <a href="http://www.fiddyp.co.uk/download/hellostumbler.zip">hello stumbler plugin</a></p>
<div class="aligncenter easyazon-info-block">
 <a   href="http://www.amazon.com/dp/1118197879?tag=commentluv-20" class="easyazon-info-block-image">
  <img src="http://ecx.images-amazon.com/images/I/51PEqkiVKsL._SL160_.jpg" height="160" width="129" />
 </a>
 
 <div class="easyazon-info-block-non-image">
  <ul>
   <li>
    <a   href="http://www.amazon.com/dp/1118197879?tag=commentluv-20">Teach Yourself VISUALLY WordPress</a>
   </li>
   <li>
    <a   href="http://www.amazon.com/dp/1118197879?tag=commentluv-20">
     List Price: <strike>$29.99</strike>
    </a>
   </li>
   <li>
    <a   href="http://www.amazon.com/dp/1118197879?tag=commentluv-20">
     Price: $17.91
    </a>
   </li>
   <li>
    <a   href="http://www.amazon.com/dp/1118197879?tag=commentluv-20#customerReviews">
     Read Reviews 
    </a>
   </li>
    <a   href="http://www.amazon.com/dp/1118197879?tag=commentluv-20">
     <img alt="Buy Now Button" src="http://fiddyp.co.uk/wp-content/plugins/easyazon/resources/frontend/buy-now/amazon-us.gif" /> 
    </a>
  </ul>
 </div>
 
 <span class="easyazon-info-block-clear"></span>
</div>
]]></content:encoded>
			<wfw:commentRss>http://fiddyp.co.uk/how-to-make-a-wordpress-plugin-with-less-than-20-lines-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello Stumbler &#8211; WordPress plugin for Stumbleupon visitors</title>
		<link>http://fiddyp.co.uk/hello-stumbler-wordpress-plugin-for-stumbleupon-visitors/</link>
		<comments>http://fiddyp.co.uk/hello-stumbler-wordpress-plugin-for-stumbleupon-visitors/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 14:49:19 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HelloStumbler]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[profit]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[stumbleupon]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.fiddyp.co.uk/2007/09/06/hello-stumbler-wordpress-plugin-for-stumbleupon-visitors/</guid>
		<description><![CDATA[Here&#8217;s a little plugin I made for Stumbleupon visitors, I got the idea while playing with the Digg This plugin. Hello Stumbler plugin will display a note at [..]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ffiddyp.co.uk%2Fhello-stumbler-wordpress-plugin-for-stumbleupon-visitors%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ffiddyp.co.uk%2Fhello-stumbler-wordpress-plugin-for-stumbleupon-visitors%2F&amp;source=commentluv&amp;style=normal&amp;service=bit.ly&amp;service_api=R_259b4e5679e2c431cca1f989e158bba4&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Here&#8217;s a little plugin I made for Stumbleupon visitors, I got the idea while playing with the <a href="http://www.aviransplace.com/index.php/digg-this-wordpress-plugin/">Digg This plugin</a>.</p>
<p>Hello Stumbler plugin will display a note at the top of your post (or wherever you put the call) when it detects that the person viewing the page came through the <a href="http://www.stumbleupon.com">Stumbleupon</a> button and ask them to give you a thumbs up.</p>
<p>Simply download the plugin, upload it to your plugins directory and activate it. Once you have done that, go to your single post template page and add the following command under the entry-content line (click image to see example).</p>
<pre class="brush: php; title: ; notranslate">
?php if (function_exists(hellostumbler)) { hellostumbler();}?&amp;gt;
</pre>
<p><a href='http://fiddyp.co.uk/wp-content/uploads/2007/09/hellostumbler2.gif' title='Hello stumbler example'><img src='http://fiddyp.co.uk/wp-content/uploads/2007/09/hellostumbler2-150x150.gif' alt='Hello stumbler example' /></a><br />
It&#8217;s as simple as that! I have tried it by showing the link if this blog is the referring page and it works, hopefully it will do the same when the post is stumbled upon with the toolbar button (it&#8217;ll take me ages to stumble and stumble until this post shows to truly test it, but it should work!).</p>
<p>If you came here via a stumble button press, please let me know if you can see the &#8220;thanks for stumble-ing&#8221; message at the top of the post. thanks!</p>
<p>Download the plugin here <a href="http://www.fiddyp.co.uk/download/hellostumbler.zip">Hello Stumbler</a></p>
<p><strong>[edit]</strong>To see a tutorial on how I made this plugin, see here: <a href="http://www.fiddyp.co.uk/how-to-make-a-wordpress-plugin-with-less-than-20-lines-of-code/">wordpress plugin sourcecode tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fiddyp.co.uk/hello-stumbler-wordpress-plugin-for-stumbleupon-visitors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

