diff --git a/root/portal/block/announcements.php b/root/portal/block/announcements.php index 37904e58..4582a20d 100644 --- a/root/portal/block/announcements.php +++ b/root/portal/block/announcements.php @@ -95,7 +95,7 @@ $fetch_news = phpbb_fetch_posts($portal_config['portal_global_announcements_foru $str_where = ( strlen($str_where) > 0 ) ? 'AND (forum_id = 0 OR (' . trim(substr($str_where, 0, -4)) . '))' : ''; - $sql = 'SELECT sizeof(topic_id) AS num_topics + $sql = 'SELECT COUNT(topic_id) AS num_topics FROM ' . TOPICS_TABLE . ' WHERE ((topic_type = ' . POST_GLOBAL . ') OR topic_type = ' . POST_ANNOUNCE . ') diff --git a/root/portal/block/news.php b/root/portal/block/news.php index c0188e00..032014c7 100644 --- a/root/portal/block/news.php +++ b/root/portal/block/news.php @@ -93,7 +93,7 @@ $fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_con $topic_type = ($portal_config['portal_show_all_news']) ? '( topic_type <> ' . POST_ANNOUNCE . ' ) AND ( topic_type <> ' . POST_GLOBAL . ')' : 'topic_type = ' . POST_NORMAL; - $sql = 'SELECT sizeof(topic_id) AS num_topics + $sql = 'SELECT COUNT(topic_id) AS num_topics FROM ' . TOPICS_TABLE . ' WHERE ' . $topic_type . ' AND topic_approved = 1 diff --git a/root/portal/block/statistics.php b/root/portal/block/statistics.php index 4ef96f89..eb4e5046 100644 --- a/root/portal/block/statistics.php +++ b/root/portal/block/statistics.php @@ -28,19 +28,19 @@ function get_db_stat($mode) switch( $mode ) { case 'announcementtotal': - $sql = 'SELECT sizeof(distinct t.topic_id) AS announcement_total + $sql = 'SELECT COUNT(distinct t.topic_id) AS announcement_total FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p WHERE t.topic_type = ' . POST_ANNOUNCE . ' AND p.post_id = t.topic_first_post_id'; break; case 'stickytotal': - $sql = 'SELECT sizeof(distinct t.topic_id) AS sticky_total + $sql = 'SELECT COUNT(distinct t.topic_id) AS sticky_total FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p WHERE t.topic_type = ' . POST_STICKY . ' AND p.post_id = t.topic_first_post_id'; break; case 'attachmentstotal': - $sql = 'SELECT sizeof(attach_id) AS attachments_total + $sql = 'SELECT COUNT(attach_id) AS attachments_total FROM ' . ATTACHMENTS_TABLE; break; } diff --git a/root/portal/block/user_menu.php b/root/portal/block/user_menu.php index 2c01e994..d55a2183 100644 --- a/root/portal/block/user_menu.php +++ b/root/portal/block/user_menu.php @@ -26,7 +26,7 @@ if (!defined('IN_PORTAL')) if ($user->data['is_registered']) { // new posts since last visit - $sql = "SELECT sizeof(distinct post_id) as total + $sql = "SELECT COUNT(distinct post_id) as total FROM " . POSTS_TABLE . " WHERE post_time >= " . $user->data['session_last_visit']; $result = $db->sql_query($sql); diff --git a/root/portal/block/whois_online.php b/root/portal/block/whois_online.php index c69d2c78..ae39f3d7 100644 --- a/root/portal/block/whois_online.php +++ b/root/portal/block/whois_online.php @@ -83,7 +83,7 @@ if ($config['load_online'] && $config['load_online_time'] && $display_online_lis { if ($db->sql_layer === 'sqlite') { - $sql = 'SELECT sizeof(session_ip) as num_guests + $sql = 'SELECT COUNT(session_ip) as num_guests FROM ( SELECT DISTINCT s.session_ip FROM ' . SESSIONS_TABLE . ' s @@ -94,7 +94,7 @@ if ($config['load_online'] && $config['load_online_time'] && $display_online_lis } else { - $sql = 'SELECT sizeof(DISTINCT s.session_ip) as num_guests + $sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests FROM ' . SESSIONS_TABLE . ' s WHERE s.session_user_id = ' . ANONYMOUS . ' AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) .