Beispiel #1
0
<?php

if (isset($_GET["antispam"]) and $_GET["antispam"] == "img") {
    PageEngine::runController("ask_antispam");
}
if (isset($_POST["action"]) and $_POST["action"] == "preview") {
    $wiky = new wiky();
    $out = array();
    $out["html"] = $wiky->parse($_POST["text"]);
    echo json_encode($out);
    exit(1);
}
if (isset($_POST["action"]) and $_POST["action"] == "possiblequestions") {
    $db = new SQL(0);
    $rows = $db->cmdrows(0, 'SELECT *,MATCH (title,question,tags) AGAINST ("{0}") as Score FROM questions WHERE MATCH (title,question,tags) AGAINST ("{0}") ORDER BY Score DESC LIMIT 0,10', array($_POST["q"]));
    echo '<div><b>Schon gestellte ähnliche Fragen...</b><ul style="list-style:none;">';
    foreach ($rows as $row) {
        echo '<li><a href="' . Question::PermalinkByData($row["id"], $row["title"]) . '">' . html($row["title"]) . '</a></li>';
    }
    echo '</ul></div>';
    exit(1);
}
if (isset($_POST["action"]) and $_POST["action"] == "save") {
    $db = new SQL(0);
    $j = true;
    $tags = array();
    if (!MyUser::isloggedin()) {
        if (!isset($_POST["antispam"]) or $_POST["antispam"] . "" == "") {
            PageEngine::AddErrorMessage("AnswerNew", "Bitte lesen Sie die Buchstaben unten im Antispam!");
            $j = false;
        }
Beispiel #2
0
            PageEngine::runController("answer_edit", array("id" => $treffer[1] + 0));
            PageEngine::html("page_answer_edit", array("id" => $treffer[1] + 0));
            exit(1);
    }
}
if (preg_match("@^/badges/([0-9]+)/[^\\/]+(/[a-z]+)?\$@", $_SERVER["REQUEST_URIpure"], $treffer)) {
    PageEngine::html("page_badgeprofile", array("badge_id" => $treffer["1"] + 0));
    exit(1);
}
if (preg_match("@^/tags/(.*?)(/[a-z\\/]+)?\$@", $_SERVER["REQUEST_URIpure"], $treffer)) {
    switch (isset($treffer[2]) ? $treffer[2] : "/info") {
        case "/info":
            PageEngine::runController("tags_info", array("id" => $treffer[1]));
            PageEngine::html("page_tags_info", array("id" => $treffer[1]));
            exit(1);
        case "/info/edit":
            if ((!MyUser::isloggedin() or MyUser::getKarmaPoints() < 2500) and !MyUser::hasAdminRight()) {
                PageEngine::html("page_error_karma", array("karma" => 2500));
            }
            PageEngine::runController("tags_infoedit", array("id" => $treffer[1]));
            PageEngine::html("page_tags_infoedit", array("id" => $treffer[1]));
            exit(1);
        case "/synonyms":
            PageEngine::runController("tags_synonyms", array("id" => $treffer[1]));
            PageEngine::html("page_tags_synonyms", array("id" => $treffer[1]));
            exit(1);
    }
}
Observer::Raise("Error_404", array("path" => $_SERVER["REQUEST_URIpure"]));
PageEngine::html("page_404");
exit(1);