예제 #1
0
파일: pcdoc.php 프로젝트: bianle/www2
}
if (isset($_GET["tid"])) {
    $tid = intval($_GET["tid"]);
} else {
    $tid = 0;
}
$link = pc_db_connect();
$pc = pc_load_infor($link, $userid);
if (!$pc) {
    pc_db_close($link);
    html_init("gb2312", "Blog");
    html_error_quit("对不起,您要查看的Blog不存在");
    exit;
}
$f_err = "";
if (pc_is_admin($currentuser, $pc) && $loginok == 1) {
    if (isset($_GET["act"])) {
        if ($_GET["act"] == "addfriend") {
            $f_err = add_friend($pc);
        }
        if ($_GET["act"] == "delfriend") {
            del_friend($pc);
        }
    }
}
$isfriend = pc_is_friend($currentuser["userid"], $pc["USER"]);
$userPermission = pc_get_user_permission($currentuser, $pc);
$sec = $userPermission["sec"];
$pur = $userPermission["pur"];
$tags = $userPermission["tags"];
$secnum = count($sec);
예제 #2
0
파일: pcblist.php 프로젝트: bianle/www2
/*
**  blog黑名单
**  windinsn Mar 5 , 2004
*/
require "pcfuncs.php";
if ($loginok != 1) {
    html_nologin();
} elseif (!strcmp($currentuser["userid"], "guest")) {
    html_init("gb2312");
    html_error_quit("guest 没有Blog!");
    exit;
} else {
    $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"]);
            }
예제 #3
0
파일: pcfuncs.php 프로젝트: bianle/www2
function pc_get_user_permission($currentuser, $pc)
{
    global $loginok;
    if ($pc['USER'] == '_filter' && pc_is_manager($currentuser)) {
        $sec = array(0 => "待处理", 1 => "已通过", 2 => "未通过", 4 => "被删除");
        $pur = 1;
        $tags = array(1, 1, 1, 0, 1, 0, 0, 0);
    } elseif (pc_is_groupwork($pc)) {
        if (pc_is_admin($currentuser, $pc) && $loginok == 1) {
            $sec = array(0 => "俱乐部", 1 => "会议室", 4 => "备份中心", 6 => "栏目管理", 7 => "参数设定");
            $pur = 3;
            $tags = array(1, 1, 0, 0, 1, 0, 1, 1);
        } else {
            $sec = array(0 => "俱乐部");
            $pur = 0;
            $tags = array(1, 0, 0, 0, 0, 0, 0, 0);
        }
    } elseif (pc_is_admin($currentuser, $pc) && $loginok == 1) {
        $sec = array("公开区", "好友区", "私人区", "收藏区", "删除区", "设定好友", "分类管理", "参数设定");
        $pur = 3;
        $tags = array(1, 1, 1, 1, 1, 1, 1, 1);
    } elseif (pc_is_friend($currentuser["userid"], $pc["USER"]) || pc_is_manager($currentuser)) {
        $sec = array("公开区", "好友区");
        $pur = 1;
        $tags = array(1, 1, 0, 0, 0, 0, 0, 0);
        if ($pc["FAVMODE"] == 1 || $pc["FAVMODE"] == 2) {
            $sec[3] = "收藏区";
            $tags[3] = 1;
        }
    } else {
        $sec = array("公开区");
        $pur = 0;
        $tags = array(1, 0, 0, 0, 0, 0, 0, 0);
        if ($pc["FAVMODE"] == 2) {
            $sec[3] = "收藏区";
            $tags[3] = 1;
        }
    }
    return array("tags" => $tags, "pur" => $pur, "sec" => $sec);
}