Example #1
0
        header("Location: " . THurl . "admin.php?rebuild");
        //f*****g hack >:[
        die;
    }
    header("Location: " . THurl . "admin.php?a=g");
    die;
} elseif ($_GET['t'] == "bl") {
    $db->insertBCW(THbcw_blotter, $_POST['post'], $_POST['postto']);
    $actionstring = "Blotter post";
    writelog($actionstring, "admin");
    header("Location: " . THurl . "admin.php?a=bl");
} elseif ($_GET['t'] == "ble") {
    $blotter = $db->fetchBCW(THbcw_blotter);
    foreach ($blotter as $blot) {
        if ($_POST['del' . $blot['id']]) {
            $db->deleteBCW(THbcw_blotter, $blot['id']);
            $actionstring = "Blotter delete\tid:" . $blot['id'];
            writelog($actionstring, "admin");
        } else {
            $blotter_entry = array('id' => (int) $_POST['id' . $blot['id']], 'text' => $db->escape_string($_POST['post' . $blot['id']]), 'board' => $db->escape_string($_POST['postto' . $blot['id']]));
            $db->updateBCW(THbcw_blotter, $blotter_entry['id'], $blotter_entry['text'], $blotter_entry['board']);
        }
    }
    header("Location: " . THurl . "admin.php?a=bl");
} elseif ($_GET['t'] == "b") {
    //echo '<pre>' . var_export($_POST,true).'</code></pre>';
    if (isset($_POST['boardselect'])) {
        $boardnumber = $db->getboardnumber($_POST['boardselect']);
        if (isset($_POST['delete' . $boardnumber]) && $_POST['delete' . $boardnumber] == TRUE) {
            // Remove associated images
            delimgs($db->fragboard($boardnumber));