|
|
#1 |
|
Member
Join Date: Jun 2009
Posts: 32
Rep Power: 1 ![]() |
Can anyone help me how to make the listings appear in random order within a category when browsing the category, and in the search results? I looked at the includes/classes/kernel/Listings.php file and found the section where the sorting is coded (around row 461), and tried to add the RAND() sorting, but then my site did not work properly, so I restored it to the original.
It would be quite important for me to do this, so any help is highly appreciated. Thanks in advance. I am running 4.1.4 Developer version. |
|
|
|
|
|
#2 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,307
Rep Power: 33 ![]() |
Please be more specific. Do you want them random all the time, from search, in browse , what?
|
|
|
|
|
|
#3 |
|
Member
Join Date: Jun 2009
Posts: 32
Rep Power: 1 ![]() |
Hi James,
I want them to be random all the time. I want it to be random when someone browses a given category, and I also want it random, when someone runs a search, so that the search results display in random order. |
|
|
|
|
|
#4 |
|
Member
Join Date: Jun 2009
Posts: 32
Rep Power: 1 ![]() |
So does anyone have a clue how this could be done? To make it clear again, my goal is the following:
- I would like the order of the listings to be random by default instead of ASC or DESC; I do not know how I could be more specific about this... |
|
|
|
|
|
#5 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,307
Rep Power: 33 ![]() |
About line 462 in your includes/classes/kernelListings.php file
change $listingSQL=$sSQL .' '. $where .' ORDER BY '. $sqlsort .' '. $sortorder; to $listingSQL=$sSQL .' '. $where .' ORDER BY RAND() '. $sortorder; Do test thoroughly that you do not get strange side effects. By the way I think this is not a great way to proceed from an SEO perspective. It looks to the search engines that nearly all of your site is random (changing constantly). No stability. The other thing to remember is this is a core file change and you will need to remember it, if and when you upgrade. |
|
|
|
|
|
#6 |
|
Member
Join Date: Jun 2009
Posts: 32
Rep Power: 1 ![]() |
Thank you very much for the help. The point you made regarding SEO is something I have to consider. It is not something I thought of...
Thanks again. Bye, Vert |
|
|
|
|
|
#7 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,307
Rep Power: 33 ![]() |
Happy to have helped.
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Featured Ads in random order | jaybarber1 | v4.1 Questions & Support | 1 | 07-26-2009 01:49 PM |
| Display Featured Ads in Random Order | MrGForce | v4.1 Questions & Support | 3 | 07-15-2009 09:09 AM |
| listing ads in descending order | tidy | v4.1 Questions & Support | 7 | 06-23-2009 04:23 PM |
| Set the order of RSS feed to random? | PeterB | v4 Questions & Support | 5 | 02-05-2009 12:09 PM |
| Extra field - Random Listing Horizontal | oktanedesign | Modules / Plugins / Modifications | 2 | 12-05-2008 02:11 PM |