From 6070a535c34a596d7749ecae4b386b60b731cc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B5=A9=E6=96=8C?= Date: Sat, 21 Sep 2024 07:23:38 +0800 Subject: [PATCH] Update ranklist.php --- trunk/web/ranklist.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/trunk/web/ranklist.php b/trunk/web/ranklist.php index e70ed952e46..e67c07bf081 100644 --- a/trunk/web/ranklist.php +++ b/trunk/web/ranklist.php @@ -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=""; @@ -83,7 +83,7 @@ $last_id=mysql_query_cache("select solution_id from solution where in_date$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 @@ -119,8 +119,9 @@ $rank ++; $view_rank[$i][0]= $rank; - $view_rank[$i][1]= ""; - $view_rank[$i][2]= "
" . htmlentities ( $row['nick'] ,ENT_QUOTES,"UTF-8") ."
"; + $view_rank[$i][1]= "" . $row['user_id'] . ""; + if(isset($row['starred']) && $row['starred'] >0 ) $view_rank[$i][1]="⭐".$view_rank[$i][1]."⭐"; //github starred rewarding + $view_rank[$i][2]= "
" . htmlentities ( $row['nick'] ,ENT_QUOTES,"UTF-8") ."
"; $view_rank[$i][3]= "
" . htmlentities ( $row['group_name'] ,ENT_QUOTES,"UTF-8") ."
"; $view_rank[$i][4]= ""; $view_rank[$i][5]= "";