BenGriffiths / pdo-mysqli-pagination

A PDO & MySQLi PHP Pagination Class - PDO MySQLi Pagination class is a PHP pagination class that will work with either PDO, or MySQLi. The outputted pagination is served as a UL or as an array, and the options are extensive.
50 stars 27 forks source link

how to display just prev and next links #9

Closed magna25 closed 10 years ago

magna25 commented 10 years ago

I would like to display only next and prev links. Is there any class for that? I don't need the numbers. If there is a class for that, all I need to do is use css and set it to display:none without any modification on php side. I need this for mobile version of my site. Thanks

jarebear6expepjozn6rakjq5iczi3irqwphcvb commented 10 years ago

You can try commenting out lines 679 through 699 of pagination.php to disable the creation of the additional page links. You might also need to comment out line 713 to make sure you don't get any stray ellipses.

magna25 commented 10 years ago

@cjaredrun Thanks that works however I want to hide the links only on mobile. Want to display it desktops and laptops.

jarebear6expepjozn6rakjq5iczi3irqwphcvb commented 10 years ago

That question isn't really specific to the code base, so you might do better asking on stackoverflow.com for how to differentiate between mobile and desktop and deciding what to show when. Good luck.

magna25 commented 10 years ago

@cjaredrun that's why I was asking if it has specific class so that I can apply media queries, you just don't have any idea what I meant. See below how I figured it out. Thanks for giving me the code line though.

on line 689 I just added hide class to the anchor tag and using media queries I set hide to display none for mobile devices.

   $this->links_html .= '<li><a  href="'.$this->build_link_url($counter).'" class="hide '.$this->get_current_or_normal_class($counter).'">'.$counter.'</a></li>'.PHP_EOL;