Пример #1
0
 function delete($id = false)
 {
     if ($id) {
         $rs = new Talk($id);
         $rs->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect($_SERVER['HTTP_REFERER']);
 }
Пример #2
0
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) {
        $u = "";
    } else {
        $u = $user->getUser();
    }
} else {
    $u = "";
}