Tagged: easy folder listing
January 12, 2012 at 4:50 pm #217
I’m using easy folder module on a joomla website to display pdf’s as a list.
I would like to sort my list by date but instead of sorting it by year then month then day it sorts it by what the date actually displays (i.e. 16 December 2011 THEN 13 October 2011 THEN 12 October 2011 THEN 12 December 2011)
you can see it at:
It’s in the “CTX Media” box in the middle – why is “12 October 2011” not first?January 13, 2012 at 1:09 pm #1398
@tchoidesign. Thanks for your post. That’s interesting. Looking at it now, I realize that the reason it does this is because I format the date before I sort it. To fix it, I will have to sort it first, and then format the date. I will set this as a priority for the next release, which should be in a couple of weeks.
If you want to fix it now, and you understand the basics of PHP, then I can tell you what to do to fix it. Let me know.January 13, 2012 at 1:55 pm #1399
Thanks Michael for your reply. I’ve got little knowledge in php but i’d like to give it a try anyway, if you could tell me what to do that would be great!January 14, 2012 at 1:04 am #1400
@tchoidesign. Ok, I am on the forum late tonight. I haven’t tested this code, but it should work. You will be editing code in the helper.php file.
STEP 1: Go to around line 67, and you will see:1$list[$index]['date'] = modEasyFolderListingHelper::formatDate($params, $filestats['mtime']);
Change it to:1$list[$index]['date'] = $filestats['mtime'];
STEP 2: Go to line 220, and you should see:1$html .= $rows[$i]['date'];
Change it to:1$html .= modEasyFolderListingHelper::formatDate($params, $rows[$i]['date']);
STEP 3: Go to line 268, and you should see:1$html .= ' ['.$rows[$i]['date'].']';
Change it to:1$html .= ' ['.modEasyFolderListingHelper::formatDate($params, $rows[$i]['date']).']';
That’s it!January 26, 2012 at 2:28 pm #1401
Hey Michael, I’ve followed your steps and even did it twice to make sure but I always end-up with a white screen when refreshing the page…
When is the update coming out?January 26, 2012 at 3:01 pm #1402
@tchoidesign. i must apologize for the syntax errors in the code in the above post. I corrected them. Please try again. I just tested it. It works now.January 26, 2012 at 3:17 pm #1403
Thanks a lot for your help Michael… It works!
The topic ‘Trying to sort my list by date’ is closed to new replies.