List proper group names and lins in overboard.

This commit is contained in:
Retro_Guy 2024-02-02 10:20:37 -07:00
parent a12dc5414d
commit 025f73cd3e
2 changed files with 24 additions and 13 deletions

View File

@ -812,7 +812,7 @@ function groups_show_frames($gruppen)
*/ */
function headerDecode($value) function headerDecode($value)
{ {
$value = preg_replace_callback('/(=\?[^\?]+\?Q\?)([^\?]+)(\?=)/i', function($matches) { $value = preg_replace_callback('/(=\?[^\?]+\?Q\?)([^\?]+)(\?=)/i', function ($matches) {
return $matches[1] . str_replace('_', '=20', $matches[2]) . $matches[3]; return $matches[1] . str_replace('_', '=20', $matches[2]) . $matches[3];
}, $value); }, $value);
return mb_decode_mimeheader($value); return mb_decode_mimeheader($value);
@ -1768,7 +1768,8 @@ function get_poster_name($name)
return ($thisposter); return ($thisposter);
} }
function save_config_value($configfile, $name, $value) { function save_config_value($configfile, $name, $value)
{
$list = file($configfile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $list = file($configfile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$saveconfig = fopen($configfile, 'w+'); $saveconfig = fopen($configfile, 'w+');
foreach ($list as $save) { foreach ($list as $save) {
@ -1978,7 +1979,7 @@ function check_duplicate_msgid($msgid, $group)
$stmt->bindParam(':newsgroup', $group); $stmt->bindParam(':newsgroup', $group);
$stmt->execute(); $stmt->execute();
while ($row = $stmt->fetch()) { while ($row = $stmt->fetch()) {
if($row['msgid'] == $msgid) { if ($row['msgid'] == $msgid) {
$found = true; $found = true;
} }
} }
@ -1992,7 +1993,7 @@ function check_duplicate_msgid($msgid, $group)
$stmt->bindParam(':newsgroup', $group); $stmt->bindParam(':newsgroup', $group);
$stmt->execute(); $stmt->execute();
while ($row = $stmt->fetch()) { while ($row = $stmt->fetch()) {
if($row['msgid'] == $msgid) { if ($row['msgid'] == $msgid) {
$found = true; $found = true;
} }
} }
@ -2149,15 +2150,23 @@ function get_db_data_from_msgid($msgid, $group)
} }
} }
function get_data_from_msgid($msgid) function get_data_from_msgid($msgid, $thisgroup = null)
{ {
global $spooldir; global $spooldir;
$database = $spooldir . '/articles-overview.db3'; $database = $spooldir . '/articles-overview.db3';
$articles_dbh = overview_db_open($database); $articles_dbh = overview_db_open($database);
if ($thisgroup != null) {
$articles_query = $articles_dbh->prepare('SELECT * FROM overview WHERE msgid=:messageid AND newsgroup=:newsgroup');
$articles_query->execute([
'messageid' => $msgid,
'newsgroup' => $thisgroup
]);
} else {
$articles_query = $articles_dbh->prepare('SELECT * FROM overview WHERE msgid=:messageid'); $articles_query = $articles_dbh->prepare('SELECT * FROM overview WHERE msgid=:messageid');
$articles_query->execute([ $articles_query->execute([
'messageid' => $msgid 'messageid' => $msgid
]); ]);
}
$found = 0; $found = 0;
while ($row = $articles_query->fetch()) { while ($row = $articles_query->fetch()) {
$found = 1; $found = 1;
@ -2229,6 +2238,7 @@ function send_admin_message($admin, $from, $subject, $message)
$dbh = null; $dbh = null;
return true; return true;
} }
function delete_message($messageid, $group, $overview_dbh) function delete_message($messageid, $group, $overview_dbh)
{ {
global $logfile, $config_dir, $spooldir, $CONFIG, $webserver_group; global $logfile, $config_dir, $spooldir, $CONFIG, $webserver_group;

View File

@ -57,6 +57,7 @@ if (isset($frames_on) && $frames_on === true) {
} }
if (isset($_GET['thisgroup'])) { if (isset($_GET['thisgroup'])) {
$title .= " - " . _rawurldecode(_rawurldecode($_GET['thisgroup'])) . " - latest messages"; $title .= " - " . _rawurldecode(_rawurldecode($_GET['thisgroup'])) . " - latest messages";
$activegroup = urldecode($_GET['thisgroup']);
} else { } else {
$title .= " - " . $config_name . " - overboard"; $title .= " - " . $config_name . " - overboard";
} }
@ -249,7 +250,7 @@ foreach ($files as $article) {
} else { } else {
$threadref = false; $threadref = false;
} }
$target = get_data_from_msgid($thismsgid); $target = get_data_from_msgid($thismsgid, $activegroup);
if ($target['date'] > time()) { if ($target['date'] > time()) {
continue; continue;
} }