echo "<table border=\"1\">";
echo "<tr><th>Committed By</th><th>Date</th><th>Commit Log Entry</th></tr>";
foreach($commitids as $ids) {
- $rs = popen("git --git-dir=$repo_base/$repo_view_call.git log --pretty=format:\"%at%n%ce%n%s\" $ids -1", "r");
+ $rs = popen("git --git-dir=$repo_base/$repo_view_call.git log --pretty=format:\"%at%n%ce%n%an%n%s\" $ids -1", "r");
if($rs) {
$flin1 = trim(fgets($rs));
- $flin2 = gwvpmini_emailToUserLink(trim(fgets($rs)));
+ $flin2 = trim(fgets($rs));
+ $flin3 = trim(fgets($rs));
while(!feof($rs)) {
- $flin3 = fread($rs, 8192);
+ $flin4 = fread($rs, 8192);
+ }
+ $flon = gwvpmini_emailToUserLink($flin2);
+ if(!$flon) {
+ $flon = "$flin3 (external)";
}
}
- echo "<tr><td>$flin2</td><td>$flin1</td><td>$flin3</td></tr>";
+ echo "<tr><td>".get_gravatar($flin2, 18, 'mm', 'g', true)."$flon</td><td>$flin1</td><td>$flin4</td></tr>";
}
echo "</table>";
}
-
}
\r
{
global $BASE_URL;
- $username = gwvpmini_GetUserNameFromEmail($username);
+ $username = gwvpmini_GetUserNameFromEmail($email);
if($username !== false) {
return "<a href=\"$BASE_URL/user/$username\">$username</a>";
} else {
- return "Uknown";
+ return false;
}
}
}
+/**\r
+ * Get either a Gravatar URL or complete image tag for a specified email address.\r
+ *\r
+ * @param string $email The email address\r
+ * @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ]\r
+ * @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ]\r
+ * @param string $r Maximum rating (inclusive) [ g | pg | r | x ]\r
+ * @param boole $img True to return a complete IMG tag False for just the URL\r
+ * @param array $atts Optional, additional key/value attributes to include in the IMG tag\r
+ * @return String containing either just a URL or a complete image tag\r
+ * @source http://gravatar.com/site/implement/images/php/\r
+ */\r
+function get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\r
+ $url = 'http://en.gravatar.com/avatar/';\r
+ $url .= md5( strtolower( trim( $email ) ) );\r
+ $url .= "?s=$s&d=$d&r=$r";\r
+ if ( $img ) {\r
+ $url = '<img src="' . $url . '"';\r
+ foreach ( $atts as $key => $val )\r
+ $url .= ' ' . $key . '="' . $val . '"';\r
+ $url .= ' />';\r
+ }\r
+ return $url;\r
+}\r
+
?>
\ No newline at end of file