Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Randomly Sort Results Found....

Quote Reply
Randomly Sort Results Found....
Is there currently a mod that would allow me to randomly sort search results that are found?

For example, all search results returned for the Baseball and Softball checkbox
http://site.com/...=BaseballandSoftball

Would be sorted randomly.

So the search results would be found, and the resorted so that they appear differently each time.

Thanks for the help,
-Greg
Quote Reply
Re: [Gregorio] Randomly Sort Results Found.... In reply to
Hi. Not as far as I know. Logically, it wouldn't be that fesable. If you have spanning pages, it will mess up the results that are shown, and probably show duplicates :(

Any particular reason you are trying to do this?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Randomly Sort Results Found.... In reply to
Hi, Andy;

The spanning problem can be solved.

I did some programming a long time ago that required random results that covered all possibilities without repeat.
You will find there are several ways of doing this. One way is to populate an array fom 1 to x, and use the random function on it so that the order is mixed:

populate with 1 2 3 4 5 6 7 8 9 10
random it -> 2 7 6 4 5 1 9 8 10 3

I think the newer MySQL has such a function.

The original work was for a real time quiz. This randomized the order of the questions.
The program would in fact take interruptions as it randomized from a restartable seed and the location of the pointer was kept in memory.

regards.