'f.id', 'FROM' => 'forums AS f' ); ($hook = get_hook('apr_prune_comply_qr_get_all_forums')) ? eval($hook) : null; $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); $num_forums = $forum_db->num_rows($result); for ($i = 0; $i < $num_forums; ++$i) { $fid = $forum_db->result($result, $i); prune($fid, $_POST['prune_sticky'], $prune_date); sync_forum($fid); } } else { $prune_from = intval($prune_from); prune($prune_from, $_POST['prune_sticky'], $prune_date); sync_forum($prune_from); } delete_orphans(); ($hook = get_hook('apr_prune_pre_redirect')) ? eval($hook) : null; redirect(forum_link($forum_url['admin_prune']), $lang_admin_prune['Prune done'].' '.$lang_admin_common['Redirect']); } $prune_days = intval($_POST['req_prune_days']); if ($prune_days < 0) message($lang_admin_prune['Days to prune message']); $prune_date = time() - ($prune_days * 86400); $prune_from = $_POST['prune_from']; if ($prune_from != 'all') { $prune_from = intval($prune_from); // Fetch the forum name (just for cosmetic reasons) $query = array( 'SELECT' => 'f.forum_name', 'FROM' => 'forums AS f', 'WHERE' => 'f.id='.$prune_from ); ($hook = get_hook('apr_prune_comply_qr_get_forum_name')) ? eval($hook) : null; $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); $forum = forum_htmlencode($forum_db->result($result)); } else $forum = 'all forums'; // Count the number of topics to prune $query = array( 'SELECT' => 'COUNT(t.id)', 'FROM' => 'topics AS t', 'WHERE' => 't.last_post<'.$prune_date.' AND t.moved_to IS NULL' ); if ($prune_from != 'all') $query['WHERE'] .= ' AND t.forum_id='.$prune_from; if (!isset($_POST['prune_sticky'])) $query['WHERE'] .= ' AND t.sticky=0'; ($hook = get_hook('apr_prune_comply_qr_get_topic_count')) ? eval($hook) : null; $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); $num_topics = $forum_db->result($result); if (!$num_topics) message($lang_admin_prune['No days old message']); // Setup breadcrumbs $forum_page['crumbs'] = array( array($forum_config['o_board_title'], forum_link($forum_url['index'])), array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), array($lang_admin_common['Management'], forum_link($forum_url['admin_reports'])), array($lang_admin_prune['Prune topics'], forum_link($forum_url['admin_prune'])), $lang_admin_prune['Confirm prune heading'] ); ($hook = get_hook('apr_prune_comply_pre_header_load')) ? eval($hook) : null; define('FORUM_PAGE_SECTION', 'management'); define('FORUM_PAGE', 'admin-prune'); require FORUM_ROOT.'header.php'; // START SUBST - ob_start(); ($hook = get_hook('apr_prune_comply_output_start')) ? eval($hook) : null; ?>

', $tpl_temp, $tpl_main); ob_end_clean(); // END SUBST - require FORUM_ROOT.'footer.php'; } else { // Setup form $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0; // Setup breadcrumbs $forum_page['crumbs'] = array( array($forum_config['o_board_title'], forum_link($forum_url['index'])), array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), array($lang_admin_common['Management'], forum_link($forum_url['admin_reports'])), array($lang_admin_common['Prune topics'], forum_link($forum_url['admin_prune'])) ); ($hook = get_hook('apr_pre_header_load')) ? eval($hook) : null; define('FORUM_PAGE_SECTION', 'management'); define('FORUM_PAGE', 'admin-prune'); require FORUM_ROOT.'header.php'; // START SUBST - ob_start(); ($hook = get_hook('apr_main_output_start')) ? eval($hook) : null; ?>

'.$lang_admin_common['Required'].'') ?>



', $tpl_temp, $tpl_main); ob_end_clean(); // END SUBST - require FORUM_ROOT.'footer.php'; }