Xuups
Get an account!     Login

Utilities

Main menu

Who's Online

13 user(s) are online (1 user(s) are browsing Hacks and Tips)

Members: 0
Guests: 13

more...

Get Xoops

Support Xuups Project

Modules :  Adding pagination to your module
 
Adding pagination to your module
To you use this you must create the module handler class first for db operation

if (isset($_GET['start']) ) {
    
$start intval($_GET['start']);
    } else {
    
$start 0;
        
     }
    
$this_handler =& xoops_getModuleHandler('tablename','modulename');
    
        
$numrows $this_handler->getCount();
        
$recordsperpage 1;
        if (
$numrows $recordsperpage){
        include_once 
XOOPS_ROOT_PATH '/class/pagenav.php';
        if (!
$start$start 0
        
$nav = new XoopsPageNav($numrows$recordsperpage$start'start');
        echo 
"<div align='left'>".$nav->renderNav(4)."</div>";
    } 
        
        
$criteria = new CriteriaCompo();
        
$criteria->setSort("id");
        
$criteria->setOrder("DESC");
        
$criteria->setLimit($recordsperpage);
        
$criteria->setStart($start);
        
$obj $this_handler->getall($criteria);


you can print your result here

Author
Waqar
Author Waqar
News by the same authorMore stories
Author rssAuthor rss
StatisticsStatistics
 
Story
Date 2009/8/31 15:13:17
Views 2333
Favorites 0
Send this Story to a FriendSend
Printer Friendly PagePrint
Create a PDF from the articleCreate a pdf
 
Bookmarks
         
         
         
         
         
     
Recents
Adding pagination to your module
Random
Adding pagination to your module
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread
trabis
Posted: 2009/9/1 23:52  Updated: 2009/9/1 23:52
Moderator
Joined: 2008/4/7
From: Portugal
Posts: 303
 Re: Adding pagination to your module
Very nice Waqar, thanks for sharing!

Welcome to xuups
 

Login

Username:

Password:

Remember me



Lost Password?

Register now!

Ajax Search


Advanced Search

Sub menu

Last comments