summaryrefslogtreecommitdiff
path: root/0.4.8a2/ranking.php4
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:47 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:47 +0200
commit630af0ed6c0af69c7df2e45aef7a87722a3c00c0 (patch)
treead76f850278b090f7e5c26561035d19c320400cc /0.4.8a2/ranking.php4
parent2860b03f00e48264ed15c132ad90b240ebe6070b (diff)
tagging ychat-perl-legacyychat-perl-legacy
Diffstat (limited to '0.4.8a2/ranking.php4')
-rw-r--r--0.4.8a2/ranking.php480
1 files changed, 80 insertions, 0 deletions
diff --git a/0.4.8a2/ranking.php4 b/0.4.8a2/ranking.php4
new file mode 100644
index 0000000..54104fb
--- /dev/null
+++ b/0.4.8a2/ranking.php4
@@ -0,0 +1,80 @@
+<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
+<html>
+<head>
+ <title>Top 20 Ranking</title>
+ <style rel="stylesheet" type="text/css">
+ body { background-color: #005146 }
+ body.blank { background-color: #000000 }
+ body.online { background-color: #000000 }
+ div { font-family: arial, verdana, helvetiva; font-size: 9pt; color: #ffffff }
+ div.b { font-weight: bold; color: #ffa500 }
+ a { font-family: arial, verdana, helvetiva; font-size: 8pt; color: #FF0000 }
+ a:hover { color: #000000; text-decoration: none }
+ </style>
+</head>
+<body>
+<?
+
+$pfad = "data/user/counts";
+$handle = opendir($pfad);
+$counter = 0;
+$datei=readdir($handle);
+$datei=readdir($handle);
+while($datei=readdir($handle))
+{
+
+ $ganzername = $pfad . "/" . $datei;
+ $groesse = filesize($ganzername);
+ $dateihandle = fopen($ganzername,"r");
+ $onlinezeit = fgets($dateihandle, $groesse+1);
+ $counter++;
+ $user = substr($datei, 0, strlen($datei) - 7);
+ $array[$user] = (int) ($onlinezeit / 60);
+
+}
+echo "<div>Es wurden " . sizeof($array) . " Eintr&auml;ge gefunden und ausgewertertet.<p> Top-40 Ranking:<br></div><HR>";
+arsort($array);
+
+
+echo "<table border=0 bgcolor=#000000 cellspacing=1 cellpadding=2>";
+
+echo "<tr><td bgcolor=#DD0000 align=center>";
+echo "<div> &nbsp;Rank&nbsp; </div>";
+echo "<td bgcolor=#DD0000 align=center>";
+echo "<div> &nbsp;Chatter&nbsp; </div>";
+echo "<td bgcolor=#DD0000 align=center>";
+echo "<div> &nbsp;Onlinezeit&nbsp;<br>&nbsp;[DD:HH:MM]&nbsp; </div>";
+echo "</tr>";
+$mykeys = array_keys($array);
+$counter = 0;
+$platz=0;
+foreach ($mykeys as $keyname) {
+ $counter++;
+ if ($counter <= 40) {
+ $namedesprofils=$keyname;
+ $min = (int) ($array[$keyname] % 60);
+ $tmphrs = (int) ($array[$keyname] / 60);
+ $hrs = (int) ($tmphrs % 24);
+ $tmpdays = (int) ($tmphrs / 24);
+ $days = (int) ($tmphrs / 24);
+
+ $onlinezeit = sprintf("%02d:%02d:%02d", $days, $hrs, $min);
+ echo "<tr><td bgcolor=#EEEEEE align=center>";
+ echo "<font face=\"arial,verdana,helvetiva\" size=1 color=#000000>$counter</font>";
+ echo "<td bgcolor=#EEEEEE align=center>";
+ echo "<a href=\"main2.pl?var=alias_html&tmp=$namedesprofils&alias=$alias&tmpid=$tmpid\" target=\"_self\">";
+ echo "<font face=\"arial,verdana,helvetiva\" size=1 color=#FF0000>";
+ echo "$keyname";
+ echo "</font>";
+ echo "</a>";
+ echo "<td bgcolor=#999999 align=center>";
+ echo "<font face=\"arial,verdana,helvetiva\" size=1 color=#FFFFFF>$onlinezeit</font>";
+ echo "</tr>";
+ }
+ if ($keyname == $alias) { $platz=$counter; }
+}
+echo "</table> <HR>";
+echo "<div> $alias, Du befindest Dich momentan auf Platz Nr.: $platz</div>";
+?>
+</body>
+</html>