1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

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
This commit is contained in:
Ludovic Arnaud
2003-03-28 00:41:16 +00:00
parent fb5957474b
commit 42ec5e67da
4 changed files with 965 additions and 1054 deletions

View File

@@ -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 =\

View File

@@ -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);
?>