From e5f23dd63fd7d4adae16eb67a54f369de9b90ea2 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Fri, 5 Jul 2024 06:31:17 -0700 Subject: [PATCH] Try to avoid listing threads multiple times in thread view. --- Rocksolid_Light/rocksolid/lib/thread.inc.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Rocksolid_Light/rocksolid/lib/thread.inc.php b/Rocksolid_Light/rocksolid/lib/thread.inc.php index 3da2d94..33721e7 100644 --- a/Rocksolid_Light/rocksolid/lib/thread.inc.php +++ b/Rocksolid_Light/rocksolid/lib/thread.inc.php @@ -893,7 +893,7 @@ function thread_format_lastmessage($c, $group = '') $table = 'articles'; if (is_file($database)) { $dbh = article_db_open($database, $table); - $stmt = $dbh->prepare("SELECT * FROM $table WHERE date=:date ORDER BY date DESC"); + $stmt = $dbh->prepare("SELECT name,date,msgid,number FROM $table WHERE date=:date ORDER BY date DESC"); $stmt->bindParam(':date', $c->date_thread); $stmt->execute(); if ($found = $stmt->fetch()) { @@ -907,7 +907,7 @@ function thread_format_lastmessage($c, $group = '') $database = $spooldir . '/articles-overview.db3'; $table = 'overview'; $dbh = overview_db_open($database, $table); - $stmt = $dbh->prepare("SELECT * FROM $table WHERE newsgroup=:newsgroup AND date=:date ORDER BY date DESC"); + $stmt = $dbh->prepare("SELECT name,date,msgid,number FROM $table WHERE newsgroup=:newsgroup AND date=:date ORDER BY date DESC"); $stmt->bindParam(':newsgroup', $group); $stmt->bindParam(':date', $c->date_thread); $stmt->execute(); @@ -956,6 +956,8 @@ function thread_show_recursive(&$headers, &$liste, $depth, $tree, $group, $artic global $file_article, $thread_maxSubject; global $age_count, $age_time, $age_color, $spooldir; global $frame_article; + global $last_thread; + global $debug_log; $output = ""; if ($thread_treestyle == 3) $output .= "\n