function display_recommend_topic($link, $topic) { global $pcconfig, $users, $colors; $nodes = array(); if (!getRecommendNodesByTopic($link, $topic, $nodes)) { return; } ?> <tbody> <tr> <td bgcolor="#999999" height="3"> </td> </tr> <tr> <td> <table class="table2" width="100%" cellspacing="0" cellpadding="3" > <tr> <td class="td3" bgcolor="<?php echo $colors[rand(0, sizeof($colors) - 1)]; ?> " align="left"><b><a href="pcsec.php?sec=<?php echo $topic; ?> "><font color="white"><?php echo $pcconfig["SECTION"][$topic]; ?> </font></a></b></td> </tr> <tr> <td align="left" class="td3"> <table width="100%"> <?php foreach ($nodes as $node) { if (!$users[$node[uid]]) { $users[$node[uid]] = pc_load_infor($link, '', $node[uid]); } echo '<tr><td align="left">[<a href="index.php?id=' . $users[$node['uid']]['USER'] . '"><font class="low2">' . $users[$node[uid]]['NAME'] . '</font></a>] ' . '<a href="pccon.php?id=' . $node[uid] . '&nid=' . $node[nid] . '&s=all">' . html_format($node[subject]) . '</a> (<a href="/bbsqry.php?userid=' . $users[$node[uid]]['USER'] . '">' . $users[$node[uid]]['USER'] . '</a>)</td>' . '<td align="right"><a href="/bbsqry.php?userid=' . $node[recuser] . '"><font class="low">' . $node[recuser] . '</a> 推荐</font></td></tr>'; } ?> </table> <table width="100%"><tr><td align="right"><a href="pcreclist.php?topic=<?php echo $topic; ?> ">更多推荐文章</a></td></tr></table> </td> </tr> </table> </td> </tr> </tbody> <?php }
<?php /* ** 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"]);
<?php require "pcfuncs.php"; $userid = addslashes($_GET["id"]); $uid = (int) $_GET["id"]; $link = pc_db_connect(); $pc = pc_load_infor($link, $userid, $uid); if (!$pc) { pc_db_close($link); html_init("gb2312", $pcconfig["BBSNAME"] . "Blog"); html_error_quit("对不起,您要查看的Blog不存在"); exit; } $query = "SELECT nodexsl , stylesheet FROM userstyle WHERE uid = " . $pc["UID"] . " LIMIT 0 , 1;"; $result = mysql_query($query, $link); $rows = mysql_fetch_array($result); mysql_free_result($result); pc_db_close($link); if (!$rows) { html_init("gb2312", $pcconfig["BBSNAME"] . "Blog"); html_error_quit("对不起,您要查看的用户尚未设定自定义XSL文件"); exit; } if ($rows[stylesheet] == 1) { header("Content-Type: text/css"); header("Content-Disposition: inline;filename=SMTHBlog_" . $pc["USER"] . ".css"); } else { header("Content-Type: text/xml"); header("Content-Disposition: inline;filename=SMTHBlog_" . $pc["USER"] . ".xsl"); } echo stripslashes($rows[nodexsl]);
pc_check_referer(); if (isset($_GET['fid'])) { $fid = intval($_GET['fid']); } else { html_error_quit("错误的参数"); } $link = pc_db_connect(); if (!($f = new UserFile($fid))) { html_error_quit("文件不存在"); } if (!$f->fid || $f->type != 0) { html_error_quit("文件不存在"); } if ($pcconfig["USERFILEPERM"]) { if ($f->access != 0) { $pc = pc_load_infor($link, '', $f->uid); if (!$pc) { html_error_quit("文件不存在"); } if ($f->access == 2) { if (!pc_is_admin($currentuser, $pc)) { html_error_quit("文件不存在"); } } if ($f->access == 1) { if (!pc_is_friend($currentuser["userid"], $pc["USER"])) { html_error_quit("文件不存在"); } } } }
function pcmain_blog_recommend_nodes() { global $pcconfig, $link; $nodes = getRecommendNodes($link, _PCMAIN_REC_NODES_); $num = count($nodes); ?> <table cellspacing=0 cellpadding=3 width=98%> <tr><td style="line-height:16px " align="left" width="50%"><ul> <?php for ($i = 0; $i < $num; $i++) { if ($i == intval($num / 2)) { echo "</td><td align=\"left\" style=\"line-height:16px\" width=\"50%\">"; } $rows = $nodes[$i]; $pcinfor = pc_load_infor($link, "", $rows["uid"]); echo "<li><a href=\"pccon.php?id=" . $rows["uid"] . "&nid=" . $rows["nid"] . "&s=all\">"; $subject = "<span title=\"" . html_format($rows["subject"]) . "\">" . html_format(substr($rows["subject"], 0, 20)); if (strlen($rows["subject"]) > 20) { $subject .= "..."; } $subject .= "</span>"; echo $subject . "</a>\n <a href=\"index.php?id=" . $pcinfor["USER"] . "\">"; //echo "<font class=low>".$pcinfor[NAME]."</font></a> <a href=\"/bbsqry.php?userid=".$pcinfor["USER"]."\">"; echo "<font class=low2>" . $pcinfor["USER"] . "</font></a>"; echo "</li>\n"; } ?> </ul></td> </tr> </table> <?php }
$newtype = 1; } if (!$_GET["isgroup"] && !pc_is_groupwork($pcc)) { $newtype--; } $query = "UPDATE users SET createtime = createtime , pctype = " . $newtype . " WHERE uid = " . $pcc["UID"] . " LIMIT 1;"; mysql_query($query, $link); if ($_GET["isgroup"] && !pc_is_groupwork($pcc)) { pc_convertto_group($link, $pcc); } $action = "调整 " . $pcc["USER"] . " 的BLOG参数(N:" . $newtype . ";O:" . $pcc["TYPE"] . ")"; pc_logs($link, $action, "", $pcc["USER"]); unset($_GET["userid"]); } if ($_GET["userid"]) { $pcc = pc_load_infor($link, $_GET["userid"]); if (!$pcc) { html_error_quit($_GET["userid"] . "尚无BLOG"); exit; } ?> <form action="<?php echo $_SERVER["PHP_SELF"]; ?> " method="get"> <input type="hidden" name="conv" value="1"> 处理的用户名:<input type="text" name="userid" value="<?php echo $pcc["USER"]; ?> "><br />
require "pcadmin_inc.php"; pc_admin_check_permission(); $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;
<?php /* ** some comments actions in personal corp. ** @id:windinsn Nov 19,2003 */ require "pcfuncs.php"; $nid = (int) $_GET["nid"]; $act = $_GET["act"]; @($cid = (int) $_GET["cid"]); $link = pc_db_connect(); $query = "SELECT `access`,`uid` FROM nodes WHERE `nid` = '" . $nid . "' AND `type` != '1' AND `comment` != '0';"; $result = mysql_query($query, $link); $rows = mysql_fetch_array($result); mysql_free_result($result); $pc = pc_load_infor($link, "", $rows["uid"]); if (!$pc) { html_error_quit("对不起,您要查看的Blog不存在"); exit; } if (!$pc["ANONYCOMMENT"]) { if ($loginok != 1) { html_nologin(); exit; } elseif (!strcmp($currentuser["userid"], "guest")) { html_init("gb2312"); html_error_quit("guest 不能发表评论!\n<br>\n<a href=\"/\" target=\"_top\">现在登录</a>"); exit; } } pc_html_init("gb2312", $pcconfig["BBSNAME"] . "Blog", "", "", "", 1);
function pc_add_users($link, $userid, $corpusname, $manual, $blogtype = "", $groupmanager = "") { global $pcconfig, $currentuser, $bbsman_modes; if (!$userid || !$corpusname) { return -1; } if (!$blogtype) { $blogtype = "normal"; } if ($blogtype == "normal") { $lookupuser = array(); if (bbs_getuser($userid, $lookupuser) == 0) { return -2; } $userid = $lookupuser["userid"]; } else { if (!$pcconfig["TYPES"][$blogtype]) { return -3; } $userid = $pcconfig["TYPES"][$blogtype] . '.' . $userid; if (!$groupmanager) { return -4; } $lookupuser = array(); if (bbs_getuser($groupmanager, $lookupuser) == 0) { return -4; } $groupmanager = $lookupuser["userid"]; } //更新申请表 if ($manual) { $query = "INSERT INTO `newapply` ( `naid` , `username` , `appname` , `appself` , `appdirect` , `hostname` , `apptime` , `manager` , `management` ) " . "VALUES ('', '" . addslashes($userid) . "', '" . addslashes($corpusname) . "', '', '', '" . addslashes($_SERVER["REMOTE_ADDR"]) . "', NOW( ) , '" . addslashes($currentuser["userid"]) . "' , '0');"; } else { $query = "UPDATE newapply SET apptime = apptime ,manager = '" . addslashes($currentuser["userid"]) . "',management = '0' WHERE username = '******'"; } // ORDER BY naid DESC LIMIT 1 ;"; if (!mysql_query($query, $link)) { $errstr = "MySQL Error: " . mysql_error($link); pc_db_close($link); exit($errstr); } if (pc_load_infor($link, $userid)) { return -5; } if ($manual) { $query = "SELECT username FROM newapply WHERE management != 1 AND management != 3 AND management != 0 AND username = '******' LIMIT 0 , 1;"; $result = mysql_query($query, $link); if ($rows = mysql_fetch_array($result)) { return -6; } } //分配个人空间 if ($pcconfig["USERFILES"]) { $userfile_limit = $pcconfig["USERFILESLIMIT"]; $userfile_num_limit = $pcconfig["USERFILESNUMLIMIT"]; } else { $userfile_limit = $userfile_num_limit = 0; } //添加用户 $query = "INSERT INTO `users` ( `uid` , `username` , `corpusname` , `description` , `theme` , `nodelimit` , `dirlimit` , `createtime` , `style` , `backimage` , `visitcount` , `nodescount` , `logoimage` , `modifytime` , `links` , `htmleditor` , `indexnodechars` , `indexnodes` , `useremail` , `favmode` , `updatetime` , `userinfor` , `pctype` ,`defaulttopic`,`userfile`,`filelimit`) " . "VALUES ('', '" . addslashes($userid) . "', '" . addslashes($corpusname) . "', '" . addslashes($corpusname) . "' , 'others', '300', '300', NOW( ) , '0', '' , '0', '0', '' , NOW( ) , '', '1', '600', '5', '', '0', NOW( ) , '' , '0' , '其他类别' , '" . $userfile_limit . "','" . $userfile_num_limit . "');"; if (!mysql_query($query, $link)) { $errstr = "MySQL Error: " . mysql_error($link); pc_db_close($link); exit($errstr); } //log一下 if ($blogtype != "normal") { $action = $groupmanager . " 申请建立群体Blog:" . $userid . "(www)"; pc_logs($link, $action, "", $userid); } $action = $currentuser["userid"] . " 通过 " . $userid . " 的BLOG申请(www)"; pc_logs($link, $action, "", $userid); //发布公告 if ($blogtype == "normal") { bbs_user_setflag($userid, BBS_PCORP_FLAG, 1); $annTitle = "[公告] 批准 " . $userid . " 的 Blog 申请"; $annBody = "\n\n 根据用户 " . $userid . " 申请,经审核、讨论后决定开通该用户\n" . " Blog ,Blog 名称“" . $corpusname . "”。\n\n" . " Blog 大部分功能提供在web 模式下,Blog 名称、描述、\n" . " 分类等属性请用户在web 登录后自行修改。\n\n"; } else { $annTitle = "[公告] 开设 " . $userid . " 群体Blog"; $annBody = "\n\n 根据用户 " . $groupmanager . " 申请,经审核、讨论后决定开设\n" . " " . $userid . " 群体Blog,Blog 名称“" . $corpusname . "”。\n\n" . " Blog 大部分功能提供在web 模式下,Blog 名称、描述、\n" . " 分类等属性请群体Blog管理员在web 登录后自行修改。\n\n"; } $ret = bbs_postarticle($pcconfig["APPBOARD"], preg_replace("/\\\\(['|\"|\\\\])/", "\$1", $annTitle), preg_replace("/\\\\(['|\"|\\\\])/", "\$1", $annBody), 0, 0, 0, 0); if ($ret != 0) { return -7; } //发信件给用户 $ret = bbs_postmail($blogtype == "normal" ? $userid : $groupmanager, preg_replace("/\\\\(['|\"|\\\\])/", "\$1", $annTitle), preg_replace("/\\\\(['|\"|\\\\])/", "\$1", $annBody), 0, 0); if ($ret < 0) { return -8; } //标记公告 //bbs_bmmanage($pcconfig["APPBOARD"],$ret,$bbsman_modes["MARK"],0); if ($manual && $blogtype != "normal") { $pcc = pc_load_infor($link, $userid); if (!$pcc) { return -9; } pc_convertto_group($link, $pcc); pc_add_member($link, $pcc, $groupmanager); } return 0; }
<hr size=1> <center> <table cellpadding=5 cellspacing=0 class=t1 width=98% border=0> <tbody><tr> <td class=t2 width=20> </td> <td class=t2>文章主题</td> <td class=t2 width=160>Blog名称</td> <td class=t2 width=80>作者</td> <td class=t2 width=80>类别</td> <td class=t2 width=80>推荐人</td> </tr></tbody> <?php for ($i = 0; $i < $num; $i++) { $rows = mysql_fetch_array($result); if (!$pcuser[$rows[uid]]) { $pcuser[$rows[uid]] = pc_load_infor($link, "", $rows[uid]); } echo "<tbody><tr>\n" . "<td class=t3>" . ($i + $start + 1) . "</td>" . "<td class=t5><a href=\"pccon.php?id=" . $rows[uid] . "&nid=" . $rows[nid] . "&s=all\">" . html_format($rows[subject]) . "</a></td>" . "<td class=t3><span title=\"" . $pcuser[$rows[uid]]["DESC"] . "\"><a href=\"index.php?id=" . $pcuser[$rows[uid]]["USER"] . "\">" . $pcuser[$rows[uid]]["NAME"] . "</a></span></td>" . "<td class=t4><a href=\"/bbsqry.php?userid=" . $pcuser[$rows[uid]]["USER"] . "\">" . $pcuser[$rows[uid]]["USER"] . "</a></td>" . "<td class=t3><span title=\"点击查看该分类的其它Blog信息\"><a href=\"pcreclist.php?topic=" . $rows[topic] . "\">" . html_format($pcconfig["SECTION"][$rows[topic]]) . "</a></span></td>" . "<td class=t4><a href=\"/bbsqry.php?userid=" . $rows[recuser] . "\">" . $rows[recuser] . "</a></td>" . "</tr></tbody>\n"; } ?> </table> <p align="center"> <?php if ($pno > 1) { echo "[<a href=\"pcreclist.php?pno=" . ($pno - 1) . "\">上一页</a>]\n"; } if ($num == $pcconfig["LIST"]) { echo "[<a href=\"pcreclist.php?pno=" . ($pno + 1) . "\">下一页</a>]\n"; } ?> </p>
html_init("gb2312"); html_error_quit("请登录后再进行Blog申请!"); exit; } else { if (time() - $currentuser["firstlogin"] < intval($pcconfig["MINREGTIME"] * 2592000)) { html_init("gb2312"); html_error_quit("对不起,您的注册时间尚不足" . $pcconfig["MINREGTIME"] . "个月"); exit; } if (!$_POST["appname"] || !$_POST["appself"] || !$_POST["appdirect"]) { html_init("gb2312"); html_error_quit("对不起,请详细填写Blog申请表"); exit; } $link = pc_db_connect(); if (pc_load_infor($link, $currentuser["userid"])) { pc_db_close($link); html_init("gb2312"); html_error_quit("对不起,您已经拥有Blog了"); exit; } $appstate = pc_app_have_applied($link, $currentuser); if ($appstate === 0) { pc_db_close($link); html_init("gb2312"); html_error_quit("对不起,您的Blog申请已通过"); exit; } elseif ($appstate == 1) { pc_db_close($link); html_init("gb2312"); html_error_quit("对不起,您的Blog申请还在处理中,请耐心等候");
if (!$comment) { @mysql_free_result($result); pc_html_init("gb2312", $pcconfig["BBSNAME"] . "Blog"); html_error_quit("对不起,您要查看的评论不存在"); exit; } $query = "SELECT `access`,`uid`,`subject`,`emote`,`tid`,`pid`,`nodetype` FROM nodes WHERE `nid` = '" . $comment["nid"] . "' LIMIT 0 , 1 ;"; $result = mysql_query($query, $link); $node = mysql_fetch_array($result); if (!$node) { @mysql_free_result($result); pc_html_init("gb2312", $pcconfig["BBSNAME"] . "Blog"); html_error_quit("对不起,您要查看的评论不存在"); exit; } $pc = pc_load_infor($link, "", $node["uid"]); if (!$pc) { pc_html_init("gb2312", $pcconfig["BBSNAME"] . "Blog"); html_error_quit("对不起,您要查看的Blog不存在"); exit; } function pc_add_new_comment($nid, $alert) { global $pc, $currentuser; ?> <center> <table cellspacing="0" cellpadding="5" width="500" border="0" class="t1"> <tr> <td class="t5"><strong>发表评论 </strong> <?php if ($alert && !$pc["ANONYCOMMENT"]) {
if (@$_GET["p"] == "p" || @$_GET["p"] == "n") { if ($_GET["p"] == "p") { $query = "SELECT `nid` FROM nodes WHERE `nid` < " . $nid . " AND `uid` = '" . $id . "' AND `pid` = '" . $pid . "' AND `access` = '" . $tag . "' AND `tid` = '" . $tid . "' AND `type` != '1' ORDER BY `nid` DESC LIMIT 0 , 1 ;"; $err_alert = "本文已是该分类第一篇文章。"; } else { $query = "SELECT `nid` FROM nodes WHERE `nid` > " . $nid . " AND `uid` = '" . $id . "' AND `pid` = '" . $pid . "' AND `access` = '" . $tag . "' AND `tid` = '" . $tid . "' AND `type` != '1' ORDER BY `nid` ASC LIMIT 0 , 1 ;"; $err_alert = "本文已是该分类最后一篇文章。"; } $result = mysql_query($query, $link); $rows = mysql_fetch_array($result); mysql_free_result($result); if ($rows) { header("Location: pccon.php?id=" . $id . "&nid=" . $rows[nid] . "&pid=" . $pid . "&tag=" . $tag . "&tid=" . $tid); } } $pc = pc_load_infor($link, "", $id); if (!$pc) { pc_db_close($link); html_init("gb2312", "Blog"); html_error_quit("对不起,您要查看的Blog不存在"); exit; } $userPermission = pc_get_user_permission($currentuser, $pc); $pur = $userPermission["pur"]; $tags = $userPermission["tags"]; if ($pc['USER'] == '_filter') { $query = "SELECT * FROM filter WHERE `fid` = '" . $nid . "' LIMIT 0 , 1 ;"; } else { $query = "SELECT * FROM nodes WHERE `nid` = '" . $nid . "' AND `uid` = '" . $id . "' AND type = 0 LIMIT 0 , 1 ;"; } $result = mysql_query($query, $link);