aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_admin.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-09-30 14:58:05 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-09-30 14:58:05 +0000
commitb08c54f35eb85d0ccd01c65e1d9460603fc1c076 (patch)
tree252d8a70ca5e3b84eb590c404a2fe7df16653972 /phpBB/includes/functions_admin.php
parente4fc191e0dba2f18dd046451f1a95e4fb9e76a88 (diff)
downloadforums-b08c54f35eb85d0ccd01c65e1d9460603fc1c076.tar
forums-b08c54f35eb85d0ccd01c65e1d9460603fc1c076.tar.gz
forums-b08c54f35eb85d0ccd01c65e1d9460603fc1c076.tar.bz2
forums-b08c54f35eb85d0ccd01c65e1d9460603fc1c076.tar.xz
forums-b08c54f35eb85d0ccd01c65e1d9460603fc1c076.zip
- fixing a bug i am unsure about when it occurs (but it occurs). The symptoms are broken template cache files if after removing unnecessary php opening/closing tags result in statements being syntactially incorrect.
- added real syncing to forums acp (not only forum statistics rebuild) git-svn-id: file:///svn/phpbb/trunk@6419 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r--phpBB/includes/functions_admin.php31
1 files changed, 25 insertions, 6 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 7ce428a2b7..27e271dbb7 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -1068,14 +1068,33 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
}
else
{
- if (!sizeof($where_ids))
+ if (!$where_type)
{
- return;
+ $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";
}
+ else
+ {
+ // Do not sync the "global forum"
+ $where_ids = array_diff($where_ids, array(0));
- // $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";
+ 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";
+ }
}
switch ($mode)
@@ -1129,7 +1148,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$where_sql_and t.topic_first_post_id = p.post_id";
$db->sql_query($sql);
break;
-
+
default:
$sql = 'SELECT t.topic_id, p.post_approved
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p