aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm
diff options
context:
space:
mode:
authorLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2003-03-28 00:41:16 +0000
committerLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2003-03-28 00:41:16 +0000
commit42ec5e67da2b91d3230e61f7ca12bcb619af38f9 (patch)
tree5cb86f36cc3f0723ada1ab3699b343b18d9c1791 /phpBB/adm
parentfb5957474b8bdb29bf77c3d89ec3d30fcbfc7035 (diff)
downloadforums-42ec5e67da2b91d3230e61f7ca12bcb619af38f9.tar
forums-42ec5e67da2b91d3230e61f7ca12bcb619af38f9.tar.gz
forums-42ec5e67da2b91d3230e61f7ca12bcb619af38f9.tar.bz2
forums-42ec5e67da2b91d3230e61f7ca12bcb619af38f9.tar.xz
forums-42ec5e67da2b91d3230e61f7ca12bcb619af38f9.zip
MCP: resync() function deemed stable enough to replace sync() in functions_admin.php. I will keep extensively testing it though...
Pruning: now works as expected. git-svn-id: file:///svn/phpbb/trunk@3737 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm')
-rw-r--r--phpBB/adm/admin_forums.php4
-rw-r--r--phpBB/adm/admin_prune.php36
2 files changed, 17 insertions, 23 deletions
diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php
index 84e99eb4c1..3b61263482 100644
--- a/phpBB/adm/admin_forums.php
+++ b/phpBB/adm/admin_forums.php
@@ -377,7 +377,7 @@ switch ($mode)
break;
case 'sync':
- sync('forum', intval($_GET['this_f']));
+ sync('forum', 'forum_id', intval($_GET['this_f']));
break;
case 'add':
@@ -973,7 +973,7 @@ function move_forum_content($from_id, $to_id)
{
$db->sql_query('DELETE FROM ' . TOPICS_TABLE . ' WHERE topic_id IN (' . implode(', ', $topic_ids) . ')');
}
- sync('forum', $to_id);
+ sync('forum', 'forum_id', $to_id);
//
// TODO: there might be conflicts in ACL tables =\
diff --git a/phpBB/adm/admin_prune.php b/phpBB/adm/admin_prune.php
index 5b0f5c48c9..a672acff16 100644
--- a/phpBB/adm/admin_prune.php
+++ b/phpBB/adm/admin_prune.php
@@ -44,17 +44,7 @@ if (!$auth->acl_get('a_prune'))
}
// Get the forum ID for pruning
-if (isset($_REQUEST['f']))
-{
- $forum_id = intval($_REQUEST['f']);
- $forum_sql = ($forum_id == -1) ? '' : "AND forum_id = $forum_id";
-}
-else
-{
- $forum_id = '';
- $forum_sql = '';
-}
-
+$forum_id = (isset($_REQUEST['f'])) ? intval($_REQUEST['f']) : -1;
// Check for submit to be equal to Prune. If so then proceed with the pruning.
if (isset($_POST['doprune']))
@@ -81,19 +71,21 @@ if (isset($_POST['doprune']))
<?php
// Get a list of forum's or the data for the forum that we are pruning.
- $sql = "SELECT forum_id, forum_name
- FROM " . FORUMS_TABLE . "
- ORDER BY left_id ASC";
+ // NOTE: this query will conceal all forum names, even those the user isn't authed for
+ $sql = 'SELECT forum_id, forum_name
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_postable = 1' . (($forum_id) ? ' AND forum_id = ' . $forum_id : '') . '
+ ORDER BY left_id ASC';
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
+ $prune_ids = array();
$log_data = '';
do
{
- $p_result = prune($forum_rows[$i]['forum_id'], $prunedate);
- sync('forum', $forum_rows[$i]['forum_id']);
-
+ $prune_ids[] = $row['forum_id'];
+ $p_result = prune($row['forum_id'], $prunedate, FALSE);
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
?>
@@ -104,12 +96,14 @@ if (isset($_POST['doprune']))
</tr>
<?php
- $log_data .= (($log_data != '') ? ', ' : '') . $forum_rows[$i]['forum_name'];
+ $log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name'];
}
- while($row = $db->sql_fetchrow($result));
+ while ($row = $db->sql_fetchrow($result));
add_log('admin', 'log_prune', $log_data);
+ // Sync all pruned forums at once
+ sync('forum', 'forum_id', $prune_ids, TRUE);
}
else
{
@@ -146,11 +140,11 @@ page_header($user->lang['PRUNE']);
// If they haven't selected a forum for pruning yet then
// display a select box to use for pruning.
-if (empty($forum_id))
+if ($forum_id == -1)
{
// Output a selection table if no forum id has been specified.
- $select_list = '<option value="-1">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select(false, false, false);
+ $select_list = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select(false, false, false);
?>