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

📄 show.php

📁 这是一个新闻管理的软件
💻 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世纪网"></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统计计数器>");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">网页制作</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>"); ?> &lt;&lt; <a href="index.php">文章教程</a> &lt;&lt; <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">&nbsp;</td>
            <td align="center" width="150">子类</td>
            <td align="center" width="370">文章标题</td>
            <td align="center" width="100">更新时间</td>
            <td align="center" width="100">查看次数</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("<","&lt;",$message[$i]);
		$tmpmsg = str_replace(">","&gt;",$tmpmsg);
		$tmpmsg = str_replace("&lt;link&gt;","<",$tmpmsg);
 	$tmpmsg = str_replace("&lt;/link&gt;",">",$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>[发表新文章</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>[发表新文章</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 + -