summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/db.php11
-rw-r--r--include/functions.php10
-rw-r--r--include/output.php2
-rw-r--r--include/preferences.php1
-rw-r--r--include/user.php9
5 files changed, 27 insertions, 6 deletions
diff --git a/include/db.php b/include/db.php
index cc40f67..882a1ad 100644
--- a/include/db.php
+++ b/include/db.php
@@ -470,6 +470,17 @@ function DB_get_names_of_last_logins($N)
return $names;
}
+function DB_get_emails_of_last_logins($N)
+{
+ $emails = array();
+
+ $result = DB_query("SELECT email FROM User ORDER BY last_login DESC LIMIT $N");
+ while($r = DB_fetch_array($result))
+ $emails[] = $r[0];
+
+ return $emails;
+}
+
function DB_get_names_of_new_logins($N)
{
$names = array();
diff --git a/include/functions.php b/include/functions.php
index 43fbb24..63216eb 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -803,7 +803,8 @@ function display_table ()
" Hand.point_call, ".
" User.last_login, ".
" Hand.hash, ".
- " User.timezone ".
+ " User.timezone, ".
+ " User.email ".
"FROM Hand ".
"LEFT JOIN User ON User.id=Hand.user_id ".
"WHERE Hand.game_id='".$gameid."' ".
@@ -821,11 +822,14 @@ function display_table ()
$call = $r[5];
$hash = $r[7];
$timezone = $r[8];
+ $email = $r[9];
$wins = DB_get_number_of_tricks($gameid,$pos);
date_default_timezone_set($defaulttimezone);
$lastlogin = strtotime($r[6]);
date_default_timezone_set($timezone);
$timenow = strtotime(date("Y-m-d H:i:s"));
+ $gravatar = "$name<br /><img class=\"gravatar\" title=\"$name\" src=\"http://www.gravatar.com/avatar/".md5(strtolower(trim($email)))."?d=identicon\" />";
+
echo " <div class=\"table".($pos-1)."\">\n";
@@ -838,10 +842,10 @@ function display_table ()
$comment = $vacation[2];
$title = "begin: $start end: $stop $comment";
- echo " <span class=\"vacation\" title=\"$title\">$name (on vacation until $stop)</span> \n";
+ echo " <span class=\"vacation\" title=\"$title\">$gravatar (on vacation until $stop)</span> \n";
}
else
- echo " $name \n";
+ echo " $gravatar \n";
if($debug)
echo"</a>\n";
diff --git a/include/output.php b/include/output.php
index 33f7b19..9e87de3 100644
--- a/include/output.php
+++ b/include/output.php
@@ -301,7 +301,7 @@ function output_header()
<title>e-Doko</title>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
<link rel="shortcut icon" type="image/x-icon" href="pics/edoko-favicon.png" />
- <link rel="stylesheet" type="text/css" href="css/standard021.css" />
+ <link rel="stylesheet" type="text/css" href="css/standard022.css" />
<script type="text/javascript" src="include/game.js"> </script>
<script type="text/javascript" src="include/jquery.js"> </script>
<script type="text/javascript" src="include/jquery.tablesorter.js"></script>
diff --git a/include/preferences.php b/include/preferences.php
index 2e3eef2..70ecabb 100644
--- a/include/preferences.php
+++ b/include/preferences.php
@@ -496,6 +496,7 @@ if($changed_openid)
echo " </fieldset>\n";
echo " <fieldset><legend>Submit</legend><input type=\"submit\" name=\"passwd\" value=\"set\" /></fieldset>\n";
echo " </form>\n";
+echo " <p>E-DoKo uses <a href=\"http://www.gravatar.org\">gravatars</a> as icons. I</p>";
echo "</div>\n";
return;
diff --git a/include/user.php b/include/user.php
index bac4398..a027f40 100644
--- a/include/user.php
+++ b/include/user.php
@@ -206,9 +206,14 @@ else
echo "</p>\n";
/* display last 5 users that logged on */
- $names = DB_get_names_of_last_logins(5);
echo "<h4>Players last logged in:</h4>\n<p>\n";
- echo implode(", ",$names).",...\n";
+
+ $names = DB_get_names_of_last_logins(7);
+ $emails = DB_get_emails_of_last_logins(7);
+ for($i=0;$i<7;$i++)
+ {
+ echo "<img class=\"gravatar\" title=\"".$names[$i]."\" src=\"http://www.gravatar.com/avatar/".md5(strtolower(trim($emails[$i])))."?d=identicon\" />\n";
+ }
echo "</p>\n";
echo "</div>\n";