示例#1
0
文件: post.php 项目: GHubgenius/qbbj
    }
    $MSG = '续发文章';
    unset($rsdb[content], $rsdb[subhead]);
    require dirname(__FILE__) . "/" . "head.php";
    if ($mid && file_exists(ROOT_PATH . "data/member_tpl/post_{$mid}.htm")) {
        require ROOT_PATH . "data/member_tpl/post_{$mid}.htm";
    } else {
        require dirname(__FILE__) . "/" . "template/post.htm";
    }
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($job == 'edit_more') {
    if ($step == 'post') {
        //修改内容
        query_reply($aid, $rid, 'edit');
        //生成静态
        make_article_html("{$webdb['www_url']}/member/post.php?job=endHTML&aid={$aid}&mid={$mid}&only={$only}");
        refreshto("{$FROMURL}", "<CENTER>[<A HREF='?job=postnew&fid={$fid}&mid={$mid}&only={$only}'>发表新主题</A>] [<A HREF='?job=post_more&aid={$aid}&mid={$mid}&only={$only}'>续发本主题</A>] [<A HREF='myarticle.php?job=myarticle&fid={$fid}&mid={$mid}&only={$only}'>返回文章列表</A>] [<A HREF='..{$webdb['path']}/bencandy.php?fid={$fid}&aid={$aid}' target=_blank>查看文章</A>] [<A HREF='?job=edit_more&aid={$aid}&rid={$rid}&mid={$mid}&only={$only}'>修改文章</A>]</CENTER>", 60);
    }
    $MSG = '修改文章';
    require dirname(__FILE__) . "/" . "head.php";
    if ($mid && file_exists(ROOT_PATH . "data/member_tpl/post_{$mid}.htm")) {
        require ROOT_PATH . "data/member_tpl/post_{$mid}.htm";
    } else {
        require dirname(__FILE__) . "/" . "template/post.htm";
    }
    require dirname(__FILE__) . "/" . "foot.php";
}
/**
*用户组选择
**/
function group_box($name = "postdb[group]", $ckdb = array())
示例#2
0
function do_work($id, $job, $check = 0)
{
    global $db, $pre, $timestamp, $lfjid, $lfjdb, $webdb, $web_admin, $reason, $Fid_db;
    if (!$Fid_db) {
        include ROOT_PATH . "data/all_fid.php";
    }
    if (!$lfjid) {
        showerr("请先登录");
    }
    $erp = get_id_table($id);
    $rsdb = $db->get_one("SELECT A.*,B.admin FROM {$pre}article{$erp} A LEFT JOIN {$pre}sort B ON A.fid=B.fid WHERE A.aid='{$id}' ");
    if ($check == 1) {
        if (!$web_admin && !in_array($lfjid, explode(",", $rsdb[admin]))) {
            showerr("你没权限操作此文:{$rsdb['title']}");
        }
    }
    if ($job == "delete") {
        global $forcedel;
        delete_article($rsdb[aid], '', $forcedel);
        make_article_html('', 'del', $rsdb);
        //静态处理
        $array[title] = "你发表的《{$rsdb[title]}》被删除了";
    } elseif ($job == "move" && $rsdb[yz] != 2) {
        global $fid;
        if ($fid) {
            make_article_html('', 'del', $rsdb);
            //静态处理,要放在前面,不然FID都变了,就没法删除
            $rs = $db->get_one("SELECT name FROM {$pre}sort WHERE fid='{$fid}'");
            $db->query("UPDATE {$pre}article{$erp} SET fid='{$fid}',fname='{$rs['name']}',lastfid='{$rsdb['fid']}' WHERE aid='{$id}' ");
            $db->query("UPDATE {$pre}reply{$erp} SET fid='{$fid}' WHERE aid='{$id}' ");
            $rsdb[mid] && $db->query("UPDATE {$pre}article_content_{$rsdb['mid']} SET fid='{$fid}' WHERE aid='{$id}' ");
            $array[title] = "你发表的《{$rsdb[title]}》被转移栏目了";
        }
    } elseif ($job == "color") {
        global $Color;
        $db->query("UPDATE {$pre}article{$erp} SET titlecolor='{$Color}' WHERE aid='{$id}' ");
        $array[title] = "你发表的《{$rsdb[title]}》被设置标题颜色了";
    } elseif ($job == "yz" && $rsdb[yz] != 2 && $rsdb[yz] != 1) {
        $db->query("UPDATE {$pre}article{$erp} SET yz='1',yzer='{$lfjdb['username']}',yztime='{$timestamp}' WHERE aid='{$id}' ");
        //财富处理
        Give_article_money($rsdb[uid], 'yz', $rsdb);
        $array[title] = "你发表的《{$rsdb[title]}》通过审核了";
    } elseif ($job == "unyz" && $rsdb[yz] != 2 && $rsdb[yz] != 0) {
        $db->query("UPDATE {$pre}article{$erp} SET yz='0',yzer='{$lfjdb['username']}',yztime='{$timestamp}' WHERE aid='{$id}' ");
        //财富处理
        Give_article_money($rsdb[uid], 'unyz', $rsdb);
        make_article_html('', 'del', $rsdb);
        //静态处理
        $array[title] = "你发表的《{$rsdb[title]}》被取消审核了";
    } elseif ($job == "com" && !$rsdb[levels]) {
        global $levels;
        if ($levels < 1) {
            $levels = 1;
        }
        $db->query("UPDATE {$pre}article{$erp} SET levels='{$levels}',levelstime='{$timestamp}' WHERE aid='{$id}' ");
        //财富处理
        Give_article_money($rsdb[uid], 'com', $rsdb);
        $array[title] = "你发表的《{$rsdb[title]}》被推荐了";
    } elseif ($job == "uncom" && $rsdb[levels]) {
        $db->query("UPDATE {$pre}article{$erp} SET levels='0',levelstime='0' WHERE aid='{$id}' ");
        //财富处理
        Give_article_money($rsdb[uid], 'uncom', $rsdb);
        $array[title] = "你发表的《{$rsdb[title]}》被取消推荐了";
    } elseif ($job == "top") {
        global $toptime;
        $times = $timestamp + $toptime;
        $db->query("UPDATE {$pre}article{$erp} SET list='{$times}' WHERE aid='{$id}'");
        $array[title] = "你发表的《{$rsdb[title]}》被置顶了";
    } elseif ($job == "untop") {
        $db->query("UPDATE {$pre}article{$erp} SET list=posttime WHERE aid='{$id}' ");
        $array[title] = "你发表的《{$rsdb[title]}》被取消置顶了";
    } elseif ($job == "front") {
        global $topid;
        if ($topid) {
            $rs = $db->get_one("SELECT list FROM {$pre}article{$erp} WHERE aid='{$topid}' ");
            $list = $rs["list"] + 5;
            $db->query("UPDATE {$pre}article{$erp} SET list='{$list}' WHERE aid='{$id}' ");
        } else {
            $db->query("UPDATE {$pre}article{$erp} SET list='{$timestamp}' WHERE aid='{$id}' ");
        }
        $array[title] = "你发表的《{$rsdb[title]}》被提前显示了";
    } elseif ($job == "bottom") {
        global $bottomid;
        if ($bottomid) {
            $rs = $db->get_one("SELECT list FROM {$pre}article{$erp} WHERE aid='{$bottomid}' ");
            $list = $rs["list"] - 5;
            $db->query("UPDATE {$pre}article{$erp} SET list='{$list}' WHERE aid='{$id}' ");
        } else {
            $db->query("UPDATE {$pre}article{$erp} SET list='0' WHERE aid='{$id}' ");
        }
        $array[title] = "你发表的《{$rsdb[title]}》被沉底了";
    } elseif ($job == 'return') {
        if ($rsdb[yz] == 2) {
            $db->query("UPDATE {$pre}article{$erp} SET yz=1 WHERE aid='{$id}' ");
            $array[title] = "你发表的《{$rsdb[title]}》从回收站还原了";
        }
    } elseif ($job == 'special') {
        global $spid;
        if (!$spid) {
            showerr("请选择一个专题");
        }
        $rssp = $db->get_one(" SELECT * FROM {$pre}special WHERE id='{$spid}' ");
        $detail = explode(",", $rssp[aids]);
        if (!in_array($id, $detail)) {
            if ($rssp[aids]) {
                $rssp[aids] = "{$id},{$rssp['aids']}";
            } else {
                $rssp[aids] = "{$id}";
            }
            $db->query("UPDATE `{$pre}special` SET `aids`='{$rssp['aids']}' WHERE id='{$spid}'");
        }
        $array[title] = "你发表的《{$rsdb[title]}》被设置专题了";
    } elseif ($job == 'fusort') {
        global $fid;
        if (!$fid) {
            showerr("请选择一个辅栏目");
        }
        if (!$db->get_one("SELECT * FROM {$pre}fu_article WHERE fid='{$fid}' AND aid='{$id}'")) {
            $db->query("INSERT INTO {$pre}fu_article SET fid='{$fid}',aid='{$id}'");
        }
        $array[title] = "你发表的《{$rsdb[title]}》被设置辅栏目了";
    }
    //短消息通知
    if ($reason) {
        $array[fromer] = $lfjdb[username];
        $array[fromuid] = $lfjdb[uid];
        $array[touid] = $rsdb[uid];
        $array[content] = $reason;
        pm_msgbox($array);
    }
    //删除缓存文件
    delete_cache_file($rsdb[fid], $rsdb[aid]);
}
示例#3
0
     }
 }
 if ($power == 0) {
     die("ÄãÎÞȨ²Ù×÷");
 }
 if ($step == 2) {
     if ($action == "delete") {
         do_work($id, $action);
         //¾²Ì¬Ò³´¦Àí
         make_article_html("list.php?fid={$rs['fid']}", 'del', $rs);
         refreshto("list.php?fid={$rs['fid']}", "ɾ³ý³É¹¦", 1);
     } elseif ($power == 2) {
         do_work($id, $action);
         //¾²Ì¬Ò³´¦Àí
         if ($action != "com" && $action != "uncom") {
             make_article_html("list.php?fid={$rs['fid']}", '', $rs);
         }
         refreshto("{$FROMURL}", "²Ù×÷³É¹¦", 1);
     }
 } else {
     $rs = $db->get_one("SELECT * FROM {$pre}article{$erp} WHERE aid='{$id}'");
     echo "<A HREF=\"{$webdb['www_url']}/member/post.php?job=postnew&fid={$fid}\">з¢±í</A><br><A HREF=\"{$webdb['www_url']}/member/index.php?main=post.php?job=manage&aid={$id}\">ÐÞ¸Ä</A><br><A HREF=\"{$webdb['www_url']}/do/job.php?job={$job}&act={$act}&step=2&action=delete&id={$id}\" onclick=\"return confirm('ÄãÈ·ÈÏҪɾ³ýÂð?');\">ɾ³ý</A><br>";
     if ($rs[levels] && $power == 2) {
         echo "(ÒÑÍƼö)<A HREF=\"{$webdb['www_url']}/do/job.php?job={$job}&act={$act}&step=2&action=uncom&levels=0&id={$id}\">È¡ÏûÍƼö</A><br>";
     } elseif ($power == 2) {
         echo "(δÍƼö)<A HREF=\"{$webdb['www_url']}/do/job.php?job={$job}&act={$act}&step=2&action=com&levels=1&id={$id}\">ÍƼö</A><br>";
     }
     if ($rs[yz] && $power == 2) {
         echo "(ÒÑÉóºË)<A HREF=\"{$webdb['www_url']}/do/job.php?job={$job}&act={$act}&step=2&action=unyz&yz=0&id={$id}\">È¡ÏûÉóºË</A><br>";
     } elseif ($power == 2) {
         echo "(δÉóºË)<A HREF=\"{$webdb['www_url']}/do/job.php?job={$job}&act={$act}&step=2&action=yz&yz=1&id={$id}\">ÉóºË</A><br>";
示例#4
0
if ($do == 'del') {
    if ($step == 2) {
        refreshto("?job=myarticle&only=1&mid=0", "ɾ³ý³É¹¦<div style='display:none;'><iframe src='{$webdb['www_url']}/do/job.php?job=article_html&fid={$fid}' width=0 height=0></iframe></div>", 2);
    }
    $erp = get_id_table($id);
    $rs = $db->get_one("SELECT * FROM {$pre}article{$erp} WHERE aid='{$id}' AND uid='{$lfjuid}' ");
    if (!$rs) {
        showerr("ÎÄÕ²»´æÔÚ");
    }
    delete_article($id, $rid);
    //¾²Ì¬Ò³´¦Àí
    $aid = $id;
    $fid = $rs[fid];
    $postdb = array('posttime' => $rs['posttime']);
    $fidDB = $db->get_one("SELECT * FROM `{$pre}sort` WHERE fid='{$rs['fid']}' ");
    make_article_html("?do={$do}&step=2&fid={$fid}", 'del');
    refreshto("{$FROMURL}", "ɾ³ý³É¹¦", 0);
}
if ($page < 1) {
    $page = 1;
}
$rows = 20;
$min = ($page - 1) * $rows;
$_sql = "";
if ($fid > 0) {
    $_sql = " AND fid='{$fid}' ";
    $erp = $Fid_db[iftable][$fid];
} elseif ($mid > 0) {
    $_sql = " AND mid='{$mid}' ";
    $erp = $article_moduleDB[$mid][iftable] ? $article_moduleDB[$mid][iftable] : '';
} elseif ($mid == -1) {
示例#5
0
文件: artic.php 项目: GHubgenius/qbbj
    //make_more_article_html("$webdb[admin_url]/index.php?lfj=artic&job=myarticle&fid=$postdb[fid]",'',$aidDB);
    jump("<CENTER>[<A HREF='index.php?lfj=artic&job=addpic&fid={$postdb['fid']}&bak_id={$postdb['bak_id']}'>继续发表新组图</A>] [<A HREF='index.php?lfj=artic&job=myarticle&fid={$postdb['fid']}'>返回文章列表</A>] [<A HREF='{$webdb['www_url']}{$webdb['path']}/bencandy.php?fid={$rs['fid']}&aid={$rs['aid']}' target=_blank>查看文章</A>] [<A HREF='index.php?lfj=post&job=manage&id={$rs['aid']}'>点击修改</A>]</CENTER><div style='display:none;'><iframe src='{$webdb['www_url']}/do/job.php?job=article_html&fid={$rs['fid']}&aid={$rs['aid']}' width=0 height=0></iframe></div>", "index.php?lfj=artic&job=postnew&fid={$postdb['fid']}", 600);
}
if ($action == "delete" && $Apower[artic_listartic]) {
    if (!$aid && $id) {
        $aid = $id;
    }
    $id = $aid;
    $erp = get_id_table($id);
    $rs = $db->get_one("SELECT A.*,B.admin FROM {$pre}article{$erp} A LEFT JOIN {$pre}sort B ON A.fid=B.fid WHERE A.aid='{$id}'");
    if ($rs[uid] != $lfjuid && $lfjdb[groupid] != 3 && $lfjdb[groupid] != 5 && !in_array($lfjid, explode(",", $rs[admin]))) {
        showmsg('你没权限');
    }
    delete_article($id, $rid);
    //静态页处理
    make_article_html("{$FROMURL}", 'del', $rs);
    jump("删除成功", "{$FROMURL}", 1);
} elseif ($job == "listartic" && $Apower[artic_listartic]) {
    if ($only && $mid === '') {
        $listdb[] = array('id' => 0, 'name' => '文章模型');
        $query = $db->query("SELECT * FROM {$pre}article_module ORDER BY list DESC");
        while ($rs = $db->fetch_array($query)) {
            $listdb[] = $rs;
        }
        foreach ($listdb as $key => $rs) {
            $erp = $rs[iftable] ? $rs[iftable] : '';
            @extract($db->get_one("SELECT COUNT(*) AS NUM FROM {$pre}article{$erp} WHERE mid='{$rs['id']}'"));
            $rs[NUM] = intval($NUM);
            $listdb[$key] = $rs;
        }
        require dirname(__FILE__) . "/" . "head.php";
示例#6
0
文件: post.php 项目: GHubgenius/qbbj
        query_reply($aid, '', '');
        //生成静态
        make_article_html("{$webdb['admin_url']}/index.php?lfj={$lfj}&job=endHTML&aid={$aid}&mid={$mid}&only={$only}");
        refreshto("{$FROMURL}", "<CENTER>[<A HREF='?lfj={$lfj}&job=postnew&fid={$fid}&mid={$mid}&only={$only}'>发表新主题</A>] [<A HREF='?lfj={$lfj}&job=post_more&aid={$aid}&mid={$mid}&only={$only}'>续发本主题</A>] [<A HREF='index.php?lfj=artic&job=listartic&fid={$fid}&mid={$mid}&only={$only}'>返回文章列表</A>] [<A HREF='..{$webdb['path']}/bencandy.php?fid={$fid}&aid={$aid}' target=_blank>查看文章</A>] [<A HREF='?lfj={$lfj}&job=manage&aid={$aid}&mid={$mid}&only={$only}'>修改文章</A>]</CENTER>", 60);
    }
    $MSG = '续发文章';
    unset($rsdb[content], $rsdb[subhead]);
    require dirname(__FILE__) . "/" . "head.php";
    if ($mid && file_exists(ROOT_PATH . "data/admin_tpl/post_{$mid}.htm")) {
        require ROOT_PATH . "data/admin_tpl/post_{$mid}.htm";
    } else {
        require dirname(__FILE__) . "/" . "template/post/post.htm";
    }
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($job == 'edit_more' && $Apower[artic_postnew]) {
    if ($step == 'post') {
        //修改内容
        query_reply($aid, $rid, 'edit');
        //生成静态
        make_article_html("{$webdb['admin_url']}/index.php?lfj={$lfj}&job=endHTML&aid={$aid}&mid={$mid}&only={$only}");
        refreshto("{$FROMURL}", "<CENTER>[<A HREF='?lfj={$lfj}&job=postnew&fid={$fid}&mid={$mid}&only={$only}'>发表新主题</A>] [<A HREF='?lfj={$lfj}&job=post_more&aid={$aid}&mid={$mid}&only={$only}'>续发本主题</A>] [<A HREF='index.php?lfj=artic&job=listartic&fid={$fid}&mid={$mid}&only={$only}'>返回文章列表</A>] [<A HREF='..{$webdb['path']}/bencandy.php?fid={$fid}&aid={$aid}' target=_blank>查看文章</A>] [<A HREF='?lfj={$lfj}&job=edit_more&aid={$aid}&rid={$rid}&mid={$mid}&only={$only}'>修改文章</A>]</CENTER>", 60);
    }
    $MSG = '修改文章';
    require dirname(__FILE__) . "/" . "head.php";
    if ($mid && file_exists(ROOT_PATH . "data/admin_tpl/post_{$mid}.htm")) {
        require ROOT_PATH . "data/admin_tpl/post_{$mid}.htm";
    } else {
        require dirname(__FILE__) . "/" . "template/post/post.htm";
    }
    require dirname(__FILE__) . "/" . "foot.php";
}