function report_clear()
{
    global $db, $db, $ir, $c, $h, $userid;
    if ($ir['user_level'] > 3) {
        die("403");
    }
    $_GET['ID'] = abs((int) $_GET['ID']);
    stafflog_add("Cleared player report ID {$_GET['ID']}");
    $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}");
    print "Report cleared and deleted!<br />\n<a href='staff_users.php?action=reportsview'>&gt; Back</a>";
}
function DeleteLadder()
{
    global $db, $c, $h;
    if (isset($_POST['Ladder'])) {
        $Ladder = $db->fetch_row($db->query(sprintf("SELECT `ladderId`, `ladderName` FROM `battle_ladders` WHERE `ladderId` = '%u'", @intval($_POST['Ladder']))));
        $db->query(sprintf("DELETE FROM `battle_members` WHERE `bmemberLadder`='%u'", $Ladder['ladderId']));
        $db->query(sprintf("DELETE FROM `battle_ladders` WHERE `ladderId`='%u'", $Ladder['ladderId']));
        echo 'Ladder Deleted!<br />
        > <a href="' . $_SERVER['PHP_SELF'] . '?act=DeleteLadder">Delete Another!</a><br />
        > <a href="staff.php">Back To Staff Index</a>';
        stafflog_add('Deleted Battle Ladder (' . $Ladder['ladderName'] . ')');
        $h->endpage();
        exit;
    } else {
        echo '
        
<div class="generalinfo_txt">
<div><img src="images/info_left.jpg" alt="" /></div>
<div class="info_mid"><h2 style="padding-top:10px;"> Delete Battle Ladder</h2></div>
<div><img src="images/info_right.jpg" alt="" /></div> </div>
<div class="generalinfo_simple"><br> <br><br>

        
        
        Deleting A Ladder Is Permanent!<br />
        Any Users On This Battle Ladder Will Be Taken Off.<br /><br />
        <form action="' . $_SERVER['PHP_SELF'] . '?act=DeleteLadder" method="post">
            <table class ="table">
                <tr>
                    <td>Ladder:</td>
                    <td>' . ladder_dropdown('Ladder') . '</td>
                </tr>
                <tr>
                    <th colspan="2"><input type="submit" STYLE="color: black;  background-color: white;" value="Delete Ladder!" /></th>
                </tr>
            </table>

        </form> </div><div><img src="images/generalinfo_btm.jpg" alt="" /></div><br></div></div></div></div></div>
';
    }
}
Example #3
0
function deletopic()
{
    global $db;
    $q = $db->query("SELECT * FROM forum_topics WHERE ft_id={$_GET['topic']}");
    $topic = $db->fetch_row($q);
    $db->query("DELETE FROM forum_topics WHERE ft_id={$_GET['topic']}");
    $db->query("DELETE FROM forum_posts WHERE fp_topic_id={$_GET['topic']}");
    print "Deleting topic... Done<br />";
    recache_forum($topic['ft_forum_id']);
    stafflog_add("Deleted topic {$topic['ft_name']}");
}
function mass_jail()
{
    global $db, $ir, $c, $h, $userid;
    $ids = explode(",", $_POST['ids']);
    foreach ($ids as $id) {
        $re = $db->query("UPDATE users SET fedjail=1 WHERE userid={$id}");
        if ($db->affected_rows()) {
            $db->query("INSERT INTO fedjail VALUES('',{$id},{$_POST['days']},{$userid},'" . mysql_real_escape_string($_POST['reason'], $c) . "')");
        }
        $db->query("INSERT INTO jaillogs VALUES('',{$userid}, {$id}, {$_POST['days']}, '{$_POST['reason']}',unix_timestamp())");
        print "User jailed : {$id}.";
    }
    stafflog_add("Mass jailed IDs {$_POST['ids']}");
}
function admin_gang_edit_delete()
{
    global $db, $ir, $c, $h, $userid;
    if ($ir['user_level'] != 2) {
        die("403");
    }
    $db->query("UPDATE users SET gang=0 WHERE gang={$_POST['gang']}");
    $db->query("DELETE FROM gangs WHERE gangID={$_POST['gang']}");
    stafflog_add("Deleted Gang {$_POST['gang']}");
    print "\n           <div class='generalinfo_txt'>\n<div><img src='images/info_left.jpg' alt='' /></div>\n<div class='info_mid'><h2 style='padding-top:10px;'>Gang Deletion </h2></div>\n<div><img src='images/info_right.jpg' alt='' /></div> </div>\n<div class='generalinfo_simple'><br> <br><br>\n\n            Gang Succesfully Deleted\n</div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>\n\n";
}
    $secondss = $secondss / 60;
    stafflog_add("Deleted score - User({$staffst['userid']}) - Game({$staffst['gameid']}) - Score({$staffst['score']}) - Time({$secondss} min)");
    $db->query("DELETE FROM highscores WHERE id={$_GET['scoid']}");
    print "<font color=red>Score Deleted!</font><br />";
}
$_GET['scoreid'] = abs((int) $_GET['scoreid']);
if ($_GET['scoreid']) {
    if ($ir['user_level'] != 2 && $ir['user_level'] != 3) {
        die;
    }
    $staffst = $db->fetch_row($db->query("SELECT * FROM highscores WHERE id={$_GET['scoreid']}"));
    $secondss = $staffst['endTime'] - $staffst['startTime'];
    $s2 = $secondss % 60;
    $secondss -= $s2;
    $secondss = $secondss / 60;
    stafflog_add("Deleted/Warned score - User({$staffst['userid']}) - Game({$staffst['gameid']}) - Score({$staffst['score']}) - Time({$secondss} min)");
    $uid = $db->fetch_row($db->query("SELECT userid FROM highscores WHERE id={$_GET['scoreid']}"));
    $_POST['userid'] = $uid['userid'];
    $atemp = $db->query("SELECT lastip FROM users WHERE userid={$_POST['userid']}");
    $btemp = $db->fetch_row($atemp);
    $db->query("DELETE FROM highscores WHERE userid={$_POST['userid']}");
    $db->query("INSERT INTO arcadewarn VALUES('',{$_POST['userid']},'{$btemp['lastip']}')");
    $db->query("UPDATE users SET new_mail=new_mail+1 WHERE userid={$_POST['userid']}");
    $msg = "This is a warning for cheating in the arcade. If you get three warnings, you will be banned from the arcade. If you feel you got this in error, feel free to contact an admin.";
    $db->query("INSERT INTO mail VALUES ('',0,0,{$_POST['userid']},unix_timestamp(),'Cheating in the arcade','{$msg}')") or die(mysql_error());
    print "<font color=red>Score deleted and user warned!</font><br />";
}
// Security check
$gameinfo = mysql_fetch_array(mysql_query("SELECT * FROM flash2 WHERE id = '{$gameid}'"));
$stype = $gameinfo['sortmethod'];
if (!$gameinfo[id]) {
function delbot()
{
    global $db, $ir, $c, $h, $userid;
    $_POST['userid'] = abs((int) $_POST['userid']);
    $_POST['delcb'] = abs((int) $_POST['delcb']);
    if ($_POST['userid']) {
        $q = $db->query("SELECT * FROM users WHERE userid={$_POST['userid']}");
        if ($db->num_rows($q) == 0) {
            print "Non-existant user.";
            $h->endpage();
            exit;
        }
        $r = $db->fetch_row($q);
        $q2 = $db->query("SELECT * FROM challengebots WHERE cb_npcid={$r['userid']}");
        if (!$db->num_rows($q2)) {
            print "This user is not a Challenge Bot.";
            $h->endpage();
            exit;
        }
        $r2 = $db->fetch_row($q2);
        $db->query("DELETE FROM challengebots WHERE cb_npcid={$r['userid']}");
        if ($_POST['delcb']) {
            $db->query("DELETE FROM challengesbeaten WHERE npcid={$r['userid']}");
        }
        print "Challenge Bot {$r['username']} removed.";
        stafflog_add("Removed Challenge Bot {$r['username']}");
    } else {
        print "\n\n<div class='generalinfo_txt'>\n<div><img src='images/info_left.jpg' alt='' /></div>\n<div class='info_mid'><h2 style='padding-top:10px;'> Remove Challenge Bot</h2></div>\n<div><img src='images/info_right.jpg' alt='' /></div> </div>\n<div class='generalinfo_simple'><br> <br><br>\n\n<b>NB:</b> This will not delete the user from the game, only remove their entry as a Battle Tent Challenge Bot.<form action='staff_battletent.php?action=delbot' method='post'>\nBot: " . challengebot_dropdown($c, "userid") . "<br />\nDelete challengesbeaten entries for this bot? <input type='radio' name='delcb' value='1' checked='checked' /> Yes <input type='radio' name='delcb' value='0' /> No<br />\n<input type='submit' STYLE='color: black;  background-color: white;' value='Remove Bot' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>";
    }
}
function userlevel()
{
    global $db, $ir, $c, $h, $userid;
    $_GET['level'] = abs((int) $_GET['level']);
    $_GET['ID'] = abs((int) $_GET['ID']);
    $db->query("UPDATE users SET user_level={$_GET['level']} WHERE userid={$_GET['ID']}");
    print "User's level adjusted.";
    stafflog_add("Adjusted user ID {$_GET['ID']}'s staff status.");
}
function newitemtype()
{
    global $db, $ir, $c, $h, $userid;
    if ($ir['user_level'] > 2) {
        die("403");
    }
    if ($_POST['name']) {
        $db->query("INSERT INTO itemtypes VALUES(NULL, '{$_POST['name']}')");
        print "Item Type {$_POST['name']} added.";
        stafflog_add("Added item type {$_POST['name']}");
    } else {
        print "\n\n\n<div class='generalinfo_txt'>\n<div><img src='images/info_left.jpg' alt='' /></div>\n<div class='info_mid'><h2 style='padding-top:10px;'> Add Item Type</h2></div>\n<div><img src='images/info_right.jpg' alt='' /></div> </div>\n<div class='generalinfo_simple'><br> <br><br>\n\n\n<form action='staff_items.php?action=newitemtype' method='post'>\nName: <input type='text' STYLE='color: black;  background-color: white;' name='name' /><br />\n<input type='submit' STYLE='color: black;  background-color: white;' value='Add Item Type' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>";
    }
}