Beispiel #1
0
 $db = new ThornToolsDBI();
 // Init some stuff
 if (isset($_GET['board'])) {
     $board_folder = trim($_GET['board']);
     //trim the board name from get
 } else {
     $board_folder = "";
 }
 $boardid = 0;
 $boardlink = "";
 $offset = 0;
 $offsetback = 0;
 $offsetfwd = 0;
 $count = 0;
 // We just append this to the end of all the SQL queries/links.  Makes things simpler because we only have to do it once.
 if ($board_folder != "" && $db->getboardnumber($board_folder)) {
     $boardid = $db->getboardnumber($board_folder);
     $boardlink = "&board=" . $board_folder;
 } else {
     $board_folder = "";
     // Clear $board if the getboardnumber call failed
 }
 $count = $db->getpicscount($boardid);
 if (isset($_GET['offset'])) {
     $offset = intval($_GET['offset']);
     if ($offset < 0) {
         $offset = 0;
     }
 }
 $beginning = $count - 40 - $offset;
 if ($beginning < 0) {
Beispiel #2
0
    $sm = sminit("popup.tpl");
    $sm->assign("text", $message);
    $sm->assign("timeout", $timeout);
    $sm->assign("title", "Post reporting form");
    $sm->display("popup.tpl");
    die;
} elseif (strtolower($_POST['report']) == "report2") {
    $message = "what";
    if (!isset($_POST['board']) || $_POST['board'] == "") {
        $message = "No board provided!";
    } else {
        $db = new ThornToolsDBI();
        if ($db->checkban()) {
            THdie("PObanned");
        }
        $board = $db->getboardnumber($_POST['board']);
        // verify that the board is correct
        if ($board == null) {
            $message = "Invalid board provided!";
        } else {
            if ($_POST['post'] <= 0 || isset($_POST['post']) == false) {
                $message = "No valid post to report!";
            } else {
                if (isset($_POST['category'])) {
                    $category = intval($_POST['category']);
                    if ($category > 0 && $category < 4) {
                        if ($db->checkreportpost($_POST['post'], $board) == 0) {
                            $db->reportpost($_POST['post'], $board, $category);
                        }
                        // We'll just tell them they got this far even if
                        // it was invalid for whatever reason.