From 45fb7f9ceebaf6074850e2a11ff713fedfca0987 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Mon, 2 Oct 2023 19:16:48 -0700 Subject: [PATCH] Highlight subscribed groups with new articles with '*'. --- Rocksolid_Light/rocksolid/index.php | 3 --- Rocksolid_Light/rocksolid/newsportal.php | 24 +++++++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Rocksolid_Light/rocksolid/index.php b/Rocksolid_Light/rocksolid/index.php index c22cde4..24a139d 100644 --- a/Rocksolid_Light/rocksolid/index.php +++ b/Rocksolid_Light/rocksolid/index.php @@ -1,8 +1,5 @@ '; $groupdisplay .= '' . group_display_name($g->name) . "\n"; - if ($g->description != "-") { - $groupdisplay .= '

' . $g->description . '

'; - } - // Get last article info from overview $database = $spooldir . '/articles-overview.db3'; $table = 'overview'; @@ -663,12 +658,27 @@ function groups_show($gruppen) if ($found == 1) { $lastarticleinfo['date'] = $row['date']; } + $new = false; + $new_style_on = ''; + $new_style_off = ''; + if (isset($userdata[$g->name]) && ($userdata[$g->name] < $lastarticleinfo['date'])) { + $new_style_on = '*'; + $new_style_off = ''; + $new = true; + } + $groupdisplay .= 'href="' . $file_thread . '?group=' . _rawurlencode($g->name) . '">' . $new_style_on . group_display_name($g->name) . $new_style_off . "\n"; + if ($new) { + echo ''; + } + if ($g->description != "-") { + $groupdisplay .= '

' . $g->description . '

'; + } $overview_dbh = null; if (isset($userdata[$g->name])) { $groupdisplay .= '

'; $groupdisplay .= '(unsubscribe)'; - if ($userdata[$g->name] < $lastarticleinfo['date']) { - $groupdisplay .= '(new) '; + if ($new) { + $groupdisplay .= ' (new) '; } $groupdisplay .= '