page count at bottom with prev next links

16 posts by 7 authors in: Forums > CMS Builder
Last Post: June 13, 2011   (RSS)

By Jason - June 8, 2011

Hi Andy,

If you could attach your current .php file, I could take a look and make some suggestions.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Mikey - June 8, 2011

Andy,
That's a great idea! I look forward to seeing what you come up with to get that working.

Re: [Jason] Additional help needed, was Re: [Damon] page count at bottom with prev next links

By andybarn - June 9, 2011

Hi Jason,

Please see attached php file. The Code Pagination starts at row 285

Thanks for your help.

Andy
Attachments:

listings_001.php 28K

By Jason - June 9, 2011

Hi Andy,

Here is a basic implementation.

It allows you to set a maximum number of pages to display, in this example, we use the number 9. If the page we're outputting is greater than this (ie, when we hit 10), it will output 3 periods (...) and a link to the last page:

<?php
$maxPageNumbers = 9;
?>
<?php foreach (range(1, $listingMetaData['totalPages']) as $page): ?>

<?php if ($page > $maxPageNumbers): ?>
&nbsp;...&nbsp;
<a href= "?<?php echo http_build_query(array_merge($_REQUEST, array( 'page' => $listingsMetaData['totalPages'] ))) ?>"><?php echo $listingsMetaData['totalPages']; ?></a>
<?php break; ?>
<?php endif ?>

<?php if ($page == $current_page): ?>
<strong><?php echo $page; ?></strong>
<?php else: ?>
<a href="?<?php echo http_build_query(array_merge($_REQUEST, array( 'page' => $page ))) ?>" class="whitetextlg"><?php echo $page; ?></a>
<?php endif ?>

<?php endforeach; ?>

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Jason - June 13, 2011

Hi Andy,

Here is a post by Chris that should help get you started on this:

http://www.interactivetools.com/forum/gforum.cgi?post=77815#77815

Hope this helps. Please let me know if you run into any issues.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/