|
From: Paul S. O. <ps...@us...> - 2002-02-11 12:34:42
|
Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv28308/admin
Modified Files:
admin_forum_prune.php
Log Message:
Re-arrange a few bits here and there, hopefully remove continuing issues with list array useage
Index: admin_forum_prune.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_forum_prune.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** admin_forum_prune.php 28 Jan 2002 02:36:21 -0000 1.17
--- admin_forum_prune.php 11 Feb 2002 12:34:39 -0000 1.18
***************
*** 20,36 ****
***************************************************************************/
- /***************************************************************************
- * This file is for the setup of the auto_pruning and also will allow for
- * immediate forum pruning as well.
- ***************************************************************************/
- //
- // Warning: Parts of this code were shamelessly stolen verbatim from Paul's
- // work on the Auth admin stuff :) JLH
- //
-
- //
- //First we through in the modules stuff :)
- //
-
if( !empty($setmodules) )
{
--- 20,23 ----
***************
*** 78,84 ****
$forum_sql
ORDER BY c.cat_order ASC, f.forum_order ASC";
! $f_result = $db->sql_query($sql);
! $forum_rows = $db->sql_fetchrowset($f_result);
//
--- 65,78 ----
$forum_sql
ORDER BY c.cat_order ASC, f.forum_order ASC";
! if( !($result = $db->sql_query($sql)) )
! {
! message_die(GENERAL_ERROR, "Couldn't obtain list of forums for pruning", "", __LINE__, __FILE__, $sql);
! }
! $forum_rows = array();
! while( $row = $db->sql_fetchrow($result) )
! {
! $forum_rows[] = $row;
! }
//
***************
*** 90,95 ****
// Convert days to seconds for timestamp functions...
! $prunesecs = $prunedays * 1440 * 60;
! $prunedate = time() - $prunesecs;
$template->set_filenames(array(
--- 84,88 ----
// Convert days to seconds for timestamp functions...
! $prunedate = time() - ( $prunedays * 86400 );
$template->set_filenames(array(
***************
*** 97,117 ****
);
! $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'])
--- 90,105 ----
);
! for($i = 0; $i < count($forum_rows); $i++)
{
! $p_result = prune($forum_rows[$i]['forum_id'], $prunedate);
! sync('forum', $forum_rows[$i]['forum_id']);
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars("prune_results", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
! "FORUM_NAME" => $forum_rows[$i]['forum_name'],
"FORUM_TOPICS" => $p_result['topics'],
"FORUM_POSTS" => $p_result['posts'])
***************
*** 119,124 ****
}
-
$template->assign_vars(array(
"L_FORUM" => $lang['Forum'],
"L_TOPICS_PRUNED" => $lang['Topics_pruned'],
--- 107,112 ----
}
$template->assign_vars(array(
+ "L_FORUM_PRUNE" => $lang['Forum_Prune'],
"L_FORUM" => $lang['Forum'],
"L_TOPICS_PRUNED" => $lang['Topics_pruned'],
***************
*** 142,153 ****
);
! $select_list = "<select name=\"" . POST_FORUM_URL . "\">\n";
! $select_list .= "<option value=\"-1\">" . $lang['All_Forums'] . "</option>\n";
for($i = 0; $i < count($forum_rows); $i++)
{
! $select_list .= "<option value=\"" . $forum_rows[$i]['forum_id'] . "\">" . $forum_rows[$i]['forum_name'] . "</option>\n";
}
! $select_list .= "</select>\n";
//
--- 130,141 ----
);
! $select_list = '<select name="' . POST_FORUM_URL . '">';
! $select_list .= '<option value="-1">' . $lang['All_Forums'] . '</option>';
for($i = 0; $i < count($forum_rows); $i++)
{
! $select_list .= '<option value="' . $forum_rows[$i]['forum_id'] . '">' . $forum_rows[$i]['forum_name'] . '</option>';
}
! $select_list .= '</select>';
//
***************
*** 177,183 ****
$prune_data = $lang['Prune_topics_not_posted'] . " ";
! $prune_data .= "<input type=\"text\" name=\"prunedays\" size=\"4\"> " . $lang['Days'];
! $hidden_input = "<input type=\"hidden\" name=\"" . POST_FORUM_URL . "\" value=\"$forum_id\">";
//
--- 165,171 ----
$prune_data = $lang['Prune_topics_not_posted'] . " ";
! $prune_data .= '<input type="text" name="prunedays" size="4"> ' . $lang['Days'];
! $hidden_input = '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '">';
//
***************
*** 204,206 ****
include('page_footer_admin.'.$phpEx);
! ?>
--- 192,194 ----
include('page_footer_admin.'.$phpEx);
! ?>
\ No newline at end of file
|