From e65c5f562ee5af4f4bf11f51557a66b706e80222 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 19 Jun 2008 03:58:19 +0000 Subject: [PATCH] svn path=/trunk/boinc/; revision=15434 --- html/inc/forum_db.inc | 2 +- html/ops/forum_repair.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/html/inc/forum_db.inc b/html/inc/forum_db.inc index f0143a8201..d794148bee 100644 --- a/html/inc/forum_db.inc +++ b/html/inc/forum_db.inc @@ -58,7 +58,7 @@ class BoincThread { $db = BoincDb::get(); return $db->update($this, 'thread', $clause); } - static function enum($clause) { + static function enum($clause="") { $db = BoincDb::get(); return $db->enum('thread', 'BoincThread', $clause); } diff --git a/html/ops/forum_repair.php b/html/ops/forum_repair.php index 31f20f652c..f5a06ad27f 100644 --- a/html/ops/forum_repair.php +++ b/html/ops/forum_repair.php @@ -4,6 +4,8 @@ // due to bugs and DB gremlins. // This script repairs some of them. +ini_set("memory_limit", "1024M"); + require_once("../inc/forum_db.inc"); function update_thread_timestamps() { @@ -36,7 +38,7 @@ function update_user_posts() { function update_thread_replies() { $threads = BoincThread::enum(); foreach ($threads as $t) { - $n = BoincPost::count("thread=$t->id"); + $n = BoincPost::count("thread=$t->id and hidden=0"); $n--; if ($t->replies != $n) { $t->update("replies=$n");