⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 清华BBS源代码
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php	/*	** @id:windinsn dec 3,2003	*/	require("pcfuncs.php");	function pc_get_archfile($pc,$wrap=FALSE)	{		$startYear = (int)($pc["CREATED"] / 10000000000);		$startMonth = (int)(($pc["CREATED"]-$startYear*10000000000) / 100000000);			$thisYear = date("Y");		$thisMonth = date("m");		$i = 0;		for($yy=$thisYear ; $yy >= $startYear ; $yy --)		{			$firstMonth = ($yy == $startYear)?$startMonth:1;			for($mm = $thisMonth ; $mm >= $firstMonth  ; $mm --)			{				if($wrap && $i==0) echo "<li>";				echo "<a href=\"pcarch.php?userid=".$pc["USER"]."&y=".$yy."&m=".$mm."\" target=\"_blank\">".$yy."年".$mm."月</a>\n";				if($wrap && $i==0) echo "</li>";				$i = 1 - $i ;			}			$thisMonth = 12;			}	}		function get_calendar_array($link,$pc,$pur,&$totalnodes)	{?><script language="javascript">var blogCalendarArray = new Array();var blogNodeUrl = "pccon.php?id=<?php echo $pc["UID"]; ?>&s=all";<?php			$query = "SELECT `nid` , `created` FROM nodes WHERE `uid` = '".$pc["UID"]."' AND `type` = 0 ";		if($pur == 0)			$query .= " AND `access` = 0 ";		elseif($pur > 0)			$query .= " AND ( `access` = 0 OR `access` = 1 ) ";		//elseif($pur == 3)		//	$query .= " AND ( `access` = 0 OR `access` = 1 OR `access` = 2 ) ";		$query .= " ORDER BY `nid` DESC;";		$result = mysql_query($query,$link);		$totalnodes = mysql_num_rows($result); //所有日志数		$bc = array();		while($rows = mysql_fetch_array($result))		{			if(!$bc[substr($rows[created],0,8)])			{				$bc[substr($rows[created],0,8)] = $rows[nid] ;				?>blogCalendarArray[<?php echo substr($rows[created],0,8); ?>] = <?php echo (int)($rows[nid]); ?>;<?php						}			else				continue;		}?></script><?php		mysql_free_result($result);	}		function pc_user_infor($pc)	{		if($pc[INFOR]) echo $pc[INFOR];		}		function pc_load_nodes($link,$pc,$pur=0,$pno)	{		$start = $pc["INDEX"]["nodeNum"] * ( $pno - 1 );		$query = "SELECT * FROM `nodes` WHERE `uid` = '".$pc["UID"]."' AND type = 0 ";		if($pur == 0)			$query .= " AND `access` = 0 ";		elseif($pur > 0)			$query .= " AND ( `access` = 0 OR `access` = 1 ) ";		//elseif($pur == 3)		//	$query .= " AND ( `access` = 0 OR `access` = 1 OR `access` = 2 ) ";		$query .= " ORDER BY `nid` DESC LIMIT ".$start." , 10 ;";		$result = mysql_query($query,$link);		$nodes = array();		$i = 0;		while($rows=mysql_fetch_array($result))		{			$nodes[$i]=$rows;			$i ++;		}		mysql_free_result($result);		return $nodes;	}		function display_nodes($link,$pc,$nodes,$tablewidth="100%",$tablestyle=0,$totalnodes,$pno)	{		for($i=0;$i<min($pc["INDEX"]["nodeNum"],count($nodes));$i++)		{			$contentcss = ($nodes[$i][htmltag])?"indexcontentwithhtml":"indexcontent";			if($tablestyle==1)			{				$tableclass = "f1";				if($i%2==1)					$cellclass=array("t14","t14","t14");				else					$cellclass=array("t16","t16","t16");			}			else			{				$tableclass = "t15";				if($i%2==1)					$cellclass=array("t14","t11","t8");				else					$cellclass=array("t16","t13","t5");			}			echo "<center><table cellspacing=0 cellpadding=10 width=\"".$tablewidth."\" class=".$tableclass.">\n".			"<tr><td class=\"".$cellclass[0]."\">".time_format_date($nodes[$i][created])."</td>".			"<td class=\"".$cellclass[1]."\" align=right>[<a href=\"pccom.php?act=pst&nid=".$nodes[$i][nid]."\">评论</a>]\n".			"[<a href=\"";			if($pc["EMAIL"])				echo "mailto:".$pc["EMAIL"];			else				echo "/bbspstmail.php?userid=".$pc["USER"]."&title=问候";			echo "\">写信问候</a>]</td></tr>\n".			"<tr><td class=\"".$cellclass[0]."\"><img src=\"icon/".$nodes[$i][emote].".gif\" border=0 align=absmiddle>\n".			"<a href=\"pccon.php?id=".$pc["UID"]."&tid=".$nodes[$i][tid]."&nid=".$nodes[$i][nid]."&s=all\" class=f2>".html_format($nodes[$i][subject])."</a></td>".			"<td align=right class=\"".$cellclass[1]."\">&nbsp;</td>".			"</tr>";			if($pc["INDEX"]["nodeChars"]==0)				echo "<tr><td colspan=2 class=\"".$cellclass[1]."\"><font class='".$contentcss."'>".				     html_format($nodes[$i][body],TRUE,$nodes[$i][htmltag]).				     "</font></td></tr>\n";			else			{				echo "<tr><td colspan=2 class=\"".$cellclass[1]."\"><font class='".$contentcss."'>".				     html_format(substr($nodes[$i][body],0,$pc["INDEX"]["nodeChars"])." ",TRUE,$nodes[$i][htmltag]); 
                        	if (strlen($nodes[$i][body])>$pc["INDEX"]["nodeChars"]) 
                        		echo " <br class=\"\" /> ......<br class=\"\" /><br class=\"\" />".                        		     "<strong><A href=\"pccon.php?id=".$pc["UID"]."&tid=".$nodes[$i][tid]."&nid=".$nodes[$i][nid]."&s=all\">>> 阅读全文</A></strong>".                        		     "</font></td></tr>\n";; 
                        }                        echo "<tr><td colspan=2 class=\"".$cellclass[2]."\"><font class=\"f7\">\n&nbsp; <a href=\"/bbsqry.php?userid=".$pc["USER"]."\">".$pc["USER"]."</a> 发布于 ".time_format($nodes[$i][created]).			"\n|\n浏览[".$nodes[$i][visitcount]."]".			"\n|\n<a href=\"pccon.php?id=".$pc["UID"]."&tid=".$nodes[$i][tid]."&nid=".$nodes[$i][nid]."&s=all\">评论[".$nodes[$i][commentcount]."]</a>";			if($nodes[$i][trackback])				echo "\n|\n<a href=\"javascript:openScript('pctb.php?nid=".$nodes[$i][nid]."&uid=".$pc["UID"]."&subject=".base64_encode($nodes[$i][subject])."' , 460, 480)\">引用[".$nodes[$i][trackbackcount]."]</a>";			echo "</font></td></tr>\n</table></center>\n";		}		echo "<center><table cellspacing=0 cellpadding=10 width=\"".$tablewidth."\" class=".$tableclass.">\n".		     "<tr><td class=\"".$cellclass[2]."\" align=\"center\">";		display_blog_page_tool($pc,$totalnodes,$pno);		echo "</td></tr></table></center>";	}		function display_newnodes_list($link,$pc,$nodes)	{		for($i=0;$i< count($nodes);$i++)		{			echo "<li><a href=\"pccon.php?id=".$pc["UID"]."&nid=".$nodes[$i][nid]."&tid=".$nodes[$i][tid]."\">".html_format($nodes[$i][subject])."</a>(".time_format($nodes[$i][created]).")</li>\n";		}		?><p class="f1" align="right"><a href="pcdoc.php?userid=<?php echo $pc["USER"]; ?>">更多</a>&nbsp;&nbsp;&nbsp;&nbsp;</p><?php	}		function display_blog_area_links($sec,$pc,$tags)	{		global $loginok,$currentuser,$pcconfig;?>	<table cellpadding=5 cellspacing=0 border=0 class=t1>		<tr><?php		$i = 0;		while(list($secTag,$secTagValue) = each($tags))		{			if($i > 4 ) break;			if(!$secTagValue) continue;			echo "<td class=t11><a href=\"pcdoc.php?userid=".$pc["USER"]."&tag=".$secTag."\" class=\"f1\">".$sec[$secTag]."</a></td>\n";			$i ++ ;		}?>			<td class=t11>			<a href="/bbsdoc.php?board=<?php echo $pcconfig["BOARD"]; ?>" class="f1">Blog论坛</a>			</td>			<td class=t11>			<a href="pcsearch2.php" class="f1">Blog搜索</a>			</td><td class=t11>			<a href="pcmain.php" class="f1">Blog首页</a>			</td><td class=t11>			<a href="/<?php echo ($loginok==1 && strcmp($currentuser["userid"],"guest"))?"frames.html":"guest-frames.html"; ?>" class="f1"><?php echo $pcconfig["BBSNAME"]; ?></a>			</td>		</tr>	</table><?php	}	function display_blog_intro()	{		global $pc;?>	<table cellpadding=5 cellspacing=0 width="100%" border=0 class=t1>			<tr><td align="left" class="t2">			.: 欢迎访问<?php echo $pc["NAME"]; ?> :.			</td></tr>			<tr><td class="t8">			<?php 				if($pc["LOGO"])					echo "<img alt=\"".$pc["DESC"]."\" hspace=\"5\" src=\"".$pc["LOGO"]."\" align=\"left\" vspace=\"5\" border=\"0\" />";				echo $pc["DESC"]; 			?>	</td></tr></table>	<?php			}		function display_blog_page_tool($pc,$totalnodes,$pno)	{		if(!$pc["INDEX"]["nodeNum"])			return;		$totalpages =( ( $totalnodes - 1 ) / $pc["INDEX"]["nodeNum"] ) + 1 ;		$totalpages = intval($totalpages);		echo "[\n";		for($i = 1 ; $i < $pno ; $i ++)			echo "<a href=\"".$_SERVER["PHP_SELF"]."?id=".$pc["USER"]."&pno=".$i."\">".$i."</a>\n";		echo "<strong>".$pno."</strong>\n";		for($i = $pno + 1 ; $i < $totalpages + 1 ; $i ++)			echo "<a href=\"".$_SERVER["PHP_SELF"]."?id=".$pc["USER"]."&pno=".$i."\">".$i."</a>\n";		echo "]\n";	}			function display_blog_tools($pc,$pur)	{		global $loginok,$currentuser,$pcconfig;?><table cellpadding=3 cellspacing=0 width="100%" border=0 class=t1>			<form action="pcnsearch.php" method="get" onsubmit="if(this.keyword.value==''){alert('请输入关键字');return false;}">			<input type="hidden" name="area" value="<?php echo $pc["USER"]; ?>">			<tr><td align="left" class="t3">			<strong>Blog搜索</strong>			</td></tr>			<tr><td class="t4">			<input type="text" name="keyword" id="keyword" class="f1">			<input type="submit" value="GO" class="f1">			</td></tr>			</form>			<tr><td align="left" class="t3">			<strong>登录</strong>			</td></tr>			<?php				if($loginok==1 && strcmp($currentuser["userid"],"guest"))				{?><tr><td class="t4"><strong><?php echo $currentuser["userid"]; ?></strong>&nbsp;[<a href="/bbslogout.php" target="_top" class="f1">注销</a>]</td></tr><?php				}				else				{?><form action="/bbslogin.php?mainurl=/pc/index.php?id=<?php echo $pc["USER"]; ?>" method="post" name="form1" target="_top" ><tr><td class="t4">用户名:<INPUT TYPE=text class="f1" size="12" onMouseOver="this.focus()" onFocus="this.select()" name="id" ><br>密&nbsp;&nbsp;码:<INPUT TYPE=password  class="f1" size="12" name="passwd" maxlength="39"><br><INPUT TYPE=submit value="Login" class="f1"></form></td></tr><?php									}			?>			<?php			if($pur == 3)			{?>						<tr><td align="left" class="t3">			[			<a href="pcmanage.php?userid=<?php echo $pc["USER"]; ?>&act=post&tag=0&pid=0">添加文章</a>			]			[			<a href="pcdoc.php?userid=<?php echo $pc["USER"]; ?>&tag=7">参数设定</a>			]			</td></tr><?php			}?>		</table><?php	}		function display_blog_list($pc,$blogs)	{		for($i=0;$i<( count($blogs));$i++)		{			echo "<li><a href=\"pcdoc.php?userid=".$pc["USER"]."&tag=0&tid=".$blogs[$i]["TID"]."\">".html_format($blogs[$i]["NAME"])."</a></li>\n";						}	}		function display_blog_calendar()	{?><span id='bc'></span><script language=javascript>blogCalendar(<?php echo date("Y,m,d"); ?>);</script><?php			}		function display_blog_friend_links($pc,$wrap=FALSE)	{			for($i = 0 ; $i < count($pc["LINKS"]) ; $i ++)			{				if($wrap) echo "<li>";				if($pc["LINKS"][$i]["IMAGE"])					echo "<a href='http://".htmlspecialchars($pc["LINKS"][$i]["URL"])."'><img alt=\"".htmlspecialchars($pc["LINKS"][$i]["URL"])."\" src=\"http://".htmlspecialchars($pc["LINKS"][$i]["LINK"])."\" border=\"0\" align=\"absmiddle\"></a>\n";				else					echo "<a href='http://".htmlspecialchars($pc["LINKS"][$i]["URL"])."'>".htmlspecialchars($pc["LINKS"][$i]["LINK"])."</a>\n";				if($wrap) echo "</li>";			}	}	function display_blog_out_rss($pc)	{?><a href="rss.php?userid=<?php echo $pc["USER"]; ?>"><img src="images/xml.gif" align="absmiddle" alt="XML" border="0"></a><?php	}	function display_klip_out($pc)	{?><a href="klip.php?id=<?php echo $pc["USER"]; ?>"><img src="images/KlipFolio.gif" align="absmiddle" alt="Klip Folio" border="0"></a><?php	}		function display_trackback_links($link,$pc)	{		$query = "SELECT * FROM trackback WHERE uid = '".$pc["UID"]."' ORDER BY tbid DESC LIMIT 0 , 10;";			$result = mysql_query($query,$link);		while($rows = mysql_fetch_array($result))		{			echo "<li><a href=\"".htmlspecialchars(stripslashes($rows[url]))."\">".html_format($rows[title])."</a>"				."\n(".time_format($rows[time]).")</li>";		}		mysql_free_result($result);	}		function display_new_comments($link,$pc,$pur=0)	{		$query = "SELECT cid , comments.subject , comments.created , comments.username FROM comments, nodes WHERE comments.nid = nodes.nid ";		if($pur == 0)			$query .= " AND access = 0 ";		elseif($pur > 0)			$query .= " AND ( access = 0 OR access = 1 ) ";		//elseif($pur == 3)		//	$query .= " AND ( `access` = 0 OR `access` = 1 OR `access` = 2 ) ";		$query .= " AND comments.uid = ".$pc["UID"]." AND comment = 1 ORDER BY cid DESC LIMIT 0 , 10 ;";		$result = mysql_query($query,$link);		for($i = 0;$i < mysql_num_rows($result) ; $i++)		{			$rows = mysql_fetch_array($result);			echo "<li>[<a href=\"/bbsqry.php?userid=".$rows[username]."\">".$rows[username]."</a>]<a href=\"pcshowcom.php?cid=".$rows[cid]."\">".html_format($rows[subject])."</a>(".time_format($rows[created]).")</li>";		}		mysql_free_result($result);	}			function display_blog_earthsong($link,$pc,$sec,$nodes,$blogs,$pur,$tags,$pno,$totalnodes)	{		global $pcconfig;?><center><table cellspacing=0 cellpadding=0 border=0 width=780>	<tr><td colspan=2 height=167><img src="style/earthsong/es_r1_c1.jpg" border=0></td></tr>	<tr>	<td width=414 height=232><img src="style/earthsong/es_r2_c1.jpg" border=0></td>	<td width=366 height=232><img src="style/earthsong/es_r2_c2.jpg" border=0></td>	</tr>	<tr>	<td colspan=2 class="blogarea">	<table cellspacing=0 cellpadding=0 border=0 class=f1>	<tr><td class="blogarea" align="center">	<?php echo $pc["NAME"]; ?>&nbsp;&gt;&gt;	</td><td class="blogarea">	<?php display_blog_area_links($sec,$pc,$tags); ?></td>	</tr>	</table></td></tr>

⌨️ 快捷键说明

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