Ian Purton

Ian Purton’s Notes

Integrating Gravatars into PunBB forums

  • PublishedOctober 7th, 2008
  • AuthorIan Purton
  • CategoriesUncategorized

PunBB already has it’s own Avatar system however I wanted to use the Gravatar site which is a central place to store avatar images.

To add gravatar functionality to PunBB you need to edit your viewtopic.php and look for the following line.

else
    $user_avatar = '';

And replace it with..

else
{
    $user_avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id=';
    $user_avatar .= md5($cur_post['email']);
    $user_avatar .= '&size=40" width="40" height="40" alt="" />';
}

This will automatically slect the graviatar based on the users email address.

"Integrating Gravatars into PunBB forums" was published on October 7th, 2008 and is listed in Uncategorized.

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

(required)
(required)
 

Subtraction Wordpress Theme by Ian Purton