修改上色
This commit is contained in:
@@ -30,10 +30,13 @@
|
||||
$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
|
||||
|
||||
if ($label_theme == "") $label_theme = "default";
|
||||
?>
|
||||
<a href="problemset.php?search=<?php echo urlencode($tag); ?>" class="ui label"><?php echo $tag; ?></a>
|
||||
<a href="problemset.php?search=<?php echo urlencode($tag); ?>" class="ui label label-<?php echo $label_theme; ?>"><?php echo $tag; ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
Reference in New Issue
Block a user