From c05b4ab308aefab2a1b84b7ac67ea8be68620e00 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Mon, 26 Feb 2024 06:02:08 -0700 Subject: [PATCH] Add Message-ID search bar to header. --- Rocksolid_Light/common/header.php | 19 ++++++++--- Rocksolid_Light/rocksolid/article-flat.php | 32 ++++++++++--------- Rocksolid_Light/rocksolid/article.php | 26 +++++++++++++++ .../rslight/overrides.inc.php.dist | 17 +++++++++- 4 files changed, 73 insertions(+), 21 deletions(-) diff --git a/Rocksolid_Light/common/header.php b/Rocksolid_Light/common/header.php index 1bb9ae0..d0bac57 100644 --- a/Rocksolid_Light/common/header.php +++ b/Rocksolid_Light/common/header.php @@ -90,11 +90,8 @@ if (isset($user)) { echo 'login'; } echo ''; -?> - - - -'; +echo ''; include($config_dir.'/fortunes.conf'); @@ -122,6 +119,18 @@ foreach ($menulist as $menu) { echo ''; } echo '

'; + +if($OVERRIDES['disable_msgid_search'] != true) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
Message-ID: '; + echo ' '; + echo '

'; +} + echo ''; if ($unread) { $motd = '
*** You have unread mail. Click Here ***
'; diff --git a/Rocksolid_Light/rocksolid/article-flat.php b/Rocksolid_Light/rocksolid/article-flat.php index 2a69be4..db5b44d 100644 --- a/Rocksolid_Light/rocksolid/article-flat.php +++ b/Rocksolid_Light/rocksolid/article-flat.php @@ -22,22 +22,9 @@ if (isset($_COOKIE['mail_name'])) { $id = $_REQUEST["id"]; $group = _rawurldecode($_REQUEST["group"]); -// Switch to correct section in case group has been moved and link is to old section -$findsection = get_section_by_group($group); -if (trim($findsection) !== $config_name) { - if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') - $link = "https"; - else - $link = "http"; - $link .= "://"; - $link .= $_SERVER['HTTP_HOST']; - $link .= $_SERVER['REQUEST_URI']; - $newurl = preg_replace("|/$config_name/|", "/$findsection/", $link); - header("Location:$newurl"); - die(); -} if (strpos($id, '@') !== false) { if ($CONFIG['article_database'] == '1') { + $id = '<'.trim($id, '<> ').'>'; $database = $spooldir . '/articles-overview.db3'; $articles_dbh = overview_db_open($database); $articles_query = $articles_dbh->prepare('SELECT * FROM overview WHERE msgid=:messageid'); @@ -53,13 +40,28 @@ if (strpos($id, '@') !== false) { } $dbh = null; if ($found) { - $newurl = 'article-flat.php?id=' . $id . '&group=' . $group . '#' . $id; + $newurl = 'article-flat.php?id=' . $id . '&group=' . $row['newsgroup'] . '#' . $id; header("Location: $newurl"); die(); } } } +// Switch to correct section in case group has been moved and link is to old section +$findsection = get_section_by_group($group); +if (($findsection) && trim($findsection) !== $config_name) { + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') + $link = "https"; + else + $link = "http"; + $link .= "://"; + $link .= $_SERVER['HTTP_HOST']; + $link .= $_SERVER['REQUEST_URI']; + $newurl = preg_replace("|/$config_name/|", "/$findsection/", $link); + header("Location:$newurl"); + die(); +} + if (isset($_REQUEST["first"])) $first = $_REQUEST["first"]; diff --git a/Rocksolid_Light/rocksolid/article.php b/Rocksolid_Light/rocksolid/article.php index a0aecda..d6545b2 100644 --- a/Rocksolid_Light/rocksolid/article.php +++ b/Rocksolid_Light/rocksolid/article.php @@ -10,6 +10,32 @@ include "$file_newsportal"; $id = $_REQUEST["id"]; $group = _rawurldecode($_REQUEST["group"]); +if (strpos($id, '@') !== false) { + if ($CONFIG['article_database'] == '1') { + $id = '<'.trim($id, '<> ').'>'; + $database = $spooldir . '/articles-overview.db3'; + $articles_dbh = overview_db_open($database); + $articles_query = $articles_dbh->prepare('SELECT * FROM overview WHERE msgid=:messageid'); + $articles_query->execute([ + 'messageid' => $id + ]); + $found = 0; + while ($row = $articles_query->fetch()) { + $id = $row['number']; + $group = $row['newsgroup']; + $found = 1; + break; + } + $dbh = null; + if ($found) { + $findsection = get_section_by_group($row['newsgroup']); + $newurl = '/' . $findsection . '/article.php?id=' . $id . '&group=' . $row['newsgroup'] . '#' . $id; + header("Location: $newurl"); + die(); + } + } +} + $thread_show["replies"] = true; $thread_show["lastdate"] = false; $thread_show["threadsize"] = false; diff --git a/Rocksolid_Light/rslight/overrides.inc.php.dist b/Rocksolid_Light/rslight/overrides.inc.php.dist index 1cdf597..a23bf12 100644 --- a/Rocksolid_Light/rslight/overrides.inc.php.dist +++ b/Rocksolid_Light/rslight/overrides.inc.php.dist @@ -7,8 +7,23 @@ return [ 'maxarticles_per_run' => 100, 'maxfirstrequest' => 100, + // Disable spoolnews if less than this num in Gb free for spool + 'min_spool_disk_space' => 5, + + // If your remote_server is already filtered, enable this + 'disable_spamassassin_spooling' => true, + // Display short view of headers (only subject, name, date) - 'short_headers' => false, + 'short_headers' => true, + + // Log posts? + 'enable_post_log' => false, + + // Disable name/email spoof option in Configuration + 'disable_change_name' => false, + + // Disable Message-ID search in header + 'disable_msgid_search' => false, // Just leave this here to avoid comma errors 'comma' => true