Support Forums

Sorting listing

This is a discussion on Sorting listing within the Technical Support forums, part of the Technical Support Forums category; I thank you every body for fast support and ideas to solve problems. I do not have time to test ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 04-17-2008, 04:59 AM   #11
Customer
 
philoo's Avatar
 
Join Date: Apr 2008
Posts: 145
Rep Power: 18
philoo is on a distinguished road
Default

I thank you every body for fast support and ideas to solve problems.

I do not have time to test these solutions today, but I am sure we will find an issue
philoo is offline  
Old 04-17-2008, 12:46 PM   #12
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 296
Rep Power: 26
cwp is a jewel in the rough
Default

Quote:
Originally Posted by suzkaw View Post
That should be pretty easy. Open includes/classes/kernel/Listings.php and go to line 360:
Code:
$listingSQL=$sSQL .' '. $where .' ORDER BY '. $sqlsort .' '. $sortorder;
Change to something like:
Code:
$listingSQL=$sSQL .' '. $where .' ORDER BY featured DESC, '. $sqlsort .' '. $sortorder;
Eric, by doing this modification your featured listings will always be on top, and then you can select something else in the first check box where it asks how you want the listings sorted?
__________________
Version 4.0.3 Developer
cwp is offline  
Old 04-17-2008, 07:53 PM   #13
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 136
Eric Barnes is just really nice Eric Barnes is just really nice
Default

I am not sure I understand your question. Basically with that hack featured listings will be sorted first no matter the user resorts them.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 04-18-2008, 05:09 AM   #14
Customer
 
philoo's Avatar
 
Join Date: Apr 2008
Posts: 145
Rep Power: 18
philoo is on a distinguished road
Default

Quote:
Originally Posted by suzkaw View Post
I am not sure I understand your question. Basically with that hack featured listings will be sorted first no matter the user resorts them.
It is the answer for my specific usage...
philoo is offline  
Old 10-20-2008, 04:50 AM   #15
Customer
 
philoo's Avatar
 
Join Date: Apr 2008
Posts: 145
Rep Power: 18
philoo is on a distinguished road
Default

After some days of experimentation (I launched 68C last week) these solution

PHP Code:
$listingSQL=$sSQL .' '$where .' ORDER BY featured DESC, '$sqlsort .' '$sortorder
solve the problem for showing Featured first in category listings but it produce colateral effects everywhere :

- Featured ads are also showed first when asking "last listings" or "top viewed listings" (toplistings.php script)

- Featured ads are also showed first in admin 'manage listings'


.... so I would like to explore the possibility of having FEATURED first showed at the top only when browsing category listings
__________________
v4.08 Developer
philoo is offline  
Old 01-16-2009, 12:06 AM   #16
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 293
Rep Power: 23
hel68c is just really nice hel68c is just really nice
Default

Quote:
$listingSQL=$sSQL .' '. $where .' ORDER BY featured DESC, '. $sqlsort .' '. $sortorder;
I used this code and it work fine for toplisting but when I look by category, the first page is sort by featured DESC and the rest are list ASC.

look at here to see Welcome on Hobby Classified. Free Hobby ads...
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline  
Old 08-29-2009, 02:06 PM   #17
Customer
 
mgravlee's Avatar
 
Join Date: Mar 2009
Posts: 34
Rep Power: 12
mgravlee is on a distinguished road
Default

Quote:
Originally Posted by Eric Barnes View Post
That should be pretty easy. Open includes/classes/kernel/Listings.php and go to line 360:
Change to something like:
Code:
$listingSQL=$sSQL .' '. $where .' ORDER BY featured DESC, '. $sqlsort .' '. $sortorder;
When I made the code change I get this when I click on an ad in the list(search functions work OK):

Notice: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f.fOrder ASC' at line 1 SQL: SELECT f.fID,sValue FROM class_products_fields AS p, `class_fields` AS f WHERE p.pID='1245' AND f.fSeen='Y' AND p.fID=f.fID f.fOrder ASC in /home/cattleto/public_html/classified_ads/includes/classes/database/mysql.php on line 143

I'm using mySQL5.
__________________
Using Developer 4.1.5 with Custom Fluid Template

http://agads.net/
http://horsepages.com/
http://cattletoday.com/classified_ads/
http://ranchers.net/classifieds/
mgravlee is offline  
Old 08-29-2009, 02:26 PM   #18
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by mgravlee View Post
When I made the code change I get this when I click on an ad in the list(search functions work OK):

Notice: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'f.fOrder ASC' at line 1 SQL: SELECT f.fID,sValue FROM class_products_fields AS p, `class_fields` AS f WHERE p.pID='1245' AND f.fSeen='Y' AND p.fID=f.fID f.fOrder ASC in /home/cattleto/public_html/classified_ads/includes/classes/database/mysql.php on line 143

I'm using mySQL5.
When you start making changes to you script files you really need to slow down and make sure you are following suggestions for your version of 68C. Your sig says your running 4.1.5 but this is a thread for 4.0.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 08-29-2009, 07:15 PM   #19
Customer
 
mgravlee's Avatar
 
Join Date: Mar 2009
Posts: 34
Rep Power: 12
mgravlee is on a distinguished road
Default

Had a mySQL problem. This code works in v4.1.x.

Check it out on my site.
__________________
Using Developer 4.1.5 with Custom Fluid Template

http://agads.net/
http://horsepages.com/
http://cattletoday.com/classified_ads/
http://ranchers.net/classifieds/
mgravlee is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
MODIFICATION: Receive a copy of the email sent from visitors to listing owners. cwp Modules / Plugins / Modifications 15 07-25-2009 08:02 AM


All times are GMT -4. The time now is 06:17 PM.


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