default.php

来自「清华BBS源代码」· PHP 代码 · 共 566 行 · 第 1/2 页

PHP
566
字号
<?phprequire("pcfuncs.php");require("pcstat.php");require("pcmainfuncs.php");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_);?><?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>&nbsp;<a href=\"/bbsqry.php?userid=".$newUser[username]."\"><font class=\"low\">".$newUser[username]."</font></a></li>";		}?>				<?php}function pcmain_blog_top_ten(){	global $pcconfig,$link;	$mostVstUsers = getMostVstUsers($link,_PCMAIN_USERS_NUM_);?>		<?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>&nbsp;<a href=\"/bbsqry.php?userid=".$mostVstUser[username]."\"><font class=\"low\">".$mostVstUser[username]."</font></a></li>";		}?>						<?php}function pcmain_blog_last_update(){	global $pcconfig,$link;	$lastUpdates = getLastUpdates($link,_PCMAIN_USERS_NUM_);?>				<?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>&nbsp;<a href=\"/bbsqry.php?userid=".$lastUpdate[username]."\"><font class=\"low\">".$lastUpdate[username]."</font></a></li>";		}?>								<?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">水木动态</font></td></tr>	<tr><td align="left" valign="top" class="td"><?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"]; ?>">&gt;&gt; 更多</a></li>	</td></tr></table><?php	}/*function pcmain_recommend_blogger(){	global $link;	mt_srand();	$pos = mt_rand(0,50);//排名前50的博客随机抽取一个	$query = "SELECT username , corpusname , description FROM users ORDER BY visitcount DESC LIMIT ".$pos.",1;";	$result = mysql_query($query,$link);	$pc = mysql_fetch_array($result);?><table width="100%" cellspacing="0" cellpadding="3" border="0" class="table">	<tr><td class="channelback" align="right"><font class="channel">博客推荐</font></td></tr>	<tr><td align="left" valign="top" bgcolor="#ECF5FF" class="td">	<table width="100%" cellspacing="0" cellpadding="3" border="0" class="table">		</table>	</td></tr></table><?php	mysql_free_result($result);	}*/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 "|&nbsp;<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&nbsp;<a href=\"index.php?id=".$pcinfor[USER]."\">";		//echo "<font class=low>".$pcinfor[NAME]."</font></a>&nbsp;<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%"><?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&nbsp;<a href=\"index.php?id=".$pcinfor[USER]."\">";		//echo "<font class=low>".$pcinfor[NAME]."</font></a>&nbsp;<a href=\"/bbsqry.php?userid=".$pcinfor[USER]."\">";		echo "<font class=low2>".$pcinfor[USER]."</font></a>";		echo "</li>\n";		}?>				</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%"><?php	for($i = 0;$i < $num ;$i ++)	{		if( $i == intval( $num / 2 ) ) echo "</tr><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&nbsp;<a href=\"index.php?id=".$pcinfor[USER]."\">";		//echo "<font class=low>".$pcinfor[NAME]."</font></a>&nbsp;<a href=\"/bbsqry.php?userid=".$pcinfor[USER]."\">";		echo "<font class=low2>".$pcinfor[USER]."</font></a>\n";		echo "</li>\n";		}?></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>]".			"&nbsp;<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]."&tid=".$newBlogs[useretems][$i][tid]."&nid=".$newBlogs[useretems][$i][nid]."&s=all'>".			"<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%"><?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&nbsp;<a href=\"index.php?id=".$pcinfor[USER]."\">";		//echo "<font class=low>".$pcinfor[NAME]."</font></a>&nbsp;<a href=\"/bbsqry.php?userid=".$pcinfor["USER"]."\">";		echo "<font class=low2>".$pcinfor["USER"]."</font></a>";		echo "</li>\n";		}?></td></tr>			</table><?php		}function pcmain_blog_sections(){	global $pcconfig;	$secNum = count($pcconfig["SECTION"]);	$secKeys = array_keys($pcconfig["SECTION"]);?><table width="100%" cellpadding="2" cellspacing="0"><?php	for($i = 0 ; $i < $secNum ; $i ++ )	{		if( $i % 9 == 0 ) echo "<tr>";				echo "<td align=center><a href=\"pcsec.php?sec=".htmlspecialchars($secKeys[$i])."\">".htmlspecialchars($pcconfig["SECTION"][$secKeys[$i]])."</a></td>";

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?