Wap Buddy Next Page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Wap Buddy Next Page

    does this work now if not im going to bed
    Code:
    <?
    $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) != &#39;.&#39; 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>

    #2
    does this work now if not im going to bed
    Code:
    <?
    $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) != &#39;.&#39; 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>
    [/b]
    yeah its work fine now...don&#39;t know how to appreciate ur work @matty

    Comment

    Working...
    X