Beispiel #1
0
    $link = pc_db_connect();
    $pc = pc_load_infor($link, $currentuser["userid"]);
    if (!$pc || !pc_is_admin($currentuser, $pc)) {
        pc_db_close($link);
        html_error_quit("对不起,您要查看的Blog不存在");
        exit;
    }
    pc_html_init("gb2312", $pc["NAME"]);
    $buserid = $_GET["userid"];
    if ($_GET["act"] == "add" && $buserid) {
        $lookupuser = array();
        if (bbs_getuser($buserid, $lookupuser) == 0) {
            echo "<script language=\"javascript\">用户" . $buserid . "不存在!</script>";
        } else {
            $buserid = $lookupuser["userid"];
            if (!pc_in_blacklist($link, $buserid, $pc["UID"])) {
                pc_add_blacklist($link, $buserid, $pc["UID"]);
            }
        }
    }
    if ($_GET["act"] == "del" && $buserid) {
        pc_del_blacklist($link, $buserid, $pc["UID"]);
    }
    $query = "SELECT * FROM blacklist WHERE uid = " . $pc[UID] . ";";
    $result = mysql_query($query, $link);
    $num = mysql_num_rows($result);
    ?>
<br/>
<p align="center">Blog黑名单</p>
<center>
<table cellspacing=0 cellpadding=5 width=90% class=t1 border=0>
Beispiel #2
0
function pc_can_comment($link, $uid)
{
    global $currentuser;
    if ($currentuser["userlevel"] & BBS_PERM_LOGINOK) {
        if (pc_in_blacklist($link, $currentuser["userid"], $uid)) {
            return FALSE;
        } else {
            return TRUE;
        }
    } else {
        return FALSE;
    }
}