Search results newest first

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-11-2007, 09:14 PM
Casual Pligger
 
Join Date: Jan 2007
Posts: 68
Search is sorted by oldest first. This creates lots of usability faults. I searched the forum, but couldn't answer to my qestion:
How to order search results by newest first?
Reply With Quote
  #2 (permalink)  
Old 05-22-2007, 09:49 PM
erico's Avatar
Casual Pligger
 
Join Date: Jan 2006
Location: Recife, Brasil
Posts: 30
I'm searching for the same thing. Anyone could help us? Thanks.
Reply With Quote
  #3 (permalink)  
Old 05-26-2007, 07:33 AM
Casual Pligger
Pligg Version: 9.5
Pligg Template: yget modified
 
Join Date: Apr 2007
Posts: 43
I'm also searching for the same thing. Tx
Reply With Quote
  #4 (permalink)  
Old 05-26-2007, 12:36 PM
New Pligger
 
Join Date: Mar 2007
Posts: 10
Tags also use the search module, so if you browse a Pligg site by tags, you're going to see a list of results with the the oldest ones displaying first which is confusing. Ideally, you'd have a toggle that allows the user to sort them in either direction, but I think the default should be newest first.
Reply With Quote
  #5 (permalink)  
Old 05-26-2007, 01:50 PM
wwwSENSERELYcom's Avatar
Casual Pligger
 
Join Date: May 2007
Location: Tianjin, China
Posts: 67
I think (not tested) in the file /lib/search.php there is a variable line 16 on beta9.5
it's NULL per default you should set it to:
link_date DESC

because at line 110 there's:
Quote:
if(isset($this->orderBy)){
$this->orderBy = "ORDER BY " . $this->orderBy;
}
OOOOOOOOOOOOOOOOKKKKKKKKKKKKKKKKKKKKK

forget what I wrote above, in fact you should not change anything on line 16 because that's the class declaration and it should be neutral.

but on line 125 begins the search function which is where you can change for links and tags

so for links you can add after line 150 something like
$this->orderBy = "link_date DESC";

try this maybe it will work.

for tags, it depends with what you want to order them, by alphabetical order or what.. but it begins not at line 150 but at line 133

Last edited by wwwSENSERELYcom; 05-26-2007 at 01:57 PM.
Reply With Quote
  #6 (permalink)  
Old 06-04-2007, 04:49 PM
Casual Pligger
Pligg Version: 995
Pligg Template: Yget
 
Join Date: Sep 2006
Posts: 59
Unfortunately, it doesn't work. Any other suggestions?
Reply With Quote
  #7 (permalink)  
Old 06-11-2007, 06:12 PM
Casual Pligger
 
Join Date: Jan 2007
Posts: 68
I can pay or donate some cash if this problem is solved.
Reply With Quote
  #8 (permalink)  
Old 06-11-2007, 09:36 PM
Adaman's Avatar
Constant Pligger/Designer
Pligg Version: v9.8.2
Pligg Template: Custom
 
Join Date: Jan 2007
Location: Scotland
Posts: 101
Dev please help i require this too sorting results by oldest in a search isnt that user friendly.

I have tried editing both the search.php files but cannot find the correct solution.

Adam
Reply With Quote
  #9 (permalink)  
Old 06-12-2007, 05:00 AM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,181
open /libs/search.php

find

PHP Code:
asort($sortarray); 
replace

PHP Code:
arsort($sortarray); 
Reply With Quote
  #10 (permalink)  
Old 06-12-2007, 05:20 AM
Casual Pligger
Pligg Version: 995
Pligg Template: Yget
 
Join Date: Sep 2006
Posts: 59
Thanks a lot savant, Savant. This is perfectly working.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Let the user sort the search results by different ways? Niko Questions and Comments 0 11-17-2007 03:49 AM
Search Yields Too Many Results mitchb13 Questions and Comments 0 04-02-2007 02:40 PM
tag and search results prob chad90382 Questions and Comments 3 11-29-2006 08:08 PM
Search: No Results konakevin Questions and Comments 21 07-06-2006 01:12 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development