Wap Buddy Next Page

Started on the old forum in April 2008 · view the original in the archive · old links redirect here

1 reply · 555 views · started 18 years ago · 1 min read

Guest #1

does this work now if not im going to bed

<?
$page = $_GET["page"];
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" and $file != "search.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
?> 
<wml> 
<card id="card1" title="Wallpapers Section"> 
<p mode="nowrap">

<?

echo "[size="1"]";

echo "[b][u]These Wallpapers Are So Cool![/u][/b]
";

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 Page</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 Page</a>
";
}
echo "
Total Files:
$file_count ";
if ($file_count == 1)
{echo "file";}
else
{echo "files";}

echo " (" . round($total/1024,1) . "kb)";
}
closedir($dp);
echo "[/size]";
?>

[size="1"]Search This Category:[/size]

<input title="Search:" emptyok="true" name="q"/>
[size="1"]
[url="search.php?search=$(q)"]search[/url][/size]

[size="1"]page: $page[/size]
[size="1"]Jump To Page[/size]

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

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

[size="1"][url="../index.php"]Downloads Menu[/url][/size]
</p>
</card> 
</wml>
HUMAYUN Newbie · 7 posts #2

does this work now if not im going to bed

<?
$page = $_GET["page"];
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" and $file != "search.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
?> 
<wml> 
<card id="card1" title="Wallpapers Section"> 
<p mode="nowrap">

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

yeah its work fine now...don't know how to appreciate ur work @matty

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