SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 54
  1. #26
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    Did you get this fixed? I have the same problem!!

    kind Regards

    Chris

  2. #27
    paulerob
    SitePoint Community Guest
    Chris,

    most likely you have you php.ini file set to force the long version of the php open tag.
    Look for the following in your php.ini to be sure.
    short_open_tag = Off

    That being the case you need to edit the Paginated.php and PageLayout.php files and make sure the open tag is '<?php'. After that the example should run smoothly.

    paul.

  3. #28
    SitePoint Zealot
    Join Date
    Sep 2007
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for this useful article.

  4. #29
    Fideri
    SitePoint Community Guest
    The most flexible and easiest to implement pagination class I have seen so far. Brilliant.

  5. #30
    gobinath
    SitePoint Community Guest
    pagination using phpcode+mysql,html code

  6. #31
    new2php
    SitePoint Community Guest
    Your thoughts on using a default strategy or explicitly have the user define it in the constructor of Paginated class rather use setLayout()?

  7. #32
    SitePoint Member
    Join Date
    Jun 2007
    Location
    Trinidad and Tobago
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interesting now in ZF 1.6 is the Zend_Paginator. It works on the notion of a strategy for the data to be passed and accepts arrays and a db select object

    $pageNumber = $this->_getParam('page') ? $this->_getParam('page') : 1;

    $select->from('user')
    ->order("user.name")
    ->limitPage($pageNumber, 10);

    //set page number
    $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select));
    $paginator->setCurrentPageNumber($pageNumber);
    $paginator->setItemCountPerPage(10);
    Zend_Paginator::setDefaultScrollingStyle('All');
    Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_control.phtml');

    $this->view->paginator = $paginator;

    //the above is available in your view
    //<?=$this->paginator?> will echo page links

  8. #33
    O.J.
    SitePoint Community Guest
    Extremely useful on small result sets, but I think this would slow down pages with very large result sets. An approach similar to the Zend_Paginator may be applied by modifying the Paginated class to accept SQL SELECT strings.

  9. #34
    Anonymous
    SitePoint Community Guest
    wel coding.i like this type of templates.i will say it is nice coding.

  10. #35
    Nadeem Aslam
    SitePoint Community Guest
    it is good coding but i want to learn more easy steps!

  11. #36
    SitePoint Zealot darksystem's Avatar
    Join Date
    Jan 2005
    Location
    Fayettville, North Carolina
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as OJ mentioned, this is not good with huge result set. In thousand result set, this will surely pretty slow, what more with millions of records? Don't like to recommend this one.

    http://collecta-mania.com.au

  12. #37
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can this code be amended to use a set of ID's within the array as the pagination instead of page numbers?

    i.e instead of ?page=2 you would have ?imageid=1610, the resulting pagination thus forming permalinks.

  13. #38
    Federico
    SitePoint Community Guest
    Notice: Undefined offset: 8 in C:\workspace\turnos\hosting\scr\modelo\paginacion\Paginated.php on line 100 i have this problem when i have 8 items in my array and i show 5 elemens per page, the page 1 show ok but the second show this notice

  14. #39
    a reader
    SitePoint Community Guest
    Nice tutorial as usual, but i have to be honest, it's not really that easy to follow. Maybe i'm experiencing a blond moment, and i'm sure i could just download the code and play, but the run down on instructios need to be put into better novice terms or perhaps less use of web language terms would make this a little easier to read.

    I'm still learning PHP myself (constantly - it's never ending, lol), and although it makes sense for the most part, i can't help but feel baffled by what seems should be fairly straight-forward task.

    I'd suggest just this, pass along your article to a family member, someone with little or no experience and ask them if what they read makes sense, if not then perhaps rethink the wording or terms used.

    I've read many articles here, and it's an absolute gem of a resource, but i felt this one a little lacking in the breakdown. Of course that's not to say it's a bad article, it's great work, just left a little high and dry with the "idiot proof" run down on code.

    We idiots need it in simple terms to, even if the above seems simple enough... *does that make sense*...

    All the best to sitepoint peeps for 2009 anywho!!..

  15. #40
    kasey mccurdy
    SitePoint Community Guest
    add this at line 101 or so of Paginated.php (replace what's there) - should fix the error.

    if($index<sizeof($this->rs)){
    return $this->rs[$index];
    }else{
    return false;
    }

  16. #41
    Daniel Way
    SitePoint Community Guest
    The script works well, but how can I convert this so that it reads information out of my database? I also need to be able to have multiple column of data, is this possible to do?

    Dan.

  17. #42
    Great article
    SitePoint Community Guest
    I don't know PHP that well. I'm a Ruby guy. But this is what I'd expect from a pagination lib and was incredibly simple to work with & extend.

  18. #43
    Vlad
    SitePoint Community Guest
    Hey, awesome tutorial, works very well with personal extension, one thing (minor cosmetic fix); in your doublebarlayout.php, in order to keep consistency, put the "next" before the "last" at the very end of the file

  19. #44
    Martin Bean
    SitePoint Community Guest
    I can't say this class seems practical to use. It could be made so much more simpler than it is.

    For example, my pagination class you pass a result set, batch number (number of records to show at any one time) and the current page number. Job's a good 'un.

  20. #45
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Location
    Brisbane, Australia
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know, I find the following much easier myself
    PHP Code:
    $paginator Zend_Paginator::factory($rowset)
                     ->
    setCurrentPageNumber(3);

    echo 
    $paginator

  21. #46
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have tried to implement this class (which I love, by the way). It offers me the ability to enter my own query AND results display, which I haven't found anywhere else. I do have one question and am unsure of where to post it. Could someone please help me figure out where to post a question regarding the target being a page "included" in a div via a database query?

  22. #47
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    hi hapagirl and welcome to the forums

    Post your question in the main PHP forum.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  23. #48
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I love this Pagination!
    Last edited by LTT; Aug 24, 2009 at 12:06. Reason: I R DUMB

  24. #49
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fatal error: Interface 'PageLayout' not found in [path]\DoubleBarLayon line 4

    This is still not working for me either!!

    Did anyone find a solution?

    Colin

  25. #50
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SOLVED:

    require_once "DoubleBarLayout.php"; was needed.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •