<?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>Paulund</title> <atom:link href="http://www.paulund.co.uk/feed" rel="self" type="application/rss+xml" /><link>http://www.paulund.co.uk</link> <description>PHP, jQuery, CSS and HTML5 Tutorials And Snippets</description> <lastBuildDate>Thu, 17 May 2012 19:36:01 +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>Creating WordPress Custom Page Templates</title><link>http://www.paulund.co.uk/creating-wordpress-custom-page-templates</link> <comments>http://www.paulund.co.uk/creating-wordpress-custom-page-templates#comments</comments> <pubDate>Wed, 16 May 2012 03:33:48 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[archive]]></category> <category><![CDATA[contact]]></category> <category><![CDATA[custom]]></category> <category><![CDATA[full width]]></category> <category><![CDATA[page]]></category> <category><![CDATA[template]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=5218</guid> <description><![CDATA[In WordPress you start off with 2 default types of posts you have the standard posts and you also have pages. For these types of posts WordPress will use different PHP files to display the content, the standard posts will use the single.php file and the pages will use the page.php file. But the problem [...]]]></description> <content:encoded><![CDATA[<p><img src="http://paulund.paulund.netdna-cdn.com/wp-content/uploads/2012/04/wp-custom-page-template.png" alt="wp-custom-page-template" title="wp-custom-page-template" width="283" height="448" class="aligncenter size-full wp-image-5348" /></p><p>In <strong>WordPress</strong> you start off with 2 default types of posts you have the standard posts and you also have pages.</p><p>For these types of posts WordPress will use different PHP files to display the content, the standard posts will use the single.php file and the pages will use the page.php file.</p><p>But the problem with this is that you can only use one file for your pages so you can&#8217;t have different page layouts or styles. This is why WordPress created the ability to create <strong>custom page templates</strong>, which allows developers to create as many different <strong>page templates</strong> as they want.<br /> <span id="more-5218"></span></p><h2>Create A Custom Page Template</h2><p>To create a <a href="http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates" title="Custom page template">custom page template</a> all you have to do is add a new blank php file to your <a href="http://www.paulund.co.uk/what-makes-a-premium-wordpress-theme-premium" title="What Makes A Premium WordPress Theme Premium?">theme directory</a> and save this as <strong>custom_page_template.php</strong>. Within this new file all you have to do is add comments to the top of the file.</p><p>[php]<br /> <?php<br /> /*<br /> Template Name: Custom Page Template<br /> */<br /> ?><br /> [/php]</p><p>Adding this to the top will automatically add this file to a drop down when adding a new page, from the drop down you will see the default template (page.php) and Custom Page Template.</p><p>If you select the new page to use the Custom Page Template then this will override the page.php and your page will use your custom page template.</p><h2>Examples Of Custom Page Template</h2><p>Some of the common examples of <strong>custom page templates</strong> are contact pages, full width pages and <a href="http://www.paulund.co.uk/archives" title="Archives">archive pages</a>.</p><h3>Create A Contact Page Template</h3><p>The <strong>contact page</strong> will make it easy for your website visitors to send an email to the admin email address of your WordPress blog.</p><p>Below is an example to use for a contact us page, you can copy and paste this code into a new PHP file to easily add contact pages to your WordPress theme.</p><p>[php]<br /> <?php<br /> /*<br /> Template Name: Contact<br /> */<br /> ?><br /> <?php</p><p>$nameError = '';<br /> $emailError = '';<br /> $commentError = '';<br /> $sumError = '';</p><p>if(isset($_POST['submitted'])) {<br /> if(trim($_POST['contactName']) === '') {<br /> $nameError = 'Please enter your name.';<br /> $hasError = true;<br /> } else {<br /> $name = trim($_POST['contactName']);<br /> }</p><p> if(trim($_POST['email']) === '')  {<br /> $emailError = 'Please enter your email address.';<br /> $hasError = true;<br /> } else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {<br /> $emailError = 'You entered an invalid email address.';<br /> $hasError = true;<br /> } else {<br /> $email = trim($_POST['email']);<br /> }</p><p> if(trim($_POST['comments']) === '') {<br /> $commentError = 'Please enter a message.';<br /> $hasError = true;<br /> } else {<br /> if(function_exists('stripslashes')) {<br /> $comments = stripslashes(trim($_POST['comments']));<br /> } else {<br /> $comments = trim($_POST['comments']);<br /> }<br /> }</p><p> if(trim($_POST['sum']) === '' || trim($_POST['sum']) != '11' ){<br /> $sumError = "Please enter what's 7 + 4";<br /> $hasError = true;<br /> }</p><p> if(!isset($hasError)) {<br /> $emailTo = get_option('pu_email');<br /> if (!isset($emailTo) || ($emailTo == '') ){<br /> $emailTo = get_option('admin_email');<br /> }<br /> $subject = '[Contact Form] From '.$name;<br /> $body = "Name: $name \n\nEmail: $email \n\nComments: $comments";<br /> $headers = 'From: '.$name.' <'.$emailTo.'>&#8216; . &#8220;\r\n&#8221; . &#8216;Reply-To: &#8216; . $emailTo;</p><p> mail($emailTo, $subject, $body, $headers);<br /> $emailSent = true;<br /> }</p><p>} ?></p><p><?php get_header(); ?></p> <section class="box grid_9 list_posts"><div class="inner"><p> <?php if (have_posts()) : while (have_posts()) : the_post(); ?></p><div <?php post_class() ?> id=&#8221;post-<?php the_ID(); ?>&#8220;></p><h1 class="entry-title"><?php the_title(); ?></h1><div class="entry-content"><div class="contact-form clearfix"><p> <?php if(isset($emailSent) &#038;&#038; $emailSent == true) { ?></p><div class="thanks"><p><?php _e('Thanks, your email was sent successfully.', 'framework') ?></p></p></div><p> <?php } else { ?></p><p> <?php the_content(); ?></p><p> <?php if(isset($hasError) || isset($captchaError)) { ?></p><p class="error"><?php _e('Sorry, an error occured.', 'framework') ?><p> <?php } ?></p><form action="<?php the_permalink(); ?>&#8221; id=&#8221;contactForm&#8221; method=&#8221;post&#8221;></p><ul class="contactform"><li><label for="contactName"><?php _e('Name:', 'framework') ?></label><br /> <input type="text" name="contactName" id="contactName" value="<?php if(isset($_POST['contactName'])) echo $_POST['contactName'];?>&#8221; class=&#8221;required requiredField&#8221; /><br /> <?php if($nameError != '') { ?><br /> <span class="error"><?php echo $nameError; ?></span><br /> <?php } ?></li><li><label for="email"><?php _e('Email:', 'framework') ?></label><br /> <input type="text" name="email" id="email" value="<?php if(isset($_POST['email']))  echo $_POST['email'];?>&#8221; class=&#8221;required requiredField email&#8221; /><br /> <?php if($emailError != '') { ?><br /> <span class="error"><?php echo $emailError; ?></span><br /> <?php } ?></li><li class="textarea"><label for="commentsText"><?php _e('Message:', 'framework') ?></label><br /><textarea name="comments" id="commentsText" rows="20" cols="30" class="required requiredField"><?php if(isset($_POST['comments'])) { if(function_exists('stripslashes')) { echo stripslashes($_POST['comments']); } else { echo $_POST['comments']; } } ?></textarea><br /> <?php if($commentError != '') { ?><br /> <span class="error"><?php echo $commentError; ?></span><br /> <?php } ?></li><li><label for="sum"><?php _e('7 + 4:', 'framework') ?></label><br /> <input type="text" name="sum" id="sum" value="<?php if(isset($_POST['sum'])) echo $_POST['sum'];?>&#8221; class=&#8221;required requiredField&#8221; /><br /> <?php if($sumError != '') { ?><br /> <br/><span class="error"><?php echo $sumError; ?></span><br /> <?php } ?></li><li class="buttons"> <input type="hidden" name="submitted" id="submitted" value="true" /> <label></label><button class="button-message" type="submit"><?php _e('Send Email', 'framework') ?></button></li></ul></form><p> <?php } ?></p></div></p></div></p></div><p> <?php endwhile; else: ?></p><div id="post-0" <?php post_class() ?>></p><h1 class="entry-title"><?php _e('Error 404 - Not Found', 'framework') ?></h1><div class="entry-content"><p><?php _e("Sorry, but you are looking for something that isn't here.", "framework") ?></p><p> <?php get_search_form(); ?></div></p></div><p> <?php endif; ?></p></div> </section><p> <?php get_sidebar(); ?></p><p><?php get_footer(); ?><br /> [/php]</p><h3>Full Width Page Template</h3><p>The full width page template is a template I use which the main difference is that the sidebar has been removed and makes the content area stretch across the width of the page.</p><p>[php]<br /> <?php<br /> /*<br /> Template Name: Fullwidth<br /> */<br /> ?></p><p><?php get_header(); ?></p> <section class="box grid_12 list_posts"><div class="inner"> <article id="primary" class="hfeed"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?></p><div <?php post_class() ?> id=&#8221;post-<?php the_ID(); ?>&#8220;></p><h1 class="entry-title"><?php the_title(); ?></h1><div class="entry-content"> <?php the_content(); ?><br /> <?php wp_link_pages(array('before' => &#8216;<p><strong>&#8216;.__(&#8216;Pages:&#8217;, &#8216;framework&#8217;).&#8217;</strong> &#8216;, &#8216;after&#8217; => &#8216;</p><p>&#8216;, &#8216;next_or_number&#8217; => &#8216;number&#8217;)); ?></p></div></p></div><p> <?php comments_template('', true); ?></p><p> <?php endwhile; endif; ?><br /> </article></p></div> </section><p><?php get_footer(); ?><br /> [/php]</p><h3>Create An Archives Page Template</h3><p>The <a href="http://www.paulund.co.uk/archives" title="Archives">archive page template</a> will display a list of all your old post. In this template it will list all the posts from the previous 30 days, list the posts by month and list the posts by category.</p><p>Copy the following in a new PHP page template.</p><p>[php]<br /> <?php<br /> /*<br /> Template Name: Archives<br /> */<br /> ?></p><p><?php get_header(); ?></p> <section class="box grid_9 list_posts"><div class="inner"><p> <?php if (have_posts()) : while (have_posts()) : the_post(); ?></p><div <?php post_class() ?> id=&#8221;post-<?php the_ID(); ?>&#8220;></p><h1 class="entry-title"><?php the_title(); ?></h1><div class="entry-content"><div class="archive-lists"><h4><?php _e('Last 30 Posts', 'framework') ?></h4><ul> <?php $archive_30 = get_posts('numberposts=30');<br /> foreach($archive_30 as $post) : ?></p><li><a href="<?php the_permalink(); ?>&#8220;><?php the_title();?></a></li><p> <?php endforeach; ?></ul><h4><?php _e('Archives by Month:', 'framework') ?></h4><ul> <?php wp_get_archives('type=monthly'); ?></ul><h4><?php _e('Archives by Subject:', 'framework') ?></h4><ul> <?php wp_list_categories( 'title_li=' ); ?></ul></p></div></p></div></p></div><p> <?php endwhile; else: ?></p><div id="post-0" <?php post_class() ?>></p><h1 class="entry-title"><?php _e('Error 404 - Not Found', 'framework') ?></h1><div class="entry-content"><p><?php _e("Sorry, but you are looking for something that isn't here.", "framework") ?></p><p> <?php get_search_form(); ?></div></p></div><p> <?php endif; ?></div> </section><p> <?php get_sidebar(); ?></p><p><?php get_footer(); ?><br /> [/php]</p><p>Which custom page templates do you use?</p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/creating-wordpress-custom-page-templates/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Add Additional Links To The WordPress Plugin Admin</title><link>http://www.paulund.co.uk/add-additional-links-to-the-wordpress-plugin-admin</link> <comments>http://www.paulund.co.uk/add-additional-links-to-the-wordpress-plugin-admin#comments</comments> <pubDate>Tue, 15 May 2012 13:38:45 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[dashboard]]></category> <category><![CDATA[links]]></category> <category><![CDATA[Plugin]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=5875</guid> <description><![CDATA[Here is a useful snippet submitted by SHelfinger.EU. When you activate a plugin in WordPress the author can place links in the plugin dashboard screen to show the users of the plugin links back to the plugin homepage, support page, FAQs or a way to contact the creator of the plugin. By default WordPress will [...]]]></description> <content:encoded><![CDATA[<p>Here is a useful snippet submitted by <a href="https://plus.google.com/u/0/104753541785944238696/posts" title="SHelfinger.EU">SHelfinger.EU</a>.</p><p>When you activate a plugin in WordPress the author can place links in the plugin dashboard screen to show the users of the plugin links back to the plugin homepage, support page, FAQs or a way to contact the creator of the plugin.</p><p>By default WordPress will add the name of the author and a link back to the plugin homepage.</p><p>Using this snippet you can add extra links to this section like the image below from the Antivirus WordPress plugin.</p><p><img src="http://paulund.paulund.netdna-cdn.com/wp-content/uploads/2012/05/plugin-links.png" alt="" title="plugin-links" class="aligncenter size-full wp-image-5876" /><br /> <span id="more-5875"></span><br /> All you have to do is add the following in your plugin file and it will create new links for plugin.</p><p>[php]<br /> add_filter(&#8216;plugin_row_meta&#8217;,  &#8216;Register_Plugins_Links&#8217;, 10, 2);<br /> function Register_Plugins_Links ($links, $file) {<br /> $base = plugin_basename(__FILE__);<br /> if ($file == $base) {<br /> $links[] = &#8216;<a href="admin.php?page=settings_plugin">&#8216; . __(&#8216;Settings&#8217;) . &#8216;</a>&#8216;;<br /> $links[] = &#8216;<a href="http://domain.com/FAQ/">&#8216; . __(&#8216;FAQ&#8217;) . &#8216;</a>&#8216;;<br /> $links[] = &#8216;<a href="http://domain.com/contact-us">&#8216; . __(&#8216;Support&#8217;) . &#8216;</a>&#8216;;<br /> $links[] = &#8216;<a href="https://plus.google.com/u/0/b/104753541785944238696/">&#8216; . __(&#8216;Google Plus Page&#8217;) . &#8216;</a>&#8216;;<br /> }<br /> return $links;<br /> }<br /> [/php]</p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/add-additional-links-to-the-wordpress-plugin-admin/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Change The Amount Of WordPress Post Revisions Stored</title><link>http://www.paulund.co.uk/change-the-amount-of-wordpress-post-revisions-stored</link> <comments>http://www.paulund.co.uk/change-the-amount-of-wordpress-post-revisions-stored#comments</comments> <pubDate>Tue, 15 May 2012 03:50:20 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[autosave]]></category> <category><![CDATA[feature]]></category> <category><![CDATA[Post]]></category> <category><![CDATA[revision]]></category> <category><![CDATA[snippet]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=5257</guid> <description><![CDATA[WordPress has a autosave feature which will automatically save a revision of your post as you are typing. But the problem with this comes when you have a WordPress blog with hundreds of posts. Each one of these posts will have a number of automatically saved post revisions. This can quickly add thousands of a [...]]]></description> <content:encoded><![CDATA[<p><img src="http://paulund.paulund.netdna-cdn.com/wp-content/uploads/2011/07/wordpress.png" alt="Wordpress" title="wordpress" width="150" height="150" class="aligncenter size-full wp-image-777" /></p><p><strong>WordPress</strong> has a autosave feature which will automatically save a revision of your post as you are typing. But the problem with this comes when you have a <a href="http://www.paulund.co.uk/what-makes-a-premium-wordpress-theme-premium" title="What Makes A Premium WordPress Theme Premium?">WordPress blog</a> with hundreds of posts. Each one of these posts will have a number of automatically saved post revisions.<br /> <span id="more-5257"></span><br /> This can quickly add thousands of a posts to your <a href="http://www.paulund.co.uk/create-wordpress-database-error-page" title="Create WordPress Database Error Page">wordpress database</a>.</p><p>The following WordPress snippet will allow you to pick how many post revisions each post has or if you want to turn off the auto save feature.</p><p>To change the post revision to save 3 revisions add the following to your wp-config.php file.</p><p>[php]<br /> define(&#8216;WP_POST_REVISIONS&#8217;, 3);<br /> [/php]</p><p>To turn off the auto save feature add the following to your wp-config.php file.</p><p>[php]<br /> define(&#8216;WP_POST_REVISIONS&#8217;, false);<br /> [/php]</p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/change-the-amount-of-wordpress-post-revisions-stored/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Display The Number of Database Queries In WordPress</title><link>http://www.paulund.co.uk/display-the-number-of-database-queries-in-wordpress</link> <comments>http://www.paulund.co.uk/display-the-number-of-database-queries-in-wordpress#comments</comments> <pubDate>Mon, 14 May 2012 13:43:40 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[database]]></category> <category><![CDATA[queries]]></category> <category><![CDATA[site]]></category> <category><![CDATA[timer]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=5469</guid> <description><![CDATA[When you are preforming maintenance on a WordPress blog one of things you need to check for is the speed of your WordPress database. You need to make sure that the amount of queries is down to a minimum and that there isn&#8217;t anything holding up the database. In WordPress there is a couple of [...]]]></description> <content:encoded><![CDATA[<p>When you are preforming maintenance on a WordPress blog one of things you need to check for is the <a href="http://www.paulund.co.uk/11-steps-to-speed-up-your-wordpress-site" title="11 Steps To Speed Up Your WordPress Site">speed of your WordPress database</a>. You need to make sure that the amount of queries is down to a minimum and that there isn&#8217;t anything holding up the database.</p><p>In WordPress there is a couple of inbuilt functions that allow you to display the amount of SQL queries and the time it took them to run on any page.</p><p>Using this display you can then see what affect different changes make to your WordPress database.</p><p>Some of the tips mentioned in <a href="http://www.paulund.co.uk/11-steps-to-speed-up-your-wordpress-site" title="11 Steps To Speed Up Your WordPress Site">11 Steps To Speed Up Your WordPress Site</a> talk about database optimisation and reducing database calls by caching. It is very useful to take note of how long a page takes to load before and after you make these changes to see what affect they have.</p><p><span id="more-5469"></span></p><p>Below a snippet you can use to display both the amount of queries and the time it took them to run. But you don&#8217;t want these stats to be displayed to every visitor to your site so make sure you wrap them in a if statement to check if the user is logged in.</p><p>[php]<br /> <?php<br /> if(is_user_logged_in()){<br /> echo get_num_queries().' queries in '. timer_stop(1) .' seconds.';<br /> }<br /> ?><br /> [/php]</p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/display-the-number-of-database-queries-in-wordpress/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Creating WordPress Shortcodes For Envato Marketplace API</title><link>http://www.paulund.co.uk/creating-wordpress-shortcodes-for-envato-marketplace-api</link> <comments>http://www.paulund.co.uk/creating-wordpress-shortcodes-for-envato-marketplace-api#comments</comments> <pubDate>Mon, 14 May 2012 09:06:38 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[affiliate]]></category> <category><![CDATA[codecanyon]]></category> <category><![CDATA[envato]]></category> <category><![CDATA[files]]></category> <category><![CDATA[free]]></category> <category><![CDATA[shortcode]]></category> <category><![CDATA[widget]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=4229</guid> <description><![CDATA[If your a regular reader here then you will know every month I display a list of Free items that you can get from the Envato marketplace. The Envato marketplace is a set of different websites which are all dedicated to sell premium standard files on all types of files you will need for design [...]]]></description> <content:encoded><![CDATA[<p>If your a regular reader here then you will know every month I display a list of <strong>Free items</strong> that you can get from the <strong>Envato marketplace</strong>.</p><p>The <strong>Envato marketplace</strong> is a set of different websites which are all dedicated to sell premium standard files on all types of files you will need for design and development.</p><p>You can get WordPress themes, code scripts, graphics, photos and much more.</p><p>In this tutorial we are going to look at how to use the <strong>API</strong> to get public information and how to turn this into a <a href="http://www.paulund.co.uk/what-makes-a-premium-wordpress-theme-premium" title="What Makes A Premium WordPress Theme Premium?">WordPress plugin</a> to display item information on your Website. We are going to team up the API with your account name to easily earn money from the affiliate account by referring new users to the marketplace.<br /> <span id="more-4229"></span></p><h2>Envato Marketplace Sites</h2><p>Currently there are nine sites which make you the <strong>Envato marketplace</strong>, all providing different things to your design or development projects.</p><h3>Activeden</h3><p><a href="http://activeden.net/?ref=paulund"><img alt="" src="http://envato.s3.amazonaws.com/wiki/logo_fd.png" title="ActiveDen" class="aligncenter" width="180" height="42" /></a></p><p>At ActiveDen you can buy and sell royalty-free Adobe Flash and Flex files for just a few dollars. Items are priced on the complexity, quality and use of the file. The site is home to a bustling community of Flash designers and developers and is the largest Flash library on the web.</p><p><a href="http://activeden.net/?ref=paulund" class="button">Activeden</a></p><h3>AudioJungle</h3><p><a href="http://audiojungle.net?ref=paulund"><img alt="" src="http://envato.s3.amazonaws.com/wiki/audiojungle.png" title="AudioJungle" class="aligncenter" width="201" height="45" /></a></p><p>At AudioJungle you can buy and sell royalty-free music and sound effects that are completely Podsafe for just a few dollars. The site is home to a bustling community of audio composers and producers.</p><p><a href="http://audiojungle.net?ref=paulund" class="button">Audio Jungle</a></p><h3>Themeforest</h3><p><a href="http://themeforest.net?ref=paulund"><img alt="" src="http://envato.s3.amazonaws.com/wiki/logo_tf.png" title="Themeforest" class="aligncenter" width="211" height="40" /></a></p><p>At ThemeForest you can buy and sell HTML templates as well as themes for popular CMS products like WordPress, Joomla and Drupal with prices ranging from just $5 up to $40. Items are priced on the complexity, quality and use of the file. The site is home to a bustling community of web designers and developers and is the biggest marketplace of its kind.</p><p><a href="http://themeforest.net?ref=paulund" class="button">Themeforest</a></p><h3>Videohive</h3><p><a href="http://videohive.net?ref=paulund"><img alt="" src="http://envato.s3.amazonaws.com/wiki/logo_vh.png" title="VideoHive" class="aligncenter" width="179" height="44" /></a></p><p>At VideoHive you can buy and sell royalty-free footage and motion graphics as well as After Effects Project files starting at just a few dollars. Items are priced on the complexity, quality and use of the file. The site is home to a bustling community of motion graphics junkies!</p><p><a href="http://videohive.net?ref=paulund" class="button">Video Hive</a></p><h3>Graphic River</h3><p><a href="http://graphicriver.net?ref=paulund"><img alt="" src="http://envato.s3.amazonaws.com/wiki/logo_gr.png" title="Graphic River" class="aligncenter" width="220" height="57" /></a></p><p>At GraphicRiver you can buy and sell royalty-free, layered Photoshop files, vectors, icon packs, Adobe add-ons and design templates for just a few dollars. Items are priced on the complexity, quality and use of the file. The site is home to a bustling community of graphic designers and illustrators.</p><p><a href="http://graphicriver.net?ref=paulund" class="button">Graphic River</a></p><h3>3D Ocean</h3><p><a href="http://3docean.net?ref=paulund"><img alt="" src="http://wiki.envato.com/wp-content/uploads/2009/11/3docean.png" title="3DOcean" class="aligncenter" width="163" height="37" /></a></p><p>At 3DOcean you can buy and sell royalty-free 3D models, textures, concepts, and materials and shaders. Items are priced on the complexity, quality and use of the file.</p><p><a href="http://3docean.net?ref=paulund" class="button">3D Ocean</a></p><h3>Codecanyon</h3><p><a href="http://codecanyon.net?ref=paulund"><img alt="" src="http://envato.s3.amazonaws.com/wiki/logo_cc.png" title="CodeCanyon" class="aligncenter" width="210" height="37" /></a></p><p>At CodeCanyon, you can purchase and sell scripts and components for a variety of languages and frameworks, currently including JavaScript, PHP, ASP.NET, and Java. Items are priced between $3 and $25; we review complexity, quality, and overall appeal when determining the specific value to assign to an item.</p><p><a href="http://codecanyon.net?ref=paulund" class="button">Code Canyon</a></p><h3>Tutorials</h3><p><a href="http://marketplace.tutsplus.com?ref=paulund"><img alt="" src="http://themeforest.net/images/tutsmarketplace/logo-light.png" title="Tuts+" class="aligncenter" width="152" height="37" /></a></p><p>At the Tuts+ Marketplace you can buy and sell tutorials and eBooks on topics like Design, Web Development and Computer Graphics. Items are priced based on depth and complexity. The site is home to a bustling community of people learning and teaching across all skill levels and is the biggest marketplace of its kind.</p><p><a href="http://marketplace.tutsplus.com?ref=paulund" class="button">Tuts+ Marketplace</a></p><h3>Photodune</h3><p><a href="http://photodune.net?ref=paulund"><img alt="" src="http://1.envato-static.com/images/photodune/logo-dark.png?1311219810" title="Photdune" class="aligncenter" width="213" height="45" /></a></p><p>At PhotoDune you can buy and sell royalty-free photographs and images starting at just $1. Items are priced on the size/megapixels of each file. The site is home to a bustling community of photographers and digital imaging experts.</p><p><a href="http://photodune.net?ref=paulund" class="button">Photodune</a></p><h2>Envato Marketplaces API</h2><p>All of the websites listed above can be accessed using the <a href="http://wiki.envato.com/community/the-api/the-envato-marketplace-api/" title="Envato API">Envato API</a>, making it easy for outside applications to use the data stored in the <strong>API</strong>. An <strong>API</strong> is a set of routines, data structure and object classes used to access data.</p><p>Using the <strong>API</strong> you can get to data on any of the marketplaces, these are set into 2 sections&#8230;public sets and user sets. The public set consists of everything which is publicly available such as new items, popular items, blog posts, users. The user sets consist of everything for a specific user and you need an API key to get to this information.</p><p>In this tutorial we are going to look at the public set data and how to create a <strong>WordPress plugin</strong> to get at this data.</p><h2>Public Sets API Data</h2><p>The data which is available for the public via the API is.</p><ul><li><strong>blog-posts</strong> &#8211; A list of blog posts for a particular site. Requires a site paramater, e.g. blog-posts:activeden</li><li><strong>active-threads</strong> &#8211; Threads with the most recent messages activity. Requires a site parameter, e.g. active-threads:activeden.</li><li><strong>number-of-files</strong> &#8211; Shows the number of files in the major categories of a particular site. Requires a site paramater, e.g. number-of-files:activeden</li><li><strong>new-files</strong> -	New files, recently uploaded to a particular site. Requires site and category paramaters, e.g. new-files:themeforest,site-templates or new-files:graphic-river,graphics</li><li><strong>popular</strong> &#8211; Returns the popular files for a particular site. Requires a site paramater, e.g. popular:activeden</li><li><strong>new-files-from-user</strong> &#8211; Shows the newest 10 files a user has uploaded to a particualr site. Requires username and site paramaters, e.g. new-files-from-user:collis,themeforest</li><li><strong>random-new-files</strong> &#8211; Shows a random list of newly uploaded files from a particular site (i.e. like the homepage). Requires a site paramater, e.g. random-new-files:activeden</li><li><strong>search</strong> &#8211; Search for items, users or forum messages. Returns only the first 50 results. First parameter is site (e.g. activeden, audiojungle), second parameter is type (e.g. site-templates, music, graphics, for a full list of types, look at the search select box values on the particular marketplace), third paramater is the search term (e.g. xml, preloader, dance, sky). First and second parameters are optional, third is required. Examples: search:themeforest,site-templates,xml.json search:,,collis.json search:audiojungle,,happy.json</li><li><strong>user</strong> &#8211; Shows username, country, number of sales, location and image for a user. Requires a username, e.g. collis</li><li><strong>releases</strong> &#8211; Returns Release and Set information for the API (used to generate the documentation)</li></ul><p>The above are the parameters you need to send to the <strong>API</strong> to get the data you want. If you want to get the most popular products on <a href="http://codecanyon.net?ref=paulund" title="Codecanyon">CodeCanyon</a> then use the following URL.</p><h4>Popular Items On CodeCanyon Return As JSON</h4><p>http://marketplace.envato.com/api/edge/popular:codecanyon.json</p><p><a href="http://marketplace.envato.com/api/edge/popular:codecanyon.json">Popular Items On CodeCanyon Return As JSON</a></p><h4>Popular Items On CodeCanyon Return As XML</h4><p>http://marketplace.envato.com/api/edge/popular:codecanyon.xml</p><p><a href="http://marketplace.envato.com/api/edge/popular:codecanyon.xml">Popular Items On CodeCanyon Return As XML</a></p><p>Each of these parameters will return different nodes but if you are working with JSON or XML it is very easy to get at the data that we want.</p><h2>Creating A WordPress Plugin</h2><p>We are going to create a <strong>WordPress plugin</strong> which will create a number of different <a href="http://www.paulund.co.uk/enable-shortcodes-in-widgets" title="Enable Shortcodes In Widgets">shortcodes</a> to display the data we want in your WordPress posts.</p><p>We start off by defining the <strong>WordPress plugin</strong> by placing the following comments at the top of the file. This allows us to tell <strong>WordPress</strong> that this is a plugin and allows us to activate it and deactivate it from the <a href="http://www.paulund.co.uk/remove-wordpress-dashboard-widgets" title="Remove WordPress Dashboard Widgets">plugin dashboard</a>.</p><p>[php]<br /> /*<br /> * Plugin Name: Paulund Envato Shortcodes<br /> * Version: 1<br /> * Plugin URI: http://www.paulund.co.uk<br /> * Description: Create a number of shortcodes to be used in your WordPress themes<br /> * Author: Paul Underwood<br /> * Author URI: http://www.paulund.co.uk<br /> */<br /> [/php]</p><h2>Enable Shortcodes</h2><p>To start with we want to be able to use these shortcodes anywhere on the Website. By default you can&#8217;t use shortcodes in widgets so we are going to use the following code to allow us to use <a href="http://www.paulund.co.uk/enable-shortcodes-in-widgets" title="Enable Shortcodes In Widgets">shortcodes in widgets</a>.</p><p>[php]<br /> // Enable shortcodes in widget areas<br /> add_filter( &#8216;widget_text&#8217;, &#8216;do_shortcode&#8217; );<br /> [/php]</p><h2>Envato Wrapper API Class</h2><p>Below is the class we are going to use to get all the items for a specific set and category. This is take the attributes from the <strong>shortcode</strong> to display exactly what we want. The benefit of using this class means that the code in the shortcodes is very minimal and the class will do all the work for us.</p><p>Copy the following into your PHP file.</p><p>[php]<br /> /**<br /> * The class wrapper for envato API<br /> */<br /> class Paulund_Envato{</p><p> /**<br /> * Shortcode attributes<br /> */<br /> private $atts = FALSE;</p><p> /**<br /> * The API URL<br /> */<br /> private $url = FALSE;</p><p> /**<br /> * All items<br /> */<br /> private $items = FALSE;</p><p> /**<br /> * Set debug mode<br /> */<br /> private $debug = FALSE;</p><p> /**<br /> * Constructor for wrapper class<br /> *<br /> * @param $atts &#8211; Shortcode attributes<br /> */<br /> public function __construct( $atts ){<br /> // Set default attributes<br /> $this->atts = shortcode_atts(array(<br /> &#8216;marketplace&#8217; 		=> &#8221;,<br /> &#8216;set&#8217; 				=> &#8221;,<br /> &#8216;category&#8217; 			=> &#8221;,<br /> &#8216;limit&#8217; 			=> &#8221;,<br /> &#8216;id&#8217; 				=> &#8221;,<br /> &#8216;user&#8217; 				=> &#8221;,<br /> &#8216;search&#8217; 			=> &#8221;,<br /> &#8216;ref&#8217; 				=> &#8216;paulund&#8217;,<br /> &#8216;buttontext&#8217;		=> &#8216;Buy Now&#8217;,<br /> &#8216;displaytitle&#8217; 		=> &#8216;true&#8217;,<br /> &#8216;displayimage&#8217; 		=> &#8216;true&#8217;,<br /> &#8216;displaysales&#8217; 		=> &#8221;,<br /> &#8216;displayrating&#8217; 	=> &#8221;,<br /> &#8216;displaycost&#8217;	 	=> &#8216;true&#8217;,<br /> &#8216;displaytags&#8217; 		=> &#8221;,<br /> &#8216;displaycategory&#8217; 	=> &#8221;,<br /> &#8216;displaynumberfiles&#8217;=> &#8221;,<br /> &#8216;displaybutton&#8217;		=> &#8216;true&#8217;,<br /> &#8216;debug&#8217;				=> &#8216;false&#8217;), $atts);</p><p> // If debug mode is on set class field to true<br /> if($this->atts["debug"] == &#8216;true&#8217;){<br /> $this->debug = TRUE;<br /> }<br /> }</p><p> /**<br /> * Defines which set of files we want<br /> *<br /> * @param $set &#8211; Set of files<br /> */<br /> public function Set( $set ){<br /> $this->atts["set"] = $set;<br /> }</p><p> /**<br /> * Defines which category we want from set of files<br /> * Used on searches such as popular which return popular last week, popular last 3 months and popular authors<br /> *<br /> * @param $category &#8211; Defines category<br /> */<br /> public function Set_Category( $category ){<br /> $this->atts["category"] = $category;<br /> }</p><p> /**<br /> * Works out the URL to call by the attributes sent<br /> */<br /> private function Set_Url( $format = &#8220;.json&#8221;){<br /> $url = &#8220;http://marketplace.envato.com/api/edge/&#8221;;</p><p> if( $this->atts["set"] != &#8220;&#8221; ){<br /> $url .= $this->atts["set"];<br /> }</p><p> if( $this->atts["marketplace"] != &#8220;&#8221; ){<br /> $url .= &#8220;:&#8221;.$this->atts["marketplace"];<br /> }</p><p> if( $this->atts["id"] != &#8220;&#8221; ){<br /> $url .= &#8220;:&#8221;.$this->atts["id"];<br /> }</p><p> $url .= $format;</p><p> $this->url = $url;<br /> }</p><p> /**<br /> * The main method for the class which will set the url, get the items, parse the items and display each items<br /> */<br /> public function Display_Items(){</p><p> // Set the URL<br /> $this->Set_Url();</p><p> // Display debug messages<br /> if($this->debug){<br /> echo &#8216;Start Display Items&#8217;;<br /> echo &#8216;<pre>';
			print_r($this->atts);
			echo '</pre><p>&#8216;;<br /> }</p><p> // Extract the variables from array<br /> extract($this->atts);</p><p> // Make sure that at least one of these are set<br /> if( $id == &#8221; &#038;&#038; $marketplace == &#8221; &#038;&#038; $set == &#8221;){<br /> return;<br /> }</p><p> // Get the items<br /> $this->Get_Items();</p><p> // Parse the correct category<br /> $this->Parse_Category();</p><p> // Displays each item<br /> $this->Display_Each_Item();<br /> }</p><p> /**<br /> * Uses the WordPress remote get function to return the json items<br /> */<br /> public function Get_Items(){<br /> // Get items as json<br /> $json = wp_remote_get( $this->url );</p><p> // Display debug messages<br /> if($this->debug){<br /> echo &#8216;Get Items&#8217;;<br /> echo &#8216;URL &#8211; &#8216;.$this->url;<br /> echo &#8216;<pre>';
			print_r($json);
			echo '</pre><p>&#8216;;<br /> }</p><p> // Set the items variable with the body of the json<br /> $this->items = json_decode($json["body"], true);<br /> }</p><p> /**<br /> * Parse the items to get exactly the data we want<br /> */<br /> private function Parse_Category(){</p><p> // Display debug messages<br /> if($this->debug){<br /> echo &#8216;Parse Category&#8217;;<br /> echo &#8216;<pre>';
			print_r($this->atts);
			print_r($parsed_items);
			echo '</pre><p>&#8216;;<br /> }</p><p> // Set the items<br /> $items = $this->items;</p><p> // Get the set of items we want<br /> if($this->atts["set"] != &#8220;&#8221;){<br /> $parsed_items = $items[$this->atts["set"]];<br /> }</p><p> // Get the category of items we want<br /> if($this->atts["category"] != &#8220;&#8221;){<br /> $parsed_items = $parsed_items[$this->atts["category"]];<br /> }</p><p> // Limit the items to the amount we want back<br /> if($this->atts["limit"] != &#8220;&#8221;){<br /> $parsed_items = array_slice($parsed_items, 0, $this->atts["limit"]);<br /> }</p><p> // Display the parsed items<br /> if($this->debug){<br /> echo &#8216;End Parse Category Display Items&#8217;;<br /> echo &#8216;<pre>';
			print_r($parsed_items);
			echo '</pre><p>&#8216;;<br /> }</p><p> // Set the items variable to the new parsed items<br /> $this->items = $parsed_items;<br /> }</p><p> /**<br /> * Loop through all of the items to display each item<br /> */<br /> private function Display_Each_Item(){</p><p> // Display the debug messages<br /> if($this->debug){<br /> echo &#8216;Display Each Items&#8217;;<br /> echo &#8216;<pre>';
			print_r($this->items);
			echo '</pre><p>&#8216;;<br /> }</p><p> // Set the attributes variable<br /> $atts = $this->atts;</p><p> // Make sure that the items are inside an array<br /> if(!is_array($this->items[0])){<br /> $this->items = array($this->items);<br /> }</p><p> // Loop through all items to display on the page<br /> foreach($this->items as $item){<br /> $url = $item["url"].&#8221;?ref=&#8221;.$atts["ref"];</p><p> ?><div class="paulund_envato"><?php</p><p> // Display the title<br /> if($atts["displaytitle"] == "true"){<br /> $title = NULL;</p><p> if(isset($item["item"])){<br /> $title = $item["item"];<br /> }</p><p> if(isset($item["title"])){<br /> $title = $item["title"];<br /> }</p><p> if($title != NULL){<br /> ?><br /><h2 class="paulund_envato_header"><?php echo $title;?></h2><p><?php<br /> }<br /> }</p><p> // Display image<br /> if($atts["displayimage"] == "true"){<br /> $image = NULL;</p><p> if(isset($item["live_preview_url"]) &#038;&#038; $image == NULL){<br /> $image = $item["live_preview_url"];<br /> }</p><p> if(isset($item["image"]) &#038;&#038; $image == NULL){<br /> $image = $item["image"];<br /> }</p><p> if(isset($item["thumbnail"]) &#038;&#038; $image == NULL){<br /> $image = $item["thumbnail"];<br /> }</p><p> if($image != NULL){<br /> ?><br /> <a href="<?php echo $url;?>&#8221; target=&#8221;_blank&#8221;><br /> <img class="paulund_envato_image"<br /> src="<?php echo $image;?>&#8221;<br /> alt=&#8221;<?php echo $item["item"];?>&#8221; /><br /> </a><br /> <?php<br /> }<br /> }</p><p> // Display sales<br /> if($atts["displaysales"] == "true"){<br /> ?><p class="paulund_envato_sales">Total Sales: <?php echo $item["sales"];?></p><p><?php<br /> }</p><p> // Display ratings<br /> if($atts["displayrating"] == "true"){<br /> ?><p class="paulund_envato_rating">Rating: <?php echo $item["rating"];?> out of 5</p><p><?php<br /> }</p><p> // Display the cost<br /> if($atts["displaycost"] == "true"){<br /> ?><p class="paulund_envato_cost">Price: $<?php echo $item["cost"];?></p><p><?php<br /> }</p><p> // Display the tags<br /> if($atts["displaytags"] == "true"){<br /> ?><p class="paulund_envato_tags">Tags: <?php echo $item["tags"];?></p><p><?php<br /> }</p><p> // Display the category<br /> if($atts["displaycategory"] == "true"){<br /> ?><p class="paulund_envato_category">Category: <?php echo $item["category"];?></p><p><?php<br /> }</p><p> // Display the number of files<br /> if($atts["displaynumberfiles"] == "true"){<br /> ?><p class="paulund_envato_number_files">Number Of Files: <?php echo $item["number_of_files"];?></p><p><?php<br /> }</p><p> // Display the button<br /> if($atts["displaybutton"] == "true"){<br /> ?><br /> <a href="<?php echo $url; ?>&#8221;<br /> target=&#8221;_blank&#8221;<br /> class=&#8221;button paulund_envato_button&#8221;><br /> <?php echo $atts["buttontext"]; ?><br /> </a><br /> <?php<br /> }</p><p> ?></p></div><p> <?php<br /> }<br /> }<br /> }<br /> [/php]</p><h3>Envato Shortcodes</h3><p>Now we can use <a href="http://www.paulund.co.uk/enable-shortcodes-in-widgets" title="Enable Shortcodes In Widgets">shortcodes in widgets</a> we can add shortcodes anywhere in the theme.</p><p>In this plugin we are going to make shortcodes for the following.</p><ul><li>Popular Files</li><li>Featured Files</li><li>New Files</li><li>New Files by certain Author</li><li>Random Files</li><li>Specific Files</li><li>All files from a specific user</li></ul><p>[php]<br /> add_shortcode( &#8216;paulund_envato_popular&#8217;, &#8216;paulund_envato_popular_function&#8217; );<br /> add_shortcode( &#8216;paulund_envato_features&#8217;, &#8216;paulund_envato_features_function&#8217; );<br /> add_shortcode( &#8216;paulund_envato_new_files&#8217;, &#8216;paulund_envato_new_files_function&#8217; );<br /> add_shortcode( &#8216;paulund_envato_new_files_from_user&#8217;, &#8216;paulund_envato_new_files_from_user_function&#8217; );<br /> add_shortcode( &#8216;paulund_envato_random_new_files&#8217;, &#8216;paulund_envato_random_new_files_function&#8217; );<br /> add_shortcode( &#8216;paulund_envato_item&#8217;, &#8216;paulund_envato_item_function&#8217; );<br /> add_shortcode( &#8216;paulund_envato_user&#8217;, &#8216;paulund_envato_user_function&#8217; );<br /> [/php]</p><p>Each of these shortcodes will run a PHP function, from this function we can call the above class to get exactly the items we want.</p><p>Copy the following into your PHP file outside of the Envato Wrapper Class.</p><p>[php]<br /> /**<br /> * Get popular envato files<br /> *<br /> * @param $atts &#8211; Attributes in the shortcode<br /> * @param $content &#8211; Content in shortcode can be null<br /> */<br /> function paulund_envato_popular_function( $atts, $content = null ){<br /> $envato = new Paulund_Envato($atts);</p><p> $envato->Set(&#8220;popular&#8221;);<br /> $envato->Set_Category($atts["category"]);<br /> $envato->Display_Items();<br /> }</p><p>/**<br /> * Get featured envato files<br /> *<br /> * @param $atts &#8211; Attributes in the shortcode<br /> * @param $content &#8211; Content in shortcode can be null<br /> */<br /> function paulund_envato_features_function( $atts, $content = null ){<br /> $envato = new Paulund_Envato($atts);</p><p> $envato->Set(&#8220;features&#8221;);<br /> $envato->Set_Category($atts["category"]);<br /> $envato->Display_Items();<br /> }</p><p>/**<br /> * Get new envato files<br /> *<br /> * @param $atts &#8211; Attributes in the shortcode<br /> * @param $content &#8211; Content in shortcode can be null<br /> */<br /> function paulund_envato_new_files_function( $atts, $content = null ){<br /> $envato = new Paulund_Envato($atts);</p><p> $envato->Set(&#8220;new-files&#8221;);<br /> $envato->Display_Items();<br /> }</p><p>/**<br /> * Get new envato files for user<br /> *<br /> * @param $atts &#8211; Attributes in the shortcode<br /> * @param $content &#8211; Content in shortcode can be null<br /> */<br /> function paulund_envato_new_files_from_user_function( $atts, $content = null ){<br /> $envato = new Paulund_Envato($atts);</p><p> $envato->Set(&#8220;new-files-from-user&#8221;);<br /> $envato->Display_Items();<br /> }</p><p>/**<br /> * Get random new envato files<br /> *<br /> * @param $atts &#8211; Attributes in the shortcode<br /> * @param $content &#8211; Content in shortcode can be null<br /> */<br /> function paulund_envato_random_new_files_function( $atts, $content = null ){<br /> $envato = new Paulund_Envato($atts);</p><p> $envato->Set(&#8220;random-new-files&#8221;);<br /> $envato->Display_Items();<br /> }</p><p>/**<br /> * Get specific envato file item<br /> *<br /> * @param $atts &#8211; Attributes in the shortcode<br /> * @param $content &#8211; Content in shortcode can be null<br /> */<br /> function paulund_envato_item_function ( $atts, $content = null ){<br /> $envato = new Paulund_Envato($atts);</p><p> $envato->Set(&#8220;item&#8221;);<br /> $envato->Display_Items();<br /> }</p><p>/**<br /> * Get envato files for specific user<br /> *<br /> * @param $atts &#8211; Attributes in the shortcode<br /> * @param $content &#8211; Content in shortcode can be null<br /> */<br /> function paulund_envato_user_function( $atts, $content = null ){<br /> $envato = new Paulund_Envato($atts);</p><p> $envato->Set(&#8220;user&#8221;);<br /> $envato->Display_Items();<br /> }<br /> [/php]</p><h2>Using The Shortcodes</h2><p>With all the code for your <strong>WordPress plugin</strong> finished we can discover how to use these shortcodes.</p><h3>Popular Files</h3><p>The <strong>envato popular files API</strong> return 3 types popular files.</p><ul><li>Popular items last week</li><li>Popular items of the last three months</li><li>Popular Author of last month</li></ul><p>Because for these three categories we need to use both the set and category attributes in the shortcode</p><h4>Popular items last week shortcode</h4><p>[html]<br /> [ paulund_envato_popular marketplace="codecanyon" category="items_last_week" displaysales="true" displayrating="true" displaytags="true" buttontext="Buy Now" limit="5" ]<br /> [/html]</p><h4>Popular items of the last three months shortcode</h4><p>[html]<br /> [ paulund_envato_popular marketplace="codecanyon" category="items_last_three_months" displaysales="true" displayrating="true" displaytags="true" buttontext="Buy Now" limit="5" ]<br /> [/html]</p><h4>Popular Author of last month shortcode</h4><p>[html]<br /> [ paulund_envato_popular marketplace="codecanyon" category="authors_last_month" displaysales="true" displayrating="true" displaytags="true" buttontext="Buy Now" limit="5" ]<br /> [/html]</p><h3>Featured Files</h3><p>The featured call will return the current featured files on the marketplace.</p><ul><li>Featured File</li><li>Featured Authors</li><li>Free File</li></ul><h4>Featured File shortcode</h4><p>[html]<br /> [ paulund_envato_features marketplace="codecanyon" category="featured_file" displaysales="true" displayrating="true" displaytags="true" buttontext="Buy Now" ]<br /> [/html]</p><h4>Featured Authors shortcode</h4><p>[html]<br /> [ paulund_envato_features marketplace="codecanyon" category="featured_author" displaysales="true" displayrating="true" displaytags="true" buttontext="Buy Now" ]<br /> [/html]</p><h4>Free File shortcode</h4><p>[html]<br /> [ paulund_envato_features marketplace="codecanyon" category="free_file" displaysales="true" displayrating="true" displaytags="true" buttontext="Get Your Free File" ]<br /> [/html]</p><h3>New Files</h3><p>To get the new files for a marketplace you also need to pass the category you want to get the new files from.</p><p>To do this use the following shortcode.</p><p>[html]<br /> [ paulund_envato_new_files marketplace="themeforest,site-templates" displaysales="true" displayrating="true" displaytags="true" buttontext="Buy Now" ]<br /> [/html]</p><h3>New Files by certain Author</h3><p>Get the new files for a certain user.</p><p>[html]<br /> [ paulund_envato_new_files_from_user marketplace="collis,themeforest" displaysales="true" displayrating="true" displaytags="true" buttontext="Buy Now" ]<br /> [/html]</p><h3>Random Files</h3><p>Get random new files for a marketplace.<br /> [html]<br /> [ paulund_envato_random_new_files marketplace="themeforest" displaysales="true" displayrating="true" displaytags="true" buttontext="Buy Now" ]<br /> [/html]</p><h3>Specific Files</h3><p>Get specific files by the item ID.</p><p>[html]<br /> [ paulund_envato_item id="372656" displaysales="true" displayrating="true" displaytags="true" buttontext="Buy Now" ]<br /> [/html]</p><h3>All files from a specific user</h3><p>Get all the files from a specific user.</p><p>[html]<br /> [ paulund_envato_user id="collis" displaysales="true" displayrating="" displaytags="" displaycost="" buttontext="Buy Now" ]<br /> [/html]</p><h2>Download</h2><p>I&#8217;ve add this plugin to the WordPress.org so you can download this and use the shortcodes on your WordPress site.</p><p><a href="http://wordpress.org/extend/plugins/envato-marketplace-api-shortcodes/" class="button">Download Envato API Shortcodes</a></p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/creating-wordpress-shortcodes-for-envato-marketplace-api/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Add Search Form To A WordPress Menu</title><link>http://www.paulund.co.uk/add-search-form-to-a-wordpress-menu</link> <comments>http://www.paulund.co.uk/add-search-form-to-a-wordpress-menu#comments</comments> <pubDate>Sun, 13 May 2012 03:33:07 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[Form]]></category> <category><![CDATA[Menu]]></category> <category><![CDATA[search]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=5500</guid> <description><![CDATA[WordPress comes with the functionality to create menus in the dashboard area, from here you can select pages or custom custom menu items to make up your menu. Menus are normally going to be display at the top of the page to give the visitor easy access to your main pages. But this top navigation [...]]]></description> <content:encoded><![CDATA[<p><img src="http://paulund.paulund.netdna-cdn.com/wp-content/uploads/2011/07/wordpress.png" alt="Wordpress" title="wordpress" width="150" height="150" class="aligncenter size-full wp-image-777" /></p><p>WordPress comes with the functionality to <a href="http://www.paulund.co.uk/get-all-wordpress-navigation-menus" title="Get All WordPress Navigation Menus">create menus</a> in the dashboard area, from here you can select pages or custom custom menu items to make up your menu.</p><p>Menus are normally going to be display at the top of the page to give the visitor easy access to your main pages. But this top navigation bar is also a good place to have your search box so if people can&#8217;t find what they are looking for then they can use your search box.<br /> <span id="more-5500"></span><br /> With the default behaviour of the WordPress menus you can only add pages to the menu and not a search box.</p><p>Below is a WordPress snippet you can use to add a <a href="http://www.paulund.co.uk/how-to-create-pretty-search-forms" title="How To Create Pretty Search Forms">search form</a> to a certain menu, just add the following to your WordPress functions.php file.</p><p>[php]<br /> add_filter(&#8216;wp_nav_menu_items&#8217;, &#8216;add_search_form&#8217;, 10, 2);</p><p> function add_search_form($items, $args) {<br /> if( $args->theme_location == &#8216;CHANGE-THIS-TO-YOUR-MENU-NAME&#8217; )<br /> $items .= &#8216;<li class="search"><form role="search" method="get" id="searchform" action="'.home_url( '/' ).'"> <input type="text" value="search" name="s" id="s" /> <input type="submit" id="searchsubmit" value="'. __('Search') .'" /></form></li><p>&#8216;;<br /> return $items;<br /> }<br /> [/php]</p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/add-search-form-to-a-wordpress-menu/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How To Exclude Posts From Search</title><link>http://www.paulund.co.uk/how-to-exclude-posts-from-search</link> <comments>http://www.paulund.co.uk/how-to-exclude-posts-from-search#comments</comments> <pubDate>Sat, 12 May 2012 03:20:04 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[exclude]]></category> <category><![CDATA[posts]]></category> <category><![CDATA[search]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=5465</guid> <description><![CDATA[There may be times when you have a little rant of make a mistake in a post and want to exclude this from the in-built WordPress search functionality. There is a way you can intercept the WordPress search functionality and exclude certain posts from being displayed. All you have to do is find out the [...]]]></description> <content:encoded><![CDATA[<p><img src="http://paulund.paulund.netdna-cdn.com/wp-content/uploads/2011/10/Keyword-research-with-right-tools.jpg" alt="Keywords" title="Keyword-research-with-right-tools" width="380" height="265" class="aligncenter size-full wp-image-2017" /></p><p>There may be times when you have a little rant of make a mistake in a post and want to exclude this from the in-built WordPress search functionality.</p><p>There is a way you can intercept the <a href="http://www.paulund.co.uk/redirect-wordpress-searches" title="Redirect WordPress Searches">WordPress search functionality</a> and exclude certain posts from being displayed. All you have to do is find out the post ID and add it to the following function in your functions.php file.<br /> <span id="more-5465"></span><br /> [php]<br /> function exclude_posts($query) {<br /> if ($query->is_search) {<br /> $query->set(&#8216;cat&#8217;,&#8217;110, 201, 254, 302&#8242;);    //Change the numbers to your post IDs<br /> }<br /> return $query;<br /> }</p><p>add_filter(&#8216;pre_get_posts&#8217;,'exclude_posts&#8217;);<br /> [/php]</p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/how-to-exclude-posts-from-search/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Secure WordPress Config File With htaccess</title><link>http://www.paulund.co.uk/secure-wordpress-config-file-with-htaccess</link> <comments>http://www.paulund.co.uk/secure-wordpress-config-file-with-htaccess#comments</comments> <pubDate>Fri, 11 May 2012 09:07:54 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[config]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[install]]></category> <category><![CDATA[secure]]></category> <category><![CDATA[snippet]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=5193</guid> <description><![CDATA[Your wp-config.php file stores all of your config variables for your WordPress site. If someone has access to this file they will be able to see your database username and password. When you first install WordPress there is a default wp-config-sample.php file which you need to rename and modify. To keep this secure you can [...]]]></description> <content:encoded><![CDATA[<p><img src="http://paulund.paulund.netdna-cdn.com/wp-content/uploads/2011/07/wordpress.png" alt="Wordpress" title="wordpress" width="150" height="150" class="aligncenter size-full wp-image-777" /></p><p>Your <strong>wp-config.php</strong> file stores all of your config variables for your <a href="http://www.paulund.co.uk/what-makes-a-premium-wordpress-theme-premium" title="What Makes A Premium WordPress Theme Premium?">WordPress site</a>. If someone has access to this file they will be able to see your database username and password.</p><p>When you first install <strong>WordPress</strong> there is a default wp-config-sample.php file which you need to rename and modify.<br /> <span id="more-5193"></span></p><p>To keep this secure you can move this file outside of the <a href="http://www.paulund.co.uk/8-steps-to-help-secure-your-wordpress-site" title="9 Steps To Help Secure Your WordPress Site">WordPress root folder</a>, WordPress is able to find this file one level up from the root.</p><p>Another way to secure the <strong>wp-config.php</strong> file is to use <a href="http://www.paulund.co.uk/block-wordpress-admin-by-ip" title="Block WordPress Admin By IP">htaccess</a> to deny access for everyone trying to access it. To use htaccess to deny access, add the following snippet in your htaccess file.</p><p>[php]</p><p><Files wp-config.php><br /> Order Allow,Deny<br /> Deny from all<br /> </Files></p><p>[/php]</p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/secure-wordpress-config-file-with-htaccess/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Automatically Create Meta Description From Content</title><link>http://www.paulund.co.uk/automatically-create-meta-description-from-content</link> <comments>http://www.paulund.co.uk/automatically-create-meta-description-from-content#comments</comments> <pubDate>Thu, 10 May 2012 03:26:03 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[description]]></category> <category><![CDATA[meta]]></category> <category><![CDATA[snippet]]></category> <category><![CDATA[tag]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=4896</guid> <description><![CDATA[Meta description tags are still very much used by search engines, they provide the default text to be displayed in the search results. The Meta description tags should have relevant keywords to the article to attract visitors to your site. In WordPress it can be done by using SEO plugins, but if you don&#8217;t have [...]]]></description> <content:encoded><![CDATA[<p><img src="http://paulund.paulund.netdna-cdn.com/wp-content/uploads/2012/03/meta-description.jpg" alt="meta-description" title="meta-description" width="252" height="189" class="aligncenter size-full wp-image-4954" /></p><p><a href="http://www.paulund.co.uk/10-seo-terms-you-need-to-learn" title="10 SEO Terms You Need To Learn">Meta description</a> tags are still very much used by search engines, they provide the default text to be displayed in the search results.</p><p>The Meta description tags should have relevant keywords to the article to attract visitors to your site.</p><p>In WordPress it can be done by using <a href="http://www.paulund.co.uk/wordpress-plugins-for-any-blog" title="WordPress Plugins For Any Blog">SEO plugins</a>, but if you don&#8217;t have these plugins installed or forgot to add the meta description to this plugin then here is the WordPress snippet for you.</p><p>This snippet will automatically take the first 125 characters of your content and add this into the meta description tag for the page.<br /> <span id="more-4896"></span></p><p>[php]<br /> function create_meta_desc() {<br /> global $post;<br /> if (!is_single()) { return; }<br /> $meta = strip_tags($post->post_content);<br /> $meta = strip_shortcodes($post->post_content);<br /> $meta = str_replace(array(&#8220;\n&#8221;, &#8220;\r&#8221;, &#8220;\t&#8221;), &#8216; &#8216;, $meta);<br /> $meta = substr($meta, 0, 125);<br /> echo &#8220;<meta name='description' content='$meta' />&#8220;;<br /> }<br /> add_action(&#8216;wp_head&#8217;, &#8216;create_meta_desc&#8217;);</p><p>[/php]</p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/automatically-create-meta-description-from-content/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How To Create A Pinterest Scroll To Top Button WordPress Plugin</title><link>http://www.paulund.co.uk/how-to-create-a-pinterest-scroll-to-top-button-wordpress-plugin</link> <comments>http://www.paulund.co.uk/how-to-create-a-pinterest-scroll-to-top-button-wordpress-plugin#comments</comments> <pubDate>Wed, 09 May 2012 08:54:45 +0000</pubDate> <dc:creator>Paul</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[pinterest]]></category> <category><![CDATA[Plugin]]></category> <category><![CDATA[scroll]]></category> <category><![CDATA[to]]></category> <category><![CDATA[top]]></category><guid isPermaLink="false">http://www.paulund.co.uk/?p=5229</guid> <description><![CDATA[In a previous tutorial you would of learnt how you can use jQuery to create a scroll to top button on your website so when you click the button it will scroll you back to the top of the page. This is a really useful feature for websites which have a large scrolling page or [...]]]></description> <content:encoded><![CDATA[<p>In a previous tutorial you would of learnt <a href="http://www.paulund.co.uk/how-to-create-an-animated-scroll-to-top-with-jquery" title="How To Create An Animated Scroll To Top With jQuery">how you can use jQuery to create a scroll to top button</a> on your website so when you click the button it will <strong>scroll</strong> you back to the top of the page.</p><p>This is a really useful feature for websites which have a large scrolling page or infinite scrolling. The types of websites that will need this feature are content heavy website for example blogs. There are loads of blogs with massive pages because of all the great content on there. It would be so useful to have a scroll to top button on them&#8230;as most blogs are on WordPress I&#8217;ve decided to take the previous<a href="http://www.paulund.co.uk/how-to-create-an-animated-scroll-to-top-with-jquery" title="How To Create An Animated Scroll To Top With jQuery"> scroll to top tutorial</a> and turn this into a <strong>WordPress plugin</strong>.</p><h2>Why Pinterest?</h2><p><img src="http://paulund.paulund.netdna-cdn.com/wp-content/uploads/2012/04/Pinterest-Logo-590x342.jpg" alt="Pinterest-Logo" title="Pinterest-Logo" width="590" height="342" class="aligncenter size-large wp-image-5198" /><br /> <span id="more-5229"></span><br /> Currently the big website in social media is <a href="http://pinterest.com/paulund/" title="Pinterest">pinterest</a>, who has a <strong>scroll to top</strong> button appear in the bottom right corner of the website. This <strong>scroll to top button</strong> is not just a simple button on a website you need to scroll down before it will appear on the page, the button also has some CSS animation to slide into view and once you are at the <strong>top of the page</strong> the button will slide back off the page.</p><p>With the added complexity of this button I&#8217;ve decided to recreate this <a href="http://www.paulund.co.uk/how-to-create-an-animated-scroll-to-top-with-jquery" title="How To Create An Animated Scroll To Top With jQuery">scroll to top button</a> but as a <strong>WordPress plugin</strong> and in this tutorial and I&#8217;m going to show you how you can do it too.</p><h2>Define The WordPress Plugin</h2><p>First we are going to start off by creating the <strong>WordPress plugin</strong> this way all the HTML elements are on the page and the jQuery is included on the page.</p><p>Create a php file and add the following in the top of the file.</p><p>[php]<br /> /*<br /> Plugin Name: Paulund Scroll To Top<br /> Plugin URI: http://www.paulund.co.uk<br /> Description: Adds a jQuery scroll to top button at the bottom of the page.<br /> Author: Paul Underwood<br /> Version: 1.0<br /> Author URI: http://www.paulund.co.uk/<br /> */<br /> [/php]</p><p>When the plugin is defined the following script will run when you activate the plugin. I prefer working with PHP classes this way I know that the code will not conflict with anything else defined on WordPress.</p><p>For this plugin we are going to create a PHP class inside the plugin file to create the <strong>scroll to top button</strong>. All this class has to do is add some HTML on the page which we will use as the button, add a CSS file to the page so we can style the button and add jQuery to page to <strong>scroll back to the top</strong>.</p><p>Below is the basic structure of the PHP class.</p><p>[php]<br /> /**<br /> * The Paulund scroll to top plugin<br /> */<br /> class Paulund_Scroll_To_Top{</p><p> public function __construct(){</p><p> }</p><p> public function Scripts_Method() {</p><p> }</p><p> public function Add_Html(){</p><p> }<br /> }<br /> [/php]</p><h3>Constructor Function</h3><p>The constructor function needs to add the jQuery and CSS to the page for this we are going to add an action to the <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Actions" title="wp_enqueue_script" target="_blank">wp_enqueue_scripts action</a> which will run the function scripts method.</p><p>We are also going to use the constructor to add the HTML which will be the button, we are going to add this HTML to the bottom of the page, this means we are going to add a function to be ran on the <a href="http://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer" title="wp_footer action" target="_blank">wp_footer action</a>.</p><p>[php]<br /> public function __construct(){<br /> add_action( &#8216;wp_enqueue_scripts&#8217;, array(&#038;$this, &#8216;scripts_method&#8217;) );<br /> add_action( &#8216;wp_footer&#8217;, array(&#038;$this, &#8216;Add_Html&#8217;) );<br /> }<br /> [/php]</p><h3>Scripts Method Function</h3><p>This script methods function is used to add both the <strong>jQuery</strong> and the <strong>CSS</strong> to the page. For this to work we need to include jQuery on the page, we can then create our custom Javascript file which we are going to add a custom function to scroll the page to the top.</p><p>We are also going to include a CSS file so we are style the button to look the same as the Pinterest button.</p><p>[php]<br /> public function Scripts_Method() {<br /> wp_deregister_script( &#8216;jquery&#8217; );<br /> wp_register_script( &#8216;jquery&#8217;, ( &#8216;http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&#8217; ), false, null, true );<br /> wp_enqueue_script( &#8216;jquery&#8217; );</p><p> // Register styles and js<br /> wp_register_style( &#8216;toolbar_settings_css&#8217;, plugins_url( &#8216;/paulund-scroll-to-top/css/style.css&#8217; ) );<br /> wp_register_script( &#8216;toolbar_settings_js&#8217;, plugins_url( &#8216;/paulund-scroll-to-top/js/script.js&#8217; ), false, null, true );</p><p> wp_enqueue_style( &#8216;toolbar_settings_css&#8217; );<br /> wp_enqueue_script( &#8216;toolbar_settings_js&#8217; );<br /> }<br /> [/php]</p><h3>Add HTML</h3><p>The final function in the plugin is going to add the HTML to the page in the <a href="http://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer" title="wp_footer" target="_blank">wp_footer action</a>. The HTML for the button is very simple it&#8217;s just going to be a div with some text.</p><p>[php]<br /> public function Add_Html(){<br /> ?></p><div class="scrollToTop"> <strong>Scroll To Top</strong></div><p> <?php<br /> }<br /> [/php]</p><h2>The Javascript</h2><p>Below is the Javascript which is added to the page, this is what we are going to include on the page using the <a href="http://www.paulund.co.uk/load-jquery-cdn-with-wordpress" title="Load jQuery CDN With WordPress" target="_blank">wp_enqueue_script</a>.</p><p>Here we going to add all the Javascript inside a $(document).ready() function.</p><p>We are going to start off by adding an event to the <strong>window scroll event</strong>, this function will run when the visitor scrolls down the page. We need to do a check on the current position of the scroll bar as we only want the button to appear when you scrolled down the page. For this we are saying if the scroll position is over 200 pixels then display the button.</p><p>The way we are displaying the button is to change the position of the button up to -10px and to hide it we are going to move the button out of view by placing the bottom position to -100px. We are wrapping the change of pixel position around the <a href="http://api.jquery.com/animate/" title="Animate" target="_blank">jQuery animate function</a>, this way the button will slide in and out of view.</p><p>[javascript]<br /> //Check to see if the window is top if not then display button<br /> $(window).scroll(function(){<br /> if ($(this).scrollTop() > 200) {<br /> $(&#8216;.scrollToTop&#8217;).animate({&#8216;bottom&#8217;:'-10px&#8217;}, 350);<br /> } else {<br /> $(&#8216;.scrollToTop&#8217;).animate({&#8216;bottom&#8217;:'-100px&#8217;}, 350);<br /> }<br /> });<br /> [/javascript]</p><p>Next we can setup the button click event, this will set the scroll back to the top of the page. For this it&#8217;s very simple we just add a <strong>click event</strong> on the .scrollToTop class, on this click event we are going to <strong>animate</strong> the <strong>scrollTop</strong> back to the top of the page.</p><p>[javascript]<br /> //Click event to scroll to top<br /> $(&#8216;.scrollToTop&#8217;).click(function(){<br /> $(&#8216;html, body&#8217;).animate({scrollTop : 0},800);<br /> return false;<br /> });<br /> [/javascript]</p><p>Below is the full javascript we are going to use for the plugin.</p><p>[javascript]<br /> /**<br /> * @author Paulund<br /> */<br /> if (jQuery) {<br /> $(document).ready(function(){</p><p> //Check to see if the window is top if not then display button<br /> $(window).scroll(function(){<br /> if ($(this).scrollTop() > 200) {<br /> $(&#8216;.scrollToTop&#8217;).animate({&#8216;bottom&#8217;:'-10px&#8217;}, 350);<br /> } else {<br /> $(&#8216;.scrollToTop&#8217;).animate({&#8216;bottom&#8217;:'-100px&#8217;}, 350);<br /> }<br /> });</p><p> //Click event to scroll to top<br /> $(&#8216;.scrollToTop&#8217;).click(function(){<br /> $(&#8216;html, body&#8217;).animate({scrollTop : 0},800);<br /> return false;<br /> });<br /> });<br /> }<br /> [/javascript]</p><h2>Style Like Pinterest</h2><p>As mentioned above this is a button to act like the pinterest button, to do this we need it to look like the pinterest button.</p><p>Below is the CSS we are using to style the button just like Pinterest.<br /> [css]<br /> .scrollToTop{<br /> right: 15px;<br /> bottom: -100px;<br /> width: 50px;<br /> padding: 20px 10px 25px;<br /> text-align:center;<br /> font-family: &#8216;helvetica neue&#8217;, arial, sans-serif;<br /> font-weight: normal;<br /> color: #666060;<br /> text-decoration: none;<br /> position:fixed;<br /> cursor: pointer;<br /> font-size: 15px;<br /> border-radius: .3em;<br /> border:1px solid #BBB;<br /> background-color: #f0eded;<br /> background:-moz-linear-gradient(center top, #fdfafb, #f9f7f7 50%, #f6f3f4 50%, #f0eded);<br /> background: -o-linear-gradient(top left, #fdfafb, #f9f7f7 50%, #f6f3f4 50%, #f0eded);<br /> background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fdfafb), to(#f0eded), color-stop(.5,#f9f7f7),color-stop(.5,#f6f3f4));<br /> filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=&#8217;#fdfafb&#8217;, endColorstr=&#8217;#f0eded&#8217;);<br /> }<br /> .scrollToTop:hover{<br /> text-decoration:none;<br /> }<br /> [/css]</p><h2>Download The Plugin</h2><p>That&#8217;s all you need to create a Pinterest scroll to top plugin.</p><p>I&#8217;ve made this plugin available to <strong>download</strong> from the WordPress Repo. If you want to download this plugin please use the link below.</p><p><a href="http://wordpress.org/extend/plugins/pinterest-scroll-to-top-plugin/" class="button">Download Pinterest Scroll To Top</a></p> ]]></content:encoded> <wfw:commentRss>http://www.paulund.co.uk/how-to-create-a-pinterest-scroll-to-top-button-wordpress-plugin/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/35 queries in 0.010 seconds using disk: basic
Object Caching 1005/1097 objects using disk: basic
Content Delivery Network via paulund.paulund.netdna-cdn.com

Served from: www.paulund.co.uk @ 2012-05-17 20:36:38 -->
