Support Forums

Old 04-12-2007, 06:53 PM   #1
Senior Member
 
CHRD's Avatar
 
Join Date: Nov 2006
Posts: 190
Rep Power: 14
CHRD is on a distinguished road
Default Daily randomise listing function

Would anybody like to see the standard listings randomise, so that everybody get the same exposure, but also randomise the featured listing above the standard listings,
or if a advertiser changes/edits there advert the system sees it as a new listing and moves there advert up, but I think this could couse a lot more bandwidth to be used

Maybe this can be inserted into V4

Thanks
Glenn
__________________
Costa del Sol
Spain
v3.1.10 Dev
V4.09 Dev sweeeet
�Powerful you have become, the dark side I sense in you.�

Last edited by CHRD; 04-13-2007 at 06:40 AM.
CHRD is offline   Reply With Quote
Old 04-14-2007, 09:52 AM   #2
Senior Member
 
gregbatch's Avatar
 
Join Date: Jun 2006
Posts: 172
Rep Power: 16
gregbatch is on a distinguished road
Default

Change ASC or DESC in ORDER BY to RANDOM
__________________
Greg
3.1.4 Designer
gregbatch is offline   Reply With Quote
Old 04-16-2007, 02:05 PM   #3
Senior Member
 
CHRD's Avatar
 
Join Date: Nov 2006
Posts: 190
Rep Power: 14
CHRD is on a distinguished road
Default

Sorry Im looking in administration/searchsettings.php and I dont have random setting in the sort listing options.
__________________
Costa del Sol
Spain
v3.1.10 Dev
V4.09 Dev sweeeet
�Powerful you have become, the dark side I sense in you.�
CHRD is offline   Reply With Quote
Old 04-16-2007, 02:55 PM   #4
Customer
 
Chaslie's Avatar
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 737
Rep Power: 28
Chaslie will become famous soon enough
Default

Quote:
Change ASC or DESC in ORDER BY to RANDOM
I tried that in searchresults.php but throws up SQL errors.

Changed this:
Quote:
$sSQL .= " ORDER BY ".MAIN_PRODUCT_SORT." ".MAIN_PRODUCT_SORT_OPTION.", p.dateadded DESC";
To this:
Quote:
$sSQL .= " ORDER BY ".MAIN_PRODUCT_SORT." ".MAIN_PRODUCT_SORT_OPTION.", p.dateadded RANDOM";
.... but that doesn't provide the solution.
__________________
Chaslie
V4.1 dev


68 Classifieds Important Links
Customer Area | Issue Tracker | User Manuals & Documentation

HTML Help
W3 Schools
Chaslie is offline   Reply With Quote
Old 04-16-2007, 03:46 PM   #5
Senior Member
 
gregbatch's Avatar
 
Join Date: Jun 2006
Posts: 172
Rep Power: 16
gregbatch is on a distinguished road
Default

Quote:
Sorry Im looking in administration/searchsettings.php and I dont have random setting in the sort listing options.
Sorry, Glenn. That was in the SQL query, but Chaslie says there are issues with that one.

UPDATE:
My error... should be rand()
__________________
Greg
3.1.4 Designer

Last edited by gregbatch; 04-16-2007 at 03:52 PM.
gregbatch is offline   Reply With Quote
Old 04-16-2007, 04:14 PM   #6
Customer
 
Chaslie's Avatar
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 737
Rep Power: 28
Chaslie will become famous soon enough
Default

Quote:
$sSQL .= " ORDER BY ".MAIN_PRODUCT_SORT." ".MAIN_PRODUCT_SORT_OPTION.", p.dateadded rand()";
Is this code correct? In searchlistings.php around line 139. SQL error again. All I did was replace 'DESC' with 'rand()'.
__________________
Chaslie
V4.1 dev


68 Classifieds Important Links
Customer Area | Issue Tracker | User Manuals & Documentation

