diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-02-26 00:36:02 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-02-26 00:36:02 +0000 |
commit | 108dbfe382cef0669125c93b9598e9c0b5d2d59a (patch) | |
tree | 9ad1adb18acb39f11f33e8017dc3fec6c6ab06c0 /phpBB/develop/merge_post_tables.php | |
parent | 7d01f3202d588bc57b92b9a2dcc6dae8153349c9 (diff) | |
download | forums-108dbfe382cef0669125c93b9598e9c0b5d2d59a.tar forums-108dbfe382cef0669125c93b9598e9c0b5d2d59a.tar.gz forums-108dbfe382cef0669125c93b9598e9c0b5d2d59a.tar.bz2 forums-108dbfe382cef0669125c93b9598e9c0b5d2d59a.tar.xz forums-108dbfe382cef0669125c93b9598e9c0b5d2d59a.zip |
Now, you just knew this was coming didn't you ... come on, admit it, you did ...
git-svn-id: file:///svn/phpbb/trunk@3536 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/develop/merge_post_tables.php')
-rw-r--r-- | phpBB/develop/merge_post_tables.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php index 1a5164e468..eb0cf2986a 100644 --- a/phpBB/develop/merge_post_tables.php +++ b/phpBB/develop/merge_post_tables.php @@ -131,6 +131,8 @@ $topic_count = $post_count = array(); $sql = "SELECT forum_id, COUNT(topic_id) AS topics FROM {$table_prefix}topics GROUP BY forum_id"; +$result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { $topic_count[$row['forum_id']] = $row['topics']; @@ -140,6 +142,8 @@ $db->sql_freeresult($result); $sql = "SELECT forum_id, COUNT(post_id) AS posts FROM {$table_prefix}posts GROUP BY forum_id"; +$result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { $post_count[$row['forum_id']] = $row['posts']; @@ -170,7 +174,7 @@ while ($row = $db->sql_fetchrow($result)) $forum_id = $row['forum_id']; $sql_ary[] = "UPDATE " . $table_prefix . "forums - SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts = " . $post_count[$forum_id] . ", forum_topics = " . $topic_count[$forum_id] . " + SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . " WHERE forum_id = $forum_id"; $sql = "SELECT t.topic_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time |