<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ivor Padilla</title>
	
	<link>http://www.ivorpadilla.net</link>
	<description>Online Portfolio + Blog</description>
	<lastBuildDate>Mon, 08 Nov 2010 18:39:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/IvorPadilla" /><feedburner:info uri="ivorpadilla" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Detect All the Browsers Using your WordPress Functions</title>
		<link>http://www.ivorpadilla.net/detect-browsers/</link>
		<comments>http://www.ivorpadilla.net/detect-browsers/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 15:43:12 +0000</pubDate>
		<dc:creator>Ivor Padilla</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Crossbrowsing]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://www.ivorpadilla.net/?p=356</guid>
		<description><![CDATA[Cross Browsing can be tricky sometimes, as a ThemeForest author we try to give our buyers the best possible experience in all the browsers. I&#8217;ve been using the CSS Browser Selector in my WordPress themes but the user need to have Javascript enabled whether this is a problem or not I&#8217;ve been trying to find [...]]]></description>
			<content:encoded><![CDATA[<p>Cross Browsing can be tricky sometimes, as a <a href="http://themeforest.net">ThemeForest</a> author we try to give our buyers the best possible experience in all the browsers. I&#8217;ve been using the <a href="http://rafael.adm.br/css_browser_selector/">CSS Browser Selector</a> in my WordPress themes but the user need to have Javascript enabled whether this is a problem or not I&#8217;ve been trying to find a solution. In this quick tip I&#8217;ll show you a simple snippet that you need to add to you WordPress functions.php.</p>
<p><span id="more-356"></span></p>
<h3>1.- Add this to your Functions file</h3>
<p>You need to create the file functions.php If the file isn&#8217;t created. Paste the following code into the file:</p>
<pre class="brush: php; title: ; notranslate">
/*----------------------------------------------*/
/* Browser detection body_class() output  */
/*----------------------------------------------*/
add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
	global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;

	if($is_lynx) $classes[] = 'lynx';
	elseif($is_gecko) $classes[] = 'gecko';
	elseif($is_opera) $classes[] = 'opera';
	elseif($is_NS4) $classes[] = 'ns4';
	elseif($is_safari) $classes[] = 'safari';
	elseif($is_chrome) $classes[] = 'chrome';
	elseif($is_IE) $classes[] = 'ie';
	else $classes[] = 'unknown';

	if($is_iphone) $classes[] = 'iphone';
	return $classes;
}
</pre>
<h3>2.- Open your Header File</h3>
<p>Add this to the body class:</p>
<pre class="brush: php; title: ; notranslate"> &lt;body &lt;?php body_class(); ?&gt; &gt; </pre>
<h3></h3>
<h3>3.- Crossbrowsing</h3>
<p>Now if you have a problem with any browser you just need to prepend your selector with the browser prefix, example:</p>
<pre class="brush: css; title: ; notranslate"> .opera #yourSelector p { color:red; } </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ivorpadilla.net/detect-browsers/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Quick Photoshop Tip: How to Drag &amp; Drop Group Layers into another PSD document</title>
		<link>http://www.ivorpadilla.net/drag-group-layers/</link>
		<comments>http://www.ivorpadilla.net/drag-group-layers/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 21:07:23 +0000</pubDate>
		<dc:creator>Ivor Padilla</dc:creator>
				<category><![CDATA[Quick Tips]]></category>

		<guid isPermaLink="false">http://www.ivorpadilla.net/?p=347</guid>
		<description><![CDATA[This is a very simple tip, there's no need of any introduction :) just watch the *very short* screencast.]]></description>
			<content:encoded><![CDATA[<p>This is a very simple tip, there&#8217;s no need of any introduction <img src='http://www.ivorpadilla.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  just watch the *very short* screencast.<br />
<span id="more-347"></span><br />
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0' width='560' height='345'><param name='movie' value='http://screenr.com/Content/assets/screenr_1116090935.swf' /><param name='flashvars' value='i=86169' /><param name='allowFullScreen' value='true' /><embed src='http://screenr.com/Content/assets/screenr_1116090935.swf' flashvars='i=86169' allowFullScreen='true' width='560' height='345' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivorpadilla.net/drag-group-layers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Customizing the new WordPress 3.0 Custom Menus Adding Different Icons to Each Link</title>
		<link>http://www.ivorpadilla.net/cuztomizing-wordpress-custom-menu-icons/</link>
		<comments>http://www.ivorpadilla.net/cuztomizing-wordpress-custom-menu-icons/#comments</comments>
		<pubDate>Tue, 25 May 2010 01:35:45 +0000</pubDate>
		<dc:creator>Ivor Padilla</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.ivorpadilla.net/?p=296</guid>
		<description><![CDATA[I came across with an issue recently, I was trying to add different classes to each menu link without any success. The new WordPress Custom Menu feature have a lot of different options to play with, let's see what we'll do.]]></description>
			<content:encoded><![CDATA[<ul>
I came across with an issue recently, I was trying to add different classes to each menu link without any success. The new WordPress Custom Menu feature have a lot of different options to play with, let&#8217;s see what we&#8217;ll do.<br />
<span id="more-296"></span></p>
<h3 class="title">1. What we&#8217;re going to do?</h3>
<p>Is very simple, I want a menu with each link containing different icons:</p>
<p><img class="aligncenter size-full wp-image-297" title="Menu Items" src="http://www.ivorpadilla.net/wp-content/uploads/2010/05/Captura-de-pantalla-2010-05-24-a-las-8.22.30-p.m..png" alt="" width="553" height="118" /></p>
<h3 class="title">2. WordPress Custom Menus</h3>
<p><a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu">WordPress 3.0 Custom Menus</a> are a simple but effective new feature of the latest beta version of WordPress. To know more about this new feature <a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu">read here</a>.</p>
<p><img src="http://www.ivorpadilla.net/wp-content/uploads/2010/05/Captura-de-pantalla-2010-05-24-a-las-8.26.13-p.m..png" alt="" title="WCM" width="438" height="525" class="aligncenter size-full wp-image-304" /></p>
<h3 class="title">3. The Problem</h3>
<p>I need to assign differents <em>CSS</em> classes to each link to add my icons.</p>
<h3 class="title">4. The Solution</h3>
<p><del datetime="2010-05-25T13:15:59+00:00">Let&#8217;s use the <strong>Title Attribute</strong> and add it as classes using <a href="http://jquery.com">jQuery</a> to each menu link.</del></p>
<p><strong>[Update:]</strong><br />
There&#8217;s some hidden features in the WordPress Custom Menu and thanks to <a href="http://john.onolan.org/">John O&#8217;Nolan</a> I just notice those features, there&#8217;s no need of jQuery here, we just need to click in <strong>Screen Options</strong> to show the hidden options.</p>
<p><img src="http://www.ivorpadilla.net/wp-content/uploads/2010/05/01.png" alt="" title="01" width="526" height="165" class="aligncenter size-full wp-image-325" /></p>
<p>You&#8217;ll need to specify the name of each individual class using:</p>
<ul>
<li>Home</li>
<li>Advertise</li>
<li>Contact</li>
<li>Archives</li>
<li>About</li>
</ul>
<p><img src="http://www.ivorpadilla.net/wp-content/uploads/2010/05/02.jpg" alt="" title="02" width="430" height="438" class="aligncenter size-full wp-image-326" /></p>
<h3 class="title">5.  The CSS</h3>
<p>This is just some generic styles to show you how I&#8217;ve named my links.</p>
<pre class="brush: css; title: ; notranslate">
#header ul.navigation li.home {background:url(&quot;images/home.png&quot;) no-repeat 0 1px transparent;display:block;padding-left:23px}
#header ul.navigation li.home:hover {background-position:0 -16px;color:#535353;border-bottom:1px dotted #535353;}

#header ul.navigation li.about {background:url(&quot;images/about.png&quot;) no-repeat 0 0px transparent;display:block;padding-left:23px}
#header ul.navigation li.about:hover {background-position:0 -16px;color:#535353;border-bottom:1px dotted #535353;}

#header ul.navigation li.advertise {background:url(&quot;images/advertise.png&quot;) no-repeat 0 0px transparent;display:block;padding-left:23px}
#header ul.navigation li.advertise:hover {background-position:0 -17px;color:#535353;border-bottom:1px dotted #535353;}

#header ul.navigation li.archive {background:url(&quot;images/archive.png&quot;) no-repeat 1px 2px transparent;display:block;padding-left:23px}
#header ul.navigation li.archive:hover {background-position:1px -14px;color:#535353;border-bottom:1px dotted #535353;}

#header ul.navigation li.contact {background:url(&quot;images/contact.png&quot;) no-repeat 0 3px transparent;display:block;padding-left:23px}
#header ul.navigation li.contact:hover {background-position:0 -12px;color:#535353;border-bottom:1px dotted #535353;}
</pre>
<h3 class="title"><del datetime="2010-05-25T13:15:59+00:00">6.  jQuery in Action</del></h3>
<p><del datetime="2010-05-25T13:15:59+00:00">The solution is pretty simple, we just grab the Title Attribute and add it to the links as a class using the <a href="http://api.jquery.com/addClass/">addClass</a> jQuery function.</del></p>
<p>There&#8217;s no need of jQuery to add individual classes, but I&#8217;ll leave this code here for reference.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
    $(document).ready(function(){
         $('ul.navigation li').addClass(function() { return $(this).attr('title'); });
    });
&lt;/script&gt;
</pre>
<h3 class="title">7.  That&#8217;s it</h3>
<p>Thanks to <a href="http://john.onolan.org/">John O&#8217;Nolan</a> for the heads up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivorpadilla.net/cuztomizing-wordpress-custom-menu-icons/feed/</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
		<item>
		<title>Using SimplePie to Retrieve your Latests Dribbble Shots</title>
		<link>http://www.ivorpadilla.net/simplepie-dribbble-latest-shots/</link>
		<comments>http://www.ivorpadilla.net/simplepie-dribbble-latest-shots/#comments</comments>
		<pubDate>Tue, 11 May 2010 16:17:00 +0000</pubDate>
		<dc:creator>Ivor Padilla</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Dribbble]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SimplePie]]></category>

		<guid isPermaLink="false">http://www.ivorpadilla.net/?p=235</guid>
		<description><![CDATA[Dribbble is show and tell for designers, developers and other creatives. Share sneak peeks of your work as &#8220;shots&#8221; — small screenshots of the designs and applications you’re working on and SimplePie is a very fast and easy-to-use class, written in PHP, that puts the &#8216;simple&#8217; back into &#8216;really simple syndication&#8217;. In this tutorial I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Dribbble</strong> is show and tell for designers, developers and other creatives. Share sneak peeks of your work as &#8220;shots&#8221; — small screenshots of the designs and applications you’re working on and <strong>SimplePie</strong> is a very fast and easy-to-use class, written in PHP, that puts the &#8216;simple&#8217; back into &#8216;really simple syndication&#8217;.</p>
<p>In this tutorial I&#8217;m going to teach you how to fetch your latests Dribbble shots as images and display it as HTML.<br />
<span id="more-235"></span></p>
<h4>1.- The Markup</h4>
<p>First of all lets create our markup:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
		&lt;link rel=&quot;stylesheet&quot; href=&quot;css/default.css&quot; /&gt;
		&lt;title&gt;Untitled Document&lt;/title&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
	&lt;div id=&quot;container&quot;&gt;

	&lt;/div&gt;&lt;!--end container--&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><br/><br/></p>
<h4>2.- Working with SimplePie</h4>
<ol>
<li>Go to the <a href="http://simplepie.org/">SimplePie</a> site and download the latest version of the script.</li>
<li>Grab the file <em><strong>simplepie.inc</strong></em> and paste the file in the <strong>/includes</strong> folder</li>
<li>Before your doctype in your markup paste this PHP code</li>
<pre class="brush: php; title: ; notranslate">
&lt;?php

require 'includes/simplepie.inc';
$feed = new SimplePie();
$feed-&gt;set_feed_url('http://dribbble.com/players/ivorpad/shots.rss');
$feed-&gt;set_item_class();
$feed-&gt;enable_cache(true);
$feed-&gt;set_cache_duration(3600);
$feed-&gt;set_cache_location('cache');
$feed-&gt;init();
$feed-&gt;handle_content_type();

?&gt;
</pre>
<li>In the line 5 you have to put the absolute URL of your Dribbble feed URL &#8211; is something like this <a href="http://dribbble.com/players/ivorpad/shots.rss">http://dribbble.com/players/ivorpad/shots.rss</a></li>
</ol>
<div class="notice">Note: Make sure that you have a /cache directory created.</div>
<p><img src="http://www.ivorpadilla.net/wp-content/uploads/2010/04/cache.jpg" alt="" title="cache" width="276" height="116" class="aligncenter size-full wp-image-256" /></p>
<h4>4.- PHP</h4>
<ol>
<li>Getting our image
<pre class="brush: php; title: ; notranslate">
&lt;?php
function returnImage ($text) {
    $text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');
    //echo $text;
    $pattern = &quot;/&lt;img[^&gt;]+\&gt;/i&quot;;
    preg_match($pattern, $text, $matches);
    $text = $matches[0];
    return $text;
}
</pre>
</li>
<li>
Filter out image url only</p>
<pre class="brush: php; title: ; notranslate">
function scrapeImage($text) {

    $pattern = '/src=[\'&quot;]?([^\'&quot; &gt;]+)[\'&quot; &gt;]/'; 

preg_match($pattern, $text, $link);

$link = $link[1];
$link = urlencode($link);
return $link;

}

?&gt;
</pre>
</li>
<li>
Finally paste this code to get your latest 3 shots.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
//Display my Dribbble shots
$count = 0;
foreach ($feed-&gt;get_items() as $item) {
$feedDescription = $item-&gt;get_content();
$image = returnImage($feedDescription);
$image = scrapeImage($image);
$image = urldecode($image);
echo '&lt;img class=&quot;yourClass&quot; src=&quot;' .$image. '&quot; alt=&quot;Dribbble Shot&quot; /&gt;';
$count++;
if ($count == 3) break;
}
?&gt;
</pre>
<p>In the line 11 <em>$count == 3</em> we&#8217;re telling that we want to display only 3 images, change it to display any ammount of images.</p>
</li>
<ol>
<h4>5.- Our final code</h4>
<pre class="brush: xml; title: ; notranslate">
&lt;?php
require 'includes/simplepie.inc';
$feed = new SimplePie();
$feed-&gt;set_feed_url('http://dribbble.com/players/ivorpad/shots.rss');
$feed-&gt;set_item_class();
$feed-&gt;enable_cache(true);
$feed-&gt;set_cache_duration(3600);
$feed-&gt;set_cache_location('cache');
$feed-&gt;init();
$feed-&gt;handle_content_type();
?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
		&lt;link rel=&quot;stylesheet&quot; href=&quot;css/default.css&quot; /&gt;
		&lt;title&gt;Dribbble and SimplePie by Ivor Padilla&lt;/title&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
		&lt;body&gt;
		&lt;div id=&quot;container&quot;&gt;
		&lt;!-- begin scripts --&gt;
		&lt;?php
		////////////////////////////////////////////////////////////////
		//Get an image
		function returnImage ($text) {
			$text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');
			//echo $text;
			$pattern = &quot;/&lt;img[^&gt;]+\&gt;/i&quot;;
			preg_match($pattern, $text, $matches);
			$text = $matches[0];
			return $text;
		}
		////////////////////////////////////////////////////////////////
		//Filter out image url only

		function scrapeImage($text) {

			$pattern = '/src=[\'&quot;]?([^\'&quot; &gt;]+)[\'&quot; &gt;]/'; 

		preg_match($pattern, $text, $link);

			$link = $link[1];
			$link = urlencode($link);
			return $link;
		}
		?&gt;
			&lt;?php
				//Display my Dribbble shots
				$count = 0;
					foreach ($feed-&gt;get_items() as $item) {
						$feedDescription = $item-&gt;get_content();
						$image = returnImage($feedDescription);
						$image = scrapeImage($image);
						$image = urldecode($image);
						echo '&lt;img class=&quot;yourClass&quot; src=&quot;' .$image. '&quot; alt=&quot;Dribbble Shot&quot; /&gt;';
						$count++;
					if ($count == 3) break;
				}
			?&gt;
		&lt;/div&gt;&lt;!--end container--&gt;
		&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><a href="http://ivor.bz/sandbox/dribbble/">Check out the demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivorpadilla.net/simplepie-dribbble-latest-shots/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Launch + Birthday</title>
		<link>http://www.ivorpadilla.net/welcome/</link>
		<comments>http://www.ivorpadilla.net/welcome/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 06:49:52 +0000</pubDate>
		<dc:creator>Ivor Padilla</dc:creator>
				<category><![CDATA[Offtopic]]></category>

		<guid isPermaLink="false">http://dev.wpcoder.com/dan/wordpress/?p=53</guid>
		<description><![CDATA[Hi everyone, its my birthday and I&#8217;m celebrating with the launch of my personal portfolio and blog site. I&#8217;m really proud of this website, anyways I&#8217;ll be writing tutorials about different topics like CSS, xHTML, jQuery, WordPress, Photoshop and more. This blog will be used to compile the most interesting things that I can encounter [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone, its my birthday <img src='http://www.ivorpadilla.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and I&#8217;m celebrating with the launch of my personal portfolio and blog site. I&#8217;m really proud of this website, anyways I&#8217;ll be writing tutorials about different topics like <abbr title="Cascading Style Sheets">CSS</abbr>, <abbr title="Extensible Hypertext Markup Language">xHTML</abbr>, <a href="http://jquery.com">jQuery</a>, <a href="http://wordpress.org">WordPress</a>, Photoshop and more. This blog will be used to compile the most interesting things that I can encounter in my jorney as a web developer.<br />
<span id="more-55"></span></p>
<h4>I&#8217;ll be covering:</h4>
<ul>
<li>Complete step by step CSS Tricks</li>
<li>HTML and CSS techniques</li>
<li>Personal Thoughts</li>
<li>Photoshop How to&#8217;s</li>
<li>Pictures</li>
<li>And more&#8230;</li>
</ul>
<p><strong>And of course the <a href="/portfolio/">showcase of my works</a>.</strong></p>
<p>There&#8217;s no much to see yet, this is just the beginning.- <img src='http://www.ivorpadilla.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ivorpadilla.net/welcome/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

