Beispiel #1
0
<?php

define("IN_STORYBOT", 1);
require_once "config/config.php";
if (!is_mod(mod_id())) {
    header("Location: index.php");
}
$_GET['sid'] = $db->real_escape_string($_GET['sid']);
if ($_GET['sid'] != "" && $_GET['type'] != "") {
    if ($_GET['type'] == "0") {
        postMedia($_GET['sid']);
        header("Location: mod.php");
    } elseif ($_GET['type'] == "1") {
        rejectImage($_GET['sid']);
        header("Location: mod.php");
    } elseif ($_GET['type'] == "2") {
        reportImage($_GET['sid']);
        header("Location: mod.php");
    } elseif ($_GET['type'] == "-1") {
        if (is_admin(mod_id())) {
            banUser($_GET['sid'], 0);
        }
        header("Location: mod.php");
    } elseif ($_GET['type'] == "-2") {
        if (is_admin(mod_id())) {
            banUser($_GET['sid'], 1);
        }
        header("Location: reports.php");
    } elseif ($_GET['type'] == "-3") {
        if (is_admin(mod_id())) {
            removeReport($_GET['sid']);
$title_error = $media_error = "";
if (isset($_POST["postMedia"])) {
    echo "vajutati nuppu";
    if (empty($_POST["title"])) {
        $title_error = "See väli on kohustuslik";
    } else {
        $title = cleanInput($_POST["title"]);
    }
    if (empty($_POST["media"])) {
        $media_error = "See väli on kohustuslik";
    } else {
        $media = cleanInput($_POST["media"]);
    }
    if ($title_error == "" && $media_error == "") {
        echo "Sisestatud!";
        postMedia($title, $media);
    }
}
function cleanInput($data)
{
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
?>