1

(3 replies, posted in Hacks & Tricks / FAQ)

Name: Gravatar
Author: V4NY
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Hi all.
I made this hack to display Gravatar in comments (see http://gravatar.com). I can't post in the hack forum so i hope you can move this topic there.
Instructions:

Open shows.inc.php in the inc directory, go to line 393 (circa) and find this line:

$output = str_replace("{mail}", "$comment_arr[2]",$output);

Add before this:

$size = 80; //size of gravatar
$default = "http://layoutstudios.com/images/noava.gif"; //default gravatar
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($comment_arr[2])."&default=".urlencode($default)."&size=".$size; //generating url
$output = str_replace("{gravatar}", "<img src=\"".$grav_url."\" align=\"left\" alt=\"\" />",$output); //template tag


change the variable values for $size and $default.
Save and exit.
You can now use the tag {gravatar} in templates http://cutephp.com/forum/style_emoticons/default/smile.gif