Jump to content

Recommended Posts

I have looked over this tutorial:
http://www.phpfreaks.com/tutorials/73/1.php

I have a question.. well... basically it is an addon that I cant figure out.

How would I modify the code to only display a maximum of 5 pages at a time, where the current page is in the middle unless it is numbers 1, 2, or the last two pages?

Say there is a total of 10 pages, and I am viewing page 4, then the counter should say:
2 3 [b]4[/b] 5 6

If Im viewing page 2:
1 [b]2[/b] 3 4 5

If Im viewing page 8:
6 7 [b]8[/b] 9 10

If Im viewing page 10:
6 7 8 9 [b]10[/b]

You get the idea (the bold is the current page, everthing else is my link).
Link to comment
https://forums.phpfreaks.com/topic/31390-number-of-pages/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.