This is my implementation, i can get it to show the default image, but not the user with a gravatar? the original pieces of code can be found at the bottom
`
function printLatestComments($number, $shorten='123') {
if(getOption('mod_rewrite')) {
$albumpath = "/"; $imagepath = "/"; $modrewritesuffix = getOption('mod_rewrite_image_suffix');
} else {
$albumpath = "/index.php?album="; $imagepath = "&image="; $modrewritesuffix = "";
}
$email = getCommentAuthorEmail();
$comments = getLatestComments($number,$shorten);
echo "\n";
echo "[list]\n";
foreach ($comments as $comment) {
if($comment['anon'] === "0") {
$author = " ".$comment['name'] .gettext(" said: ")." ";
} else {
$author = "";
}
$album = $comment['folder'];
if($comment['type'] === "images") {
$imagetag = $imagepath.$comment['filename'].$modrewritesuffix;
} else {
$imagetag = "";
}
$date = $comment['date'];
$albumtitle = $comment['albumtitle'];
if ($comment['title'] == "") $title = $image; else $title = get_language_string($comment['title']);
$website = $comment['website'];
$shortcomment = truncate_string($comment['comment'], $shorten);
if(!empty($title)) {
$title = ": ".$title;
}
$default = "http://www.thehilln10.com/images/defaultGrav.gif";
$size = 20;
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&default=".urlencode($default)."&size=".$size;
echo "[*]<a href=\"".WEBPATH.$albumpath.$album.$imagetag."\" class=\"commentmeta\">".$author."</a>
\n";
echo "".$shortcomment."";
echo '[img]'.$grav_url.'[/img]';
}
echo "[/list]\n";
echo "\n";
}
`
The original gravatar hack:
`
<?php
$email = getCommentAuthorEmail();
$default = "http://www.thehilln10.com/images/defaultGrav.gif";
$size = 40;
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&default=".urlencode($default)."&size=".$size; ?>
[img]<?php echo $grav_url; ?>[/img]
`
The original print latest comments code:
`
function printLatestComments($number, $shorten='123') {
if(getOption('mod_rewrite')) {
$albumpath = "/"; $imagepath = "/"; $modrewritesuffix = getOption('mod_rewrite_image_suffix');
} else {
$albumpath = "/index.php?album="; $imagepath = "&image="; $modrewritesuffix = "";
}
$comments = getLatestComments($number,$shorten);
echo "\n";
echo "[list]\n";
foreach ($comments as $comment) {
if($comment['anon'] === "0") {
$author = " ".$comment['name'] .gettext(" said: ")." ";
} else {
$author = "";
}
$album = $comment['folder'];
if($comment['type'] === "images") {
$imagetag = $imagepath.$comment['filename'].$modrewritesuffix;
} else {
$imagetag = "";
}
$date = $comment['date'];
$albumtitle = $comment['albumtitle'];
if ($comment['title'] == "") $title = $image; else $title = get_language_string($comment['title']);
$website = $comment['website'];
$shortcomment = truncate_string($comment['comment'], $shorten);
if(!empty($title)) {
$title = ": ".$title;
}
echo "[*]<a href=\"".WEBPATH.$albumpath.$album.$imagetag."\" class=\"commentmeta\">".$author."</a>
\n";
echo "".$shortcomment."";
}
echo "[/list]\n";
echo "\n";
}
`