Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Use smartypaginate whit DB_DataObject

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
atm0n3r
Smarty n00b


Joined: 05 Nov 2011
Posts: 3

PostPosted: Tue Nov 22, 2011 9:00 pm    Post subject: Use smartypaginate whit DB_DataObject Reply with quote

Hello,

I need a little help to use the pluging smartypaginate lib with the pear DB_DataObject:
I already use this plugin swap on another site, but now I do not know how!
Here is my query:

Code:
    // Function get_db_results pour la pagination
    function get_db_results() {
            // Requete sql
            $toph = DB_DataObject::factory('articles');
            $toph->statut = ARTICLES_ONLINE;
            $toph->whereAdd('shortdesc LIKE \'%'.$q.'%\''); // Trie par home position (page d'acceuil)
            $toph->orderBy('shortdesc ASC'); // Limite les requetes
            $toph->limit(50);
            $toph->find();
 
        return $toph;
 
 
    }
 

    // required connect
    SmartyPaginate::connect();
    // set items per page
    SmartyPaginate::setLimit(25);
    SmartyPaginate::setTotal(50);
    // assign your db results to the template
    $smarty->assign('resultSearch', get_db_results());
    // assign {$paginate} var
    SmartyPaginate::assign($smarty);


until then, my Doclass are passing in my dwt ... I get my pictures and everything I need.
Pagination working (I see the links) but not reflected on this article, I see Article 50 instead of seeing 25 pages

I can not find the error ... if anyone can help me Wink
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP