<?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>PHP Magic Book - Free PHP Scripts, Tutorials and Downloads &#187; social</title>
	<atom:link href="http://www.phpmagicbook.com/tag/social/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpmagicbook.com</link>
	<description>PHP AtoZ Reloaded, free php tutorials, free php downloads, php scripts, PHP tips</description>
	<lastBuildDate>Tue, 15 Jun 2010 13:22:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Enable Gravatar/Avatar at Your Website &#8211; Gravatar Image PHP Script</title>
		<link>http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/</link>
		<comments>http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 09:37:06 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Useful Scripts]]></category>
		<category><![CDATA[avatar]]></category>
		<category><![CDATA[displaypic]]></category>
		<category><![CDATA[gravatar]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[social]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=499</guid>
		<description><![CDATA[You might have already created an account at gravatar (Globally Recognized Avatars) and enjoying your display picture or avatar at forums and blogs when you just post your comment with your email and there you are &#8212; it displays your avatar along with your comment. If you are a developer and you create websites &#8211; [...]<p><a href="http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/">Enable Gravatar/Avatar at Your Website &#8211; Gravatar Image PHP Script</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.phpmagicbook.com/wp-content/uploads/2009/10/gravatar.png" alt="gravatar" title="gravatar" width="200" height="44" class="alignright size-full wp-image-500" />You might have already created an account at <a rel="nofollow" target="_blank" href="http://en.gravatar.com/">gravatar</a> (Globally Recognized Avatars) and enjoying your display picture or avatar at forums and blogs when you just post your comment with your email and there you are &#8212; it displays your avatar along with your comment. If you are a developer and you create websites &#8211; PHP websites &#8211; and wondering how you can enable gravatars / avatars in your next project then here is very easy to use working solution &#8211; PHP script to enable gravatar at your PHP website / blog / forum / project.</p>
<p><span id="more-499"></span></p>
<p>Copy the following code. Paste it in a file, save it in PHP extension, upload it or use it at localhost &#8211; just change the <strong>usersEmail</strong> value to your email address, if you are already at gravatars website and hit it. Other instructions for customization of script &#8211; you can find in the script. e.g. size of gravatar, default image, rating etc.</p>
<h4>Gravatars PHP Script for Your Website</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// The users email, passed to Gravatar</span>
<span style="color: #000088;">$usersEmail</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;myemail@live.com&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// default avatar to load if Gravatar doesn't find one</span>
<span style="color: #000088;">$defaultImage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://domain.com/default.png&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// The size of the image</span>
<span style="color: #000088;">$avatarSize</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;50&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Minimum rating for your site</span>
<span style="color: #666666; font-style: italic;">// Possible values (G, PG, R, X)</span>
<span style="color: #000088;">$avatarRating</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;G&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Border around the image</span>
<span style="color: #000088;">$avatarBorder</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;000000&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// URL for Gravatar</span>
<span style="color: #000088;">$gravatarURL</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.gravatar.com/avatar.php?gravatar_id=<span style="color: #009933; font-weight: bold;">%s</span>&amp;default=<span style="color: #009933; font-weight: bold;">%s</span>&amp;size=<span style="color: #009933; font-weight: bold;">%s</span>&amp;border=<span style="color: #009933; font-weight: bold;">%s</span>&amp;rating=<span style="color: #009933; font-weight: bold;">%s</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$avatarURL</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span>
<span style="color: #009900;">&#40;</span>
	<span style="color: #000088;">$gravatarURL</span><span style="color: #339933;">,</span>
	<span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$usersEmail</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #000088;">$defaultImage</span><span style="color: #339933;">,</span>
	<span style="color: #000088;">$avatarSize</span><span style="color: #339933;">,</span>
	<span style="color: #000088;">$avatarBorder</span><span style="color: #339933;">,</span>
	<span style="color: #000088;">$avatarRating</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;&lt;img src=&quot;</span><span style="color: #0000ff;">&quot; .
	<span style="color: #006699; font-weight: bold;">$avatarURL</span> . &quot;</span><span style="color: #0000ff;">&quot; width=&quot;</span><span style="color: #0000ff;">&quot; .
	<span style="color: #006699; font-weight: bold;">$avatarSize</span> . &quot;</span><span style="color: #0000ff;">&quot; height=&quot;</span><span style="color: #0000ff;">&quot; .
	<span style="color: #006699; font-weight: bold;">$avatarSize</span> . &quot;</span><span style="color: #0000ff;">&quot; /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><a href="http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/">Enable Gravatar/Avatar at Your Website &#8211; Gravatar Image PHP Script</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/text-to-image-using-php/" title="Text To Image Using PHP">Text To Image Using PHP</a></li><li><a href="http://www.phpmagicbook.com/captcha-image-number-verification/" title="Captcha &#8211; Image And Number Verification Using PHP">Captcha &#8211; Image And Number Verification Using PHP</a></li><li><a href="http://www.phpmagicbook.com/random-single-image-onload/" title="Random Single Image Onload Using PHP">Random Single Image Onload Using PHP</a></li><li><a href="http://www.phpmagicbook.com/php-javascript-based-image-gallery/" title="PHP Javascript Based Auto Populated Image Gallery">PHP Javascript Based Auto Populated Image Gallery</a></li><li><a href="http://www.phpmagicbook.com/display-images-from-folder/" title="Auto Display Images From Folder Using PHP">Auto Display Images From Folder Using PHP</a></li><li><a href="http://www.phpmagicbook.com/random-single-image-display-on-page-reload/" title="Random Single Image Display On Page Reload Using PHP">Random Single Image Display On Page Reload Using PHP</a></li><li><a href="http://www.phpmagicbook.com/php-photo-slide-show/" title="Auto Create PHP Photo Slide Show Using PHP">Auto Create PHP Photo Slide Show Using PHP</a></li><li><a href="http://www.phpmagicbook.com/image-gallery/" title="Auto Create Image Gallery from Folder Using PHP">Auto Create Image Gallery from Folder Using PHP</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/enable-gravataravatar-at-your-website-gravatar-image-php-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
