Add Message-ID search bar to header.

This commit is contained in:
Retro_Guy 2024-02-26 06:02:08 -07:00
parent 1cc18961d9
commit c05b4ab308
4 changed files with 73 additions and 21 deletions

View File

@ -90,11 +90,8 @@ if (isset($user)) {
echo 'login';
}
echo '</a>';
?>
</td>
</tr>
</table>
<?php
echo '</td></tr>';
echo '</table>';
include($config_dir.'/fortunes.conf');
@ -122,6 +119,18 @@ foreach ($menulist as $menu) {
echo '</td>';
}
echo '</tr></table></p><p>';
if($OVERRIDES['disable_msgid_search'] != true) {
echo '<table align="right">';
echo '<form name="form1" method="get" action="article-flat.php">';
echo '<tr>';
echo '<td>Message-ID: ';
echo '<input name="id" type="text" id="id" size="40" maxlength="120">&nbsp;';
echo '<input type="submit" name="Submit" value="Lookup"></form></td>';
echo '</tr>';
echo '</table><br />';
}
echo '<table cellpadding="0" cellspacing="0" class="np_header_bar_small"><tr>';
if ($unread) {
$motd = '<center>*** You have unread mail. <a href="../spoolnews/mail.php">Click Here</a> ***</center>';

View File

@ -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"];

View File

@ -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;

View File

@ -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