Improving updates section in News 2 template

Support help forum dedicated to free and commerical templates for Joomla 3 and 2.5 version.
GK User
Sat Apr 26, 2014 11:27 pm
Hello,

I propose to introduce a small correction in the file layouts/blocks/updates.php in News 2 template.

Replace line 11 from:
Code: Select all
$date_query = 'SELECT '.$column.' FROM #__'.$table.' WHERE '.$state.' = 1 ORDER BY '.$column.' DESC LIMIT 1;';

to
Code: Select all
$date_query = 'SELECT '.$column.' FROM #__'.$table.' WHERE '.$state.' = 1 AND publish_up < now() ORDER BY '.$column.' DESC LIMIT 1;';


This patch will display the correct last modification date in updates section when we have an article awaiting publication in the future.

By the way, I invite you to my page http://www.ozorkow.net based on the News 2 template.
There is still a lot to improve on it, but every day I enter corrections and it looks better and better :)


Regards
Michał Kowalski
http://www.ozorkow.net
User avatar
Fresh Boarder

teitbite
Sat Apr 26, 2014 11:32 pm
Hi

Thank for the tip. I'm sending this to programmers right away.
User avatar
Moderator

GK User
Tue Aug 05, 2014 11:17 am
It is better to use this code in this format :

Code: Select all
$date_query = 'SELECT '.$column.' FROM #__'.$table.' WHERE '.$state.' = 1 AND '.$column.' <= '.$db->Quote($now).' ORDER BY '.$column.' DESC LIMIT 1;';   
User avatar
Platinum Boarder


cron