?? show.php
字號:
<?
if($id== "")
{
header("Location:../index.php");
}
else
{
$message = file("$id/$id.php");
$total = chop($message[0]);
$numperpage = 100;
$pagenumber = round(($total + $numperpage/2)/$numperpage);
if($page== ""){ $page=1;}
?>
<html>
<head>
<title><? print($msg[0][1]); ?></title>
<meta http-equiv="目錄類型" content="文本/html; 字符集=gb2312">
<link rel="stylesheet" type="text/css" href="../default.css">
</head>
<body bgcolor="#FFFFFF" leftmargin="4" topmargin="4">
<center>
<table width="770" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="176" height="60" valign="top"><img src="../image/php2000.gif" width="176" height="60" border=0 alt="PHP世紀網(wǎng)"></td>
<td width="468" height="70" align="center" valign="top">
<p><a href="http://easytoad.com/cgi-bin/banner.cgi?action=url&user=php2000" target="_blank"> <img width="468" height="60" src="http://easytoad.com/cgi-bin/banner.cgi?action=img&user=php2000&target=Comp" border="0"></a></p>
</td>
<td height="60" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td>
<script>document.write("<a href=http://top1.263.net/count/top.dll?Type=sharkpwd&id=A7908&ReferID=A7908 target=_blank>");document.write("<img src=http://top1.263.net/count/top.dll?Type=Img5&add=1&id=A7908&refer="+escape(top.document.referrer)+" border=0 alt=263統(tǒng)計計數(shù)器>");document.write("</a>");</script>
</td>
</tr>
<tr align="center">
<td><? print(date("Y年m月d日")); ?> </td>
</tr>
<tr align="center">
<td>-_-</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="2" bgcolor="99cc99">
<tr align="center">
<td width="10%">◆<a href="../index.html">主頁</a></td>
<td width="10%">◆<font color="#FF0000">文章教程</font></td>
<td width="10%">◆<a href="../my/index.php">站長作品</a></td>
<td width="10%">◆<a href="../freecode/index.php">代碼共享</a></td>
<td width="10%">◆<a href="../bbs/index.php">PHP 論壇</a></td>
<td width="10%">◆<a href="../homepage/javascript/index.htm">網(wǎng)頁制作</a></td>
<td width="10%">◆<a href="../../download/index.php">軟件下載</a></td>
</tr>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="0">
<tr align="right">
<td height="16"><? print("<a href=show.php?id=$id>".$id."</a>"); ?> << <a href="index.php">文章教程</a> << <a href="../index.html">主頁</a></td>
</tr>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="0">
<tr valign="middle">
<td height="10" align="center"><img src="../image/linepoint.gif" width="100%" height="1"></td>
</tr>
<tr valign="top">
<td align=center> <?
if($showdetail != "yes")
{
?>
<table width="100%" border="1" cellspacing="0" cellpadding="2" bordercolorlight="808080" bordercolordark="f0f0f0" bgcolor="f0f0f0">
<tr bgcolor="99cc99">
<td colspan="5" align="center"><? print($id); ?> </td>
</tr>
<form method=post action=search.php>
<tr>
<td height="30" colspan="5" align="center">文章搜索
<input type="text" name="keyword" size="40" maxlength="50">
<input type=hidden name=searchtype value=<?print($id)?>>
部位
<select name="searchtitle">
<option value="no">全部內容</option>
<option value="yes" selected>文章標題</option>
<option value="subid">子分類</option>
</select>
<input type="submit" name="Submit42" value="搜索">
</td>
</tr>
</form>
<tr bgcolor="99cc99">
<td colspan="5" align="center">共有<? print($total); ?>個,每頁顯示<? print($numperpage); ?>個,共<? print($pagenumber); ?>頁,當前是第<? print($page); ?>頁
<? for($i=1;$i<=$pagenumber;$i++){print("<a href=show.php?id=$id&&page=$i>[$i]</a>"); } ?></td>
</tr>
<tr bgcolor="d0d0d0">
<td align="center" width="50"> </td>
<td align="center" width="150">子類</td>
<td align="center" width="370">文章標題</td>
<td align="center" width="100">更新時間</td>
<td align="center" width="100">查看次數(shù)</td>
</tr>
<?
$begin = $total - ($page-1)*$numperpage;
for($i=$begin;($i>$begin-$numperpage) && ($i>0);$i--)
{
if(!file_exists("$id/$i.php"))continue;
$message = file("$id/$i.php");
$msg = split("\|\|",stripslashes($message[0]),99);
if(($msg[3] == "") || ($msg[3] == "\r\n"))$msg[3]="-";
?>
<tr>
<td align="center"><?print($i);?></td>
<td align="center"><?print($msg[3])?></td>
<td width="380"><? print("<a href=show.php?id=$id&&name=$i&&showdetail=yes>".$msg[0]."</a>"); ?></td>
<td align="center"><? print($msg[1]); ?></td>
<td align="center"><? print($msg[2]); ?></td>
</tr>
<?
}
?>
<tr bgcolor="99cc99">
<td colspan="5" align="center">共有<? print($total); ?>個,每頁顯示<? print($numperpage); ?>個,共<? print($pagenumber); ?>頁,當前是第<? print($page); ?>頁
<? for($i=1;$i<=$pagenumber;$i++){print("<a href=show.php?id=$id&&page=$i>[$i]</a>"); } ?></td>
</tr>
</table>
<?
}
else
{
$msg[$name][3]++;
$message = file("$id/$name.php");
$handle = fopen("$id/$name.php","w");
$msg = split("\|\|",$message[0],99);
$msg[2]++;
if( ($msg[3]=="") || ($msg[3] == "\r\n"))
fputs($handle,$msg[0]."||".$msg[1]."||".$msg[2]."||||\r\n");
else
fputs($handle,$msg[0]."||".$msg[1]."||".$msg[2]."||".$msg[3]."||\r\n");
for($i=1;$i<count($message);$i++)
{
if($message[$i] != "||\r\n")
fputs($handle,$message[$i]);
}
fclose($handle);
?>
<table width="80%" border="0" height=100 cellspacing="0" cellpadding="10">
<tr>
<td style= line-height:20pt>
<?
print("<center>".$msg[0]."<br>".$msg[1]."</center><p></td></tr><tr><td style= line-height:20pt>");
for($i=1;$i<count($message);$i++)
{
$tmpmsg = str_replace("<","<",$message[$i]);
$tmpmsg = str_replace(">",">",$tmpmsg);
$tmpmsg = str_replace("<link>","<",$tmpmsg);
$tmpmsg = str_replace("</link>",">",$tmpmsg);
$tmpmsg = str_replace("\r\n","<br>",$tmpmsg);
$tmpmsg = str_replace("\n","<br>",$tmpmsg);
print(stripslashes($tmpmsg));
}
?>
</td>
</tr>
</table>
<?
if(!file_exists("$id/$name"))
{
mkdir("$id/$name",0777);
}
if(!file_exists("$id/$name/max.txt"))
fclose(fopen("$id/$name/max.txt","w"));
chdir("$id/$name");
$max = file("max.txt");
if($page == "")
{
$page = 1;
}
$numperpage = 20;
$total = $max[0];
$totalpage = round( ($total+$numperpage/2)/$numperpage );
?>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr bgcolor="99cc99">
<td align="center"><?print($idcn);?></td>
</tr>
<tr bgcolor="f0f0f0">
<td align="center">共有<? print($total); ?>篇文章,每頁顯示<? print($numperpage); ?>篇,共<? print($totalpage); ?>頁,當前為第<? print($page); ?>頁
<a href=add.php?id=<?print($id);?>&fileid=<?print($name)?>&showdetail=yes>[發(fā)表新文章</a>]</td>
</tr>
<tr bgcolor="f0f0f0">
<td align="center"> <?
for($i=1;$i<=$totalpage;$i++)
{
print("[<a href=show.php?page=$i&id=$id&name=$name&showdetail=yes>$i</a>]");
}
?> </td>
</tr>
<tr>
<td> <?
function show($filename)
{
global $id,$name;
$filenamemsg = file($filename);
$msg = split("\|\|bbs\|\|",$filenamemsg[0],99);
print("<li type=square><a href='detail.php?filename=$filename&&id=$id&&fileid=$name'>".$msg[2]."</a> <font color=e0e0e0>".$msg[0]." ".$msg[4]."</font>\r\n");
for($i=1;$i<999999;$i++)
{
$tmp = $filename."_".$i;
if( file_exists($tmp) )
{
print("<ul>\r\n");
show($tmp);
print("</ul>\r\n");
}
else
{
break;
}
}
print("</li>");
}
$begin = $total-($page-1)*$numperpage;
$end = $begin - $numperpage;
print("<ul>");
for($i=$begin;($i>0) && ($i>$end);$i--)
{
show("$i");
}
print("</ul>");
chdir("../..");
?> </td>
</tr>
<tr bgcolor="f0f0f0">
<td align="center">共有<? print($total); ?>篇文章,每頁顯示<? print($numperpage); ?>篇,共<? print($totalpage); ?>頁,當前為第<? print($page); ?>頁
<a href=add.php?id=<?print($id);?>&fileid=<?print($name)?>&showdetail=yes>[發(fā)表新文章</a>]</td>
</tr>
<tr bgcolor="f0f0f0">
<td align="center"><?
for($i=1;$i<=$totalpage;$i++)
{
print("[<a href=show.php?page=$i&id=$id&name=$name&showdetail=yes>$i</a>]");
}
?> </td>
</tr>
</table>
<?
}
?> </td>
</tr>
</table>
<? include("bottom.php") ?>
</center>
</body>
</html>
<?
}
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -