From 63e076a062b692edea334cb31c0b5061e5e1cb89 Mon Sep 17 00:00:00 2001 From: klarkxy <278370456@qq.com> Date: Thu, 1 May 2025 17:08:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=85=A8tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/template/syzoj/category.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/template/syzoj/category.php b/web/template/syzoj/category.php index 16fd412..12b8885 100644 --- a/web/template/syzoj/category.php +++ b/web/template/syzoj/category.php @@ -30,11 +30,12 @@ $sql = "SELECT count(*) as cnt FROM `problem` WHERE defunct='N' AND (title LIKE ? OR source LIKE ?)"; $tag_search = "%" . $tag . "%"; $result = pdo_query($sql, $tag_search, $tag_search); - if (!$result || $result[0]['cnt'] <= 0) continue; // Skip tags with no active problems + if (isset($_SESSION[$OJ_NAME . '_' . 'administrator'])) + $label_theme = "danger"; + else if (!$result || $result[0]['cnt'] <= 0) continue; // Skip tags with no active problems // Choose a random color theme for the tag $hash_num = hexdec(substr(md5($tag), 0, 7)); - $label_theme = $color_theme[$hash_num % count($color_theme)]; if ($label_theme == "") $label_theme = "default"; ?>