示例#1
0
    $getIntent = htmlspecialchars($_POST["intent"]);
} else {
    $getIntent = null;
}
switch ($getIntent) {
    case "getPosts":
        require_once "../framework2/Walkntrade.php";
        $wt = new Walkntrade();
        header("Content-Type:text/xml");
        $query = htmlspecialchars($_POST["query"]);
        $school = htmlspecialchars($_POST["school"]);
        $category = htmlspecialchars($_POST["cat"]);
        $offset = htmlspecialchars($_POST["offset"]);
        $sort = htmlspecialchars($_POST["sort"]);
        $amount = htmlspecialchars($_POST["amount"]);
        $payload = $wt->getPosts($query, $school, $category, $sort, $offset, $amount);
        break;
    case "getPostByIdentifier":
        require_once "../framework2/Walkntrade.php";
        $wt = new Walkntrade();
        $args = array_keys($_POST);
        $args = split(":", $args[1]);
        $identifier = htmlspecialchars($args[1]);
        $school = htmlspecialchars($args[0]);
        $wt->getPostByIdentifier($identifier, $school);
        break;
    case "getSchools":
        require_once "../framework2/Walkntrade.php";
        $wt = new Walkntrade();
        header("Content-Type:text/xml");
        $query = htmlspecialchars($_POST["query"]);
示例#2
0
} else {
    $getIntent = null;
}
switch ($getIntent) {
    case "getPosts":
        require_once "../framework/Walkntrade.php";
        $wt = new Walkntrade();
        header("Content-Type:text/xml");
        $query = htmlspecialchars($_POST["query"]);
        $school = htmlspecialchars($_POST["school"]);
        $category = htmlspecialchars($_POST["cat"]);
        $offset = htmlspecialchars($_POST["offset"]);
        $sort = htmlspecialchars($_POST["sort"]);
        $amount = htmlspecialchars($_POST["amount"]);
        if (isset($_POST["ellipse"])) {
            echo $wt->getPosts($query, $school, $category, $sort, $offset, $amount, 1);
        } else {
            echo $wt->getPosts($query, $school, $category, $sort, $offset, $amount, 0);
        }
        break;
    case "getPostByIdentifier":
        require_once "../framework/Walkntrade.php";
        $wt = new Walkntrade();
        $args = array_keys($_POST);
        $args = split(":", $args[1]);
        $identifier = htmlspecialchars($args[1]);
        $school = htmlspecialchars($args[0]);
        echo $wt->getPostByIdentifier($identifier, $school);
        break;
    case "getSchools":
        require_once "../framework/Walkntrade.php";