Beispiel #1
0
// Forum
$forum_selected = array($def_forums);
$forum_csv = '';
if ($var =& $_REQUEST[$forum_key]) {
    $forum_selected = get_id_ary($var);
    if (in_array($all_forums, $forum_selected)) {
        $forum_selected = array($all_forums);
    }
    $forum_csv = join(',', $forum_selected);
    $url = $forum_csv != $def_forums ? url_arg($url, $forum_key, $forum_csv) : $url;
}
// Topic
$topic_selected = null;
$topic_csv = '';
if ($var =& $_REQUEST[$topic_key]) {
    $topic_selected = get_id_ary($var);
    $topic_csv = join(',', $topic_selected);
    $url = $topic_csv ? url_arg($url, $topic_key, $topic_csv) : $url;
}
// Order
$order_val = 'log_time';
// Sort
$sort_val = $def_sort;
if ($var =& $_REQUEST[$sort_key] and $var != $def_sort) {
    $sort_val = $var == $sort_asc ? $sort_asc : $sort_desc;
    $url = url_arg($url, $sort_key, $sort_val);
}
// Time
$datetime_val = $def_datetime;
$daysback_val = $def_days;
if ($var =& $_REQUEST[$daysback_key] and $var != $def_days) {
<?php

if (!empty($setmodules)) {
    $module['FORUMS']['PRUNE'] = basename(__FILE__);
    return;
}
require './pagestart.php';
$all_forums = -1;
$pruned_total = 0;
$prune_performed = false;
if (isset($_REQUEST['submit'])) {
    if (!($var =& $_REQUEST['f']) or !($f_selected = get_id_ary($var))) {
        bb_die('Forum not selected');
    }
    if (!($var =& $_REQUEST['prunedays']) or !($prunedays = abs(intval($var)))) {
        bb_die($lang['NOT_DAYS']);
    }
    $prunetime = TIMENOW - 86400 * $prunedays;
    $forum_csv = in_array($all_forums, $f_selected) ? $all_forums : join(',', $f_selected);
    $where_sql = $forum_csv != $all_forums ? "WHERE forum_id IN({$forum_csv})" : '';
    $sql = "SELECT forum_id, forum_name FROM " . BB_FORUMS . " {$where_sql}";
    foreach (DB()->fetch_rowset($sql) as $i => $row) {
        $pruned_topics = topic_delete('prune', $row['forum_id'], $prunetime, !empty($_POST['prune_all_topic_types']));
        $pruned_total += $pruned_topics;
        $prune_performed = true;
        $template->assign_block_vars('pruned', array('ROW_CLASS' => !($i % 2) ? 'row1' : 'row2', 'FORUM_NAME' => htmlCHR($row['forum_name']), 'PRUNED_TOPICS' => $pruned_topics));
    }
    if (!$prune_performed) {
        bb_die($lang['NONE_SELECTED']);
    }
    if (!$pruned_total) {
Beispiel #3
0
         case 'newposts':
             $new_val = true;
             break;
     }
 }
 // Forum
 $forum_selected = '';
 if ($var =& $_REQUEST[$forum_key]) {
     $forum_selected = get_id_ary($var);
     if (!in_array($search_all, $forum_selected)) {
         $forum_val = join(',', $forum_selected);
     }
 }
 // Topic
 if ($var =& $_REQUEST[$topic_key]) {
     $topic_val = join(',', get_id_ary($var));
 }
 // Poster id (from requested name or id)
 if ($var = request_var($poster_id_key, 0)) {
     $poster_id_val = (int) $var;
     if ($poster_id_val != $user_id && !get_username($poster_id_val)) {
         bb_die($lang['USER_NOT_EXIST']);
     }
 } else {
     if ($var =& $_POST[$poster_name_key]) {
         $poster_name_sql = str_replace("\\'", "''", clean_username($var));
         if (!($poster_id_val = get_user_id($poster_name_sql))) {
             bb_die($lang['USER_NOT_EXIST']);
         }
     }
 }