svn path=/trunk/boinc/; revision=15434

This commit is contained in:
David Anderson 2008-06-19 03:58:19 +00:00
parent 13319d65f8
commit e65c5f562e
2 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class BoincThread {
$db = BoincDb::get(); $db = BoincDb::get();
return $db->update($this, 'thread', $clause); return $db->update($this, 'thread', $clause);
} }
static function enum($clause) { static function enum($clause="") {
$db = BoincDb::get(); $db = BoincDb::get();
return $db->enum('thread', 'BoincThread', $clause); return $db->enum('thread', 'BoincThread', $clause);
} }

View File

@ -4,6 +4,8 @@
// due to bugs and DB gremlins. // due to bugs and DB gremlins.
// This script repairs some of them. // This script repairs some of them.
ini_set("memory_limit", "1024M");
require_once("../inc/forum_db.inc"); require_once("../inc/forum_db.inc");
function update_thread_timestamps() { function update_thread_timestamps() {
@ -36,7 +38,7 @@ function update_user_posts() {
function update_thread_replies() { function update_thread_replies() {
$threads = BoincThread::enum(); $threads = BoincThread::enum();
foreach ($threads as $t) { foreach ($threads as $t) {
$n = BoincPost::count("thread=$t->id"); $n = BoincPost::count("thread=$t->id and hidden=0");
$n--; $n--;
if ($t->replies != $n) { if ($t->replies != $n) {
$t->update("replies=$n"); $t->update("replies=$n");