Zebra_Pagination, a generic, Twitter Bootstrap compatible, pagination class written in PHP

Get the latest updates on this PHP library via RSS



You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Zebra_Pagination, a generic, Twitter Bootstrap compatible, pagination class written in PHP”.

190 responses to “Zebra_Pagination, a generic, Twitter Bootstrap compatible, pagination class written in PHP”

Follow the comments via RSS
  • Wilma, 2013-12-16, 17:15

    Your great script stopped working after my hosting company upgraded to PHP5.4

    Opening the webpage shows
    01 02 03 04 05 06 07 09 09 10 … 25 next
    But on page?9 it shows
    previous 1 2 3 4 5 6 7 8 9
    and the next button disappeared

    $records_per_page = 10;

    Reply
    • Stefan Gabos, 2014-02-07, 15:09

      I am unable to reproduce this on PHP 5.4.12. Maybe your query is wrong

  • Reke, 2013-12-17, 18:07

    At first i would thank you for the very good PHP Script, Stefan.
    It works very well.

    But i have now a problem with the “url” method.
    My startpage address looks like this:

    http://localhost/einhundertelf/website/site/

    with “url” method and the variable “seite” next pages must been look like this

    http://localhost/einhundertelf/website/site/seite2,
    http://localhost/einhundertelf/website/site/seite3 etc.

    on the startpage it works very well, but on another page the links look like this for Example:

    http://localhost/einhundertelf/website/site/seite3?seite=4

    I have an RewriteRule in my htacces:

    RewriteRule ^seite(.*)$ index.php?seite=$1 [L]

    Can you help me Please?

    Greets from Germany,

    Reke

    Reply
    • Stefan Gabos, 2013-12-17, 20:53

      that’s because you must set the method to “url”…

    • Reke, 2013-12-18, 13:26

      Hi,

      i have already done this. Today It works with all links.
      I don´t know, maybe the cache was´nt emptied.

  • Gunju, 2014-01-26, 22:38

    finally i configured in my localhost works perfect. thanks a lot. 😉

    Reply
  • Guy, 2014-02-10, 13:35

    Great script, my page numbers have a leading 0 in front of them. How can I remove them please ?

    Reply
    • Stefan Gabos, 2014-02-10, 13:41
      $pagination->padding(false);
  • Karan, 2014-02-27, 15:06

    The pagination displays, when i click on number 2 or 3 to get to next page, it displays the same page

    Reply
  • edo, 2014-03-15, 15:43

    Hi, Stefan thank you for this class, it’s really helpful, i already the Docs, but i cant find how to add additional variable to the pagination outpot, for example i want the output to be like this = http://localhost/index.php?page=1&type=product, how can i accomplish this

    thank you in advance

    Reply
    • Stefan Gabos, 2014-03-17, 09:48

      it’s actually there in the documentation

      $pagination->base_url('http://localhost/index.php?type=product', true);
  • manisankar, 2014-09-08, 07:38

    is it possible implement filter option in this pagination?i tried it.but first page correct data,if i go to the Other page,full records automatically fetched.how to solve the issue

    Reply
  • manisankar, 2014-09-10, 10:25

    i want pass 7 values like page number.how can pass that value?.that seven values are search criteriae help me

    Reply
  • Rick, 2014-09-15, 01:28

    How can I use a variable returned via form in the where clause?

    Reply
  • Josh, 2014-09-15, 14:26

    Hey Stefan, thanks for the great plugin! I’m trying to get this working on a custom PHP file within WordPress (don’t ask why :)) I’ve hit a brick wall though. WordPress automatically redirects any /page2/, /page3/ etc. to /page/2/, /page/3/ etc. This messes up the pagination (basically it doesn’t show records beyond 1st page). I tried changing the variable_name(), method(), base_url() etc. for no avail. Is there something I can do to get this working? Thanks in advance!

    Reply
  • Larry, 2014-09-16, 23:34

    Stephan… Excellent plugin, very simple to set up and use, however I’m having an issue with a website that I am currently trying to use it on. I have .htaccess rule set to display URLs with .html extension like this:
    RewriteRule ^([^/]*)/([^/]*)/page-([^/]*)\.html$ /community.php?city=$1&community=$2&p=$3 [L]

    If I visit the 1st page link, which looks like this: /naples/olde-naples.html, the plugin wants to add the next page url after the .html like this: /naples/olde-naples.html/page-3, when I want it to display it like this: /naples/olde-naples/page-3.html.

    I’ve tried changing settings, and even tried to add some logic in with the code to avoid this but to no avail. Any ideas on how this can be accomplished?

    Thanks!

    Reply
  • Sam Fourie, 2014-10-16, 18:01

    Hi there very easy script. just one question.. not knowing much about PHP and JS how and where would I change it so that the page numbers appear below or above the prev and next links so that i can use this in a responsive bootstrap page

    Thank you
    Sam

    Reply
  • Sergio Araújo, 2014-10-29, 14:41

    Great Job Done here.
    I would like to add a anchor in the Url, liked to know how to do so.
    Like this index.php?page=2#portfolio
    Thanks.

    Reply
  • Shivani, 2014-11-12, 14:36

    Hello,

    This is an awesome script i must say!
    here my question is how can i maintain record’s order number on each pages? eg.(1,2….100)
    Right now if i have 10 records per page from the very next page order starts from 1 only.
    Thanks in advance.

    Reply
  • Zaftot, 2014-12-15, 18:46

    Great Class but i have problem
    The Description of my problem that:
    I used this class in my own simple MVC
    So,
    My Link before use class was
    public/home/index(or any other method)
    After i click on the link of class
    public/home/index/page2(or any num)?route=home/index/page2(or any num)
    and more on other hit on link

    i used url method
    and
    in my .httacess
    i use
    Options -MultiViews
    RewriteEngine On

    RewriteBase /mvc_ad/

    RewriteCond !-d
    RewriteCond !-f
    RewriteRule ^$ index.php?route=home [QSA,L]
    RewriteRule ^(.+)$ index.php?route=$1 [QSA,L]

    to remove route from url
    but it has been appear when used pagination class

    can u help me??

    Reply

Leave a Reply

Your email address will not be published
You can use <strong>, <em>, <a>, <img>, <code>
Characters are not case-sensitive