From db2a73d2f07cd04e787c0b9ecc5533e4895a400b Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 7 Sep 2003 17:16:12 +0000 Subject: okie, using array_merge. :D fixed: admin_prune added: prune topics last viewed at... (only admin_prune ATM) moved: delete_attachments to functions_admin git-svn-id: file:///svn/phpbb/trunk@4482 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_prune.php | 72 +++++++++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 25 deletions(-) (limited to 'phpBB/adm/admin_prune.php') diff --git a/phpBB/adm/admin_prune.php b/phpBB/adm/admin_prune.php index 2663cad24a..5a469f9a64 100644 --- a/phpBB/adm/admin_prune.php +++ b/phpBB/adm/admin_prune.php @@ -1,23 +1,15 @@ acl_get('a_prune')) } // Get the forum ID for pruning -$forum_id = (isset($_REQUEST['f'])) ? array_map('intval', $_REQUEST['f']) : 0; +$forum_id = (isset($_REQUEST['f'])) ? array_map('intval', $_REQUEST['f']) : array(); // Check for submit to be equal to Prune. If so then proceed with the pruning. if (isset($_POST['submit'])) { - $prunedays = (isset($_POST['prunedays'])) ? intval($_POST['prunedays']) : 0; + $prune_posted = (isset($_POST['prune_days'])) ? intval($_POST['prune_days']) : 0; + $prune_viewed = (isset($_POST['prune_vieweddays'])) ? intval($_POST['prune_vieweddays']) : 0; + $prune_all = !$prune_posted && !$prune_viewed; + $prune_flags = 0; $prune_flags += (!empty($_POST['prune_old_polls'])) ? 2 : 0; $prune_flags += (!empty($_POST['prune_announce'])) ? 4 : 0; $prune_flags += (!empty($_POST['prune_sticky'])) ? 8 : 0; // Convert days to seconds for timestamp functions... - $prunedate = time() - ($prunedays * 86400); + $prunedate_posted = time() - ($prune_posted * 86400); + $prunedate_viewed = time() - ($prune_viewed * 86400); adm_page_header($user->lang['PRUNE']); @@ -74,7 +70,7 @@ if (isset($_POST['submit'])) sql_fetchrow($result)) { $prune_ids = array(); + $p_result['topics'] = 0; + $p_result['posts'] = 0; $log_data = ''; do { if ($auth->acl_get('f_list', $row['forum_id'])) { - $p_result = prune($row['forum_id'], $prunedate, $prune_flags, FALSE); + if ($prune_all) + { + $p_result = prune($row['forum_id'], 'posted', time(), $prune_flags, false); + } + else + { + if ($prune_posted) + { + $return = prune($row['forum_id'], 'posted', $prunedate_posted, $prune_flags, false); + $p_result['topics'] += $return['topics']; + $p_result['posts'] += $return['posts']; + } + if ($prune_viewed) + { + $return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false); + $p_result['topics'] += $return['topics']; + $p_result['posts'] += $return['posts']; + } + } + + $prune_ids[] = $row['forum_id']; $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; @@ -207,6 +225,10 @@ else lang['PRUNE_NOT_POSTED']; ?> + + lang['PRUNE_NOT_VIEWED']; ?> + + lang['PRUNE_OLD_POLLS'] ?>:
lang['PRUNE_OLD_POLLS_EXPLAIN']; ?> lang['YES']; ?>   lang['NO']; ?> @@ -220,7 +242,7 @@ else lang['YES']; ?>   lang['NO']; ?> - + -- cgit v1.2.1