diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-09-06 00:29:07 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-09-06 00:29:07 +0000 |
commit | ef36331c3e4201f36c3ff76a0d450e11292c2bea (patch) | |
tree | c16a511dc7173edad0e349a95d3c9dd6e0b4e340 /phpBB/includes/functions.php | |
parent | 620e60adbb21fcbae5d330900183f66a32f6a746 (diff) | |
download | forums-ef36331c3e4201f36c3ff76a0d450e11292c2bea.tar forums-ef36331c3e4201f36c3ff76a0d450e11292c2bea.tar.gz forums-ef36331c3e4201f36c3ff76a0d450e11292c2bea.tar.bz2 forums-ef36331c3e4201f36c3ff76a0d450e11292c2bea.tar.xz forums-ef36331c3e4201f36c3ff76a0d450e11292c2bea.zip |
Numerous updates and additions for polling and assorted fixes ... or bugs, whichever they turn out to be
git-svn-id: file:///svn/phpbb/trunk@987 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index cc668e8f3a..4642446a21 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -627,7 +627,15 @@ function sync($type, $id) { message_die(GENERAL_ERROR, "Could not get post count", "Error", __LINE__, __FILE__, $sql); } - $total_posts = ( $row = $db->sql_fetchrow($result) ) ? $row['total'] : 0; + + if( $row = $db->sql_fetchrow($result) ) + { + $total_posts = ($row['total']) ? $row['total'] : 0; + } + else + { + $total_posts = 0; + } $sql = "SELECT COUNT(topic_id) AS total FROM " . TOPICS_TABLE . " @@ -636,7 +644,15 @@ function sync($type, $id) { message_die(GENERAL_ERROR, "Could not get topic count", "Error", __LINE__, __FILE__, $sql); } - $total_topics = ( $row = $db->sql_fetchrow($result) ) ? $row['total'] : 0; + + if( $row = $db->sql_fetchrow($result) ) + { + $total_topics = ($row['total']) ? $row['total'] : 0; + } + else + { + $total_topics = 0; + } $sql = "UPDATE " . FORUMS_TABLE . " SET forum_last_post_id = $last_post, forum_posts = $total_posts, forum_topics = $total_topics @@ -658,7 +674,7 @@ function sync($type, $id) if( $row = $db->sql_fetchrow($result) ) { - $last_post = $row['last_post']; + $last_post = ($row['last_post']) ? $row['last_post'] : 0; } else { @@ -672,7 +688,15 @@ function sync($type, $id) { message_die(GENERAL_ERROR, "Could not get post count", "Error", __LINE__, __FILE__, $sql); } - $total_posts = ( $row = $db->sql_fetchrow($result) ) ? $row['total'] - 1 : 0; + + if( $row = $db->sql_fetchrow($result) ) + { + $total_posts = ($row['total']) ? $row['total'] - 1 : 0; + } + else + { + $total_posts = 0; + } $sql = "UPDATE " . TOPICS_TABLE . " SET topic_replies = $total_posts, topic_last_post_id = $last_post |