PDA

View Full Version : Sort after date ?



Peter Jonsson
August 26, 2012, 05:53 PM
Why arent there a Sort by date ?

If you click on any of the sort button theb its impossible to go back to its normal state that are after date, newest first.

Can you give us any code to have a sort by date button?

Vladimir
August 27, 2012, 04:28 AM
Hello,

You can try resolve this problem the following way:

- open file includes/controllers/listing_type.inc.php
- find following code (~lines 124 and 317):



$rlSmarty -> assign_by_ref( 'sorting', $sorting );


and before it to add this code:



$sorting['Date'] = array('Key' => "Date", 'Type' => "date", 'name' => $GLOBALS['lang']['date'], 'Default' => '', 'Condition' => '');

Peter Jonsson
August 27, 2012, 05:02 AM
So, what will this do ?

After i added it nothing happened, i didnt get a sort by date "button"

Vladimir
August 27, 2012, 06:34 AM
I am sorry, you should add line before this code:



$rlSmarty -> assign_by_ref( 'sorting', $sorting );


We've fixed it on your site.

Peter Jonsson
August 27, 2012, 02:17 PM
Nice, thanks :)

Petrache Nicolae
October 7, 2012, 12:41 PM
I am sorry, you should add line before this code:



$rlSmarty -> assign_by_ref( 'sorting', $sorting );


We've fixed it on your site.

hello. i have added the new line before the code you mentioned and nothing is happening

$sorting['Date'] = array('Key' => "Date", 'Type' => "date", 'name' => $GLOBALS['lang']['date'], 'Default' => '', 'Condition' => '');
$rlSmarty -> assign_by_ref( 'sorting', $sorting );

what should we do in adition? thanks

Chris Brown
October 7, 2012, 04:23 PM
hello. i have added the new line before the code you mentioned and nothing is happening


what should we do in adition? thanks

In vladamir's first post it says find following code (~lines 124 and 317):

Looks like its in 2 positions have you done both? Just thought i would ask, you may have done this already :D

Petrache Nicolae
October 7, 2012, 04:59 PM
thanks for this. missed the second line. works fine now