read all files in folder and paginate

PHP coding talk.

Moderator: Moderators

read all files in folder and paginate

Postby roders22 on Tue Oct 31, 2006 9:03 am

Hi all,
I know how to read all files present in a folder and display it but is there a way to paginate them as well?
User avatar
roders22
Registered User
Registered User
 
Posts: 141
Joined: Thu Jun 09, 2005 4:33 pm
Location: Mauritius

Postby blueray on Wed Nov 01, 2006 11:45 am

Please have a look at phpbb pagination function

or here

http://pbms.bestbulletinboard.com/viewtopic.php?p=3#3
blueray
Registered User
Registered User
 
Posts: 7
Joined: Fri Oct 06, 2006 5:08 am

Postby roders22 on Wed Nov 01, 2006 2:12 pm

Manage to do it. But i have to say that there might be a bug in the script that you pointed me to, because the next and prev text wasn't appearing even if i set it to true. And also the & in the link is constantly there.
User avatar
roders22
Registered User
Registered User
 
Posts: 141
Joined: Thu Jun 09, 2005 4:33 pm
Location: Mauritius

Postby blueray on Wed Nov 01, 2006 4:30 pm

hi, roders22, it does't , the code I have posted just is a part of it. You should download a copy of phpbb to checkout how it is called.
Also I can't post full code althought it is under GPL. So, checkout again to see which file this function is called from. I have updated it to show partial code.

Be sure ths vars are correctly setup
$base_url => the base url of you page
$num_items => total number of items
$per_page => items per page
$start_item => this should be a get varaible and should set as this way

Code: Select all
   $start_item = isset($_GET['start']) ? $_GET['start'] : 0;
   $start_item = intval($start_item) ? intval($start_item) : 0;


hope this help
blueray
Registered User
Registered User
 
Posts: 7
Joined: Fri Oct 06, 2006 5:08 am


Return to PHP Programming

Who is online

Users browsing this forum: No registered users and 0 guests

cron