Randomly display albums in user galleries without repetition Randomly display albums in user galleries without repetition
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Randomly display albums in user galleries without repetition

Started by sjordan, July 30, 2006, 01:23:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sjordan

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

sjordan

Hello,

Just passed 600 users and wanted to check in on thoughts devs might have about this topic: randomly display albums in user galleries without repitition to allow greater user exposure.

Thank you again