4 * SourceForge Top-Statistics: Highest-Ranked Users
6 * SourceForge: Breaking Down the Barriers to Open Source Development
7 * Copyright 1999-2001 (c) VA Linux Systems
8 * http://sourceforge.net
18 require_once('pre.php');
20 $yesterday = time()-60*60*24;
21 $yd_month = date('Ym', $yesterday);
22 $yd_day = date('d', $yesterday);
25 SELECT user_metric.ranking,users.user_name,users.realname,
26 user_metric.metric,user_metric_history.ranking AS old_ranking
27 FROM users,user_metric LEFT JOIN user_metric_history
28 ON (user_metric.user_id=user_metric_history.user_id
29 AND user_metric_history.month='$yd_month'
30 AND user_metric_history.day='$yd_day')
31 WHERE users.user_id=user_metric.user_id
36 if (!$res_top || db_numrows($res_top)<1) {
38 'Information not available',
39 'Information about highest ranked users is not available. '
44 $HTML->header(array('title'=>'Highest Ranked Users'));
46 print '<h1>Highest Ranked Users</h1>
47 <BR><I>(Updated Daily)</I>
49 <P><A href="/top/">[View Other Top Categories]</A>
51 <P><TABLE width="100%" cellpadding=0 cellspacing=0 border=0>
54 <TD><B>User Name<BR> </B></TD>
55 <TD><B>Real Name<BR> </B></TD>
56 <TD align="right"><B>Rating</B></TD>
57 <TD align="right"><B>Last Rank</B></TD>
58 <TD align="right"><B>Change</B> </TD></TR>
61 while ($row_top = db_fetch_array($res_top)) {
63 print '<TR BGCOLOR="'. html_get_alt_row_color($i) .'"><TD> '.$row_top['ranking']
64 .'</TD><TD><A href="/users/'. $row_top['user_name'] .'/">'
65 .$row_top['user_name'].'</A></td>'
66 .'<td>'.$row_top['realname'].'</td>'
67 .'</TD><TD align="right">'.sprintf('%.2f', $row_top['metric'])
68 .' </TD><TD align="right">'.$row_top['old_ranking']
69 .' </TD>'
70 .'<TD align="right">';
73 $diff = $row_top["old_ranking"] - $row_top["ranking"];
74 if (!$row_top["old_ranking"] || !$row_top["ranking"]) {
77 else if ($diff == 0) {
81 print "<FONT color=\"#009900\">Up $diff</FONT>";
84 print "<FONT color=\"#CC0000\">Down ".(0-$diff)."</FONT>";
87 print ' </TD></TR>
93 print ' <table width="100%">
94 <TR BGCOLOR="'.$HTML->COLOR_LTBACK2.'">
95 <TD>'.(($offset>=$LIMIT)?'<A HREF="topusers.php?&offset='.($offset-50).'"><B><-- More</B></A>':' ').'</TD>
96 <TD ALIGN="RIGHT"><A HREF="topusers.php?offset='.($offset+50).'"><B>More --></B></A></TD></TR>
100 $HTML->footer(array());