Automatic page adding more items, ajax pagination?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Automatic page adding more items, ajax pagination?

Post by Celauran »

I'd defer to something like this: http://googlewebmastercentral.blogspot. ... endly.html

tl;dr Use infinite scroll, just don't only use infinite scroll
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Automatic page adding more items, ajax pagination?

Post by simonmlewis »

How...??
Do you mean add a list of "page numbers" as well?? If you do, that would not work... would it?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Automatic page adding more items, ajax pagination?

Post by Celauran »

simonmlewis wrote:Do you mean add a list of "page numbers" as well??
That is precisely what I mean.
simonmlewis wrote:If you do, that would not work... would it?
Why not?
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Automatic page adding more items, ajax pagination?

Post by simonmlewis »

So you mean, at the foot of the page, to add the page numbering.
In my pages that use to use that format, the Script use to be:

Code: Select all

LIMIT $offset, $rowsPerPage
But with this infinite scrollng, it uses LIMIT in a different way.

Hence, I couldn't use both....
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Automatic page adding more items, ajax pagination?

Post by Celauran »

No idea what you mean. I also don't see why you couldn't just wrap the call for these queries into functions and call them separately rather than having everything inline. What one section of your page needs should have absolutely no bearing on what any other section needs.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Automatic page adding more items, ajax pagination?

Post by simonmlewis »

I'm lost now, sorry.
I have never called queries into functions.
I think you are saying the links in the footer can run a PHP "select *" query via a function, rather than just the usual way, but I have never done that. So utterly blind to it.
If the code I have submitted can be made to run two queries, based on which is click, that could be rather cool. But for me, I've no idea how to incorporate that.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply