<?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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Cagintranet Web Design</title>
	
	<link>http://www.cagintranet.com</link>
	<description>Pittsburgh Web Design » Cagintranet Web Design - Web Designer, Developer, Graphic Artist and Web 2.0 Guru</description>
	<pubDate>Sun, 21 Jun 2009 03:05:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<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" href="http://feeds.feedburner.com/cagintranet" type="application/rss+xml" /><feedburner:emailServiceId>cagintranet</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>The New &amp; Improved Way to Turn Wordpress 2.7 into a Membership Community</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/sKX9T6Wi6E8/</link>
		<comments>http://www.cagintranet.com/archive/the-new-improved-way-to-turn-wordpress-27-into-a-membership-communit/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 17:35:18 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=449</guid>
		<description><![CDATA[

Last March I wrote an article for WPDesigner (then subsequently republished it here) detailing the ways you could use a base install of Wordpress (then on version 2.3) into a membership directory with the help of just a few plugins. This worked, and still works beautifully for me over at my Pittsburgh Designers community site. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2009/02/pghdesigners.jpg" alt="Pittsburgh Designers" title="Pittsburgh Designers" width="500" height="250" class="alignnone size-full wp-image-466" /></p>

<p>Last March I wrote an article for <a href="http://www.wpdesigner.com/2008/03/01/how-to-use-wordpress-as-a-membership-directory/">WPDesigner</a> (then subsequently <a href="http://www.cagintranet.com/archive/wp-membership-directory/">republished it here</a>) detailing the ways you could use a base install of Wordpress (then on version 2.3) into a membership directory with the help of just a few plugins. This worked, and still works beautifully for me over at my <a href="http://pghdesigners.com">Pittsburgh Designers community site</a>. But since writing this article new plugins have become available with the unveiling of the completely revised WP core update 2.7.</p>


<h3>Replacing the Old Plugins</h3>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2009/02/buyapghhome.jpg" alt="Buy a Pittsburgh Home" title="Buy a Pittsburgh Home" width="500" height="250" class="alignnone size-full wp-image-463" /></p>

<p>In my previous installations I used only three plugins: <a href="http://www.dealsway.net/plugins/wp-user-manager">Dealsway&#8217;s User Manager</a> and <a href="http://www.im-web-gefunden.de/wordpress-plugins/role-manager/">IWG&#8217;s Role Manager</a>. This time around I wanted more customization and more control over what was being shown to the users. I ended up trying every plugin I could find that might have a remote chance in helping me accomplish my end objective. The following is my final list of plugins and customization tricks that I used in creating my latest membership project: <a href="http://buyapittsburghhome.com">BUYAPITTSBURGHHOME.com</a>.</p>

<div style="display:none;" class="alert"><p><b>Notice:</b> <a href="http://buyapittsburghhome.com">Buy A Pittsburgh Home</a> is still in beta and not open to the public yet, but if you want, please feel free to register and poke around to see how things are setup. All I ask is that if anyone happens to find any problems or bugs, to please let me know. Thanks!</p></div>


<h3>Profile Setup &#038; Customization</h3>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2009/02/registerplus.jpg" alt="Register Plus" title="Register Plus" width="500" height="175" class="alignnone size-full wp-image-468" /></p>

<p>While this is arguably the most important part of the membership site, I really wasn&#8217;t looking for a replacement to the User Manager plguin I was currently using. I had no problem with it, and it was a fairly easy to use plugin. On my membership tutorial, someone suggested looking at the <a href="http://skullbit.com/wordpress-plugin/register-plus/">Register Plus</a> plugin. I decided to give it a shot, and I am glad I did. While I still needed to hack the <em><strong>/wp-admin/users-edit.php</strong></em> file to get my profile fields in the order I wanted them, I was happy with the noticeable improvements this plugin had over User Manager. </p>

<p>There are many things that Register Plus does well, but I chose it for the fact that I may need some of it&#8217;s features down the road, not particularly right now. I did like the fact that it gave you the ability to replace some of the outgoing WP themed emails surrounding the registration events, but after some testing I decided that it wasn&#8217;t the best plugin to handle this. <a href="http://www.epicalex.com/new-user-email-set-up/">New User Email Setup</a> did the trick, and made the outgoing emails completely customizable.</p>

<p>I also added the old and reliable <a href="http://wordpress.org/extend/plugins/user-photo/">User Photo</a> plugin. I had installed this on many client WP directory sites, but this is the first time I used it myself. There are a ton of options, but once you find the right combination - it&#8217;s a set it and forget it type of plugin.</p>

<b>Plugins I Use</b>
<ul>
<li><a href="http://skullbit.com/wordpress-plugin/register-plus/">Register Plus</a></li>
<li><a href="http://www.epicalex.com/new-user-email-set-up/">New User Email Setup</a></li>
<li><a href="http://wordpress.org/extend/plugins/user-photo/">User Photo</a></li>
</ul>

<b>Plugins I Tested (but came up short)</b>
<ul>
<li><a href="http://www.dealsway.net/plugins/wp-user-manager">WP User Manager</a></li>
</ul>



<h3>Admin Interface &#038; Branding</h3>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2009/02/cyc.jpg" alt="Customize Your Community" title="Customize Your Community" width="500" height="175" class="alignnone size-full wp-image-464" /></p>

<p>One of the most important things I wanted more control over this time was to have a more customizable admin section where the members enter their profile data. There are a slew of plugins that add various levels of branding the admin dashboard, but only one went to the extent I needed.</p>

<p><a href="http://www.sugarrae.com/wordpress/cyc/">Customize your Community</a> (or CYC) was created by one of the true Wordpress gurus, <a href="http://yoast.com/sugarrae-cyc/">Joost De Valk</a>. It is extremely easy to use, and works like a charm when paired with the <a href="http://www.kpdesign.net/wp-plugins/wp-hide-dashboard/">WP Hide Dashboard</a> plugin (without it, members can type in <em><b>/wp-admin/index.php</b></em> and get to your dashboard).</p>

<p>I ended up hacking the CYC plugin so I could order my custom profile fields the way I wanted them displayed, but this was just my preference, and not required at all for it to work perfectly.</p>

<b>Plugin I Use</b>
<ul>
<li><a href="http://www.sugarrae.com/wordpress/cyc/">Customize Your Community</a></li>
</ul>

<b>Plugins I Tested (but came up short)</b>
<ul>
<li><a href="http://pressingpixels.com/wordpress-custom-admin-branding">Custom Admin Branding</a></li>
<li><a href="http://bavotasan.com/tidbits/add-your-logo-to-the-wordpress-admin-and-login-page/">Add Logo to Admin</a></li>
<li><a href="http://www.jamesdimick.com/creations/easy-admin-color-schemes/">Easy Admin Color Schemes</a></li>
</ul>



<h3>Displaying Authors</h3>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2009/02/authorpermalink.jpg" alt="Author Permalink" title="Author Permalink" width="500" height="175" class="alignnone size-full wp-image-462" /></p>

<p>As soon as I found <a href="http://dardna.com/custom-author-permalink">Custom Author Permalink</a>, I knew it was a godsend. Anyone wanting to get rid of the awful <em><strong>/author/</strong></em> permalink structure needs this plugin. The great thing about it is that you can activate the plugin just to set the permalink, then deactivate immediately afterward - it doesn&#8217;t have to always be &#8216;on&#8217; to work.</p>

<p>In my old setup, I needed to &#8216;approve&#8217; a member by creating a new post on their behalf in order for their profile page to become visible. Now, the plugin <a href="http://wordpress.org/extend/plugins/show-authors-without-posts/">Show authors without posts</a> takes care of this for me. One problem is that now that every profile is visible, I had to reverse engineer a little PHP code to check to see if certain profile fields met certain criteria, otherwise I would just do a redirect back to the site&#8217;s homepage.</p>

<b>Plugins I Use</b>
<ul>
<li><a href="http://dardna.com/custom-author-permalink">Custom Author Permalink</a></li>
<li><a href="http://wordpress.org/extend/plugins/show-authors-without-posts/">Show authors without posts</a></li>
</ul>

<b>Plugins I Tested (but came up short)</b>
<ul>
<li><a href="http://techbasedmarketing.com/plugins/">List Authors Plus</a></li>
</ul>



<h3>Wordpress Security</h3>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2009/02/recaptcha.jpg" alt="reCAPTCHA" title="reCAPTCHA" width="500" height="175" class="alignnone size-full wp-image-467" /></p>

<p>To be honest, I didn&#8217;t have much in the way of security back when I created my original membership directory. Now, since there are a slew of great security related plugins available, I definitely made this a high priority. </p>

<p>My biggest problem was that I had a ton of spam registrations - a problem that seems to plague many Wordpress site administrators. While you can never stop a registration strictly because someone wants to look around, I found that <a href="http://www.blaenkdenum.com/wp-recaptcha/">WP-reCAPTCHA</a> took care of all the spam registrations once and for all. Although the Register Plus plugin gave me the ability to implement CAPTCHA, this plugin gave me more customizable options.</p>

<p>Another problem of mine was that although I relied on <a href="http://www.im-web-gefunden.de/wordpress-plugins/role-manager/">Role Manager</a> (and I still do) to restrict a member&#8217;s movement within the admin panel, I realized that there could be plenty going on in the background that I had no clue about. In came <a href="http://urbangiraffe.com/plugins/audit-trail/">Audit Trail</a> - a plugin that tracks every movement and attempt of a logged in user. The only thing I would change is for it to do is to track what was changed when a member updated his or her profile. Audit Trail already tries to capture this, but when you start adding custom profile fields it loses its functionality.</p>

<p>As I mentioned above, I still use IWG&#8217;s Role Manager plugin to restrict which actions can be done by logged in members. I teamed this with the already mentioned WP Hide Dashboard plugin, and my users can now only see what I want them to see.</p>

<p>I also installed <a href="http://semperfiwebdesign.com/plugins/wp-security-scan/">WP Security Scan</a> just to see what I could find - which at the time was nothing, but I figure this will end up finding its way onto my regular checklist.</p>

<b>Plugins I Use</b>
<ul>
<li><a href="http://www.blaenkdenum.com/wp-recaptcha/">WP-reCAPTCHA</a></li>
<li><a href="http://urbangiraffe.com/plugins/audit-trail/">Audit Trail</a></li>
<li><a href="http://www.im-web-gefunden.de/wordpress-plugins/role-manager/">Role Manager</a></li>
<li><a href="http://www.kpdesign.net/wp-plugins/wp-hide-dashboard/">WP Hide Dashboard</a></li>
<li><a href="http://semperfiwebdesign.com/plugins/wp-security-scan/">WP Security Scan</a></li>
</ul>

<b>Plugins I Tested (but came up short)</b>
<ul>
<li><a href="http://skullbit.com/wordpress-plugin/register-plus/">Register Plus</a></li>
</ul>



<h3>Miscellaneous &#038; Vital Plugins</h3>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2009/02/misc-reglevel.jpg" alt="RegLevel" title="RegLevel" width="500" height="175" class="alignnone size-full wp-image-465" /></p>

<p><b>Statistics:</b> For this project, I wanted to see how far I could integrate a statistics package into the Wordpress backend. I tried out <a href="http://blog.matrixagents.org/wp-plugins/">StatPress Reloaded</a> and <a href="http://tantannoodles.com/toolkit/wordpress-reports/">Wordpress Reports</a>, but in the end kept with my reliable stalwarts Statcounter and Google Analytics. I think the next plugin I want to test is for <a href="http://skullbit.com/wordpress-plugin/minty-fresh/">Mint</a>.</p>

<p><b>Database Backups:</b> Backups are essential to preserving an online community in case of a disaster and should be scheduled to run on at least a weekly basis. For me, I originally started using <a href="http://lesterchan.net/portfolio/programming/php/">WP-DBManager</a>, but after finding that it never really took a complete backup (presumably because of my horrible host) I switched to <a href="http://www.ilfilosofo.com/blog/wp-db-backup">WordPress Database Backup</A> and never looked back.</p>

<p><b>SEO:</b> I am not sure how useful sitemaps are to the search engines, but I figured creating one wouldn&#8217;t hurt. I only tried <a href="http://www.arnebrachhold.de/redir/sitemap-home/">Google XML Sitemaps</a>, and stuck with it because looked to be the best right from the start. I also chose to install <a href="http://techblissonline.com/platinum-seo-pack/">Platinum SEO Pack</a> for the flexibility it gave when creating the page titles.</p>

<p><b>Development:</b> <a href="http://wordpress.designpraxis.at/plugins/wp-phpmyadmin/">WP-phpMyAdmin</a> and <a href="http://gaarai.com/wp-easy-uploader/">WP Easy Uploader</a> were essential for me when I was doing development work on the site. With these two, my time in development was greatly reduced. </p>

<p><b>Other Usefuls:</b> Here is the rest of the list I used when creating my community: <a href="http://ocaoimh.ie/wp-super-cache/">WP Super Cache</a>, <a href="http://www.thedailyblitz.org/weasels-html-bios">Weasel&#8217;s HTML Bios</a>, <a href="http://www.bin-co.com/tools/wordpress/plugins/article_templates/">Article Templates</a>, <a href="http://www.webmaster-source.com/wp125-ad-plugin-wordpress/">WP125</a>, <a href="http://www.cagintranet.com/archive/wp-components-plugin/">WP-Components</a></p>

<p><b>Very Promising:</b> These are quality plugins that I just don&#8217;t have a use for yet. They are ones I want to keep in my back pocket just incase I ever have a need for them: <a href="http://simplepie.org/wiki/plugins/wordpress/simplepie_plugin_for_wordpress">SimplePie Plugin for WordPress</a>, <a href="http://jumping-duck.com/wordpress/reglevel/">RegLevel</a>, <a href="http://smallwebsitehost.com/wordpress-newsletter-plugin/wordpress">Wordpress Newsletter</a>, <a href="http://www.chrisabernethy.com/wordpress-plugins/member-access/">Member Access</a></p><img src="http://feeds.feedburner.com/~r/cagintranet/~4/sKX9T6Wi6E8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/the-new-improved-way-to-turn-wordpress-27-into-a-membership-communit/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/the-new-improved-way-to-turn-wordpress-27-into-a-membership-communit/</feedburner:origLink></item>
		<item>
		<title>Wordpress Plugin: WP-Components</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/928ReGiMlto/</link>
		<comments>http://www.cagintranet.com/archive/wp-components-plugin/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 15:57:48 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=427</guid>
		<description><![CDATA[

WP-Components is a new Wordpress plugin that allows theme developers to embed a short template tag instead of short bits of text and code that the website owner might want to change later on.

Before creating this plugin, if I had semi-static text within a theme I was developing (such as a short &#8220;About Me&#8221; blurb) [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/12/components-image.jpg" alt="" title="components-image" width="500" height="100" class="alignnone size-full wp-image-433" /></p>

<p><strong>WP-Components</strong> is a new Wordpress plugin that allows theme developers to embed a short template tag instead of short bits of text and code that the website owner might want to change later on.</p>

<p>Before creating this plugin, if I had semi-static text within a theme I was developing (such as a short &#8220;About Me&#8221; blurb) I would either embed the text directly into the template page (sidebar.php) or I would create a &#8220;Page&#8221; within Wordpress and use the <a href="http://www.vtardia.com/improved-include-page/">iinclude plugin</a> to &#8220;include&#8221; that page. That way, if the site owner ever wanted to change that text, he or she would just have to edit that particular page.</p>

<p>That worked OK, but there were a few quirks to it. First, the pages would show up in search results. I could get around it by installing a second plugin called <a href="http://wordpress.org/extend/plugins/search-everything/">Search Everything</a> - that would allow you to exclude certain pages from the search results. But needing to use both these plugins wasn&#8217;t ideal for such a simple problem. That&#8217;s why I developed <strong>WP-Components</strong></p>


<h3>Download</h3>
<p><a href="http://wordpress.org/extend/plugins/wp-components/">Download latest stable version from Wordpress Extend</a></p>

<h3>Installation</h3>
<ol>
<li>Upload wp-coponents.php to your wp-content/plugins/ folder.</li>
<li>Go to Settings->WP-Components to set new components.</li>
<li>Add the template tag shown below into your theme&#8217;s template files.</li>
</ol>

<h3>Usage</h3>
<p>Template tag syntax:</p>
<pre><code class="php">&lt;?php get_component('component_slug'); ?&gt;</code></pre>
<p>Template tag &#8220;safe&#8221; syntax:</p>
<pre><code class="php">&lt;?php if (function_exists('get_component')) { get_component('component_slug'); } ?&gt;</code></pre>
<ul>
<li><strong>component_slug:</strong> <em>[required]</em> The slug given within this plugin&#8217;s settings page.</li>
</ul>


<h3>Requirements</h3>
<ul>

<li>Only tested on <a href="http://wordpress.org/download">Wordpress 2.5</a>+, but there is no reason it should not work on any older versions.</li>

</ul>

<h3>FAQ</h3>
<ul>
<li><p><strong>Where can this template tag go within my theme?</strong><br />
Anywhere. Literally&#8230;</p></li>
<li><p><strong>How can I ensure this plugin doesnt break my theme?</strong><br />
The best way would be to use the safe template tag that first checks to see if the function exists before it calls it. See &#8220;Usage&#8221; above for details.</p></li>

</ul>

<h3>Version Changelog</h3>
<ul>
<li><strong>Ver 0.7</strong> - 2/23/2009 - Fixed javascript issues with the WP image uploader and other plugins.</li>
<li><strong>Ver 0.5</strong> - 12/11/2008 - Added Expand/Collapse features for each component, and a few minor style fixes for both the 2.7 and the 2.5.X versions of Wordpress.</li>
<li><strong>Ver 0.2</strong> - 12/7/2008 - Added deletion confirmation, components are sorted properly, and an &#8216;undo&#8217; function in case of an oops.</li>
<li><strong>Ver 0.1</strong> - 12/5/2008 - Plugin developed</li>

</ul>

<h3>ToDo List</h3>
<ul>
<li><strong>TinyMCE</strong> - Add TinyMCE support for those that have enabled it within their profiles.</li>
<li><strong>Nonce</strong> - Add <a href="http://codex.wordpress.org/Wordpress_Nonce_Implementation">nonce</a> protection to all procedures.</li>
<li><strong>i18n Support</strong> - Add internationalization support for the plugin.</li>

</ul>

<img src="http://feeds.feedburner.com/~r/cagintranet/~4/928ReGiMlto" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/wp-components-plugin/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/wp-components-plugin/</feedburner:origLink></item>
		<item>
		<title>How to: Sync Emails between your Blackberry and Outlook</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/1Qm8IyMpYyQ/</link>
		<comments>http://www.cagintranet.com/archive/how-to-sync-emails-between-your-blackberry-and-outlook/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 01:31:15 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[business]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=385</guid>
		<description><![CDATA[

When I started my home business, I had no way of checking my email unless I was physically at home. This worked for about a year, but after not responding to some important emails in a timely fashion, I knew I had to change something.

In came my first Blackberry Curve. 

I loved it, and it [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/10/bbcurve.jpg" alt="" title="Blackberry Curve" class="alignnone size-full wp-image-393" /></p>

<p>When I started my home business, I had no way of checking my email unless I was physically at home. This worked for about a year, but after not responding to some important emails in a timely fashion, I knew I had to change something.</p>

<p>In came my first <a href="http://na.blackberry.com/eng/devices/device-detail.jsp?navId=H0,C221,P483">Blackberry Curve</a>. </p>

<p>I loved it, and it was a breeze to setup using the setup wizard that came on the device. The only problem, I noticed, was that there was no easy way to sync emails between my Outlook 2003 (insert your desktop client here) and my Blackberry. Actually I read on many forums that it was virtually impossible without a <a href="http://en.wikipedia.org/wiki/BlackBerry_Enterprise_Server">BES server</a>.</p>

<p>Blackberry apparently only allows you to sync your tasks, calendar and contacts though the Desktop Manager - nothing else. The important thing to me were to have the emails synced, but forum after forum, I found people telling me it couldn&#8217;t be done.</p>

<h3>Moving to Gmail</h3>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/10/gmailsetup.gif" alt="" title="Gmail" class="alignnone size-full wp-image-393" /></p>
<p>I lived with the fact that my Blackberry had no idea what my Outlook was doing and vice versa for almost 5 months until I was forced to move my whole email setup from <a href="http://www.godaddy.com/">GoDaddy&#8217;s</a> servers into <a href="http://www.google.com/a/cpanel/domain/new">Google Apps</a> because of GoDaddy&#8217;s horrible email limitations.</p>

<p>Moving my <em>admin @ cagintranet.com</em> email address was pretty simple using Google Apps for Business. It is a free service, and all it took was setting up a couple new CNAME entries within GoDaddy&#8217;s domain control panel (which Google had tutorials walking me through the whole process). </p>

<h3>Outlook Setup</h3>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/10/outlook.jpg" alt="" title="Outlook" class="alignnone size-full wp-image-393" /></p>

<p>Setting up Outlook was pretty easy too, and I originally settled on connecting to my new Gmail account via regular old POP3 access, but later switched it to <a href="http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol">IMAP</a>. I did this because by using IMAP, I was able to keep what I did in Outlook synced with what Gmail saw. If I moved an email into a folder within Outlook, it was moved into a corresponding &#8220;label&#8221; within Gmail. When I sent an email, it was placed in my Outlook&#8217;s Sent Itmes folder as well as the Sent Items in Gmail. Anyway, you get the hint, so after taking the next hour or so moving all my old emails from Outlook into my new Gmail account, I was ready to reset up my Blackberry to connect to Google&#8217;s servers.</p>

<p><strong>Disclaimer:</strong> You can use any desktop client (Mail, Thunderbird, etc.) to interface between Gmail and your computer - I have Outlook, which is why I used it in this example. </p>

<h3>Blackberry Setup</h3>
<p>Because I switched email servers, I had to go into the &#8220;Personal Email Set Up&#8221; icon on my Blackberry and delete the <em>admin @ cagintranet</em> account that was already there.</p>
<p>Using the default setup wizard when adding a new account to the Blackberry, uses the <a href="http://en.wikipedia.org/wiki/Pop3">POP3 connection protocol</a>. POP3 is fine, but it is what was stopping me from having any sort of two-way email sync with Outlook. I decided to poke around the internet for an alternative, and lo and behold, I found a Google article <a href="http://mail.google.com/support/bin/answer.py?hl=en&#038;answer=78882">detailing the steps needed to setup a Blackberry via IMAP</a>.</p>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/10/gmail.gif" alt="" title="Gmail" class="alignnone size-full wp-image-393" /></p>

<p>The steps in that article are a little long (22 in all), but they were easy to follow and the outcome was perfect. I now have my Outlook desktop client syncing with my Gmail account which also syncs with my Blackberry - all in harmonium. I realize that this only helps a select few of you out there, but I thought it could be helpful enough that I wanted to post it here.</p><img src="http://feeds.feedburner.com/~r/cagintranet/~4/1Qm8IyMpYyQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/how-to-sync-emails-between-your-blackberry-and-outlook/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/how-to-sync-emails-between-your-blackberry-and-outlook/</feedburner:origLink></item>
		<item>
		<title>10 Little Known Wordpress Theme Tricks</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/o2ZqMW4ut3Y/</link>
		<comments>http://www.cagintranet.com/archive/10-little-known-wordpress-theme-tricks/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 12:13:37 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=95</guid>
		<description><![CDATA[Wordpress will never cease to amaze me. I have been working with Wordpress for years now, designing and programming projects like Pittsburgh Designers, adClustr and this site &#8212; and I am always learning new ways to improve the Wordpress experience. This is my list of the hidden theme tricks I&#8217;ve amassed over the years. 

1. [...]]]></description>
			<content:encoded><![CDATA[<p>Wordpress will never cease to amaze me. I have been working with Wordpress for years now, designing and programming projects like <a href="http://pghdesigners.com/">Pittsburgh Designers</a>, <a href="http://adclustr.com/">adClustr</a> and this site &#8212; and I am always learning new ways to improve the Wordpress experience. This is my list of the hidden theme tricks I&#8217;ve amassed over the years. </p>

<h3><strong>1. </strong>Multiple &amp; Dynamic Sidebar Templates</h3>
<p>Does trying to remember the TEMPLATEPATH syntax get to you sometimes? Do you think this is way too complicated?</p>

<pre><code class="php">&lt;?php include (TEMPLATEPATH . &#39;/sidebar-sample.php&#39;); ?&gt;</code></pre>

<p>Ok, maybe not, but now starting in Wordpress 2.5, we can use this code to include the same exact template file (<strong><em>sidebar-sample.php</em></strong>):</p>
<pre><code class="php">&lt;?php get_sidebar(&#39;sample&#39;); ?&gt;</code></pre>
<p>Now that we know this, it is easy to create a much more streamlined sidebar based on categories&#8230;</p>
<pre><code class="php">&lt;?php 
    //to be able to use this outside the_Loop 
    if ( have_posts() ) { the_post(); rewind_posts(); } 
 
    if ( in_category(&#39;1&#39;) ) { 
        get_sidebar(&#39;cat1&#39;); 
        //gets sidebar-cat1.php 
    } elseif ( in_category(&#39;2&#39;) ) { 
        get_sidebar(&#39;cat2&#39;); 
        //gets sidebar-cat2.php
    } elseif ( in_category(&#39;3&#39;) ) { 
        get_sidebar(&#39;cat3&#39;); 
        //gets sidebar-cat3.php
    } elseif ( in_category(&#39;4&#39;) || in_category(&#39;5&#39;) || in_category(&#39;6&#39;) ) { 
        get_sidebar(&#39;catRest&#39;); 
        //gets sidebar-catRest.php 
    } else { 
        get_sidebar()
        //gets sidebar.php 
    } 
?&gt;</code></pre>
<p>or by page type&#8230;</p>
<pre><code class="php">&lt;?php
	//to be able to use this outside the_Loop
	if ( have_posts() ) { the_post(); rewind_posts(); }

	if ( is_home() || is_front_page() ) {
		get_sidebar(&#39;home&#39;);
		//gets sidebar-home.php
	} elseif ( is_archive() ) {
		get_sidebar(&#39;archive&#39;);
		//gets sidebar-archive.php
	} elseif ( is_page() ) {
		get_sidebar(&#39;page&#39;);
		//gets sidebar-page.php
	} elseif ( is_single() ) {
		get_sidebar(&#39;single&#39;);
		//gets sidebar-single.php
	} else {
		get_sidebar()
		//gets sidebar.php
	}
?&gt;</code></pre>

<h3><strong>2. </strong>If Comments are Allowed&#8230;</h3>
<p>On a recent project, I had to find a way to display comments if they were enabled for the specific post, but otherwise display no evidence that comments ever existed on the page. I ended up wrapping the <strong><em>comments.php</em></strong> template call like this and it worked perfectly.</p>
<pre><code class="php">&lt;!-- Added to show no evidence of comments when 
the status has been changed to allow no comments --&gt;
&lt;?php if (&#39;open&#39; == $post-&gt;comment_status) : ?&gt;
	&lt;div class=&quot;commentsblock&quot;&gt;
		&lt;?php comments_template(); ?&gt;
	&lt;/div&gt;
&lt;?php endif; // If Comments are Open Wrapper ?&gt;</code></pre>



<h3><strong>3. </strong>Category Slogans</h3>
<p>Some blogs not only show what category a post belongs to, but also offer up a witty slogan to go along with it. You could always just name your category &#8220;The Amazing Open Source PHP Language &#8221; instead of simply &#8220;PHP&#8221;, but how extensible is that?</p>
<p> What you can do however which is just as easy is to add the slogan as the description of the category. Then you can replace your get_categories() function call with</p>

<pre><code class="php">&lt;a href=&quot;&lt;?php echo get_category_link($cat);?&gt;&quot; title=&quot;View all &lt;?php single_cat_title(&#39;prefix&#39;, &#39;display&#39;); ?&gt; Posts&quot; &gt;&lt;?php echo category_description($cat); ?&gt;&lt;/a&gt;</code></pre>

<h3><strong>4. </strong>Styling the Current Category</h3>
<p>Markup and styling of category lists is easy now that Wordpress automatically inserts a <strong><em>class=&#8221;current&#8221;</em></strong> on the category used in your post in your archives list  when using the template tag <strong><em>wp_list_categories()</em></strong>. It doesn&#8217;t get any easier than that - all we need to do is add some CSS to your stylesheet, and this is working.</p>
<pre><code class="css">.current {
color:#cc0000;
font-weight:bold;
}</code></pre>


<h3><strong>5. </strong>Return the Numbers of Comments, don&#8217;t Echo</h3>
<p>I hate when functions assume that you want the data returned to you in the form of an echo. The template tag <strong>&lt;?php comments_number(&#39;0&#39;,&#39;1 &#39;,&#39;%&#39;) ?&gt;</strong> automatically echos it&#8217;s data which means you can&#8217;t use it in any math computations or other functions as a variable. This is where we can use this undocumented function:</p>
<pre><code class="php">&lt;?php get_comments_number(); ?&gt;</code></pre>
<p>Now you can do something slightly different with your comments count like use it to <a href="http://www.cagintranet.com/archive/generating-an-automatic-popular-post-list-via-delicious-or-digg-in-wordpress">generate each post&#8217;s popularity score</a>.</p>

<h3><strong>6. </strong>The Title without any Markup</h3>
<p>This happened to me once. I was redesigning a site that used markup within the blog post&#8217;s title;  &#8220;<em>Little Known &lt;strong&gt;Wordpress&lt;/strong&gt; Theme Tricks</em>&#8220;. Knowing this template tag, my life would have been made much easier. </p>
<p>Instead of this:</p>
<pre><code class="php">&lt;h3&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;Permalink to &lt;?php the_title(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;</code></pre>

<p>&#8230;use this:</p>
<pre><code class="php">&lt;h3&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;Permalink to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title_attribute(); ?&gt;&lt;/a&gt;&lt;/h3&gt;</code></pre>
<p>This template tag provides a &#8216;clean&#8217; version of the title by stripping HTML tags and converting certain characters (including quotes) to their character entity equivalent.</p>


<h3><strong>7. </strong>Different Layout for Page 2+</h3>
<p>Here we can have a different template for any page that is not &#8220;page 1.&#8221; Place this code anywhere within the Loop. (Replace the comments with the code you want displayed on either page 1 or beyond)</p>

<pre><code class="php">&lt;?php if ( !$paged &lt; 2 ) { 
  //display code for only page 2 or higher
} else { 
  //display page 1 code
} ?&gt;</code></pre>


<h3><strong>8. </strong>Replace <em>the_excerpt</em> without a Plugin</h3>
<p>Instead of using the <a href="http://codex.wordpress.org/Template_Tags/the_excerpt">the_excerpt</a> template tag, <a href="http://codex.wordpress.org/Template_Tags/the_content_rss">the_content_rss</a>. It allows for a little more flexibility, without the need of a plugin (no matter how great it is). This won&#8217;t do everything that <a href="http://guff.szub.net/2005/02/26/the_excerpt-reloaded/">gszub&#8217;s excerpt reloaded plugin</a> does, but it will for someone that just wants a longer or shorter default excerpt.</p>
<pre><code class="php">&lt;?php the_content_rss(&#39;&#39;, TRUE, &#39;&#39;, 55); ?&gt;</code></pre>

<h3><strong>9. </strong>Built in Email Obfuscator</h3>
<p>Hate when spam bots get a hold of your email? Use this template tag to help obfuscate it.</p>
<pre><code class="php">&lt;?php echo antispambot(get_the_author_email()); ?&gt;</code></pre>

<h3><strong>10. </strong>Dedicated Options Page within the Dashboard</h3>
<p>This is not a theme trick, but I found it very interesting none-the-less. This is a hidden admin page that displays the whole wp_options database table. Go to your dashboard and change the URL to match this:</p>

<p><strong>../wp-admin/options.php</strong></p>


<img src="http://feeds.feedburner.com/~r/cagintranet/~4/o2ZqMW4ut3Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/10-little-known-wordpress-theme-tricks/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/10-little-known-wordpress-theme-tricks/</feedburner:origLink></item>
		<item>
		<title>How to Create your own BlogCatalog Widget via their API</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/WJXJ9fXXWZQ/</link>
		<comments>http://www.cagintranet.com/archive/how-to-create-your-own-blogcatalog-widget-via-their-api/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 04:00:25 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[api]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=248</guid>
		<description><![CDATA[
When releasing the first version of my WP-SocialCount Wordpress plugin a while back, an interested visitor asked if I would be so kind as to include a way to reshape the BlogCatalog widget with the next release of the plugin. I had every intention of doing that until I saw just how much would have [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/bc-main.jpg" alt="" title="Blog Catalog" width="500" height="171" class="alignnone size-full wp-image-254" /></p>
<p>When releasing the first version of my <a href="http://www.cagintranet.com/archive/wp-socialcount-plugin/">WP-SocialCount Wordpress plugin</a> a while back, <a href="http://45caliberweb.com/">an interested visitor</a> asked if I would be so kind as to include a way to reshape the <a href="http://www.blogcatalog.com/">BlogCatalog</a> widget with the next release of the plugin. I had every intention of doing that until I saw just how much would have to be changed in my plugin to accommodate this - so I decided to write this instead.</p>

<h3>Current BlogCatalog Widgets</h3>
<p>Currently, the list of <a href="http://www.blogcatalog.com/buttons.php">widgets that BlogCatalog provides</a> it&#8217;s users is pretty meager. Hopefully this tutorial will allow it&#8217;s members to promote themselves a little easier (and in better style!) than before.</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/bc-exitingwidgetsgif.gif" alt="" title="BC\&#039;s Exiting Widgets" width="500" height="348" class="alignnone size-full wp-image-253" /></p>

<h3>Step 1: Get your API Key</h3>
<p>To get your API key, all you need to do is <a href="http://www.blogcatalog.com/">sign in</a>, and go to it&#8217;s <a href="http://www.blogcatalog.com/api/">developers page</a>. A couple sections down, you will see something like the image below. Write down your key and save it for later.</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/bcapi-key.gif" alt="" title="Get the API Key" width="500" height="100" class="alignnone size-full wp-image-252" /></p>

<h3>Step 2: Construct the API Calls</h3>
<p>In order to make the API call, we need to know the structure that BlogCatalog requires the calls to be in. Looking at their <a href="http://www.blogcatalog.com/api/">developers page</a>, we see that they only have two types of calls. One is for gathering <strong>User</strong> data and the other is for getting <strong>Blog</strong> data.</p>
<p>We are going to start off using the User data api call because this should give us quite a bit of the information we need right off the bat.</p>
<p>The structure as outlined by their documentation is: <strong>http://api.blogcatalog.com/getinfo?bcwsid=[apikey]&#038;username=[username]</strong></p>

<p>Looking over this call I see that the only thing we don&#8217;t currently have is the <strong>[username]</strong>. Remember, we got the <strong>[apikey]</strong> back in Step 1.</p>

<h3>Step 3: Set Initial Variables</h3>
<p>To make our coding as easy as possible, lets set some variables right off the bat so that we can reference them anytime we need their data later on.</p>
<p><em><strong>FYI:</strong> I will be adding each new step on top of each previous step so that you can see how we build the application&#8230;</em></p>
<pre><code class="php">//Setting variables
$api = &quot;xxxxxxxxxx&quot;;		//Your API key
$username = &quot;ccagle8&quot;; 	//Your username</code></pre>
<p>FYI: I X&#8217;d out my api key, but you can easily insert your own key in here&#8230;</p>

<h3>Step 4: Use PHP to Capture Your Data</h3>
<p>Since BlogCatalog returns all their data in the form of XML (their documentation didn&#8217;t state this, but it&#8217;s the format their examples are in, so let&#8217;s run with that) we will use the <a href="http://www.php.net/simplexml_load_file">simplexml_load_file</a> php function to load the file into the variable <strong>$userfeeddata</strong>.</p>
<pre><code class="php">//Setting variables
$api = &quot;xxxxxxxxxx&quot;;		//Your API key
$username = &quot;ccagle8&quot;; 	//Your username

//Pulling API user feed data
$userfeeddata = simplexml_load_file (&quot;http://api.blogcatalog.com/getinfo?bcwsid=$api&amp;username=$username&quot;);</code></pre>

<h3>Step 5: Pull That Data Into Variables</h3>
<p>After loading that file of data into our <strong>$userfeeddata</strong> variable, we can start pulling the information we need out. You can see below that I am pulling the <em>avatar</em> and <em>url</em> from this data. How I realize the hierarchy of the data is done by doing a <a href="http://www.php.net/print_r">print_r</a> command on the <strong>$userfeeddata</strong> variable. </p>
<pre><code class="php">print_r ($userfeeddata);</code></pre>
<p>I usually add this line of code in right after we load the data, and then comment it out once I have everything that I need. After analyzing the print_r output, this is what I came up with:</p>
<pre><code class="php">//Setting variables
$api = &quot;xxxxxxxxxx&quot;;		//Your API key
$username = &quot;ccagle8&quot;; 	//Your username

//Pulling API user feed data
$userfeeddata = simplexml_load_file (&quot;http://api.blogcatalog.com/getinfo?bcwsid=$api&amp;username=$username&quot;);
//print_r ($userfeeddata);

//Loading that data into variables for later
$avatar = $userfeeddata-&gt;result-&gt;avatar;
$url = $userfeeddata-&gt;result-&gt;weblogs-&gt;weblog-&gt;url;</code></pre>

<h3>Step 6: Use this Data for the Second of our API Calls</h3>
<p>back in Step 2 we found that BC gives us two types of API calls. We already used the User data feed, but now we will make use of the Blog data feed: <strong>http://api.blogcatalog.com/bloginfo?bcwsid=[apikey]&#038;url=[blog url]</strong> </p>
<p>Just as before, we already have the <strong>[apikey]</strong> value, but we don&#8217;t yet have the <strong>[blog url]</strong>. Actually we do, and it is in the form of <strong>$url</strong>, which we got in Step 5. So, lets make another call to the API, only this time using the one to get Blog information: </p>
<pre><code class="php">//Setting variables
$api = &quot;xxxxxxxxxx&quot;;		//Your API key
$username = &quot;ccagle8&quot;; 	//Your username

//Pulling API user feed data
$userfeeddata = simplexml_load_file (&quot;http://api.blogcatalog.com/getinfo?bcwsid=$api&amp;username=$username&quot;);

//Loading that data into variables for later
$avatar = $userfeeddata-&gt;result-&gt;avatar;
$url = $userfeeddata-&gt;result-&gt;weblogs-&gt;weblog-&gt;url;

//Pulling API blog feed data
$blogfeeddata = simplexml_load_file (&quot;http://api.blogcatalog.com/bloginfo?bcwsid=$api&amp;url=$url&quot;);</code></pre>

<p>Using the print_r command again, I find a some more data that I want to pull out to include in our new widget.</p>
<pre><code class="php">//Setting variables
$api = &quot;xxxxxxxxxx&quot;;		//Your API key
$username = &quot;ccagle8&quot;; 	//Your username

//Pulling API user feed data
$userfeeddata = simplexml_load_file (&quot;http://api.blogcatalog.com/getinfo?bcwsid=$api&amp;username=$username&quot;);

//Loading that data into variables for later
$avatar = $userfeeddata-&gt;result-&gt;avatar;
$url = $userfeeddata-&gt;result-&gt;weblogs-&gt;weblog-&gt;url;

//Pulling API blog feed data
$blogfeeddata = simplexml_load_file (&quot;http://api.blogcatalog.com/bloginfo?bcwsid=$api&amp;url=$url&quot;);

//Loading that data into variables for later
$tags = $blogfeeddata-&gt;result-&gt;weblog-&gt;tags-&gt;tag;
$categories = $blogfeeddata-&gt;result-&gt;weblog-&gt;categories-&gt;category;
$bcurl = $blogfeeddata-&gt;result-&gt;weblog-&gt;bcurl;
$views = $blogfeeddata-&gt;result-&gt;weblog-&gt;views;
$rank = $blogfeeddata-&gt;result-&gt;weblog-&gt;rank;
$friends = $blogfeeddata-&gt;result-&gt;weblog-&gt;neighborhood-&gt;user;
$viewers = $blogfeeddata-&gt;result-&gt;weblog-&gt;recent_viewers-&gt;user;</code></pre>

<h3>Step 7. Echoing the Data back to the Page</h3>
<p>We have all our data mining complete, so now we can focus on sending this it out to our web page.</p>
<p>Here we are echoing out some of the user information that we received during the two API calls we did. You can see that we are showing your Avatar, which is linked to your BlogCatalog page, and your site&#8217;s number of views and rank. </p>
<pre><code class="php">//Echos out User Information
echo &quot;&lt;a href=\&quot;&quot;. $bcurl .&quot;\&quot;&gt;&lt;img src=\&quot;&quot;. $avatar .&quot;\&quot; alt=\&quot;View &quot;. $username .&quot;&#39;s BlogCatalog Profile\&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&quot;;
echo &quot;Views: &quot;. $views .&quot;&lt;br /&gt;&quot;;
echo &quot;Rank: &quot;. $rank .&quot;&lt;br /&gt;&quot;;</code></pre>

<p>The next data we want to show are the tags and categories of the blog in question. To do this, we can use a <a href="http://www.php.net/foreach">foreach</a> loop that will cycle through each tag and category and create a link back to the BlogCatalog page for each one. </p>

<p><strong>Hint:</strong> You can see that I had to sanitize the variables by converting all letters to lowercase and replace spaces with underscores in order for them to work correctly in the URL.</p>

<pre><code class="php">//Cycle through and display tags
	echo &quot;Tags:&quot;;
	$set = 0;
	foreach ($tags as $i =&gt; $tag) {
		if($set &lt; $limit){ 
			echo &quot;&lt;a href=\&quot;http://www.blogcatalog.com/tag/&quot;. strtolower($tag) . &quot;\&quot;&gt;&quot;. $tag .&quot;&lt;/a&gt; &quot;;
		}
		$set  ;
	}
	
	echo &quot;&lt;br /&gt;&quot;;
	
	//Cycle through and display categories
	echo &quot;Categories: &quot;;
	$set = 0;
	foreach ($categories as $i =&gt; $cat) {
		if($set &lt; $limit){ 
			echo &quot;&lt;a href=\&quot;http://www.blogcatalog.com/directory/&quot;. urlencode(strtolower(str_replace(&quot; &quot;, &quot;_&quot;, &quot;$cat&quot;))) . &quot;\&quot;&gt;&quot;. $cat .&quot;&lt;/a&gt; &quot;;
		}
		$set  ;
	}
</code></pre>

<p><strong>DEMO: </strong><a href="http://www.cagintranet.com/code/blog-catalog">View the final outcome of this tutorial</a> (with a little bit of CSS and HTML markup added, which you can see in the header section of the page when you do a &#8220;view source&#8221;).</p>

<p><strong>SOURCE CODE:</strong> Download the <a href='http://www.cagintranet.com/design/wp-content/uploads/2008/07/blogcatalog.phps'>full PHP source code</a>.</p><img src="http://feeds.feedburner.com/~r/cagintranet/~4/WJXJ9fXXWZQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/how-to-create-your-own-blogcatalog-widget-via-their-api/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/how-to-create-your-own-blogcatalog-widget-via-their-api/</feedburner:origLink></item>
		<item>
		<title>Using the Wordpress Link Manager to Display Your Portfolio</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/AwxqEQvEwjk/</link>
		<comments>http://www.cagintranet.com/archive/using-the-wordpress-link-manager-to-display-your-portfolio/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 04:09:21 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=224</guid>
		<description><![CDATA[

For web designers or other businesses alike, setting up a quality portfolio is essential. This tutorial will show you how you can use Wordpress&#8217;s Link Manager to create and display your portfolio. This will allow you to use Wordpress to it&#8217;s fullest extent, without the need of extra plugins or any hacked code.

Step 1. Supplying [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/08/steveleggat.jpg" alt="" title="Portfolio at SteveLeggat.com" width="500" height="200" class="alignnone size-full wp-image-295" /></p>

<p>For web designers or other businesses alike, setting up <a href="http://www.digital-web.com/articles/the_perfect_portfolio/">a quality portfolio is essential</a>. This tutorial will show you how you can use <a href="http://codex.wordpress.org/Links_Manager">Wordpress&#8217;s Link Manager</a> to create and display your portfolio. This will allow you to use Wordpress to it&#8217;s fullest extent, <strong>without</strong> the need of extra plugins or any hacked code.</p>

<h3>Step 1. Supplying the Data</h3>
<p>Lets start off by populating our Links manager with some data. In the screenshot below you can see the fields that I am using:</p>
<ul>
<li><strong>Name</strong> - Client Name</li>
<li><strong>Web Address</strong> - To link back to. This can either be an internal posting explaining the project in detail or the actual client website (which is what I use).</li>
<li><strong>Description</strong> - For <em>title</em> and <em>alt</em> attributes.</li>
<li><strong>Categories</strong> - Skills that were used in creating the project. </li>
<li><strong>Advanced: Image Address</strong> - Link to the screenshot of your project</li>
<li><strong>Advanced: Notes</strong> - Description of the project</li>
</ul>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/categoryport-full.gif" alt="" title="Create Link" width="500" height="1009" class="alignnone size-full wp-image-231" /></p>

<p>Optional fields include &#8220;<strong>Target</strong>&#8221; where you can force your links to open into a new browser window and &#8220;<strong>Keep this link private</strong>.&#8221; This is how you can set up a portfolio entry but not have it shown in the display on the site. This could be helpful for when you have a project finished, but you can&#8217;t show it until it&#8217;s live.</p>

<p>When you are finished adding all your portfolio entries, you can go to <em>Your WP Dashboard > Manage > Links</em> to see the full list. </p>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/categoryport-2.gif" alt="" title="Manage Links" width="500" height="254" class="alignnone size-full wp-image-230" /></p>


<h3>Step 2. Display Your Portfolio</h3>
<p>Wordpress has two different ways to display it&#8217;s &#8220;bookmarks&#8221; which we are now using as portfolio entries. They are <a href="http://codex.wordpress.org/Template_Tags/wp_list_bookmarks">wp_list_bookmarks</a> and <a href="http://codex.wordpress.org/Template_Tags/get_bookmarks">get_bookmarks</a></p>

<p>We will use the <em>get_bookmarks</em> template tag because it allows us to manipulate how our &#8220;bookmarks&#8221; look. The only caveat is that this template tag returns an array - which we will need to use some PHP code to parse though it. To see the data that <em>get_bookmarks</em> outputs, I quickly added this little snippet to my code:</p>
<pre><code class="php">&lt;?php 
$arr_portfolio = get_bookmarks(); 
print_r ($arr_portfolio);
?&gt;</code></pre>


<p>The <a href='http://www.cagintranet.com/design/wp-content/uploads/2008/07/getbookmarksoutput.html'>output from the print_r on get_bookmarks</a> shows how the array is structured. </p>

<p>From that file, we can decipher enough to get the rest of the data echo&#8217;d out into an unordered list. The only thing that took a little tweaking was the fact that you have to find your own categories by running SQL on the <em>wp_term_relationships</em> and <em>wp_terms</em> tables in order to derive the category names by their id and the link&#8217;s id.</p>

<pre><code class="php">&lt;?php  
$arr_portfolio = get_bookmarks();  
//print_r ($arr_portfolio);
echo &quot;&lt;ul&gt;&quot;;
foreach ($arr_portfolio as $site) {
	
   echo &quot;&lt;li&gt;&quot;;
   echo &quot;&lt;h3&gt;&quot;. $site-&gt;link_name .&quot;&lt;/h3&gt;&quot;;
   echo &quot;&lt;a href=\&quot;&quot;. $site-&gt;link_url .&quot;\&quot; title=\&quot;&quot;. $site-&gt;link_description .&quot;\&quot;&gt;&quot;;
   echo &quot;&lt;img src=\&quot;&quot;. $site-&gt;link_image .&quot;\&quot; /&gt;&lt;/a&gt;&quot;;
   echo &quot;&lt;p&gt;&quot;. $site-&gt;link_notes .&quot;&lt;/p&gt;&quot;;
    
   $cats = $wpdb-&gt;get_results(&quot;SELECT * FROM wp_term_relationships, wp_terms WHERE wp_term_relationships.object_id = $site-&gt;link_id AND wp_terms.term_id = wp_term_relationships.term_taxonomy_id&quot;);
   echo &quot;&lt;p&gt;Skills Used: &quot;;
   foreach ($cats as $cat) {
   	echo $cat-&gt;name .&quot;, &quot;;
   }
   
   echo &quot;&lt;/p&gt;&lt;/li&gt;&quot;;
}
echo &quot;&lt;/ul&gt;&quot;;
?&gt;	</code></pre>

<p>The great thing is that this code doesn&#8217;t need to be placed within <a href="http://codex.wordpress.org/The_Loop">the_Loop</a>. It will work great within it&#8217;s own template or on the sidebar.</p>

<p>View the <a href="http://www.cagintranet.com/code/demo-portfolio/">demo portfolio</a> using this code.</p>



<img src="http://feeds.feedburner.com/~r/cagintranet/~4/AwxqEQvEwjk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/using-the-wordpress-link-manager-to-display-your-portfolio/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/using-the-wordpress-link-manager-to-display-your-portfolio/</feedburner:origLink></item>
		<item>
		<title>Generating an Automatic Popular Post List via Del.icio.us or Digg in Wordpress</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/_WYaRWO7HRc/</link>
		<comments>http://www.cagintranet.com/archive/generating-an-automatic-popular-post-list-via-delicious-or-digg-in-wordpress/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 04:00:07 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=109</guid>
		<description><![CDATA[

	Photo Credit: reportergimmi


A few months ago I wrote an article on how to create a popular posts list, and in the example I used a category called &#8216;Popular&#8217; to determine what was shown within the list. This approach is great for those that remember to periodically update their list by adding new posts to that [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/auto-popular.jpg" alt="" title="Automatic Popular Post Lists" width="500" height="200" class="alignnone size-full wp-image-119" /></p>
<cite class="flickrcite">
	Photo Credit: <a href="http://www.flickr.com/photos/zanotti/385622500/">reportergimmi</a>
</cite>

<p>A few months ago I wrote an article on <a href="http://www.cagintranet.com/archive/wordpress-tip-the-easy-way-to-show-a-popular-post-list/">how to create a popular posts list</a>, and in the example I used a category called &#8216;Popular&#8217; to determine what was shown within the list. This approach is great for those that remember to periodically update their list by adding new posts to that category, but I wanted a way for this to be done automatically. </p>

<h3>Auto Popular List based on Number of Comments</h3>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/populararticles.gif" alt="" title="Popular Articles" width="242" height="187" class="imgright" />In this example I check the number of comments, and if they are greater than or equal to <strong>10</strong> (see the 8th line of the code below) then I display the post. This means that this Loop will show any post that has 10 or more comments. The <strong>$popular-&gt;query(&#39;showposts=50&#39;);</strong> at the top of the script is so that this Loop will run the &#8216;number of comments&#8217; check for each of your 50 latest posts.<p>

<p>The trick here will be finding the happy medium between those two variables. If you have the &#8216;number of comments&#8217; variable set to low, you could get too many posts in your list that meet the criteria. But on the other hand, if you have the &#8217;showposts&#8217; variable set too low then there may not be enough posts that end up hitting on the &#8216;number of comments&#8217;. A balance needs to be met here. If it was me, I would shoot to have approximately 3 to 5 posts show up in my list. Of course, since this is a dynamically created, the number of posts shown number can change at any given time. </p>

<pre><code class="php">&lt;h3&gt;Popular Articles&lt;/h3&gt;  
&lt;ul class=&quot;postlist&quot;&gt; 
&lt;?php
$popular = new WP_Query();
$popular-&gt;query(&#39;showposts=50&#39;);
while ($popular-&gt;have_posts()) : $popular-&gt;the_post(); 
    $total = get_comments_number(); 
    if ($total &gt;= 10) { ?&gt; 
        &lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; &lt;span&gt;Score: &lt;?php echo $total; ?&gt;&lt;/span&gt;&lt;/li&gt;  
    &lt;?php }; ?&gt; 
&lt;?php endwhile; ?&gt;</code></pre>

<h3>Auto Popular List based on Comments &amp; Del.icio.us Bookmarks</h3>
<p>This example is exactly the same except for on the <strong>$total</strong> line I use <a href="http://www.cagintranet.com/archive/wp-socialcount-plugin/">my own WP-SocialCount plugin</a> to pull in the amount of <a href="http://del.icio.us/">Del.ico.us</a> bookmarks that the post has. I feel this gives us a more complete idea of whether or not a post is really &#8220;popular&#8221; &#8212; rather than solely relying on it&#8217;s number of comments.</p>

<pre>
<code class="php">&lt;h3&gt;Popular Articles&lt;/h3&gt;  
&lt;ul class=&quot;postlist&quot;&gt; 
&lt;?php
$popular = new WP_Query();
$popular-&gt;query(&#39;showposts=50&#39;);
while ($popular-&gt;have_posts()) : $popular-&gt;the_post(); 
    $total = (get_comments_number() +  wpsocialcount(&#39;delicious&#39;, &#39;count&#39;, get_permalink()));
    if ($total &gt;= 10) { ?&gt; 
        &lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; &lt;span&gt;Score: &lt;?php echo $total; ?&gt;&lt;/span&gt;&lt;/li&gt;  
    &lt;?php }; ?&gt; 
&lt;?php endwhile; ?&gt;</code></pre>


<h3>Digg too&#8230;</h3>
<p>If your posts regularly show up on <a href="http://digg.com/">Digg</a> as well, then you can use <a href="http://www.cagintranet.com/archive/wp-socialcount-plugin/">the same plugin</a> and replace the <strong>$total</strong> line (line 7) in the above example with this:</p>
<pre>
<code class="php">$total = (get_comments_number() +  wpsocialcount(&#39;delicious&#39;, &#39;count&#39;, get_permalink()) +  wpsocialcount(&#39;digg&#39;, &#39;diggs&#39;, get_permalink()));</code></pre>

<h3>Scoring Methods</h3>
<p>The default scoring will be all that all &#8216;hits&#8217; are of equal strength:<br /><strong>Total Score = Comments + Del.icio.us Bookmarks + Diggs</strong></p>

<p>Alternatively, if you feel that a Digg or Bookmark is twice as important as a regular old comment, then you could change the <strong>$total</strong> line to reflect this.</p>

<code class="php">$total = (get_comments_number() + 2*(wpsocialcount(&#39;delicious&#39;, &#39;count&#39;, get_permalink()) +  wpsocialcount(&#39;digg&#39;, &#39;diggs&#39;, get_permalink())));</code></pre><img src="http://feeds.feedburner.com/~r/cagintranet/~4/_WYaRWO7HRc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/generating-an-automatic-popular-post-list-via-delicious-or-digg-in-wordpress/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/generating-an-automatic-popular-post-list-via-delicious-or-digg-in-wordpress/</feedburner:origLink></item>
		<item>
		<title>The Definitive Guide on Wordpress Syntax Highligher Plugins</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/CrQdymVJ5Jo/</link>
		<comments>http://www.cagintranet.com/archive/the-definitive-guide-on-wordpress-syntax-highligher-plugins/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 01:22:13 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=129</guid>
		<description><![CDATA[These are reviews based on my own evaluations of the plugins. I downloaded, installed and tested each one within a default Kubrick theme installation on Wordpress 2.6.


I tried to make this a complete list via the Extend Plugin Directory.
I used a snippet of code from the recent post Creating a Simple Online Application using the [...]]]></description>
			<content:encoded><![CDATA[<p>These are reviews based on my own evaluations of the plugins. I downloaded, installed and tested each one within a default Kubrick theme installation on Wordpress 2.6.</p>

<ul>
<li>I tried to make this a complete list via the <a href="http://wordpress.org/extend/plugins/">Extend Plugin Directory</a>.</li>
<li>I used a snippet of code from the recent post <a href="http://www.cagintranet.com/archive/creating-a-simple-php-application-using-the-flickr-api/">Creating a Simple Online Application using the Flickr API</a>.</li>
<li>The screenshots are taken from a Firefox 3 browser. I did not test these plugins on any other browsers (IE or Safari).</li>
<li>I removed all inherent &lt;code&gt; and &lt;pre&gt; CSS styling from the Kubrick theme for this test except for (in order to try to make all the font sizes the same):
<pre><code class="css">code, pre {font-size:12px !important;}</code></pre>
</li>
</ul>

<h3><strong>8. </strong>Code Colorer</h3>
<p><a href="http://wordpress.org/extend/plugins/codecolorer/">Download</a> | Author: <a href="http://kpumuk.info/projects/wordpress-plugins/codecolorer">Dmytro Shteflyuk</a><br />
<strong>Coloring:</strong> #8 of 8<br />
<strong>Ease of Install/Use:</strong> #8 of 8<br />
<strong>Line Numbers:</strong> Optional<br />
<strong>PRE or CODE:</strong> CODE or [cc][/cc]<br />
<strong>Other Options:</strong> Optional links to code keyword linking, Optional CSS changes though a plugin page<br />
<strong>Code Format:</strong> It can only handle full code.</p>
<p><strong>Review:</strong> Maybe the optional CSS would make a difference here, but the coloring is just horrible, and I can&#8217;t figure out why the source code is not being highlighted. The setup instructions require you to rename a CSS file (why?) &#8212; I did that and I still can&#8217;t get this to highlight correctly.</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/codecolorer.gif" alt="" title="Code Colorer" class="alignnone size-full wp-image-144" /></p>


<h3><strong>7. </strong>Highlight Source Pro</h3>
<p><a href="http://wordpress.org/extend/plugins/highlight-source-pro/">Download</a> | Author: <a href="http://blog.kno.at/tools/highlight-source-pro">Christian Knoflach</a><br />
<strong>Coloring:</strong> #7 of 8<br />
<strong>Ease of Install/Use:</strong> #5 of 8<br />
<strong>Line Numbers:</strong> Optional<br />
<strong>PRE or CODE:</strong> PRE<br />
<strong>Other Options:</strong> Headlines within the code<br />
<strong>Code Format:</strong> It can handle either already-escaped or full code.</p>
<p><strong>Review:</strong> The syntax highlighting is very similar to the other plugins that also use <a href="http://qbnz.com/highlighter/">GeSHi</a>, but the gray on dark gray background doesn&#8217;t look right to me. I am sure you can change it by playing with CSS, but it just doesn&#8217;t look very appealing right out of the box.</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/highlightsourcepro.gif" alt="" title="Highlight Source Pro" class="alignnone size-full wp-image-145" /></p>

<h3><strong>6. </strong>Snippet Highlight</h3>
<p><a href="http://wordpress.org/extend/plugins/snippet-highlight/">Download</a> | Author: <a href="http://wordpress.designpraxis.at/plugins/snippet-highlight/">Roland Rust</a><br />
<strong>Coloring:</strong> #5 of 8<br />
<strong>Ease of Install/Use:</strong> #3 of 8<br />
<strong>Line Numbers:</strong> Yes<br />
<strong>PRE or CODE:</strong> PRE<br />
<strong>Code Format:</strong> It can only handle already-escaped code.</p>
<p><strong>Review:</strong> Very straightforward. It&#8217;s only downfall is the ugly olive green line numbering and the fact that it forces you to manually escape your code.</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/snippethighlighter.gif" alt="" title="Snippet Highlighter" class="alignnone size-full" /></p>

<h3><strong>5. </strong>WP-Syntax</h3>
<p><a href="http://wordpress.org/extend/plugins/wp-syntax/">Download</a> | Author: <a href="http://ryan.mcgeary.org/">Ryan McGeary</a><br />
<strong>Coloring:</strong>  #4 of 8<br />
<strong>Ease of Install/Use:</strong> #2 of 8<em> (tied)</em><br />
<strong>Line Numbers:</strong> Optional<br />
<strong>PRE or CODE:</strong> PRE<br />
<strong>Code Format:</strong> It can handle only full code.</p>
<p><strong>Review:</strong> WP-Syntax has good coloring and I do like how the line number coloring is distinctly different from the rest of the code. Other than that, it is pretty much a no-frills highlighter (which isn&#8217;t a bad thing).</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/wp-syntax.gif" alt="" title="WP-Syntax" class="alignnone size-full wp-image-151" /></p>

<h3><strong>4. </strong>WP-Codebox</h3>
<p><a href="http://wordpress.org/extend/plugins/wp-codebox/">Download</a> | Author: <a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/">Eric Wang</a><br />

<strong>Coloring:</strong>  #3 of 8<br />
<strong>Ease of Install/Use:</strong> #2 of 8<em> (tied)</em><br />
<strong>Line Numbers:</strong> Optional<br />
<strong>PRE or CODE:</strong> PRE<br />
<strong>Other Options:</strong> Optional collapsible code area, Optional text download of code<br />
<strong>Code Format:</strong> It can only handle full code.</p>
<p><strong>Review:</strong> This example looks to be exactly like WP-Syntax except that this one give you the option to download the code. Although a &#8220;copy to clipboard&#8221; option would have been better, I feel this is still a step up from WP-Syntax.</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/wp-codebox.gif" alt="" title="WP-Codebox" class="alignnone size-full wp-image-150" /></p>

<h3><strong>3. </strong>Google Syntax Highlighter for WordPress</h3>
<p><a href="http://wordpress.org/extend/plugins/google-syntax-highlighter/">Download</a> | Author: <a href="http://www.peterryan.net/2007/08/15/wordpress-plugin-for-google-syntax-highlighter/">Peter Ryan</a><br />
<strong>Coloring:</strong> #4 of 8<br />
<strong>Ease of Install/Use:</strong> #7 of 8<br />
<strong>Line Numbers:</strong> Optional<br />
<strong>PRE or CODE:</strong> PRE<br />
<strong>Other Options:</strong> <a href="http://code.google.com/p/syntaxhighlighter/wiki/Configuration">Many</a><br />
<strong>Code Format:</strong> It can only handle already-escaped code.</p>
<p><strong>Review:</strong> This plugin is a little confusing at first with all it&#8217;s available options, but I think once you find a combination that is a right fit for your uses, it will be just as easy as any other plugin out there.</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/googlesyntax.gif" alt="" title="Google Syntax Highlighter for WordPress" class="alignnone size-full" /></p>

<h3><strong>2. </strong>WP-Chili</h3>
<p><a href="http://wordpress.org/extend/plugins/wp-chili/">Download</a> | Author: <a href="http://noteslog.com/chili/wp-chili/">Andrea Ercolino</a><br />
<strong>Coloring:</strong> #1 of 8<br />
<strong>Ease of Install/Use:</strong> #6 of 8<br />
<strong>Line Numbers:</strong> Not Available<br />
<strong>PRE or CODE:</strong> Requires both to work properly<br />
<strong>Code Format:</strong> It can only handle already-escaped code.</p>
<p><strong>Review:</strong> This example may look very plain because it requires you to provide <a href="#wpchili-bonus">your own CSS</a> for the &lt;code&gt; and &lt;pre&gt; for styling. This makes it very customizable to the do-it-yourselfer, but maybe not so appealing for those looking for something to work and look great easily right out of the box. Chili does however have the best code highlighting hands-down. Since it doesn&#8217;t use GeSHi like many of the other plugins, it&#8217;s coloring is distinctly unique.</p>
<p><strong>Disclaimer:</strong> This is the plugin I settled on, and I am happy with my choice thus far. Since I need to escape my code before using it, I use <a href="http://www.elliotswan.com/2006/03/24/allow-me-to-introduce-you-to-my-new-little-app-postable">Elliot Swan&#8217;s</a> great little app <a href="http://www.elliotswan.com/postable/">Postable</a>.</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/wp-chili.gif" alt="" title="WP-Chili" class="alignnone size-full wp-image-149" /></p>

<h3><strong>1. </strong>Syntax Highlighter Plus</h3>
<p><a href="http://wordpress.org/extend/plugins/syntaxhighlighter-plus/">Download</a> | Author: <a href="http://thislab.com/2007/12/16/release-wordpress-plugin-syntaxhighlighter-plus/">Fred Wu</a> (along with <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/">ma.tt, Viper007Bond and mdawaffe</a>)<br />
<strong>Coloring:</strong> #2 of 8<br />
<strong>Ease of Install/Use:</strong> #1 of 8<em> (tied)</em><br />
<strong>Line Numbers:</strong> Yes<br />
<strong>PRE or CODE:</strong> Neither. It uses [sourcecode][/sourcecode]<br />
<strong>Other Options:</strong> Print, Copy to clipboard, View as plain text<br />
<strong>Code Format:</strong> It can handle either already-escaped or full code.</p>
<p><strong>Review:</strong> Syntax Highlighter Plus looks fantastic right out of the box. There were no setup steps required, and the extra features such as copy to clipboard really make this plugin stand out. The alternating line colors are a big plus &#8212; and unique to this list. The code highlighting, which uses Alex Gorbatchev&#8217;s <a href="http://code.google.com/p/syntaxhighlighter/">Google Syntax Highlighter</a>, looks the same as most of the plugins here.</p>
<p>This plugin is an obvious upgrade from the original great <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/">SyntaxHighlighter</a>. It allows for un-escaped code and removes the leading zeros from the line numbers (eg 1. instead of 01.)</p>
<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/07/syntaxhighlighterplus.gif" alt="" title="Syntax Highlighter Plus" class="alignnone size-full wp-image-148" /></p>


<h3 id="wpchili-bonus" ><strong>Bonus:</strong> WP-Chili CSS</h3>
<p>Since I decided to use WP-Chili as my syntax highlighter of choice, I figured I would also share with you the CSS I perfected to make it look the way I do&#8230; Just in case anyone wanted to know.</p>
<pre><code class="css">.post pre {
	margin:0 0 20px 0;
	}
.post code {
	border:1px solid #ececec;
	display:block;
	padding:10px;
	font-family: Consolas, Monaco, "Courier New", Courier, monospace;
	font-size: 12px;
	background:#f9f9f9;
	color:#000;
	overflow: auto;
	overflow-y: hidden;
	white-space:nowrap;
	*padding:10px 10px 20px 10px; /* IE Hack-Fix */
	}</code></pre>







<img src="http://feeds.feedburner.com/~r/cagintranet/~4/CrQdymVJ5Jo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/the-definitive-guide-on-wordpress-syntax-highligher-plugins/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/the-definitive-guide-on-wordpress-syntax-highligher-plugins/</feedburner:origLink></item>
		<item>
		<title>Creating a Simple Online Application using the Flickr API</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/xURCokfzgKY/</link>
		<comments>http://www.cagintranet.com/archive/creating-a-simple-php-application-using-the-flickr-api/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 04:00:40 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[api]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=89</guid>
		<description><![CDATA[


	Photo Credit: *dans


The Flickr API is one of the most widely used APIs out there. In this article I will show you how to build your own simple online application using PHP and the Flickr API.

The sample online application we build today will be one that takes a Flickr image URL (e.g. http://www.flickr.com/photos/dans180/854998249/), then outputs [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/06/mainphoto.jpg" alt="" title="A Flickr API Tutorial" width="499" height="231" class="alignnone size-full wp-image-92" /></p>

<cite class="flickrcite">
	Photo Credit: <a href="http://www.flickr.com/photos/dans180/854998249/">*dans</a>
</cite>

<p>The <a href="http://www.flickr.com/services/api/">Flickr API</a> is one of the most widely used APIs out there. In this article I will show you how to build your own simple online application using PHP and the Flickr API.</p>

<p>The sample online application we build today will be one that takes a Flickr image URL (e.g. <em>http://www.flickr.com/photos/dans180/854998249/</em>), then outputs the code needed for you to properly display the photo&#8217;s credit. Remember, every time you use a Creative Commons licensed photo from Flickr, you <a href="http://www.flickr.com/guidelines.gne">need to provide the proper attribution</a> and that is usually considered a link back to the photo while mentioning the photographer&#8217;s name. This is an example of the kind of output that we hope to get:</p>

<!--insert link-example here -->
<p><strong>Real Link: </strong><br />
Photo Credit: <a href="http://www.flickr.com/photos/dans180/854998249/">*dans</a></p>
<strong>HTML Code Output:</strong>
<pre><code class="html">Photo Credit: &lt;a href=&quot;http://www.flickr.com/photos/dans180/854998249/&quot;&gt;*dans&lt;/a&gt;</code></pre>

<h3>Getting Started</h3>
<p>First off, you will need to get an API key. <a href="http://www.flickr.com/services/api/keys/apply/">Get one here</a> and hold onto it for later.</p>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/06/apikey.jpg" alt="" title="Get Your API Key" width="499" height="231" class="alignnone size-full wp-image-91" /></p>

<p>Next, we need to build the form that our visitors can input the URL into. This should be pretty basic stuff for most of us.</p>

<h3>The HTML Form</h3>
<!--insert form-code here -->
<pre><code class="html">&lt;form method=&quot;post&quot; id=&quot;form&quot; action=&quot;flickr_api_example.php&quot; &gt;
	&lt;table&gt;
		&lt;tr&gt;
		&lt;td&gt;&lt;label for=&quot;photo&quot;&gt;Flickr Photo URL:&lt;/label&gt;&lt;/td&gt;
		&lt;td&gt;&lt;input type=&quot;text&quot; value=&quot;&quot; size=&quot;50&quot; name=&quot;photo&quot; id=&quot;photo&quot; /&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
		&lt;td&gt;&lt;/td&gt;
		&lt;td&gt;&lt;input type=&quot;submit&quot; value=&quot;Generate Code&quot; name=&quot;submitted&quot; /&gt;&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;
&lt;/form&gt;</code></pre>

<h3>The PHP if-statement</h3>
<p>This form is setup to POST the data back to itself for processing. To handle this, we need to make use of an if-statement to check to see if the form is submitting data back to itself, or if it just needs to show a blank form to a new visitor. </p>
<p>The PHP evaluation <a href="http://us3.php.net/isset">isset</a> allows us to determine whether or not a variable is set. In our example, we check to see if the variable &#8216;<em>photo</em>&#8216; is set - because that is the name of the input field where the visitor enters the Flickr image&#8217;s URL.</p>

<!-- insert if-statement-setup here -->
<pre><code class="php">&lt;?php 
if (isset($_POST[&#39;photo&#39;])) { //The form was submitted, process the data

} else { //The form was not submitted

};
?&gt;</code></pre>

<p>If the variable &#8216;<em>photo</em>&#8216; is set, the next step is to initialize some variables. The first variable is the image URL that the user submitted into our form, while the second will be the API key we got from Flickr.</p>

<!-- insert if-statement-variables here -->
<pre><code class="php">&lt;?php 
if (isset($_POST[&#39;photo&#39;])) { //The form was submitted, process the data
	$queryString=$_POST[&#39;photo&#39;]; //The URL submitted
	$flickr_api_key = &quot;352ee7XXXXXXXXXXXXXXXXXXXXXXXXXX&quot;; //Our API Key
	
} else { //The form was not submitted

};
?&gt;</code></pre>

<p>In order to make the URL submitted usable to us, we need to split it up into its relevant sections. I use the PHP function <a href="http://us2.php.net/explode">explode</a> to help break the URL up by the character &#8216;/&#8217;. All we need from this URL is the photo id, and we can see below is the 6th of these so called sections.</p>

<p><em><strong>PHP FACT:</strong> PHP starts it&#8217;s count with 0.</em></p>

<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/06/print_r-url.gif" alt="" title="print_r output of $url" width="500" height="153" class="alignnone size-full wp-image-90" /></p>

<!-- insert if-statement-spliturl here -->
<pre><code class="php">&lt;?php 
if (isset($_POST[&#39;photo&#39;])) { //The form was submitted, process the data
	$queryString=$_POST[&#39;photo&#39;]; //The URL submitted
	$flickr_api_key = &quot;352ee7XXXXXXXXXXXXXXXXXXXXXXXXXX&quot;; //Our API Key
	
	$url = explode(&quot;/&quot;, $queryString); //Split the URL up into sections, delimited by the character '/'
	$photo_id = $url[5]; //The Photo ID is the 6th of these sections
	
} else { //The form was not submitted

};
?&gt;</code></pre>

<h3>Structuring the Flickr API</h3>
<p>After turning the contents of the <em>photo id</em> section into it&#8217;s own variable, we now have everything we need to start the API call. </p>

<p>After searching the Flickr site a while, I found the <a href="http://www.flickr.com/services/api/flickr.photos.getInfo.html">flickr.photos.getInfo</a> method - and judging by the example it displays, it looks to be exactly what we want. Notice we already have both of the required variables to make this call: <strong>$photo_id</strong> and <strong>$api_key</strong>. </p>

<p>Next, we need to find out what the correct call syntax that Flickr requires in order to get data back from their API. Luckily, they are nice enough to give us an <a href="http://www.flickr.com/services/api/response.php.html">example PHP call here</a>. This test gives us the insight needed as to what an API call should be structured like: </p>

<!-- insert if-statement-flickrapicall here -->
<p><strong>http://www.flickr.com/services/rest/?method=flickr.test.echo&#038;format=php_serial&#038;api_key=eaab5c513e33c01544385641ff9af42f</strong></p>

<p>After we modify their example to use the method <strong>flickr.photos.getInfo</strong>, we also need insert a new argument for the <em>photo_id</em>. Our newly structured API call now looks like this: <em>(changes are in red)</em></p>

<!-- insert if-statement-flickrapicall here -->
<p><strong>http://www.flickr.com/services/rest/?method=<em style="color:#cc0000;">flickr.photos.getInfo</em>&#038;format=php_serial<em style="color:#cc0000;">&#038;photo_id=$photo_id</em>&#038;api_key=<em style="color:#cc0000;">$flickr_api_key</em></strong></p>

<p>You can test the validity of our newly structured call by pasting it into any web browser&#8217;s address bar. You will get back real data if it works, or <a href="http://www.flickr.com/services/rest/?method=flickr.blogs.getList&#038;format=php_serial&#038;api_key=eaab5c513e33c01544385641ff9af42f">errors when it fails</a>.</p>

<h3>Using the Data from the Flickr API</h3>
<p>Once we get a working API call, we need to have our application read in the data that is returned. To import this data into our web app, we use the function <a href="http://us3.php.net/file_get_contents">file_get_contents</a>, then re-format it using the <a href="http://us3.php.net/manual/en/function.unserialize.php">unserialize function</a>. </p>

<!-- insert if-statement-flickrapicall here -->
<pre><code class="php">&lt;?php 
if (isset($_POST[&#39;photo&#39;])) { //The form was submitted, process the data
	$queryString=$_POST[&#39;photo&#39;]; //The URL submitted
	$flickr_api_key = &quot;352ee7XXXXXXXXXXXXXXXXXXXXXXXXXX&quot;; //Our API Key
	
	$url = explode(&quot;/&quot;, $queryString); //Split the URL up into sections, delimited by the character/
	$photo_id = $url[5]; //The Photo ID is the 6th of these sections
	
	$flickrrawoutput =  file_get_contents(&quot;http://flickr.com/services/rest/?method=flickr.photos.getInfo&amp;photo_id=$photo_id&amp;api_key=$flickr_api_key&amp;format=php_serial&quot;);
	$flickroutput = unserialize($flickrrawoutput);
	
} else { //The form was not submitted

};
?&gt;</code></pre>

<p>Since all good coders do error checking, we also need to run a quick check to see if the API call returned no data (an error). We can do so with this simple line:</p>

<!-- insert if-statement-flickrerrorline here -->
<pre><code class="php">$status = $flickroutput[&#39;stat&#39;]; //Extracts the &#39;stat&#39; value from the data returned</code></pre>

<p>Now, with a second if-statement, we check to see the variable <strong>$status</strong>&#8217;s value, and if it doesn&#8217;t contain the word &#8216;<em>fail</em>&#8216; then we know we made a successful call. Putting it all together, it looks like this:</p>

<!-- insert if-statement-flickrsecondif here -->
<pre><code class="php">&lt;?php 
if (isset($_POST[&#39;photo&#39;])) { //The form was submitted, process the data
	$queryString=$_POST[&#39;photo&#39;]; //The URL submitted
	$flickr_api_key = &quot;352ee7XXXXXXXXXXXXXXXXXXXXXXXXXX&quot;; //Our API Key
	
	$url = explode(&quot;/&quot;, $queryString); //Split the URL up into sections, delimited by the character/
	$photo_id = $url[5]; //The Photo ID is the 6th of these sections
	
	//Get the data from Flickr
	$flickrrawoutput =  file_get_contents(&quot;http://flickr.com/services/rest/?method=flickr.photos.getInfo&amp;photo_id=$photo_id&amp;api_key=$flickr_api_key&amp;format=php_serial&quot;);
	$flickroutput = unserialize($flickrrawoutput); 
	
	$status = $flickroutput[&#39;stat&#39;]; //Extracts the &#39;stat&#39; value from the data returned
	
	if ($status != &#39;fail&#39;) { //fetch from Flickr returned stats for photo
		
	} else { 
		echo &quot;The supplied photo URL is wrong. Please &lt;a href=\&quot;#form\&quot;&gt;try again&lt;/a&gt;.&quot;; //A bad URL was entered into the form
	};
	
	
} else { //The form was not submitted

};
?&gt;</code></pre>

<p>Once we know we&#8217;ve made a successful API call, we need to extract the &#8216;<em>username</em>&#8216; of the photo&#8217;s owner. We do this with this line:</p>

<!-- insert flickr-extract-data -->
<pre><code class="php">$flickr_user  = $flickroutput[&#39;photo&#39;][&#39;owner&#39;][&#39;username&#39;];</code></pre>

<p>&#8230; but this is sometimes not an easy thing to figure out. I have found the best way to find out what to extract is by analyzing the unserialized data we get back from Flickr. PHP allows us to look at the data in an easier to read format by using <a href="http://us3.php.net/manual/en/function.print-r.php">print_r</a>.</p>

<!-- insert flickr-print_r -->
<pre><code class="php">print_r ($flickroutput)</code></pre>

<p>This is probably the hardest part of using the API. If you insert the <em>print_r</em> command into your PHP document right after we unserialize the Flickr data, we can easily see the different levels of the data structure. </p>

<p><em>Hint: You can view the output of <a href="http://www.cagintranet.com/design/wp-content/uploads/2008/06/print_r.php">our print_r command here</a>. The different tiers are highlighted in red.</em></p>

<p>The way our data extract works is &#8216;photo&#8217; is the first level within the <strong>$flickroutput</strong> data. The next tier down is &#8216;owner&#8217;, which houses the last level called &#8216;username&#8217; which holds the data we need. That&#8217;s how we get <strong>$flickroutput['photo']['owner']['username']</strong> &#8212; each [] is referencing it&#8217;s own tier.</p>

<h3>Output the Data to the Visitor</h3>
<p>Once we have the <strong>$flickr_user</strong> variable set with this extract, we are ready to output our finished code. We will output it twice: One as an example &#8220;live&#8221; link, and the other will be the raw HTML code that the visitor can input into his or her site. </p>

<!-- insert if-statement-final here -->
<pre><code class="php">&lt;?php 
if (isset($_POST[&#39;photo&#39;])) { //The form was submitted, process the data
	$queryString=$_POST[&#39;photo&#39;]; //The URL submitted
	$flickr_api_key = &quot;352ee7XXXXXXXXXXXXXXXXXXXXXXXXXX&quot;; //Our API Key
	
	$url = explode(&quot;/&quot;, $queryString); //Split the URL up into sections, delimited by the character/
	$photo_id = $url[5]; //The Photo ID is the 6th of these sections
	
	//Get the data from Flickr
	$flickrrawoutput =  file_get_contents(&quot;http://flickr.com/services/rest/?method=flickr.photos.getInfo&amp;photo_id=$photo_id&amp;api_key=$flickr_api_key&amp;format=php_serial&quot;);
	$flickroutput = unserialize($flickrrawoutput); 
	
	$status = $flickroutput[&#39;stat&#39;]; //Extracts the &#39;stat&#39; value from the data returned
	
	if ($status != &#39;fail&#39;) { //fetch from Flickr returned stats for photo
		$flickr_user  = $flickroutput[&#39;photo&#39;][&#39;owner&#39;][&#39;username&#39;];
	?&gt;
	
	&lt;p&gt;Preview: &lt;/p&gt;
	&lt;cite&gt;Photo Credit: &lt;a href=&quot;&lt;?php echo $queryString; ?&gt;&quot; title=&quot;Photo Credit: &lt;?php echo $flickr_user; ?&gt;&quot;&gt;&lt;?php echo $flickr_user; ?&gt;&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
	&lt;p&gt;HTML Code:&lt;/p&gt;
	&lt;pre&gt;
		&amp;lt;cite&amp;gt;
			Photo Credit: &amp;lt;a href=&amp;quot;&lt;?php echo $queryString; ?&gt;&amp;quot; title=&amp;quot;Photo Credit: &lt;?php echo $flickr_user; ?&gt;&amp;quot;&amp;gt;&lt;?php echo $flickr_user; ?&gt;&amp;lt;/a&amp;gt;
		&amp;lt;/cite&amp;gt;
	&lt;/pre&gt;
	
	&lt;?php
	} else { 
		echo &quot;The supplied photo URL is wrong. Please &lt;a href=\&quot;#form\&quot;&gt;try again&lt;/a&gt;.&quot;; //A bad URL was entered into the form
	};
	
	
} else { //The form was not submitted

};
?&gt;</code></pre>

<h3>Putting it all Together</h3>
<p>Now that we have the form and the PHP sections completed, we need to put it all together into an application page. You can download the <a href="http://www.cagintranet.com/design/wp-content/uploads/2008/06/flickr_api_example.phps">example page here</a>, or you can take a look at the <a href="http://www.cagintranet.com/code/flickrcite/">working example I&#8217;ve put up</a>.</p><img src="http://feeds.feedburner.com/~r/cagintranet/~4/xURCokfzgKY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/creating-a-simple-php-application-using-the-flickr-api/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/creating-a-simple-php-application-using-the-flickr-api/</feedburner:origLink></item>
		<item>
		<title>CSS Tip: Easy Cross Browser &amp; Valid CSS Text Shadows</title>
		<link>http://feedproxy.google.com/~r/cagintranet/~3/mYvtfgvXp9M/</link>
		<comments>http://www.cagintranet.com/archive/css-tip-easy-cross-browser-valid-css-text-shadows/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 13:42:49 +0000</pubDate>
		<dc:creator>Chris Cagle</dc:creator>
		
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.cagintranet.com/?p=84</guid>
		<description><![CDATA[
Photo Credit: Glockenblume

Although I am certain that I am not the only one doing this, I have developed an extremely easy way to get CSS text shadows without the need to use the wildly unsupported CSS property of text-shadow.


.post_title {
position:relative;
padding:10px 0 0 0;
}

.post_title h1 {
position:absolute;
top:2px;
left:2px;
font-size:30px;
color:#C9D8E9;
padding:0;
margin:0;
}

.post_title h6 {
position:absolute;
top:0;
left:0;
font-size:30px;
color:#4471A2;
padding:0;
margin:0;
}




	Lorem ipsum dolor sit amet consectetuer
	Lorem ipsum dolor sit [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.cagintranet.com/design/wp-content/uploads/2008/06/cssshadow.png" alt="" title="CSS Text Shadows" width="500" height="200" class="alignnone size-full wp-image-85" /></p>
<cite class="flickrcite" >Photo Credit: <a href="http://www.flickr.com/photos/glockenblume/">Glockenblume</a></cite>

<p>Although I am certain that I am not the only one doing this, I have developed an extremely easy way to get CSS text shadows without the need to use the wildly unsupported CSS property of <a href="http://www.quirksmode.org/css/textshadow.html">text-shadow</a>.</p>

<style type="text/css">
.post_title {
position:relative;
padding:10px 0 0 0;
}

.post_title h1 {
position:absolute;
top:2px;
left:2px;
font-size:30px;
color:#C9D8E9;
padding:0;
margin:0;
}

.post_title h6 {
position:absolute;
top:0;
left:0;
font-size:30px;
color:#4471A2;
padding:0;
margin:0;
}

</style>

<div class="post_title">
	<h1>Lorem ipsum dolor sit amet consectetuer</h1>
	<h6>Lorem ipsum dolor sit amet consectetuer</h6>
<p>&nbsp;</p>
<div class="clear"></div>
</div>

<p>The only problem that some people may see with this example is &#8220;duplicate content&#8221; because the title is shown twice in the HTML. I&#8217;ve decided that sometimes when all you need is a simple text drop shadow, this is an acceptable problem. This technique is extremely easy, and I have used it on a couple sites of mine thus far with no cross-browser issues. </p>

<h3>The Code (HTML)</h3>
<pre><code class="html">&lt;div class=&quot;post_title&quot;&gt;
	&lt;h1&gt;Lorem ipsum dolor sit amet consectetuer&lt;/h1&gt;
	&lt;h6&gt;Lorem ipsum dolor sit amet consectetuer&lt;/h6&gt;
&lt;/div&gt;</code></pre>

<h3>The Code (CSS)</h3>
<pre><code class="css">.post_title {
position:relative;
font-family:arial;
}

.post_title h1 {
position:absolute;
top:2px;
left:2px;
font-size:30px;
color:#C9D8E9;
padding:0;
margin:0;
}

.post_title h6 {
position:absolute;
top:0;
left:0;
font-size:30px;
color:#4471A2;
padding:0;
margin:0;
}</code></pre>


<img src="http://feeds.feedburner.com/~r/cagintranet/~4/mYvtfgvXp9M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.cagintranet.com/archive/css-tip-easy-cross-browser-valid-css-text-shadows/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.cagintranet.com/archive/css-tip-easy-cross-browser-valid-css-text-shadows/</feedburner:origLink></item>
	</channel>
</rss>
