From 9c9c428cd0a11a1b47c209a19915616e7b5f8349 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Thu, 6 Sep 2001 00:44:46 +0000 Subject: [PATCH] Numerous updates and additions for polling and assorted fixes ... or bugs, whichever they turn out to be git-svn-id: file:///svn/phpbb/trunk@989 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_forum_prune.php | 67 ++++++++++++++++--------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/phpBB/admin/admin_forum_prune.php b/phpBB/admin/admin_forum_prune.php index 04fa64c890..b8f4242188 100644 --- a/phpBB/admin/admin_forum_prune.php +++ b/phpBB/admin/admin_forum_prune.php @@ -49,21 +49,14 @@ include($phpbb_root_path . 'includes/prune.php'); // // Get the forum ID for pruning // -if(isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL])) +if( isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]) ) { - $forum_id = (isset($HTTP_POST_VARS[POST_FORUM_URL])) ? $HTTP_POST_VARS[POST_FORUM_URL] : $HTTP_GET_VARS[POST_FORUM_URL]; - if($forum_id == "ALL") - { - $forum_sql = ""; - } - else - { - $forum_sql = "AND forum_id = $forum_id"; - } + $forum_id = ( isset($HTTP_POST_VARS[POST_FORUM_URL]) ) ? $HTTP_POST_VARS[POST_FORUM_URL] : $HTTP_GET_VARS[POST_FORUM_URL]; + $forum_sql = ($forum_id == "ALL") ? "" : "AND forum_id = $forum_id"; } else { - unset($forum_id); + $forum_id = ""; $forum_sql = ""; } // @@ -78,24 +71,12 @@ $f_result = $db->sql_query($sql); $forum_rows = $db->sql_fetchrowset($f_result); -// -// Check for the submit variable. -// -if(isset($HTTP_GET_VARS['submit']) || isset($HTTP_POST_VARS['submit'])) -{ - $submit = (isset($HTTP_POST_VARS['submit'])) ? $HTTP_POST_VARS['submit'] : $HTTP_GET_VARS['submit']; -} -else -{ - unset($submit); -} - // // Check for submit to be equal to Prune. If so then proceed with the pruning. // -if($submit == "Prune") +if( isset($HTTP_POST_VARS['doprune']) ) { - $prunedays = $HTTP_POST_VARS['prunedays']; + $prunedays = ( isset($HTTP_POST_VARS['prunedays']) ) ? $HTTP_POST_VARS['prunedays'] : 0; // Convert days to seconds for timestamp functions... $prunesecs = $prunedays * 1440 * 60; @@ -105,12 +86,20 @@ if($submit == "Prune") "body" => "admin/forum_prune_result_body.tpl") ); + $i = 0; reset($forum_rows); while(list(, $forum_data) = each ($forum_rows)) { $p_result = prune($forum_data['forum_id'], $prunedate); + sync("forum", $forum_data['forum_id']); + + $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; + $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; + $i++; $template->assign_block_vars("prune_results", array( + "ROW_COLOR" => "#" . $row_color, + "ROW_CLASS" => $row_class, "FORUM_NAME" => $forum_data['forum_name'], "FORUM_TOPICS" => $p_result['topics'], "FORUM_POSTS" => $p_result['posts']) @@ -118,7 +107,10 @@ if($submit == "Prune") } $template->assign_vars(array( - "PRUNE_MSG" => "Pruning of forums was successful") + "L_FORUM" => $lang['Forum'], + "L_TOPICS_PRUNED" => $lang['Topics_pruned'], + "L_POSTS_PRUNED" => $lang['Posts_pruned'], + "L_PRUNE_RESULT" => $lang['Prune_success']) ); } else @@ -127,7 +119,7 @@ else // If they haven't selected a forum for pruning yet then // display a select box to use for pruning. // - if(empty($forum_id)) + if( empty($HTTP_GET_VARS[POST_FORUM_URL]) ) { // // Output a selection table if no forum id has been specified. @@ -137,7 +129,7 @@ else ); $select_list = " Days."; + $prune_data = $lang['Prune_topics_not_posted'] . " "; + $prune_data .= " " . $lang['Days']; $hidden_input = ""; @@ -173,8 +171,13 @@ else // Assign the template variables. // $template->assign_vars(array( - "S_FORUMPRUNE_ACTION" => append_sid("admin_forum_prune.$phpEx"), "FORUM_NAME" => $forum_name, + + "L_FORUM_PRUNE" => $lang['Forum_Prune'], + "L_FORUM_PRUNE_EXPLAIN" => $lang['Forum_Prune_explain'], + "L_DO_PRUNE" => $lang['Do_Prune'], + + "S_FORUMPRUNE_ACTION" => append_sid("admin_forum_prune.$phpEx"), "S_PRUNE_DATA" => $prune_data, "S_HIDDEN_VARS" => $hidden_input) );