Пример #1
0
 $prev_filter_number = '';
 $prev_filter_ip = '';
 $smarty->assign('show_control', is_admin() || is_mod());
 $smarty->assign('boards', $boards);
 $smarty->assign('is_admin', $is_admin);
 $smarty->assign('ATTACHMENT_TYPE_FILE', Config::ATTACHMENT_TYPE_FILE);
 $smarty->assign('ATTACHMENT_TYPE_LINK', Config::ATTACHMENT_TYPE_LINK);
 $smarty->assign('ATTACHMENT_TYPE_VIDEO', Config::ATTACHMENT_TYPE_VIDEO);
 $smarty->assign('ATTACHMENT_TYPE_IMAGE', Config::ATTACHMENT_TYPE_IMAGE);
 if ($do_action && isset($_REQUEST['marked'])) {
     // Check add post id's.
     for ($i = 0; $i < count($_REQUEST['marked']); $i++) {
         $_REQUEST['marked'][$i] = posts_check_id($_REQUEST['marked'][$i]);
     }
     // Now post id's are safe. Get post by it's id's.
     $posts = posts_get_by_ids($_REQUEST['marked']);
     // Do action for each marked post.
     foreach ($posts as $post) {
         // Ban poster.
         switch ($a['ban_type']) {
             case 'simple':
                 // Ban for 1 hour by default.
                 bans_add($post['ip'], $post['ip'], 'Banned via Moderator\\\'s Main Script.', date(Config::DATETIME_FORMAT, time() + 60 * 60));
                 break;
             case 'hard':
                 hard_ban_add($post['ip'], $post['ip']);
                 break;
         }
         // Delete posts or attachments.
         switch ($a['del_type']) {
             case 'post':
Пример #2
0
 $smarty->assign('is_admin', is_admin());
 $smarty->assign('ATTACHMENT_TYPE_FILE', Config::ATTACHMENT_TYPE_FILE);
 $smarty->assign('ATTACHMENT_TYPE_LINK', Config::ATTACHMENT_TYPE_LINK);
 $smarty->assign('ATTACHMENT_TYPE_VIDEO', Config::ATTACHMENT_TYPE_VIDEO);
 $smarty->assign('ATTACHMENT_TYPE_IMAGE', Config::ATTACHMENT_TYPE_IMAGE);
 // Dirty work.
 if (isset($_GET['filter'])) {
     $_POST['filter'] = 1;
     $_POST['filter_board'] = $_GET['bf'];
 }
 // Action on marked posts.
 if (isset($_POST['action']) && isset($_POST['ban_type']) && isset($_POST['del_type']) && isset($_POST['report_act']) && isset($_POST['marked']) && is_array($_POST['marked']) && ($_POST['ban_type'] != 'none' || $_POST['del_type'] != 'none' || $_POST['report_act'])) {
     for ($i = 0; $i < count($_POST['marked']); $i++) {
         $_POST['marked'][$i] = posts_check_id($_POST['marked'][$i]);
     }
     $posts = posts_get_by_ids($_POST['marked']);
     foreach ($posts as $post) {
         if ($_POST['report_act']) {
             reports_delete($post['id']);
         }
         // Ban poster?
         switch ($_POST['ban_type']) {
             case 'simple':
                 // Ban for 1 hour by default.
                 bans_add($post['ip'], $post['ip'], '', date('Y-m-d H:i:s', time() + 60 * 60));
                 break;
             case 'hard':
                 hard_ban_add($post['ip'], $post['ip']);
                 break;
         }
         // Remove post(s) or attachment?