Пример #1
0
App::loadMod("User");
App::loadMod("Talk");
App::loadMod("Eassy");
$app = new App();
$user = new User();
$talk = new Talk();
$eassy = new Eassy();
if (!$user->isLogin()) {
    redirect("Location: status.php?action=login");
}
if (isset($_GET['action']) || isset($_GET['id'])) {
    if ($_GET['action'] == "delete") {
        if (!$user->str_check($_GET['id'])) {
            redirect("Location: error.php");
        }
        $t = $talk->getTalk($_GET['id']);
        $e = $eassy->getEassy($t['tid']);
        if ($user->getPower() != 0) {
            if ($user->getUser() != $e['author']) {
                redirect("Location: error.php");
            }
        }
        $talk->delete($_GET['id']);
        echo "<script language=\"javascript\">alert('删除成功!');history.back(-1);</script>";
        die;
    }
}
$tid = isset($_GET['tid']) ? $_GET['tid'] : "";
$limit = isset($_GET['page']) ? (intval($_GET['page']) - 1) * 20 : "0";
if ($tid == "") {
    if ($user->getPower() == 0) {