The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to set Pages count limit
Aizen
post Dec 17 2014, 07:27 PM
Post #1


Newbie
*

Group: Members
Posts: 13
Joined: 15-December 14
Member No.: 21,939



I want to limit the number of page count displayed. For example, If the search result has 10+ pages, then instead of showing all the 10 page count below the page, I want to show something like <prev 1,2,3,4,5...10 next> and once the user clicks on 5 it should display <prev 6 7 8 9 10 next>

How can I achieve this in php? Any help will be appreciated, thanks.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Dec 17 2014, 11:01 PM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



You write a program to do it. There is no particular difficulty, as long as you understand what if() means and so on. If you have a program which already produces the results without a limit, and you wrote it yourself, well you could ask about specific details. If you can't actually understand programming yourself, you need to find someone to do it for you. Programming is quite unlike cookery, so there really isn't any way I can say "Just add some more salt."

This may not help, but unless you provide some details of what you have now, it's hard to see how to help.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Aizen
post Dec 18 2014, 01:13 AM
Post #3


Newbie
*

Group: Members
Posts: 13
Joined: 15-December 14
Member No.: 21,939



QUOTE(Brian Chandler @ Dec 17 2014, 11:01 PM) *

You write a program to do it. There is no particular difficulty, as long as you understand what if() means and so on. If you have a program which already produces the results without a limit, and you wrote it yourself, well you could ask about specific details. If you can't actually understand programming yourself, you need to find someone to do it for you. Programming is quite unlike cookery, so there really isn't any way I can say "Just add some more salt."

This may not help, but unless you provide some details of what you have now, it's hard to see how to help.


Thank you, but I've already figured it out.

You may have not done it intentionally, but your reply comes off rude. I know you have to write a program to do this, so telling me that isn't helpful, but rather insulting.
advising someone to find someone else if they can't code doesn't come off all that nice either. You could have easily in a few words asked me if you required more detail.
I know programming isn't cookery, which by the way is hard too, you can't just go around throwing salt. Just my two cents. Have a nice day.

This post has been edited by Aizen: Dec 18 2014, 01:58 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Dec 18 2014, 02:43 AM
Post #4


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



Well, how am I supposed to know what you can and can't see? You wrote rather clearly what you want to do, and you didn't supply any of the code that you have at the moment, or something you have written that doesn't work and you can't see why, so there really is almost nothing anyone can say, unless they feel like writing the whole thing for you.

Incidentally, actually the precise version you wrote is a Bad Idea (I have seen it in practice), because the viewer can't see how many pages there are, so you need at least a <last> link, or something. Anyway, give us something to start from and we can perhaps help.

Sorry, gotta go, the puzzles have arrived.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Aizen
post Dec 21 2014, 03:47 AM
Post #5


Newbie
*

Group: Members
Posts: 13
Joined: 15-December 14
Member No.: 21,939



QUOTE(Brian Chandler @ Dec 18 2014, 02:43 AM) *

Well, how am I supposed to know what you can and can't see? You wrote rather clearly what you want to do, and you didn't supply any of the code that you have at the moment, or something you have written that doesn't work and you can't see why, so there really is almost nothing anyone can say, unless they feel like writing the whole thing for you.

Incidentally, actually the precise version you wrote is a Bad Idea (I have seen it in practice), because the viewer can't see how many pages there are, so you need at least a <last> link, or something. Anyway, give us something to start from and we can perhaps help.

Sorry, gotta go, the puzzles have arrived.


don't worry about it, I was being a little over dramatic now that I look at it. It was a bit of a stressful week, and I was going nuts with some of the bug fixing I've been doing lately.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Aizen
post Dec 21 2014, 03:47 AM
Post #6


Newbie
*

Group: Members
Posts: 13
Joined: 15-December 14
Member No.: 21,939



QUOTE(Brian Chandler @ Dec 18 2014, 02:43 AM) *

Well, how am I supposed to know what you can and can't see? You wrote rather clearly what you want to do, and you didn't supply any of the code that you have at the moment, or something you have written that doesn't work and you can't see why, so there really is almost nothing anyone can say, unless they feel like writing the whole thing for you.

Incidentally, actually the precise version you wrote is a Bad Idea (I have seen it in practice), because the viewer can't see how many pages there are, so you need at least a <last> link, or something. Anyway, give us something to start from and we can perhaps help.

Sorry, gotta go, the puzzles have arrived.


don't worry about it, I was being a little over dramatic now that I look at it. It was a bit of a stressful week, and I was going nuts with some of the bug fixing I've been doing lately.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Dec 21 2014, 05:13 AM
Post #7


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Try searching for "php pagination tutorial".
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 12:56 AM