HTML Help
W3 Schools
Chaslie is offline   Reply With Quote
Old 04-16-2007, 06:16 PM   #7
Customer
 
Chaslie's Avatar
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 737
Rep Power: 28
Chaslie will become famous soon enough
Default

Greg. Have you exhausted your ideas about this one yet?
__________________
Chaslie
V4.1 dev


68 Classifieds Important Links
Customer Area | Issue Tracker | User Manuals & Documentation

HTML Help
W3 Schools
Chaslie is offline   Reply With Quote
Old 04-16-2007, 06:44 PM   #8
Senior Member
 
gregbatch's Avatar
 
Join Date: Jun 2006
Posts: 172
Rep Power: 16
gregbatch is on a distinguished road
Default

Im not sure what is taking place in the "MAIN_PRODUCT_SORT" and "MAIN_PRODUCT_SORT_OPTION". I assume it would be the "field to sort on" and the "order" options from within the admin panel, then the second level sort within that by default is date added. I think you would need to kill one of the order options. I'm not so sure rand() plays well with others. Since you are basically throwing the main sort options out the window anyway, I would try kiling that.

Code:
$sSQL .= " ORDER BY ".MAIN_PRODUCT_SORT." ".MAIN_PRODUCT_SORT_OPTION.", p.dateadded DESC";
Becomes:
Code:
$sSQL .= " ORDER BY p.dateadded rand()";
__________________
Greg
3.1.4 Designer
gregbatch is offline   Reply With Quote
Old 04-16-2007, 07:09 PM   #9
Customer
 
Chaslie's Avatar
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 737
Rep Power: 28
Chaslie will become famous soon enough
Default

Quote:
Im not sure what is taking place in the "MAIN_PRODUCT_SORT" and "MAIN_PRODUCT_SORT_OPTION". I assume it would be the "field to sort on" and the "order" options from within the admin panel, then the second level sort within that by default is date added.
If you take out just "MAIN_PRODUCT_SORT" and "MAIN_PRODUCT_SORT_OPTION", featured adds immediately lose their priority listing and the sort is DESC by date added.

If you then replace DESC with rand(), you get SQL errors.

Quote:
Since you are basically throwing the main sort options out the window anyway, I would try kiling that.
It seams that by substituting DESC with 'rand()' (in any combination) produces errors.

This certainly is a feature I would like to add to our own site so the topics is still open for solving.
__________________
Chaslie
V4.1 dev


68 Classifieds Important Links
Customer Area | Issue Tracker | User Manuals & Documentation

HTML Help
W3 Schools
Chaslie is offline   Reply With Quote
Old 04-16-2007, 09:17 PM   #10
Senior Member
 
gregbatch's Avatar
 
Join Date: Jun 2006
Posts: 172
Rep Power: 16
gregbatch is on a distinguished road
Default

Yep. Don't know, as I use rand() on another site to pull featured ads randomly. I'm sure it's clashing with other code somewhere. Unfortunatley, I don't have developer to look deeper.

UPDATE:
OK. Had to look at my own code (ahem ) to remember what I did. Rand() must be used alone, i.e. ORDER BY rand() . So, the result would be TOTALLY random.
__________________
Greg
3.1.4 Designer

Last edited by gregbatch; 04-16-2007 at 09:41 PM.
gregbatch is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Price checking by Listing Package Bucketman v3.0 Questions & Support 25 12-03-2007 04:48 AM
Problems with updateOrder function flyingpylon v3.1 Questions & Support 3 11-06-2006 08:58 PM
User: See's Membership listing package garysr v3.1 Questions & Support 23 11-04-2006 01:08 PM
Problem in ACP with messed up Listing Extras pat01 v3.1 Questions & Support 0 07-18-2006 01:32 PM
View Listing (404 Error) Scooter v3.1 Questions & Support 7 06-08-2006 02:09 PM


All times are GMT -4. The time now is 04:16 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0