mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-08 01:36:57 +02:00
Ch-ch-ch-changes
- Made us more DB independent by making many queries capability based instead of DB specific - Finished PHP5ifying of the acm_file class, now with some (hopefully) enhancements to its performance - Sped up viewforum considerably (also goes towards mcp_forum) I really hope I didn't explode CVS... git-svn-id: file:///svn/phpbb/trunk@8301 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -146,8 +146,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
||||
$read_tracking_join = $read_tracking_select = '';
|
||||
}
|
||||
|
||||
$sql = "SELECT t.*$read_tracking_select
|
||||
FROM " . TOPICS_TABLE . " t $read_tracking_join
|
||||
$sql = "SELECT t.topic_id
|
||||
FROM " . TOPICS_TABLE . " t
|
||||
WHERE t.forum_id IN($forum_id, 0)
|
||||
" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . "
|
||||
$limit_time_sql
|
||||
@@ -155,10 +155,21 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
||||
$result = $db->sql_query_limit($sql, $topics_per_page, $start);
|
||||
|
||||
$topic_list = $topic_tracking_info = array();
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_list[] = $row['topic_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = "SELECT t.*$read_tracking_select
|
||||
FROM " . TOPICS_TABLE . " t $read_tracking_join
|
||||
WHERE " . $db->sql_in_set('t.topic_id', $topic_list);
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_rows[$row['topic_id']] = $row;
|
||||
$topic_list[] = $row['topic_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
@@ -181,10 +192,12 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($topic_rows as $topic_id => $row)
|
||||
foreach ($topic_list as $topic_id)
|
||||
{
|
||||
$topic_title = '';
|
||||
|
||||
$row = &$topic_rows[$topic_id];
|
||||
|
||||
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
|
||||
|
||||
if ($row['topic_status'] == ITEM_MOVED)
|
||||
|
Reference in New Issue
Block a user