Wapbuddy Download Script

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

    Wapbuddy Download Script

    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..
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>include("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) != &#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="S60 Games">
    <p align="center" mode="nowrap">

    <?php

    echo "";

    include("http://wapodium.freehostia.com/admob.php");
    echo "
    ";
    echo "***";
    echo "
    ";
    echo "</p>";
    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>
    </p></div>

    #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) != &#39;.&#39; and $file != "index.php")
    {
    $file_array[] = $file;
    }
    }
    $file_count = count ($file_array);
    sort ($file_array);
    ?>
    <wml>
    <card id="card1" title="<? echo $conf["site_name"] ?>">
    <p mode="nowrap">


    <?

    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);
    ?>

    </p>
    </card>
    </wml>
    http://ngeo.ro

    Comment

    Working...
    X