aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-09-30 15:06:03 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-09-30 15:06:03 +0000
commit4c2e2b83c7b1c60e5fdf5cf82329a7fb3549bd5a (patch)
tree977c2e678ecedcb98f14d6ffb4dfabf7fd6be818 /phpBB
parentb08c54f35eb85d0ccd01c65e1d9460603fc1c076 (diff)
downloadforums-4c2e2b83c7b1c60e5fdf5cf82329a7fb3549bd5a.tar
forums-4c2e2b83c7b1c60e5fdf5cf82329a7fb3549bd5a.tar.gz
forums-4c2e2b83c7b1c60e5fdf5cf82329a7fb3549bd5a.tar.bz2
forums-4c2e2b83c7b1c60e5fdf5cf82329a7fb3549bd5a.tar.xz
forums-4c2e2b83c7b1c60e5fdf5cf82329a7fb3549bd5a.zip
just realizing that it is better to limit the uses of RANGE.
git-svn-id: file:///svn/phpbb/trunk@6420 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/acp/acp_forums.php1
-rw-r--r--phpBB/includes/functions_admin.php31
2 files changed, 6 insertions, 26 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index fe7f14b330..b1a31dc37d 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -361,7 +361,6 @@ class acp_forums
$end = $start + $batch_size;
// Sync all topics in batch mode...
- // topic_moved
sync('topic_approved', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, false);
sync('topic', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, true);
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 27e271dbb7..b346e09a2b 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -1036,7 +1036,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$where_ids = ($where_ids) ? array((int) $where_ids) : array();
}
- if ($mode == 'forum' || $mode == 'topic')
+ if ($mode == 'forum' || $mode == 'topic' || $mode == 'topic_approved')
{
if (!$where_type)
{
@@ -1068,33 +1068,14 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
}
else
{
- if (!$where_type)
+ if (!sizeof($where_ids))
{
- $where_sql = '';
- $where_sql_and = 'WHERE';
- }
- else if ($where_type == 'range')
- {
- // Only check a range of topics/forums. For instance: 'topic_id BETWEEN 1 AND 60'
- $where_sql = 'WHERE (' . $mode{0} . ".$where_ids)";
- $where_sql_and = $where_sql . "\n\tAND";
+ return;
}
- else
- {
- // Do not sync the "global forum"
- $where_ids = array_diff($where_ids, array(0));
-
- if (!sizeof($where_ids))
- {
- // Empty array with IDs. This means that we don't have any work to do. Just return.
- return;
- }
- // Limit the topics/forums we are syncing, use specific topic/forum IDs.
- // $where_type contains the field for the where clause (forum_id, topic_id)
- $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids);
- $where_sql_and = $where_sql . "\n\tAND";
- }
+ // $where_type contains the field for the where clause (forum_id, topic_id)
+ $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids);
+ $where_sql_and = $where_sql . "\n\tAND";
}
switch ($mode)