coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: sjordan on July 30, 2006, 01:23:46 AM

Title: Randomly display albums in user galleries without repetition
Post by: sjordan on July 30, 2006, 01:23:46 AM
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
Title: Re: Randomly display albums in user galleries without repitition
Post by: sjordan on August 03, 2006, 07:38:46 PM
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