Wapbuddy Addon

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

    Wapbuddy Addon

    Can sum1 make this script to work. cant figure out the problem. Help will be much appreciated..

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$conf["items_per_page"] = 8;
    header("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    print "";
    echo "";

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



    <div align="center">
    include("../../setting1.php");
    echo "
    ";
    include("../../setting2.php");
    echo "
    -----</div>

    ";

    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 "$file_name
    ";
    echo "Download (". round(filesize($file_name)/1024,1) . "kb)

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

    {echo &#39;

    &#39;;
    echo &#39;<div align="center">-----
    &#39;;
    include("../../setting3.php");
    echo &#39;
    &#39;;
    }
    if (($file_count > 0) AND ($page != 0))
    {
    // previous button
    $prev_page = $page -1;
    echo "
    -----
    <<Prev ";
    }
    if (($file_count > 0) AND ($last_record < $file_count))

    {
    // next button
    $next_page = $page + 1;
    echo "Next>>
    ";
    }
    echo "$file_count ";
    if ($file_count == 1)
    {echo "File";}
    else
    {echo "Files";}
    echo "
    ";

    if ($page == "")$page = "1";
    $pages =(int) ceil($file_count/ $conf);
    echo "Page $page/$pages
    ";
    echo "-----
    ";
    echo "Ringtones";
    echo "
    Home";
    }
    closedir($dp);
    ?>

    </div>


    </div>

    #2
    be a good idea to know what errors your currently getting

    Comment


      #3
      i was able to solve the first problem but as i put another add on, another problem again.. how can i remove in sub index the code that should only appear in main index as you click the download link??? and what should be the code for the total page display??
      <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$conf["items_per_page"] = 8;
      header("Content-type: text/vnd.wap.wml");
      header("Cache-Control: no-store, no-cache, must-revalidate");
      print "";
      echo "";

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




      <div align="center">
      include("../../../admob.php");
      echo "
      -----</div>

      ";

      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))
      if(!isset($_GET[&#39;download&#39;])) $_GET[&#39;download&#39;] = &#39;&#39;;
      switch($_GET[&#39;download&#39;]) {
      case &#39;&#39;;
      echo "$file_name
      ";
      echo "Download (". round(filesize($file_name)/1024,1) . "kb)

      ";

      break;
      case "$file_name";
      echo "Download File:
      ";
      echo "$file_name (". round(filesize($file_name)/1024,1) . "kb)
      ";
      $total = $total + filesize($file_name);
      }
      }

      echo &#39;

      &#39;;
      echo &#39;<div align="center">-----
      &#39;;
      include("../../../admob.php");
      echo &#39;
      &#39;;

      if (($file_count > 0) AND ($page != 0))

      {
      // previous button
      $prev_page = $page -1;
      echo "
      -----
      <<Prev ";
      }
      if (($file_count > 0) AND ($last_record < $file_count))
      {
      // next button
      $next_page = $page + 1;
      echo "Next>>
      ";
      }

      Page (1/total page)

      echo "
      -----
      ";
      include("../../../buzzcity.php");
      echo "
      ------
      ";
      echo "Nseries Games
      ";
      echo "Java Games";
      echo "
      Home";
      }

      closedir($dp);
      ?>

      </div>


      </div>

      Comment

      Working...
      X