Hello,
I have approximately 300 user galleries on my site.
Be default, clicking 'user galleries' shows user's galleries in the order they registered. I would like to have the order be random on each session. This allows each user an equal share of exposure.
Looking at Nibbler's advice on
Quotehttp://forum.coppermine-gallery.net/index.php?topic=24420.0
I see the order can be manipulated. For example, I changed
Quote$sql .= "ORDER BY category ";
to
Quote$sql .= "ORDER BY RAND() ";
This sorta works, except because the query is run on each page load, moving from one page to the next via the tabs, galleries get repeated.
It seems the solution lies in storing the results of the query in the $_SESSION and only actually running it if it has not previously been run during the session. The pagination would key of the stored query.
The one downside I see to this approach is that any users that register after visiting the user galleries section, would not be displayed as by that point the query will have already been run.
Now my question: Maybe I have overlooked an implementation. Can someone suggest a way to achieve what I'm trying to do?
Thank you in advance.
v. 1.4.8