Go Back   Pligg CMS Forum > Pligg Help > Customization Assistance

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-19-2008, 10:10 PM
davemackey's Avatar
Pligg Donor
Pligg Version: 9.9.
Pligg Template: siChunkBlue
 
Join Date: Aug 2007
Location: Langhorne, PA
Posts: 286
Thanks: 33
Thanked 18 Times in 14 Posts
Order By Search/Tags?

I noticed that when one performs a search or clicks on a tag, the results are automatically sorted oldest to newest. I want this to be the reverse. So I opened up libs/search.php and found this code:
PHP Code:
if(isset($this->orderBy)){
            if(
strpos($this->orderBy"RDER BY") != 1){
                
$this->orderBy "ORDER BY " $this->orderBy;
            }
        } 
I then added an else clause like this:
PHP Code:
        if(isset($this->orderBy)){
            if(
strpos($this->orderBy"RDER BY") != 1){
                
$this->orderBy "ORDER BY " $this->orderBy;
            }
        }else{
            
// Add a default order by clause, newest to oldest.
                
$this->orderBy "ORDER BY link_published_date DESC";
        } 
But it still sorts oldest to newest. Any ideas why this clause isn't taking effect?
David.
Reply With Quote
  #2 (permalink)  
Old 07-19-2008, 10:16 PM
chuckroast's Avatar
Coder/Designer
Pligg Version: 1.0
Pligg Template: ExpertVision
 
Join Date: Jun 2006
Location: PA
Posts: 2,401
Thanks: 171
Thanked 440 Times in 279 Posts
Hi Dave

Someone brought this up before. I also think they posted a solution, although I can't seem to find it at the moment. I'll dig around a bit and see if I can't find it and post it here in this thread.
__________________
Visit PliggPro the official Pligg Mods & Template Shop!

Reply With Quote
  #3 (permalink)  
Old 07-19-2008, 10:29 PM
davemackey's Avatar
Pligg Donor
Pligg Version: 9.9.
Pligg Template: siChunkBlue
 
Join Date: Aug 2007
Location: Langhorne, PA
Posts: 286
Thanks: 33
Thanked 18 Times in 14 Posts
Thanks. Appreciate it. I've been surfing around the forums for it as well, but not too much luck.
David.
Reply With Quote
  #4 (permalink)  
Old 07-20-2008, 12:17 AM
rubber2002's Avatar
Pligg Donor
 
Join Date: Jul 2007
Posts: 252
Thanks: 30
Thanked 7 Times in 6 Posts
I am also looking for this solution.
Reply With Quote
  #5 (permalink)  
Old 07-20-2008, 08:05 AM
graphicsguru's Avatar
Pligg Donor
Pligg Version: 9.9.5
 
Join Date: Aug 2006
Location: USA
Posts: 416
Thanks: 75
Thanked 48 Times in 36 Posts
is this it chuckroast ? http://forums.pligg.com/core-develop...est-first.html
Reply With Quote
The Following 2 Users Say Thank You to graphicsguru For This Useful Post:
  #6 (permalink)  
Old 07-20-2008, 08:08 AM
chuckroast's Avatar
Coder/Designer
Pligg Version: 1.0
Pligg Template: ExpertVision
 
Join Date: Jun 2006
Location: PA
Posts: 2,401
Thanks: 171
Thanked 440 Times in 279 Posts
Yep, thats what I was looking for.. See post #9 and post #17
__________________
Visit PliggPro the official Pligg Mods & Template Shop!

Reply With Quote
The Following User Says Thank You to chuckroast For This Useful Post:
  #7 (permalink)  
Old 07-20-2008, 08:16 AM
graphicsguru's Avatar
Pligg Donor
Pligg Version: 9.9.5
 
Join Date: Aug 2006
Location: USA
Posts: 416
Thanks: 75
Thanked 48 Times in 36 Posts
Nice I just tried it seems to be fine
Reply With Quote
  #8 (permalink)  
Old 07-20-2008, 04:02 PM
davemackey's Avatar
Pligg Donor
Pligg Version: 9.9.
Pligg Template: siChunkBlue
 
Join Date: Aug 2007
Location: Langhorne, PA
Posts: 286
Thanks: 33
Thanked 18 Times in 14 Posts
Great. Thanks guys. I used that code and it worked, though I'm still wondering why my code didn't work. I set an else condition that should have essentially always triggered but it doesn't seem to, or was overridden by something else. Well, thanks!
David.
Reply With Quote
  #9 (permalink)  
Old 10-14-2008, 03:06 AM
asknat's Avatar
New Pligger
 
Join Date: Aug 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
change the sort

hi to sort by the latest change the sort function in libs/search.php to


arsort($sortarray);

do a revirse sort ...


try it :angel:
Reply With Quote
Reply

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 Off
[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
[SOLVED] Category order does not match Category Management page grey580 General Help 7 09-09-2008 01:31 PM
Pcart Order Generator System chuckroast Module Sales 3 07-22-2008 09:54 PM
Search results to be displayed in decending order - Done mde05 Bug Report 1 01-13-2007 05:56 PM
Order Categories by id to admin panel revolver Suggestions 0 11-07-2006 12:32 PM
Category order. DuckFat General Help 0 10-21-2006 08:48 PM


Search Engine Friendly URLs by vBSEO 3.2.0