Wapbuddy Download Script

Started on the old forum in August 2007 · view the original in the archive · old links redirect here

1 reply · 595 views · started 19 years ago · 1 min read

2 participants
modfiles Developer · 200 posts #1

i installed the script in javagames,s60games,index and have uploaded my files in that directory too. my problem is, my uploads doesn shows in index page, it only shows how many files are there. can na1 help me? heres the code.. CODEinclude("http://wapodium.freehostia.com/wapbuddy_settings.php"); if (!isset($page)) {$page = 0;} $total = 0;

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

<?php echo ""; include("http://wapodium.freehostia.com/admob.php"); echo " "; echo "***"; echo ""; echo " "; echo " "; echo ""; ?> <?php 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)) { echo "<a href=\"$file_name\">$file_name</a> (". round(filesize($file_name)/1024,1) . "kb) ------ "; $total = $total + filesize($file_name); } } if (($file_count > 0) AND ($page != 0)) { // previous button $prev_page = $page -1; echo " <a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">«Prev</a>"; } if (($file_count > 0) AND ($last_record < $file_count)) { // next button $next_page = $page + 1; echo " <a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">Next»</a> "; } echo " Total Files: $file_count "; if ($file_count == 1) {echo "file";} else {echo "files";} echo " (" . round($total/1024,1) . "kb)"; } closedir($dp); echo ""; ?>

page: $page Jump To Page

<input type="text" name="page" title="1-34 pages only" maxlength="20" size="03" value=""/>

<anchor><go href="index.php" method="post"><postfield name="page" value="$(page)"/></go>[GO]</anchor>

blackhowk Senior · 411 posts #2

fiirst put the corect path to includes (settings)

<? 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\">";

include("../wapbuddy_settings.php");

if (!isset($page)) {$page = 0;} $total = 0;

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="<? echo $conf["site_name"] ?>">

	<?

echo ""; include("http://wapodium.freehostia.com/admob.php"); echo " "; 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))
				{
		
				echo "<a href=\"$file_name\">$file_name</a> (". round(filesize($file_name)/1024,1) . "kb)

"; $total = $total + filesize($file_name); } }

		if (($file_count > 0) AND ($page != 0))
			{
			// previous button
			$prev_page = $page -1;
			echo "

<a href="".$_SERVER["PHP_SELF"]."?page=$prev_page">Prev</a> "; }

		if (($file_count > 0) AND ($last_record < $file_count))
			{
			// next button
			$next_page = $page + 1;
			echo "

<a href="".$_SERVER["PHP_SELF"]."?page=$next_page">Next</a> "; } echo " Directory: $file_count "; if ($file_count == 1) {echo "file";} else {echo "files";}

		echo " (" . round($total/1024,1) . "kb)";
		echo "

<a href="../index.php">Home</a>"; } closedir($dp); ?>

</card> </wml>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close