default.php
来自「清华BBS源代码」· PHP 代码 · 共 566 行 · 第 1/2 页
PHP
566 行
if( $i % 9 == 8 ) echo "</tr>"; }?> </table><?php}function pcmain_section_top_view(){ global $pcconfig,$link;?><table cellspacing=0 cellpadding=3 width="100%"><?php $sections = array_keys($pcconfig["SECTION"]); $othersections = array(); foreach( $sections as $section ) { $query = "SELECT nodes.uid , nid , subject , theme , username , corpusname ". "FROM nodes , users ". "WHERE nodes.uid = users.uid AND pctype < 4 AND access = 0 AND type = 0 AND recommend != 2 AND created > ".date("YmdHis",time()- _PCMAIN_TIME_LONG_ )." AND theme = '".$section."' ". "GROUP BY nodes.uid ". "ORDER BY nodes.visitcount DESC , nid DESC ". "LIMIT 0 , 12 ;"; $result = mysql_query($query,$link); $num_rows = mysql_num_rows($result); if($num_rows) { $nodes = array(); $totallength = 0; while($rows = mysql_fetch_array($result) ) { if( $totallength + strlen( $rows[subject] ) > 65 ) continue; $nodes[] = $rows; $totallength += strlen( $rows[subject] ); } mysql_free_result($result); //$subjectlength = ( $totallength > 65 )?13:65; $nodesNum = max(1,count($nodes) - 1);?><tr><td align="left">[<strong><a href="/pc/pcsec.php?sec=<?php echo $section; ?>"><font class=low2><?php echo $pcconfig["SECTION"][$section]; ?></font></a></strong>] <?php for( $i = 0 ; $i < $nodesNum ; $i ++ ) { echo "<a href=\"/pc/pccon.php?id=".$nodes[$i][0]."&nid=".$nodes[$i][nid]."&s=all\">". "<span title=\"".html_format($nodes[$i][subject])."(".$nodes[$i][username]."'s BLOG:".html_format($nodes[$i][corpusname]).")\">"; //$subject = substr( $nodes[$i][subject] , 0 , $subjectlength ); //if( strlen( $nodes[$i][subject] ) > $subjectlength ) $subject .= "..."; //echo html_format($subject)."</span></a>"; echo html_format($nodes[$i][subject])."</span></a>"; if( $i < $nodesNum - 1 ) echo " | "; }?></td></tr><?php } else $othersections[] = $section; }?><tr><td><?php foreach( $othersections as $section ) echo "[<a href=\"/pc/pcsec.php?sec=".$section."\"><font class=low2>".$pcconfig["SECTION"][$section]."</class></a>]\n";?></td></tr></table><?php}if(pc_update_cache_header()) return;$link = pc_db_connect();pcmain_html_init();?> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td width="200" align="center" valign="top"><table width="100%" border="0" cellpadding="5" cellspacing="0" class="table"> <tr> <td class="channelback"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="73%" class="channel">水木统计</td> <td width="27%" align="right" class="more"> </td> </tr> </table></td> </tr> <tr> <td align="left" valign="top" bgcolor="#ECF5FF" class="td"> <?php pcmain_blog_statistics_list(); ?> </td> </tr> </table> <br /> <table width="100%" border="0" cellpadding="5" cellspacing="0" class="table"> <tr> <td class="channelback"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="channel">点击排行</td> <td align="right" class="more"><a href="pc.php?order=visitcount&order1=DESC"><font class="more">更多</font></a></td> </tr> </table></td> </tr> <tr> <td align="left" valign="top" bgcolor="#F6F6F6" class="td"> <?php pcmain_blog_top_ten(); ?> <center> [<a href="pc.php?order=visitcount&order1=DESC" class="low2">更多</a>] [<a href="opml.php?t=1" class="low2">OPML</a>] </center> </td> </tr> </table> <br /> <table width="100%" border="0" cellpadding="5" cellspacing="0" class="table"> <tr> <td class="channelback"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="70%" class="channel">最近更新</td> <td width="30%" align="right" class="more"><a href="pc.php?order=modifytime&order1=DESC"><font class="more">更多</font></a></td> </tr> </table></td> </tr> <tr> <td align="left" valign="top" bgcolor="#E8FFEE" class="td"> <?php pcmain_blog_last_update(); ?> <center> [<a href="pc.php?order=modifytime&order1=DESC" class="low2">更多</a>] [<a href="opml.php" class="low2">OPML</a>] </center> </td> </tr> </table> <br /> <table width="100%" border="0" cellpadding="5" cellspacing="0" class="table"> <tr> <td class="channelback"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="74%" class="channel">最新申请</td> <td width="26%" align="right" class="more"><a href="pc.php?order=createtime&order1=DESC"><font class="more">更多</font></a></td> </tr> </table></td> </tr> <tr> <td align="left" valign="top" bgcolor="#FFFFE6" class="td"> <?php pcmain_blog_new_user(); ?> <center> [<a href="pc.php?order=createtime&order1=DESC" class="low2">更多</a>] [<a href="opml.php?t=2" class="low2">OPML</a>] </center> </td> </tr> </table> <br /> <table width="100%" border="0" cellpadding="5" cellspacing="0" class="table"> <tr> <td class="channelback"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="73%" class="channel">新增模板</td> <td width="27%" align="right" class="more">更多</td> </tr> </table></td> </tr> <tr> <td align="left" valign="top" bgcolor="#ECF5FF" class="td"> </td> </tr> </table> <br /> <table width="100%" border="0" cellpadding="5" cellspacing="0" class="table"> <tr> <td class="channelback">RSS频道</td> </tr> <tr> <td align="left" valign="top" bgcolor="#F6F6F6" class="td"> 推荐日志 <a href="/pc/rssrec.php"><img src="/pc/images/xml.gif" border="0" alt="推荐日志" /></a> <br /> 最新日志 <a href="/pc/rssnew.php"><img src="/pc/images/xml.gif" border="0" alt="最新日志" /></a> <br /><br /><br /> <b>OPML频道群组</b><br /><br /> <a href="opml.php">最近更新用户组</a><br /> <a href="opml.php?t=1">访问最多用户组</a><br /> <a href="opml.php?t=2">最新申请用户组</a> </td> </tr> </table></td><td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td> <table cellspacing=0 cellpadding=0 width=100% border=0> <tr> <td width="100%"> <?php pcmain_annouce(); ?> </td> <td> <?php /* pcmain_recommend_blogger(); */ ?> </td> </tr> </table> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td class="topic">水木推荐</td> </tr> <tr> <td bgcolor="#ECF5FF"><?php pcmain_blog_recommend_nodes(); ?></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="0"> <tr> <td class="topic">热门话题</td> </tr> <tr> <td><?php pcmain_blog_most_hot(); ?></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="0"> <tr> <td class="topic">点击排行</td> </tr> <tr> <td bgcolor="#FCFCFC"><?php pcmain_blog_most_view(); ?></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="0"> <tr> <td class="topic">引用排行</td> </tr> <tr> <td bgcolor="#F6F6F6"><?php pcmain_blog_most_trackback(); ?></td> </tr> </table></td> </tr> <form action="pcsearch.php" method="get" onsubmit="if(this.keyword.value==''){alert('请输入关键字');return false;}"> <tr> <td align="center" background="images/bg.gif"> BLOG搜索 <input name="keyword" type="text" class="textinput" size="20"> <input type="hidden" name="exact" value="0"> <input type="radio" name="key" value="u" checked>用户名 <input type="radio" name="key" value="c">Blog名 <input type="radio" name="key" value="d">Blog描述 <input type="submit" class="textinput" value="GO"> </td> </tr> </form> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td class="topic">分类主题</td> </tr> <tr> <td bgcolor="#E8FFEE"> <?php pcmain_section_top_view(); ?> </td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="0"> <tr> <td class="topic">最新日志</td> </tr> <tr> <td><?php pcmain_blog_new_nodes(); ?></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr><?phppc_db_close($link);pcmain_html_quit()?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?