June 7th, 2007phpld - Sort by Date
This adds another sorting option for directory listings. Using this simple modification you can sort listings by date.
Just 2 files need to be modified: main.tpl and /admin/conf_options.php
in main.tpl,
Locate
After that, ADD
{if $sort eq 'D'} | <span class="sort">{l}Date{/l}</span>{else} |
<a href="?s=D{if not $smarty.const.ENABLE_REWRITE}&c={$category.ID}
{/if}{if $search}&search={$search}{/if}{if $uid}&uid={$uid}{/if}
{if !empty($p)}&p={$p}{/if}">{l}Date{/mµçÓÂöç²ö–gÐУÂö6öFS
in conf_options.php
FIND
'OPTIONS' => array(
'P' => _L('PageRank') ,
'H' => _L('Hits') ,
'A' => _L('Alphabetical')
),
REPLACE BY
'OPTIONS' => array(
'D' => _L('Date') ,
'P' => _L('PageRank') ,
'H' => _L('Hits') ,
'A' => _L('Alphabetical')
),
You are done!
6 Responses to “phpld - Sort by Date”
Leave a Reply
You must be logged in to post a comment.


June 7th, 2007 at 8:27 am
Thanks for a quick solution to my question on DP..
You are always rocking..
I have applied this mod on my directory..
June 7th, 2007 at 8:44 am
Thanks for the awesome mods, you have all my admiration
June 20th, 2007 at 3:37 am
To make older listings appear on top do this:
open index.php and find
and replace it by
June 24th, 2007 at 4:23 pm
What about in version 2.1 ? will it work? which are the files to edit. I tried it by editing main.tpl and admin/int.php, but it seems it is not working.
June 24th, 2007 at 4:39 pm
for older versions you will need to make this modification in index.php
Find:
and replace by:
March 8th, 2008 at 9:34 am
In 3.0.6 version, the modification of the admin options are in
admin/init.php file
open the file and replace this:
‘OPTIONS’ => array(
‘P’ => _L(’PageRank’) ,
‘H’ => _L(’Hits’) ,
‘A’ => _L(’Alphabetical’)
),
with:
‘OPTIONS’ => array(
‘D’ => _L(’Date’) ,
‘P’ => _L(’PageRank’) ,
‘H’ => _L(’Hits’) ,
‘A’ => _L(’Alphabetical’)
),
Hope will helps !