Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Randomly display albums in user galleries without repetition  (Read 2051 times)

0 Members and 1 Guest are viewing this topic.

sjordan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52

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
Quote
http://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
« Last Edit: August 06, 2006, 11:58:48 pm by sjordan »
Logged

sjordan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 52
Re: Randomly display albums in user galleries without repitition
« Reply #1 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
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 20 queries.