Total Index Page

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

    Total Index Page

    Can ne1 help me the code showing the total page and the page wherein the the user is in in this script? eg. Page: 3/15

    <?php

    $conf["items_per_page"] = 8;
    header("Pragma: no-cache");
    echo "<?xml version=\"1.0\"?>";
    echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
    echo "<head>";
    echo "<meta forua=\"false\" http-equiv=\"Cache-Control\" content=\"max-age=0\" />";
    echo "<meta forua=\"false\" http-equiv=\"Cache-Control\" content=\"must-revalidate\" />";
    echo "<meta name=\"keywords\" content=\"wap news, messages, chatrooms, downloads, mp3, games, scandals, AMR, polytones, animations, wallpapers, themes, applications, videos ,tools , wap service, entertainment, wap search, useful linksers Link, Wapmaster, top downloads, free\">";
    echo "<meta name=\"description\" content=\"100% Free Downloads\">";
    echo "<meta http-equiv=\"Content-type\" content=\"application/vnd.wap.xhtml+xml\" charset=\"utf-8\" />";
    echo "<title>Test</title>";
    echo "<style type=\"text/css\">";

    include (&#39;../../test.php&#39;);

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

    echo "</style></head><body>";
    echo "<div align=\"center\" class=\"dir\">";

    include("../../test.php");
    echo "
    </div>";
    echo "<div class=\"body\">";

    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 "<a href=\"$file_name\">Download (". round(filesize($file_name)/1024,1) . "kb)</a>

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

    {echo &#39;
    </div>&#39;;
    echo &#39;<div align="center">
    &#39;;
    include("../../test.php");
    echo &#39;
    &#39;;
    }
    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 "
    $file_count ";
    if ($file_count == 1)
    {echo "File";}
    else
    {echo "Files";}
    echo "<small /></div>";
    echo &#39;<div align="center" class="dir"><small>&#39;;
    include("../../test.php");
    echo "
    </div>";
    echo &#39;<div align="center" class="foot">&#39;;
    echo "<a href=\"../../themes/index.php\">Themes</a>";
    echo "
    <a href=\"../../index.php\"><img alt=\"\" src=\"../../../images/home.gif\" />Home</a>";
    }
    closedir($dp);
    echo "
    ";
    echo "</div>";
    echo "</body>";
    echo "</xhtml>";
    ?>

    #2
    take a look at the wapbuddy script

    Comment


      #3
      Ad somewhere where you want to show the pages this code:
      Code:
      echo &#39;Page &#39;.($page+1).&#39; of &#39;.ceil($file_count/$conf["items_per_page"]).&#39;
      &#39;;
      Advertise your mobile site for FREE with AdTwirl

      Comment


        #4
        take a look at the wapbuddy script[/b]
        and what script do you think is that?? ive just edited it but its still the wapbuddy script. lolz! thanks Gum. workin fine already.

        Comment

        Working...
        X