diff --git a/Rocksolid_Light/common/themes/style.css b/Rocksolid_Light/common/themes/style.css index 564417d..f8fd83e 100644 --- a/Rocksolid_Light/common/themes/style.css +++ b/Rocksolid_Light/common/themes/style.css @@ -631,6 +631,17 @@ h1.np_post_headline { margin-top: 10px; } +/* show or hide groups toggle */ +.np_show_hide_toggle { + margin-top: 0; + margin-bottom: 0; + text-decoration: none; + text-align: center; + color: var(--color-highlight); + font-family: Arial, Helvetica, sans-serif; + font-size: 1.2em; +} + /* =========== specifically for rocksolid overboard =========== */ /* results table */ diff --git a/Rocksolid_Light/rocksolid/index.php b/Rocksolid_Light/rocksolid/index.php index 4930f08..d6a7863 100644 --- a/Rocksolid_Light/rocksolid/index.php +++ b/Rocksolid_Light/rocksolid/index.php @@ -4,6 +4,10 @@ if (! isset($_SESSION['last_access']) || (time() - $_SESSION['last_access']) > 6 $_SESSION['last_access'] = time(); } +header("Expires: " . gmdate("D, d M Y H:i:s", time() + (30)) . " GMT"); +header("Cache-Control: max-age=30"); +header("Pragma: cache"); + $_SESSION['isframed'] = 1; include "config.inc.php"; @@ -26,8 +30,8 @@ include "head.inc"; echo '

' . basename(getcwd()) . '

'; echo ''; -// If logged in: button for new only +// If logged in: button for new only if (isset($_COOKIE['mail_name'])) { if (isset($OVERRIDES['overboard_disable_new_link']) && $OVERRIDES['overboard_disable_new_link'] === true) { $newlink = false; @@ -46,6 +50,14 @@ if (isset($_COOKIE['mail_name'])) { } } } + if ($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) { + $userfile = $spooldir . '/' . strtolower($_COOKIE['mail_name']) . '-articleviews.dat'; + $user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . strtolower($_COOKIE['mail_name']) . '.config')); + if (isset($_POST['hide_unsub'])) { + $user_config['hide_unsub'] = $_POST['hide_unsub']; + file_put_contents($config_dir . '/userconfig/' . strtolower($_COOKIE['mail_name']) . '.config', serialize($user_config)); + } + } } // View Latest button diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 5efb405..5856ae7 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -615,14 +615,6 @@ function groups_show($gruppen) $userfile = $spooldir . '/' . strtolower($_COOKIE['mail_name']) . '-articleviews.dat'; $user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . strtolower($_COOKIE['mail_name']) . '.config')); } - - if (! isset($user_config['hide_unsub'])) { - if (isset($OVERRIDES['hide_unsub'])) { - $user_config['hide_unsub'] = $OVERRIDES['hide_unsub']; - } else { - $user_config['hide_unsub'] = 'hide'; - } - } } for ($i = 0; $i < $c; $i ++) { unset($groupdisplay); @@ -762,11 +754,37 @@ function groups_show($gruppen) foreach ($nonsubs as $nonsub) { echo $nonsub; } - echo "
\n"; + echo ""; + echo ''; + echo '
'; if (isset($user_config['hide_unsub']) && $user_config['hide_unsub'] == 'hide') { - echo ' Unsubscribed groups are HIDDEN. Visit User/Configuration to change
'; - echo ' or select groups from Grouplist to add groups
'; + echo ' Unsubscribed groups are HIDDEN.'; + echo ' Select groups from Grouplist to add groups'; } + if (isset($userdata)) { + show_groups_hide_toggle(); + } + echo '
'; +} + +function show_groups_hide_toggle() +{ + global $user_config; + echo '
'; + echo ' Unsubscribed Groups: '; + if ($user_config['hide_unsub'] == 'hide') { + echo 'Show'; + echo ' '; + echo 'Hide'; + echo ' '; + } else { + echo 'Show'; + echo ' '; + echo 'Hide'; + echo ' '; + } + echo ''; + echo '
'; } /* @@ -1077,10 +1095,10 @@ function display_links_in_body($text) $pattern = "!$pattern!"; $text = preg_replace($pattern, '' . $url . '', $text, 1); } - if(file_exists($config_dir . '/rewrite_body.inc.php')) { + if (file_exists($config_dir . '/rewrite_body.inc.php')) { include ($config_dir . '/rewrite_body.inc.php'); } - + echo $text; if ($isquote) { echo ''; @@ -1566,8 +1584,7 @@ function get_newsgroups_by_msgid($msgid, $noarray = false) } $overview_dbh = null; if ($noarray) { - return(implode(",", $groups)); - + return (implode(",", $groups)); } else { return ($groups); }