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

📄 index.php

📁 一具非常好的用系统你可照着说明就可以用了
💻 PHP
字号:
<? require ("inc/config.php");?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新易设计简单下载系统</title>
<link rel="stylesheet" href="css.css">
<script language='JavaScript1.2'>
function openScript(url, width, height) {
var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
}
window.status='';
</script>
<SCRIPT language=javascript>
<!-- Begin
tPopWait=100;
tPopShow=2000;
showPopStep=5;
popOpacity=99;
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;
document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { background-color: #52D0BB; border: 1px #2f4119 solid; color: #2f4119; font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");

function showPopupText(){
var o=event.srcElement;
MouseX=event.x;
MouseY=event.y;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
if(o.dypop!=sPop) {
sPop=o.dypop;
clearTimeout(curShow);
clearTimeout(tFadeOut);
clearTimeout(tFadeIn);
clearTimeout(tFadeWaiting); 
if(sPop==null || sPop=="") {
dypopLayer.innerHTML="";
dypopLayer.style.filter="Alpha()";
dypopLayer.filters.Alpha.opacity=0; 
}
else {
if(o.dyclass!=null) popStyle=o.dyclass 
else popStyle="cPopText";
curShow=setTimeout("showIt()",tPopWait);
}

}
}

function showIt(){
dypopLayer.className=popStyle;
dypopLayer.innerHTML=sPop;
popWidth=dypopLayer.clientWidth;
popHeight=dypopLayer.clientHeight;
if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
else popLeftAdjust=0;
if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
else popTopAdjust=0;
dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
dypopLayer.style.filter="Alpha(Opacity=0)";
fadeOut();
}

function fadeOut(){
if(dypopLayer.filters.Alpha.opacity<popOpacity) {
dypopLayer.filters.Alpha.opacity+=showPopStep;
tFadeOut=setTimeout("fadeOut()",1);
}
else {
dypopLayer.filters.Alpha.opacity=popOpacity;
tFadeWaiting=setTimeout("fadeIn()",tPopShow);
}
}

function fadeIn(){
if(dypopLayer.filters.Alpha.opacity>0) {
dypopLayer.filters.Alpha.opacity-=1;
tFadeIn=setTimeout("fadeIn()",1);
}
}
document.onmouseover=showPopupText;
// End -->
</SCRIPT>
<style type="text/css">
<!--
body {
	background-color: #52D0BB;
}
.style1 {color: #FF0000}
-->
</style></head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<div align="left">
  <table width="533" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr bgcolor="#52D0BB"> 
      <td height="21" bgcolor="#52D0BB"> 
        <div align="center" ><font color="#2f4119">|<a href="index.php">全部程序</a>| 
          <?
$fp=@file("index");
for ($i=1;$i<count($fp);$i++)
{
    $info=explode("│",$fp[$i]);
    echo "<a href=\"index.php?class=".$info[0]."\" title=\"".$info[2]."\n共有程序".$info[3]."个\">".$info[1]."</a>|";
    $$info[0]=$info[1];
}


?>
          </font><a href="search.php" class="style1">查找程序</a> </div></td>
    </tr>
    <tr>
      <td background="../index/images/bg.jpg"><TABLE bgcolor="#52D0BB" cellSpacing=0 cellPadding=0 width="533" border=0>
          <TR>
            <TD width="533">
              <TABLE bgcolor="#52D0BB" cellSpacing=0 cellPadding=0 width="533" border=0>
                <TBODY>
                  <TR>
                    <TD width="50%" height=20><b><font color="#2f4119">&nbsp;程序分类列表&nbsp;&gt;&gt;
                            <?if ($class) echo $$class;
elseif ($search) echo "全部程序检索";
else echo "全部程序";?>
                      <?
if ($class) 
{
    $fp=@file("index");
    for ($i=1;$i<count($fp);$i++)
    {
        $info=explode("│",$fp[$i]);
        if ($info[0]==$class)
        {
            $info[3]=intval($info[3]); echo $info[3];
        }
    }
}
elseif ($search)
{
	$key=trim($key);
	$fp=@file("date/index");
	$j=0;
	for ($i=0;$i<count($fp);$i++)
	{
        $info=explode("│",$fp[$i]);
        if (eregi($key,$info[1]))
        {
            $j++;
        }
    }
	echo $j;
}

else 
{
    $fp=@file("index");
    $sum=0;
    for ($i=1;$i<count($fp);$i++)
    {
        $info=explode("│",$fp[$i]);
        $info[3]=intval($info[3]);
        $sum+=$info[3];
    }
    echo $sum;
}


?>
                    个</font></b></TD>
                    <CENTER>
                      <TD width="50%"
height=20></TD>
                    </center>
                  </TR>
                </TBODY>
              </TABLE>
              <TABLE bgcolor="#52D0BB" cellSpacing=0 cellPadding=0 width="533" border=0>
                <TR>
                  <TD bgcolor="#52D0BB" width="7" rowspan="2" style="FONT-SIZE: 12px; LINE-HEIGHT: 22px"> </TD>
                  <TD bgcolor="#52D0BB" style="FONT-SIZE: 12px; LINE-HEIGHT: 22px" width="600" valign="top">
                    <table width="529" border="0" cellpadding="0" cellspacing="3">
                      <tr>
                        <td  width="46" height="20">
                        <div align="center"><font color="#2f4119">序号</font></div></td>
                        <td width="179" height="20">
                        <div align="center"><font color="#2f4119">程序名称</font></div></td>
                        <td width="84" height="20">
                        <div align="center"><font color="#2f4119">类别</font></div></td>
                        <td width="56" height="20">
                        <div align="center"><font color="#2f4119">下载次数</font></div></td>
                        <td width="217" height="20">
                        <div align="center"><font color="#2f4119">加入时间</font></div></td>
                      </tr>
                      <tr>
                        <td>
                          <?
if ($class) 
{
    $fp=@file("date/index");
    $t=0;
    for ($i=0;$i<count($fp);$i++)
    if (eregi("^$class",$fp[$i]))  
    {
        $temp[$t]=$fp[$i];$t++; 
    }
    $total=count($temp);
    $pages=intval($total/$pageshows);
    if (($total%$pageshows)!=0) $pages++;
	if ($pages==0) $pages=1;
    if ($topage)
    {
		if (eregi("[^0-9]",$topage)) $topage=1;
        if ($topage>$pages) $page=$pages;
        else $page=$topage;
    }
    if (!isset($page))
    $page=1;
    //计算记录偏移量
    $offset=$pageshows*($page-1);
    //循环显示
    //判断数组是否到末尾
    $j=$total-$offset-$pageshows;
    if ($j<0) $j=0;
    $sum=0;
    for ($i=$total-$offset-1;$i>=$j;$i--)
    {
        $info=explode("│",$temp[$i]);
        $sum++;
        echo "<tr bgcolor=\"#52D0BB\" bordercolor=\"#2f4119\">";
        echo "<td bgcolor=\"#52D0BB\" width=\"54\" height=\"2\"><div align=\"center\">".($offset+$sum)."</div></td>";
        echo "<td bgcolor=\"#52D0BB\" width=\"150\" height=\"2\"><div align=\"left\"><a href=javascript:openScript('show.php?filename=$info[2]',500,520) >$info[1]</a></div></td>";
        echo "<td bgcolor=\"#52D0BB\" width=\"50\" height=\"2\"><div align=\"center\">".$$class."</div></td>";
        echo "<td bgcolor=\"#52D0BB\" width=\"30\" height=\"2\"><div align=\"center\">".$info[3]."</div></td>";
        echo "<td bgcolor=\"#52D0BB\" width=\"122\" height=\"2\"><div align=\"center\">".$info[4]."</div></td>";
        echo "</tr>";
    }
	echo "</table>";
    echo "<div align='right'>共有".$pages."页[".$page."/".$pages."]</div>";
    for ($i=1;$i<$page;$i++)
    echo "<a href='index.php?class=".$class."&page=".$i."'>第".$i ."页</a>  ";
    echo "第".$page."页  ";
    for ($i=$page+1;$i<=$pages;$i++)
    echo "<a href='index.php?class=".$class."&page=".$i."'>第".$i ."页</a>  ";
    //显示转到页数
    echo "<form action='index.php?class=".$class."' method='post'> ";
    //计算首页、上一页、下一页、尾页的页数值
    $first=1;
    $prev=$page-1;
    $next=$page+1;
    $last=$pages;
    if ($page>1)
    {
        echo "<a href='index.php?class=".$class."&page=".$first."'>首页</a>  ";
        echo "<a href='index.php?class=".$class."&page=".$prev."'>上一页</a>  ";
    }
    if ($page<$pages)
    {
        echo "<a href='index.php?class=".$class."&page=".$next."'>下一页</a>  ";
        echo "<a href='index.php?class=".$class."&page=".$last."'>尾页</a>  ";
    }
    echo "转到<input type=text name='topage' size='2' style=\"background-color:#52D0BB; color:#2f4119; border: 0 double #B4B4B4\" onMouseOver = \"this.style.backgroundColor = '#52D0BB'\" onMouseOut = \"this.style.backgroundColor = ''\" value=".$page.">页 ";
    echo "<input type=submit name='more' value='GO' style='background-color:#52D0BB;color:#2f4119;border:0 double'>";
    echo "</form>";
}
elseif ($search)
{
	$key=trim($key);
	$fp=@file("date/index");
	$sum=0;
	for($i=count($fp)-1;$i>=0;$i--)
	{
		$info=explode("│",$fp[$i]);
		if (eregi($key,$info[1]))
		{
			$sum++;
			echo "<tr bgcolor=\"#52D0BB\" bordercolor=\"#52D0BB\">";
	        echo "<td bgcolor=\"#52D0BB\" width=\"54\" height=\"2\"><div align=\"center\">".($sum)."</div></td>";
		    echo "<td bgcolor=\"#52D0BB\" width=\"150\" height=\"2\"><div align=\"left\"><a href=javascript:openScript('show.php?filename=$info[2]',500,520)>$info[1]</a></div></td>";
	        echo "<td bgcolor=\"#52D0BB\" width=\"50\" height=\"2\"><div align=\"center\">".$$info[0]."</div></td>";
		    echo "<td bgcolor=\"#52D0BB\" width=\"30\" height=\"2\"><div align=\"center\">".$info[3]."</div></td>";
			echo "<td bgcolor=\"#52D0BB\" width=\"122\" height=\"2\"><div align=\"center\">".$info[4]."</div></td>";
			echo "</tr>";
		}	
	}
	echo "</table>";
}

else
{
    $fp=@file("date/index");
    $total=count($fp);
    $pages=intval($total/$pageshows);
    if (($total%$pageshows)!=0) $pages++;
	if ($pages==0) $pages=1;
    if ($topage)
    {
		if (eregi("[^0-9]",$topage)) $topage=1;
        if ($topage>$pages) $page=$pages;
        else $page=$topage;
    }
    if (!isset($page))
    $page=1;
    //计算记录偏移量
    $offset=$pageshows*($page-1);
    //循环显示
    //判断数组是否到末尾
    $j=$total-$offset-$pageshows;
    if ($j<0) $j=0;
    $sum=0;
    for ($i=$total-$offset-1;$i>=$j;$i--)
    {
        $info=explode("│",$fp[$i]);
        $sum++;
        echo "<tr bgcolor=\"#52D0BB\" bordercolor=\"#52D0BB\">";
        echo "<td bgcolor=\"#52D0BB\" width=\"54\" height=\"2\"><div align=\"center\">".($offset+$sum)."</div></td>";
        echo "<td bgcolor=\"#52D0BB\" width=\"150\" height=\"2\"><div align=\"left\"><a href=javascript:openScript('show.php?filename=$info[2]',500,520) title=$info[1]>$info[1]</a></div></td>";
        echo "<td bgcolor=\"#52D0BB\" width=\"50\" height=\"2\"><div align=\"center\">".$$info[0]."</div></td>";
        echo "<td bgcolor=\"#52D0BB\" width=\"30\" height=\"2\"><div align=\"center\">".$info[3]."</div></td>";
        echo "<td bgcolor=\"#52D0BB\" width=\"122\" height=\"2\"><div align=\"center\">".$info[4]."</div></td>";
        echo "</tr>";
    }
	echo "</table>";
    echo "<div align='right'>共有".$pages."页[".$page."/".$pages."]         ";
    $first=1;
    $prev=$page-1;
    $next=$page+1;
    $last=$pages;
    if ($page>1)
    {
        echo "<a href='index.php?page=".$first."'>首页</a>  ";
        echo "<a href='index.php?page=".$prev."'>上一页</a>  ";
    }
    if ($page<$pages)
    {
        echo "<a href='index.php?page=".$next."'>下一页</a>  ";
        echo "<a href='index.php?page=".$last."'>尾页</a>  ";
    }
	echo "</div>";
}


?>
                        </TD>
                      </TR>
                    </TABLE></TD>
                </TR>
              </TABLE></TD>
          </TR>
          <tr>
            <td hight=30> </td>
          </tr>
        </TABLE></td>
    </tr>
    <tr> 
      <td height="20"> 
        <div align="center"></div> </td>
    </tr>
  </table>

</div>
</body>
</html>

⌨️ 快捷键说明

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