Esempio n. 1
0
$link = pc_db_connect();
$fid = intval($_GET["fid"]);
$query = 'SELECT * FROM filter WHERE fid = ' . $fid . ' LIMIT 1;';
$result = mysql_query($query);
$node = mysql_fetch_array($result);
if (!$node) {
    html_error_quit("文章不存在");
}
if (strtolower($_GET['filter']) == 'n') {
    if ($node[state] == 0 || $node[state] == 2) {
        $query = 'UPDATE filter SET state = 1 WHERE fid = ' . $fid . ' LIMIT 1;';
        mysql_query($query);
        $pc = pc_load_infor($link, "", $node[uid]);
        if ($node[nid]) {
            //过滤的是评论
            $ret = pc_add_comment($link, $pc, $node[nid], $node[emote], $node[username], $node[subject], $node[body], $node[htmltag], true, $node[hostname]);
        } else {
            $ret = pc_add_node($link, $pc, $node[pid], $node[tid], $node[emote], $node[comment], $node[access], $node[htmltag], $node[trackback], $node[theme], $node[subject], $node[body], $node[nodetype], $node[auto_tbp], $node[tbp_url], $node[tbp_art], $node[tbpencoding], true, $node[hostname], $node[publisher]);
        }
        switch ($ret) {
            case -1:
                html_error_quit("缺少日志主题");
                exit;
                break;
            case -2:
                html_error_quit("目录不存在");
                exit;
                break;
            case -3:
                html_error_quit("该目录的日志数已达上限");
                exit;
Esempio n. 2
0
     *
     *   希望使用水木代码的Web站点加上powered by kbs的图标.该图标
     * 位于html/images/poweredby.gif目录,链接指向http://dev.kcn.cn
     * 使用水木代码的站点可以通过dev.kcn.cn获得代码的最新信息.
     *
     */
    powered_by_smth();
    ?>
<p>
<?php 
} else {
    if (!$_POST["subject"]) {
        html_error_quit("请输入评论标题!");
        exit;
    }
    $ret = pc_add_comment($link, $pc, $nid, intval($_POST["emote"]), $currentuser["userid"], $_POST["subject"], html_editorstr_format($_POST["blogbody"]), $_POST["htmltag"] == 1 ? 1 : 0, false);
    switch ($ret) {
        case -6:
            html_error_quit("由于系统原因导致评论失败");
            break;
        case -9:
            echo "<script language=\"javascript\">alert('您的文章可能含有不当词汇,请等待管理员审核。');</script>";
            break;
        default:
    }
    ?>
<script language="javascript">
window.location.href="pccon.php?id=<?php 
    echo $uid;
    ?>
&nid=<?php