Pligg CMS Forums


Go Back   Pligg CMS Forum > Pligg Help > Customization Assistance



Search results newest first

Questions about customizing your Pligg site.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-11-2007, 09:14 PM
Casual Pligger
 
Join Date: Jan 2007
Posts: 67
Question Search results newest first

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
Sponsor
  #2 (permalink)  
Old 05-22-2007, 09:49 PM
erico's Avatar
Casual Pligger
 
Join Date: Jan 2006
Location: Recife, Brasil
Posts: 42
I'm searching for the same thing. Anyone could help us? Thanks.

Érico Oliveira
http://www.linkk.com.br
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 are also sorted with oldest first

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: 73
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: 63
Unfortunately, it doesn't work. Any other suggestions?

Pligg - a Swiss version of Pligg (very much online)
Reply With Quote
  #7 (permalink)  
Old 06-11-2007, 06:12 PM
Casual Pligger
 
Join Date: Jan 2007
Posts: 67
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
Designer
Pligg Version: v9.8.2
Pligg Template: Custom
 
Join Date: Jan 2007
Location: Scotland
Posts: 111
Dev please help :p 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

The Original Pligg Template Community Site - http://pligg-template.com
The P2P and File Sharing News and Bookmarking Site: http://p2pvine.com
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,218
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: 63
Thanks a lot savant, Savant. This is perfectly working.

Pligg - a Swiss version of Pligg (very much online)
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
SEO (Search Engine Optimization) GrinGEO Wiki Articles 24 12-02-2007 12:27 PM
Let the user sort the search results by different ways? Niko General Help 0 11-17-2007 03:49 AM

Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Use the coupon code PLIGG at Dreamhost.com to receive a discount of up to $84.00 Make a donation to support Pligg CMS development