A program fault has been recorded in the log
Home arrow Forum

Remository Forum

 


lo0k

Karma: 0  
Container Order - 2010/06/23 19:05 Hello,

How i can change the sort order of the containers ?



I want :
Sommaire 2010
Sommaire 2009
Sommaire 2008
Sommaire 2007...


In old version i replaced by :

$sql = 'SELECT * FROM #__downloads_containers ORDER BY name DESC';

But in new Version (3.53)
I don't see the file to replace.

Sorry for my English :/

But Help me
Thank you
Joomla Version :1.5.15
Remository: Version 3.53

Post edited by: lo0k, at: 2010/06/23 19:06
  | | Sorry, you do not currently have permission to write here.
admin

Karma: 112  
Re:Container Order - 2010/06/24 16:43 Look at the code near the start of ../com_remository/p-classes/remositoryContainerManager.php:

Code:

  class remositoryContainerSorter {     var $_object_array = array();     public function __construct (&amp;$a) {         $this->_object_array =&amp$a;         $this->sort();     }     // This is not genuinely public, but has to be declared so for the callback     public  function containerCompare (&amp;$a, &amp;$b) {         if ($a->sequence > $b->sequence) return  1;         if ($a->sequence < $b->sequence) return -1;         if ($a->name > $b->name)  return 1;         if ($a->name < $b->name) return -1;         return 0;     }     private function sort () {         usort($this->_object_array, array($this,' containerCompare'));     } }



This carried out the sorting of containers prior to display. If you want the names to be sorted in reverse order, then look at the lines that mention $a->name in the method "containerCompare" and swap over the greater than and less than signs. It will then read:

Code:

  class remositoryContainerSorter {     var $_object_array = array();     public function __construct (&amp;$a) {         $this->_object_array =&amp$a;         $this->sort();     }     // This is not genuinely public, but has to be declared so for the callback     public  function containerCompare (&amp;$a, &amp;$b) {         if ($a->sequence > $b->sequence) return  1;         if ($a->sequence < $b->sequence) return -1;         if ($a->name < $b->name)  return 1;         if ($a->name > $b->name) return -1;         return 0;     }     private function sort () {         usort($this->_object_array, array($this,' containerCompare'));     } }

Martin Brampton aka Counterpoint
http://aliro.org
http://black-sheep-research.com
  | | Sorry, you do not currently have permission to write here.
Reiner

Karma: 0  
Re:Container Order - 2010/06/25 07:58 Hello

Sorry, do not ih where I can change in the code was? A brief explanation on how and where we can change what would be super!

German:

Sorry, ich verstehe nicht wo ich in dem Code was ändern kann? Kurze Anleitung wie und wo man was ändern kann , damit man die Container Sortierung ändern kann wäre Super !

Sorry I am a German User, Workink with Google Translator

Reiner
  | | Sorry, you do not currently have permission to write here.
admin

Karma: 112  
Re:Container Order - 2010/06/25 10:09 If you open the file described in my earlier post using an editor, you will see the code quoted immediately, starting at around line 20, preceded only by comments.

If you would like me to make the change for you, please subscribe to Premium Support.
Martin Brampton aka Counterpoint
http://aliro.org
http://black-sheep-research.com
  | | Sorry, you do not currently have permission to write here.
tia

Karma: 0  
Re:Container Order - 2013/02/22 15:04 Hi,

I´m not sure about this, but try:

public function containerCompare (&$a, &$b) {
if ($a->sequence > $b->sequence) return 1;
if ($a->sequence < $b->sequence) return -1;
if ($a->name > $b->name) return -1;
if ($a->name < $b->name) return 1;
return 0;
}

After, tell me if it works.

Tia
  | | Sorry, you do not currently have permission to write here.

Save FM Radio

Login

Subscribe to Premium Support

Get priority support for Remository and Glossary, sign up now for a Premium Support monthly subscription:

Your Remository user name

Or purchase a year's support:

Your Remository user name

Who is Online

Remository welcomes guests and visitors

We have 2 guest online

Real Time Web Analytics