function getNewBlogs($link, $pno = 1, $etemnum = 0) { global $pcconfig; if ($pno < 1) { $pno = 1; } $etemnum = intval($etemnum); if ($etemnum <= 0) { $etemnum = $pcconfig["NEWS"]; } $newBlogs = array(); $newBlogs["channel"] = array("siteaddr" => "http://" . $pcconfig["SITE"], "title" => $pcconfig["BBSNAME"] . "即时Blog日志", "pcaddr" => "http://" . $pcconfig["SITE"], "desc" => $pcconfig["BBSNAME"] . "最新" . $etemnum . "个日志", "email" => $pcconfig["BBSNAME"], "publisher" => $pcconfig["BBSNAME"], "creator" => $pcconfig["BBSNAME"], "rights" => $pcconfig["BBSNAME"], "date" => date("Y-m-d"), "updatePeriod" => "10分钟更新一次", "updateFrequency" => "最新的" . $etemnum . "个Blog日志", "updateBase" => date("Y-m-d H:i:s")); $query = "SELECT users.visitcount,description,corpusname,username,created,subject,body,htmltag,nodes.uid,nid,tid,users.theme,nodescount " . "FROM nodes force index(PRIMARY) ,users " . "WHERE `access` = 0 " . " AND nodes.uid = users.uid " . " AND pctype < 6 " . " AND nodetype = 0 " . "ORDER BY `nid` DESC " . "LIMIT " . ($pno - 1) * $etemnum . " , " . $etemnum . " ;"; $result = mysql_query($query, $link); $j = 0; while ($rows = mysql_fetch_array($result)) { $body = "<br>\n" . "来自: " . html_format($rows["corpusname"]) . "<br>\n" . "作者: " . html_format($rows["username"]) . "<br>\n" . "发信站: " . $pcconfig["BBSNAME"] . "<br>\n" . "时间: " . time_format($rows["created"]) . "<br>\n" . "<hr size=1>\n" . html_format($rows["body"], TRUE, $rows["htmltag"]) . "<hr size=1>\n" . "(<a href=\"http://" . $pcconfig["SITE"] . "/pc/pccon.php?id=" . $rows["uid"] . "&nid=" . $rows["nid"] . "&tid=" . $rows["tid"] . "&s=all\">浏览全文</a>\n" . "<a href=\"http://" . $pcconfig["SITE"] . "/pc/pccom.php?act=pst&nid=" . $rows["nid"] . "\">发表评论</a>)<br>\n" . "<a href=\"http://" . $pcconfig["SITE"] . "/pc/rss.php?userid=" . html_format($rows["username"]) . "\"><img src=\"http://" . $pcconfig["SITE"] . "/pc/images/xml.gif\" border=\"0\" align=\"absmiddle\" alt=\"XML\">Blog地址:http://" . $pcconfig["SITE"] . "/pc/rss.php?userid=" . html_format($rows["username"]) . "</a>"; $newBlogs["useretems"][$j] = array("addr" => "http://" . $pcconfig["SITE"] . "/pc/pccon.php?id=" . $rows["uid"] . "&nid=" . $rows["nid"] . "&tid=" . $rows["tid"], "subject" => htmlspecialchars($rows["subject"]), "desc" => $body, "tid" => $rows["tid"], "nid" => $rows["nid"], "publisher" => $pcconfig["BBSNAME"], "creator" => html_format($rows["username"]), "pc" => $rows["uid"], "created" => time_format($rows["created"]), "rights" => html_format($rows["username"]) . ".bbs@" . $pcconfig["SITE"], "theme" => pc_get_theme($rows["theme"]), "pcdesc" => $rows["description"], "pcname" => $rows["corpusname"], "pcvisit" => $rows[0], "pcnodes" => $rows["nodescount"]); $j++; } mysql_free_result($result); return $newBlogs; }
function pc_load_infor($link, $userid = FALSE, $uid = 0) { global $currentuser; if (!$userid && !$uid) { return FALSE; } if ($userid) { $query = "SELECT *,UNIX_TIMESTAMP(`createtime`) 'ts_createtime' FROM users WHERE `username`= '" . addslashes($userid) . "' LIMIT 0,1;"; } else { $query = "SELECT *,UNIX_TIMESTAMP(`createtime`) 'ts_createtime' FROM users WHERE `uid` = '" . intval($uid) . "' LIMIT 0,1;"; } $result = mysql_query($query, $link); $rows = mysql_fetch_array($result); mysql_free_result($result); if (!$rows) { return FALSE; } else { $pcThem = pc_get_theme($rows["theme"]); $pc = array("NAME" => html_format($rows["corpusname"]), "USER" => $rows["username"], "UID" => $rows["uid"], "DESC" => html_format($rows["description"]), "THEM" => $pcThem, "TIME" => $rows["createtime"], "TS_TIME" => $rows["ts_createtime"], "VISIT" => $rows["visitcount"], "CREATED" => $rows["createtime"], "MODIFY" => $rows["modifytime"], "NODES" => $rows["nodescount"], "NLIM" => $rows["nodelimit"], "DLIM" => $rows["dirlimit"], "STYLE" => pc_style_array($rows["style"]), "LOGO" => str_replace("<", "<", stripslashes($rows["logoimage"])), "BKIMG" => str_replace("<", "<", stripslashes($rows["backimage"])), "LINKS" => pc_get_links(stripslashes($rows["links"])), "EDITOR" => $rows["htmleditor"], "INDEX" => array("nodeNum" => $rows["indexnodes"], "nodeChars" => $rows["indexnodechars"]), "EMAIL" => htmlspecialchars(stripslashes($rows["useremail"])), "FAVMODE" => (int) $rows["favmode"], "UPDATE" => (int) $rows["updatetime"], "INFOR" => str_replace("<?", "<?", stripslashes($rows["userinfor"])), "TYPE" => $rows["pctype"], "DEFAULTTOPIC" => $rows["defaulttopic"], "FILELIMIT" => intval($rows["userfile"]), "FILENUMLIMIT" => intval($rows["filelimit"]), "ANONYCOMMENT" => defined("_BLOG_ANONY_COMMENT_") ? $rows["anonycomment"] : false); if ($pc["TYPE"] == 9) { if (!pc_is_manager($currentuser)) { return false; } } return $pc; } }
<center><br><br><br> <table cellspacing="0" cellpadding="3" width="95%" class="t1"> <tr> <td class="t2" width="30">编号</td> <td class="t2" width="70">用户名</td> <td class="t2">Blog名称</td> <td class="t2" width="50">类别</td> <td class="t2" width="50">文章数</td> <td class="t2" width="50">访问量</td> <td class="t2" width="120">创建时间</td> <td class="t2" width="120">更新时间</td> </tr> <?php for ($i = 0; $i < $num_rows; $i++) { $rows = mysql_fetch_array($result); $pcThem = pc_get_theme($rows[theme]); echo "<tr>\n<td class=t3>" . ($startno + $i + 1) . "</td>\n" . "<td class=t4><a href=\"/bbsqry.php?userid=" . html_format($rows[username]) . "\">" . html_format($rows[username]) . "</a></td>\n" . "<td class=t3><span title=\"" . html_format($rows[description]) . "\"><a href=\"index.php?id=" . $rows[username] . "\">" . html_format($rows[corpusname]) . "</a></span></td>\n" . "<td class=t3><span title=\"点击查看该分类的其它Blog信息\"><a href=\"pcsec.php?sec=" . html_format($pcThem[0]) . "\">" . html_format($pcconfig["SECTION"][$pcThem[0]]) . "</a></span></td>\n" . "<td class=\"t4\">" . $rows[nodescount] . "</a>" . "<td class=\"t3\">" . $rows[visitcount] . "</a>" . "<td class=\"t4\">" . time_format($rows[createtime]) . "</a>" . "<td class=\"t3\">" . time_format($rows[modifytime]) . "</td>\n</tr>\n"; } ?> </table> </center> <p align="center"> <?php pc_main_navigation_bar(); ?> </p> <?php mysql_free_result($result); pc_db_close($link); }
function display_user_list($link, $listorder = "username", $listorder1 = "ASC", $char = FALSE, $startno = 0, $pagesize = 10) { global $pcconfig; if ($char) { $query = "SELECT `uid` , `username` , `corpusname` , `description` , `theme` , `createtime`,`modifytime`,`nodescount`,`visitcount` " . " FROM users WHERE `username` LIKE '" . $char . "%' AND pctype < 2 ORDER BY " . $listorder . " " . $listorder1 . " LIMIT " . $startno . " , " . $pagesize . ";"; } else { $query = "SELECT `uid` , `username` , `corpusname` , `description` , `theme` , `createtime`,`modifytime`,`nodescount`,`visitcount` " . " FROM users WHERE pctype < 2 ORDER BY " . $listorder . " " . $listorder1 . " LIMIT " . $startno . " , " . $pagesize . ";"; } $result = mysql_query($query, $link); $list_user_num = mysql_num_rows($result); ?> <table border="0" cellspacing="0" cellpadding="5" width="99%" class="t1"> <tbody> <tr> <td class="t2" width="50">编号</td> <td class="t2" width="90"> 用户名 <a href="pc.php?order=username&order1=ASC&char=<?php echo $char; ?> "><img src="images/desc_order.png" border="0" align="absmiddle" alt="按用户名递增排序"></a> <a href="pc.php?order=username&order1=DESC&char=<?php echo $char; ?> "><img src="images/asc_order.png" border="0" align="absmiddle" alt="按用户名递减排序"></a> </td> <td class="t2">Blog名称</td> <td class="t2" width=70>类别</td> <td class="t2" width="70"> 文章数 <a href="pc.php?order=nodescount&order1=ASC&char=<?php echo $char; ?> "><img src="images/desc_order.png" border="0" align="absmiddle" alt="按文章数递增排序"></a> <a href="pc.php?order=nodescount&order1=DESC&char=<?php echo $char; ?> "><img src="images/asc_order.png" border="0" align="absmiddle" alt="按文章数递减排序"></a> </td> <td class="t2" width="70">访问量 <a href="pc.php?order=visitcount&order1=ASC&char=<?php echo $char; ?> "><img src="images/desc_order.png" border="0" align="absmiddle" alt="按访问量递增排序"></a> <a href="pc.php?order=visitcount&order1=DESC&char=<?php echo $char; ?> "><img src="images/asc_order.png" border="0" align="absmiddle" alt="按访问量递减排序"></a> </td> <td class="t2" width="130"> 创建时间 <a href="pc.php?order=createtime&order1=ASC&char=<?php echo $char; ?> "><img src="images/desc_order.png" border="0" align="absmiddle" alt="按创建时间递增排序"></a> <a href="pc.php?order=createtime&order1=DESC&char=<?php echo $char; ?> "><img src="images/asc_order.png" border="0" align="absmiddle" alt="按创建时间递减排序"></a> <td class="t2" width="130"> 更新时间 <a href="pc.php?order=modifytime&order1=ASC&char=<?php echo $char; ?> "><img src="images/desc_order.png" border="0" align="absmiddle" alt="按更新时间递增排序"></a> <a href="pc.php?order=modifytime&order1=DESC&char=<?php echo $char; ?> "><img src="images/asc_order.png" border="0" align="absmiddle" alt="按更新时间递减排序"></a> </td> </tr></tbody> <?php for ($i = 0; $i < $list_user_num; $i++) { $rows = mysql_fetch_array($result); $pcThem = pc_get_theme($rows["theme"]); echo "<tbody><tr>\n<td class=\"t3\">" . ($startno + $i + 1) . "</td>\n" . "<td class=\"t4\"><a href=\"/bbsqry.php?userid=" . html_format($rows["username"]) . "\">" . html_format($rows["username"]) . "</a></td>\n" . "<td class=\"t3\"><span title=\"" . html_format($rows["description"]) . "\"><a href=\"index.php?id=" . $rows["username"] . "\">" . html_format($rows["corpusname"]) . "</a> </span></td>\n" . "<td class=\"t3\"><span title=\"点击查看该分类的其它Blog信息\"><a href=\"pcsec.php?sec=" . html_format($pcThem[0]) . "\">" . html_format($pcconfig["SECTION"][$pcThem[0]]) . "</a></span></td>\n" . "<td class=\"t4\">" . $rows["nodescount"] . "</a>" . "<td class=\"t3\">" . $rows["visitcount"] . "</a>" . "<td class=\"t4\">" . time_format($rows["createtime"]) . "</a>" . "<td class=\"t3\">" . time_format($rows["modifytime"]) . "</td>\n</tr></tbody>\n"; } ?> </table> <?php mysql_free_result($result); }