PHP Facebook Paginator

While building the Viddler Facebook application, I needed to create a pagination tool that worked just like Facebook’s. After looking at their HTML and their logic of what pages to display, I came up with one, which I’m releasing for anyone to use. The function takes 5 arguments, in the following order:

Here’s an example:

<?php echo paginator('/videos', 2, 44, 5, false, 'items'); ?>

And here’s what it would look like:

Paginator example

You can download the source here. Hopefully this helps someone!

Posted on July 8, 2008
Tagged with: , , , ,

7 Comments

Avatar

andi 21 Jul 2008 at 9:50AM

This is great, man. Thanks!

Avatar

Vaibhav 09 Apr 2009 at 3:33PM

This is GREAT………… Thanks a lot!!!!!!!!

Avatar

Kyle 09 Apr 2009 at 8:38PM

Glad I could help!

Avatar

Andrew Slattery 14 Apr 2009 at 5:10PM

If it works like I hope it does (and as the screenshot depicts), I look forward to using it in my Facebook app! So thanks in advance!

Avatar

Ram Khadka 02 May 2009 at 1:43AM

This is great. Thanks a lot

Avatar

Lisa 19 May 2009 at 3:35PM

Augmented to work my way, but amazing starting point! Thanks much!

Avatar

A.Hairi 14 May 2010 at 4:21PM

Thank you for sharing.

I am a still new to Facebook Application development and PHP. I am trying to show some items from an RSS feed inside my application tab using SimplePie. I was able to do so, but I wasn’t able to use your code in my case. Can you please elaborate more?

Thank you very much!

Leave A Comment

Ajax-loader