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

📄 index.php

📁 wap 程序 手器电脑通用
💻 PHP
字号:
<?
/** 
*
* @package wappyCULT: wap community script
* @version 1.00 2006/09/12 21:53:27 wappy
* @copyright (c) 2004-2006 wappyCULT 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
*/
Include ('../function_dskspace.php');
header("Content-type: text/vnd.wap.wml"); 
echo "<?xml version=\"1.0\"?>"; 
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; 

$conf["items_per_page"] = 10;
if (!isset($page)) {$page = 0;}
$user = explode ('/', $HTTP_USER_AGENT);

if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array(); 
while ($file = readdir ($dp))
	{
	if(substr($file,0,1) != '.' and $file != "index.php")
		{
		$file_array[] =  $file;
		}
	}
$file_count = count ($file_array);
sort ($file_array);
?> 
<wml> 
<card id="card1" title="wappyCULT"> 
	<p mode="nowrap">

		<?
if ($file_count=="0"){echo "<small>Sorry there are $file_count files in this folder!</small>";}		
		if ($file_count > 0)
			{
			$first_record = $page * $conf["items_per_page"];
			$last_record = $first_record + $conf["items_per_page"];
			
			while (list($fileIndexValue, $file_name) = each ($file_array))
				{
				


				if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
					{
//icon code
$icon = "unknown.gif";
$rev = strrev ($file_name);
$exp = explode (".", $rev);
$true = strrev ($exp[0]);
$trueext = strtolower ($true);
if ($trueext=="zip" OR $trueext=="rar" OR $trueext=="gz"){$icon = "zip.gif";}
if ($trueext=="amr"){$icon = "amr.gif";}
if ($trueext=="midi"){$icon = "midi.gif";}
if ($trueext=="mid"){$icon = "mid.gif";}
if ($trueext=="gif"){$icon = "gif.gif";}
if ($trueext=="jpeg"){$icon = "jpeg.gif";}
if ($trueext=="jpg"){$icon = "jpg.gif";}
if ($trueext=="jad"){$icon = "jad.gif";}
if ($trueext=="jar"){$icon = "jar.gif";}
if ($trueext=="sis"){$icon = "sis.gif";}
if ($trueext=="bmp"){$icon = "bmp.gif";}
if ($trueext=="wbmp"){$icon = "wbmp.gif";}
if ($trueext=="txt"){$icon = "txt.gif";}
if ($trueext=="avi"){$icon = "avi.gif";}
if ($trueext=="thm"){$icon = "thm.gif";}
if ($trueext=="nth"){$icon = "nth.gif";}
if ($trueext=="png"){$icon = "png.gif";}
if ($trueext=="mmf"){$icon = "mp4.gif";}
if ($trueext=="wav"){$icon = "wav.gif";}

//find true path
$docname = "" . $_SERVER [ 'SERVER_NAME' ] . $_SERVER [ 'PHP_SELF' ];
$path = dirname($docname);

//show file links	
$number=($fileIndexValue+1);
$size = round(filesize($file_name)/1024,1);					echo "<small><a href=\"../file.php?file=$file_name&amp;icon=$icon&amp;path=$path&amp;page=$page&amp;size=$size&amp;type=$trueext&amp;sid=$sid\"><img src=\"../images/$icon\" alt=\"$number\"/>$file_name ($size KB)</a></small><br/>";
					$total = $total + filesize($file_name);
					}
				}

$pages =(int) ceil($file_count / $conf["items_per_page"]);
$pages = ($pages -1);
if ($pages>0){ echo "<small>---</small><br/>";}			
			if (($file_count > 0) AND ($page != 0))
				{
				// previous button
				$prev_page = $page -1;
				echo "<small><a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">&#171;Prev</a></small>";
				}
			
			
			if (($file_count > 0) AND ($last_record < $file_count))
				{
				// next button
				$next_page = $page + 1;
				echo "|<small><a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page&amp;sid=$sid\">Next&#187;</a></small>";
				}


if ($page>$pages){echo "<br/><small>---<br/>This page does not exist!</small>";}
if($pages>2){echo "<small><br/>---<br/>Jump (0-$pages/$page):</small><br/>";}
if($pages>2)print "<input emptyok=\"true\" name=\"jump\" format=\"*N\" size=\"3\" value=\"\" /><small><a href=\"".$_SERVER["PHP_SELF"]."?page=$(jump)&amp;sid=$sid\">[Go]</a></small>";
if ($page<$pages){echo "<br/><small><a href=\"".$_SERVER["PHP_SELF"]."?page=$pages&amp;sid=$sid\">&#187;Last page</a></small>";}
if ($page=="0" AND $file_count>10){echo "<br/>";}
if ($page>0){echo "<br/><small><a href=\"".$_SERVER["PHP_SELF"]."?page=0&amp;sid=$sid\">&#171;First page</a></small><br/>";}							
echo "<small>---<br/>$file_count </small>";
			if ($file_count == 1)
				{echo "<small>file </small>";}
			else
				{echo "<small>files </small>";}
echo "<small>in this folder:</small>";


$path = str_replace ("www.", "", $path);	
$space = dskspace ('./');
$space = round ($space/1024000,1);
$mb = "mb";
echo "<br/><small>$path/<br/>using $space$mb of space.</small>";
echo "<small><br/>---<br/>Search this folder:</small><br/>
<input title=\"Search:\" emptyok=\"true\" name=\"q\"/><br/><small>
<a href=\"../filesearchcat.php?path=$path&amp;page=$page&amp;sid=$sid&amp;search=$(q)\">Search</a></small>";

			}

		closedir($dp);

		echo "<small><br/>---<br/><a href=\"../index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a><br/>---<br/>&#169;2004-2006 wappyCULT</small>";

		?>
		
	</p>
</card> 
</wml> 

⌨️ 快捷键说明

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