📄 pcmain.php
字号:
<?php//require_once("pcfuncs.php");require_once("pcstat.php");require_once("pcmainfuncs.php");if(defined("_PCMAIN_RECOMMEND_QUEUE_")) @include(_PCMAIN_RECOMMEND_QUEUE_);if(pc_update_cache_header()) return;function pcmain_blog_statistics_list(){ global $link;?>用户:<strong><?php echo getUsersCnt($link); ?></strong> 人<br />日志:<strong><?php echo getNodesCnt($link); ?></strong> 个<br />评论:<strong><?php echo getCommentsCnt($link); ?></strong> 篇<br /><?php}function pcmain_blog_new_user(){ global $pcconfig,$link; $newUsers = getNewUsers($link,_PCMAIN_USERS_NUM_);?><ul><?php foreach($newUsers as $newUser) { echo "<li><a href=\"index.php?id=".$newUser["username"]."\"><span title=\"".html_format($newUser["description"])."\">".html_format($newUser["corpusname"])."</span></a> <a href=\"/bbsqry.php?userid=".$newUser["username"]."\"><font class=\"low\">".$newUser["username"]."</font></a></li>"; }?> </ul><?php}function pcmain_blog_top_ten(){ global $pcconfig,$link; //$mostVstUsers = getHotUsersByPeriod($link,'day',_PCMAIN_USERS_NUM_); //每日热门 if(defined("_BLOG_SCORE_STAT_")) $mostVstUsers = getScoreTopUsers($link, _PCMAIN_USERS_NUM_); else $mostVstUsers = getMostVstUsers($link,_PCMAIN_USERS_NUM_);?><ul><?php foreach($mostVstUsers as $mostVstUser) { echo "<li><a href=\"index.php?id=".$mostVstUser["username"]."\"><span title=\"".html_format($mostVstUser["description"])."\">".html_format($mostVstUser["corpusname"])."</span></a> <a href=\"/bbsqry.php?userid=".$mostVstUser["username"]."\"><font class=\"low\">".$mostVstUser["username"]."</font></a></li>"; }?> </ul><?php}function pcmain_blog_last_update(){ global $pcconfig,$link; $lastUpdates = getLastUpdates($link,_PCMAIN_USERS_NUM_);?><ul><?php foreach($lastUpdates as $lastUpdate) { echo "<li><a href=\"index.php?id=".$lastUpdate["username"]."\"><span title=\"".html_format($lastUpdate["description"])."\">".html_format($lastUpdate["corpusname"])."</span></a> <a href=\"/bbsqry.php?userid=".$lastUpdate["username"]."\"><font class=\"low\">".$lastUpdate["username"]."</font></a></li>"; }?></ul><?php}function pcmain_annouce(){ global $pcconfig,$link; $anns = getPcAnnounce($link, _PCMAIN_ANNS_NUM_ );?><table width="100%" cellspacing="0" cellpadding="3" border="0" class="table"> <tr><td class="channelback"><font class="channel"><?php echo BBS_NICKNAME; ?>动态</font></td></tr> <tr><td align="left" valign="top" class="td"><ul><?php foreach($anns as $ann) echo "<li><a href=\"/pc/pccon.php?id=".$ann[0]."&nid=".$ann["nid"]."&s=all\">".html_format($ann["subject"])."</a></li>";?> <li><a href="/pc/index.php?id=<?php echo $pcconfig["ADMIN"]; ?>">>> 更多</a></li> </ul></td></tr></table><?php }function pcmain_recommend_blogger(){ global $link; mt_srand(); $pos = mt_rand(0,50);//排名前50的BLOG随机抽取一个 if(defined("_PCMAIN_RECOMMEND_BLOGGER_")) $query = "SELECT uid , username , corpusname , description FROM users WHERE username = '".addslashes(_PCMAIN_RECOMMEND_BLOGGER_)."' LIMIT 1;"; else $query = "SELECT uid , username , corpusname , description FROM users ORDER BY visitcount DESC LIMIT ".$pos.",1;"; $result = mysql_query($query,$link); $pc = mysql_fetch_array($result); mysql_free_result($result); if (!$pc) return; //提取该用户最热门的5篇文章 $query = "SELECT nid,subject FROM nodes WHERE access = 0 AND uid = '".$pc["uid"]."' ORDER BY visitcount DESC LIMIT 0 , 5;"; $result = mysql_query($query,$link); $nodes = array(); while($rows = mysql_fetch_array($result)) $nodes[] = $rows; mysql_free_result($result); ?><table width="100%" cellspacing="0" cellpadding="3" border="0" class="table"> <tr><td class="channelback" align="right"><font class="channel">BLOG推荐</font></td></tr> <tr><td align="left" valign="top" class="td" bgcolor="#E8FFEE"> <table width="100%" cellspacing="0" cellpadding="3" border="0"> <tr> <td valign="top" align="left"> [<b><a href="index.php?id=<?php echo $pc["username"]; ?>"><?php echo html_format($pc["corpusname"]); ?></a></b>] <a href="/bbsqry.php?userid=<?php echo $pc["username"]; ?>"><font class="low2"><?php echo $pc["username"]; ?></font></a></td></tr> <tr><td> <?php echo html_format($pc["description"]); ?> </td> </tr> </table> </td></tr> <tr> <td align="left" valign="top" class="td"><ul><?php foreach($nodes as $node) echo "<li><a href=\"pccon.php?id=".$pc["uid"]."&nid=".$node["nid"]."&s=all\">".html_format($node["subject"])."</a></li>";?> </ul></td> </tr></table><?php }function pcmain_blog_most_hot(){ global $pcconfig,$link; $nodes = getHotNodes($link, "comments" , _PCMAIN_TIME_LONG_ ,_PCMAIN_NODES_NUM_ ); $num = count($nodes);?><table cellspacing=0 cellpadding=3 width=100%><?php for($i = 0;$i < $num ;$i ++) { $rows = $nodes[$i]; if($i % 4 == 0 ) { echo "<tr>"; $tdclass = "td2"; } elseif($i % 4 == 2 ) { echo "<tr>"; $tdclass ="td1"; } echo "<td class=\"".$tdclass."\" width=\"33%\">"; $pcinfor = pc_load_infor($link,"",$rows["uid"]); echo "| <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>\n"; echo "</td>\n"; if($i % 2 == 1 ) echo "</tr>"; }?> </table><?php }function pcmain_blog_most_trackback(){ global $pcconfig,$link; $nodes = getHotNodes($link, "trackbacks" , _PCMAIN_TIME_LONG_ * 2 ,_PCMAIN_NODES_NUM_ ); $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 }function pcmain_blog_most_view(){ global $pcconfig,$link; $nodes = getHotNodes($link, "visits" , _PCMAIN_TIME_LONG_ ,_PCMAIN_NODES_NUM_ ); $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 style=\"line-height:16px \" align=left 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>\n"; echo "</li>\n"; }?></ul></td></tr></table><?php }function pcmain_blog_new_nodes(){ global $link; $newBlogs = getNewBlogs($link,1, _PCMAIN_NEW_NODES_ ); $newNum = count($newBlogs["useretems"]);?><table cellspacing=0 cellpadding=3 width=98%><?php for($i = 0;$i < $newNum ;$i ++) { if($i % 4 == 0 ) { echo "<tr>"; $tdclass = "td2"; } elseif($i % 4 == 2 ) { echo "<tr>"; $tdclass ="td1"; } echo "<td class=".$tdclass." width=\"33%\">[<span title=\"".$newBlogs["useretems"][$i]["pcdesc"]."\"><a href=\"index.php?id=".$newBlogs["useretems"][$i]["creator"]."\"><font class=low2>".$newBlogs["useretems"][$i]["pcname"]."</font></a></span>]". " <a href='/bbsqry.php?userid=".$newBlogs["useretems"][$i]["creator"]."'><font class=low>".$newBlogs["useretems"][$i]["creator"]."</font></a><br />". "<a href='pccon.php?id=".$newBlogs["useretems"][$i]["pc"]."&nid=".$newBlogs["useretems"][$i]["nid"]."&s=all&tid=".$newBlogs["useretems"][$i]["tid"]."'>". "<span title=\"".$newBlogs["useretems"][$i]["subject"]."\">"; echo substr($newBlogs["useretems"][$i]["subject"],0,36); if(strlen($newBlogs["useretems"][$i]["subject"])>36) echo "..."; echo "</span></a></td>"; if($i % 2 == 1 ) echo "</tr>"; }?></td></tr> </table><?php }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 }function pcmain_blog_sections(){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -