<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>D&#039;Arcy Norman dot net &#187; avatar</title>
	<atom:link href="http://www.darcynorman.net/tag/avatar/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.darcynorman.net</link>
	<description>apparently much happier in person</description>
	<lastBuildDate>Fri, 20 Nov 2009 03:52:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>User Avatar Photos in WordPress</title>
		<link>http://www.darcynorman.net/2008/09/02/user-avatar-photos-in-wordpress/</link>
		<comments>http://www.darcynorman.net/2008/09/02/user-avatar-photos-in-wordpress/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 17:04:01 +0000</pubDate>
		<dc:creator>dnorman</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[avatar]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[ucalgaryblogs.ca]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.darcynorman.net/?p=2222</guid>
		<description><![CDATA[WordPress has supported Gravatars for awhile, which is great, but if you&#8217;re rolling out a site for a bunch of students to hammer on, it&#8217;s not ideal to have to send them to a third party service to set up photos. It&#8217;s awkward, and confusing, for new users to have to go somewhere else to [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress has supported <a href="http://en.gravatar.com/">Gravatars</a> for awhile, which is great, but if you&#8217;re rolling out a site for a bunch of students to hammer on, it&#8217;s not ideal to have to send them to a third party service to set up photos. It&#8217;s awkward, and confusing, for new users to have to go somewhere else to add a photo to their profile. And profile photos can be very useful, especially at the beginning of a semester when everyone is just getting to know everyone else in a class, to put a face to a name.</p>
<p>So, for <a href="http://ucalgaryblogs.ca">UCalgaryBlogs.ca</a>, I just installed the handy <a href="http://wordpress.org/extend/plugins/user-photo/">User Photo plugin</a>. Now, any site can enable this, and the users of that site will be able to add photos to their profiles, like this:</p>
<p><a href="http://www.darcynorman.net/wp-content/uploads/2008/09/userphoto_wordpress_plugin.png"><img class="alignnone size-full wp-image-2223" title="userphoto_wordpress_plugin" src="http://www.darcynorman.net/wp-content/uploads/2008/09/userphoto_wordpress_plugin.png" alt="" width="500" height="200" /></a></p>
<p>The plugin can be configured with custom sizes for the full-size and thumb versions of the avatar, and the avatar image can be deleted and/or replaced at any time.</p>
<p>It&#8217;s not completely trivial to enable &#8211; because the themes need to be User Photo aware. That&#8217;s pretty easy to add, though. For the cutline theme we&#8217;re using on a project, I edited a handful of files to add the code, and it works great. On index.php, and single.php, just add this wherever you want the blog author&#8217;s photo to be displayed on the post (I put it in the section displaying the post meta information):</p>
<pre><code>&lt;?php if (function_exists('userphoto_the_author_thumbnail')) {  userphoto_the_author_thumbnail();}?&gt;</code></pre>
<p>Wrapping the thumbnail display code in a function_exists conditional means it will degrade nicely if the plugin is unavailable. Always a good thing to degrade instead of borking.</p>
<p>That results in this display when viewing the post:</p>
<p><a href="http://www.darcynorman.net/wp-content/uploads/2008/09/cutline_avatar_first_post.png"><img class="alignnone size-full wp-image-2224" title="cutline_avatar_first_post" src="http://www.darcynorman.net/wp-content/uploads/2008/09/cutline_avatar_first_post.png" alt="" width="437" height="180" /></a></p>
<p>Now, if you also want to show avatars on the comments, just edit comments.php to add this code (I put it in the comment meta info section):</p>
<pre><code>&lt;?php if (function_exists('userphoto_comment_author_thumbnail')) { userphoto_comment_author_thumbnail();}?&gt;</code></pre>
<p>And that will look like this when displayed on the blog:</p>
<p><a href="http://www.darcynorman.net/wp-content/uploads/2008/09/cutline_avatar_comment_thread.png"><img class="alignnone size-full wp-image-2225" title="cutline_avatar_comment_thread" src="http://www.darcynorman.net/wp-content/uploads/2008/09/cutline_avatar_comment_thread.png" alt="" width="500" height="323" /></a></p>
<p>If a user hasn&#8217;t added an avatar, it won&#8217;t display any image. But if they do have one, they&#8217;ll get the properly sized version of their avatar image displayed automatically. Easy peasy. It&#8217;s a bit awkward having to edit the themes, but it&#8217;s not difficult. The hard part will be remembering to re-apply the edits if the themes get updated (hence this post&#8230;)</p>
 <img src="http://www.darcynorman.net/wp-content/plugins/feed-statistics.php?view=1&post_id=2222" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.darcynorman.net/2008/09/02/user-avatar-photos-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
