random list sorting

16 years 8 months ago #43244 by Michael87
random list sorting was created by Michael87
Since I'm using CB I've always wanted my user lists sorted by random so that each user has the chance to appear at the top of the list.

So far I'`ve always did that small hack myself.. but having to hack it back in after each CB version upgrade is getting annoying...

Please Log in to join the conversation.

16 years 8 months ago #43342 by beat
Replied by beat on topic Re:random list sorting
Michael87 wrote:

Since I'm using CB I've always wanted my user lists sorted by random so that each user has the chance to appear at the top of the list.

So far I'`ve always did that small hack myself.. but having to hack it back in after each CB version upgrade is getting annoying...


Maybe if you donate your hack back to the project, we could integrate it ?

Just post here, so others could benefit from it, and we could take a look at how to integrate this nice idea :)

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

16 years 8 months ago #43356 by mikko
Replied by mikko on topic Re:random list sorting
You do not need a hack for this if you know a bit of SQL. (I assume that you do, since you were able to hack it)

You can get random sorting by first defining the list to sort with any field. Then go to your database and table jos_comprofiler_lists. You will see that one column contains the list of colums that are used for sorting. Edit this and replace the name of the column with RAND(), and you have a randomly ordered lists without hacking.

-Mikko

Please Log in to join the conversation.

16 years 8 months ago #43384 by Michael87
Replied by Michael87 on topic Re:random list sorting
Thanks a lot!

That's far better than my hack soloution. :woohoo:

Post edited by: Michael87, at: 2007/08/18 19:40

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.224 seconds

Facebook Twitter LinkedIn