Skip to content

Commit

Permalink
Update ranklist.php
Browse files Browse the repository at this point in the history
  • Loading branch information
zhblue authored Sep 20, 2024
1 parent ac9a176 commit 6070a53
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions trunk/web/ranklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
if ($rank < 0)
$rank = 0;

$sql = "SELECT `user_id`,`nick`,`solved`,`submit`,group_name FROM `users` $where ORDER BY `solved` DESC,submit,reg_time LIMIT " . strval ( $rank ) . ",$page_size";
$sql = "SELECT `user_id`,`nick`,`solved`,`submit`,group_name,starred FROM `users` $where ORDER BY `solved` DESC,submit,reg_time LIMIT " . strval ( $rank ) . ",$page_size";

if($scope){
$s="";
Expand All @@ -83,7 +83,7 @@
$last_id=mysql_query_cache("select solution_id from solution where in_date<str_to_date('$s','%Y-%m-%d') order by solution_id desc limit 1;");
if(!empty($last_id)&&is_array( $last_id)) $last_id=$last_id[0][0];else $last_id=0;
$view_total=mysql_query_cache("select count(distinct(user_id)) from solution where solution_id>$last_id")[0][0];
$sql="SELECT users.`user_id`,`nick`,s.`solved`,t.`submit`,group_name FROM `users`
$sql="SELECT users.`user_id`,`nick`,s.`solved`,t.`submit`,group_name,starred FROM `users`
inner join
(select count(distinct (problem_id)) solved ,user_id from solution
where solution_id>$last_id and user_id not in (".$OJ_RANK_HIDDEN.") and problem_id>0 and result=4
Expand Down Expand Up @@ -119,8 +119,9 @@
$rank ++;

$view_rank[$i][0]= $rank;
$view_rank[$i][1]= "<div class=center><a href='userinfo.php?user=" .htmlentities ( $row['user_id'],ENT_QUOTES,"UTF-8") . "'>" . $row['user_id'] . "</a>"."</div>";
$view_rank[$i][2]= "<div class=center>" . htmlentities ( $row['nick'] ,ENT_QUOTES,"UTF-8") ."</div>";
$view_rank[$i][1]= "<a href='userinfo.php?user=" .htmlentities ( $row['user_id'],ENT_QUOTES,"UTF-8") . "'>" . $row['user_id'] . "</a>";
if(isset($row['starred']) && $row['starred'] >0 ) $view_rank[$i][1]="".$view_rank[$i][1].""; //github starred rewarding
$view_rank[$i][2]= "<div class=center>" . htmlentities ( $row['nick'] ,ENT_QUOTES,"UTF-8") ."</div>";
$view_rank[$i][3]= "<div class=center>" . htmlentities ( $row['group_name'] ,ENT_QUOTES,"UTF-8") ."</div>";
$view_rank[$i][4]= "<div class=center><a href='status.php?user_id=" .htmlentities ( $row['user_id'],ENT_QUOTES,"UTF-8") ."&jresult=4'>" . $row['solved']."</a>"."</div>";
$view_rank[$i][5]= "<div class=center><a href='status.php?user_id=" . htmlentities ($row['user_id'],ENT_QUOTES,"UTF-8") ."'>" . $row['submit'] . "</a>"."</div>";
Expand Down

0 comments on commit 6070a53

Please sign in to comment.