summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--css/standard022.css (renamed from css/standard021.css)14
-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
6 files changed, 37 insertions, 10 deletions
diff --git a/css/standard021.css b/css/standard022.css
index 6957924..79dfeea 100644
--- a/css/standard021.css
+++ b/css/standard022.css
@@ -165,7 +165,7 @@ body { background-color: #ddd; }
div.table {
position:absolute;
width:100%;
- height:35em;
+ height:37em;
margin:0;
left:0;
padding:0;
@@ -202,7 +202,7 @@ div.table div.table0 {
right:62.5%;
}
div.table div.table1 {
- top:7.5%;
+ top:0%;
left:43.75%;
}
div.table div.table2 {
@@ -210,7 +210,7 @@ div.table div.table2 {
left:62.5%;
}
div.table div.table3 {
- bottom:5%;
+ bottom:0%;
left: 43.75%;
}
@@ -413,7 +413,7 @@ ul.tricks li div div span.comment span{
.mycards {
margin:0;
- margin-top:34.5em;
+ margin-top:38.5em;
padding:0;
border-top: 2px solid gray;
/* border-bottom: 2px solid green;*/
@@ -643,4 +643,10 @@ table.openid td, table.openid th{
.vacation {
color: #666;
background-color: #fc3;
+}
+
+div.table div img.gravatar, img.gravatar {
+ width: 4em;
+ height: 4em;
+ border: 3px solid #aaa;
} \ No newline at end of file
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";