Total Index Page

Started on the old forum in October 2007 · view the original in the archive · old links redirect here

3 replies · 526 views · started 19 years ago · 1 min read

wapodium #1

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 ('../../test.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") { $file_array[] = $file; } } $file_count = count ($file_array); sort ($file_array);

echo "</style></head><body>"; echo "";

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

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

{echo ''; echo ' '; include("../../test.php"); echo ' '; } 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 ""; echo ''; include("../../test.php"); echo ""; echo ''; 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 ""; echo "</body>"; echo "</xhtml>"; ?>

Guest #2

take a look at the wapbuddy script

GumSlone Administrator Principal · 1,690 posts #3

Ad somewhere where you want to show the pages this code:

echo 'Page '.($page+1).' of '.ceil($file_count/$conf["items_per_page"]).'
';

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

wapodium #4

take a look at the wapbuddy script

and what script do you think is that?? ive just edited it but its still the wapbuddy script. lolz! thanks Gum. workin fine already.

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