i am struggling for months with this thing. so i am starting from the beginning
i have a side menu with items to different categories.
each category may or may not have an article/item written per day. not more than one though.
So, i wan to show a "new" -icon/gif whatever- next to the menu item of each category that has a new article written today.
i have managed to do it by:
- creating a custom template in my_theme/html/mod_menu
- using the publish_up field of the jos_k2_items table.
but because my timezone is +3 hours to UTC the article must be written after 3am ...
my server time is UTC. this cannot be changed
my joomla timezone is set to Europe/Athens
K2 stores UTC time in publish_up field
here is my query, but i start to believe that i need a completely different approach
any ideas would be much appreciated :)
i have a side menu with items to different categories.
each category may or may not have an article/item written per day. not more than one though.
So, i wan to show a "new" -icon/gif whatever- next to the menu item of each category that has a new article written today.
i have managed to do it by:
- creating a custom template in my_theme/html/mod_menu
- using the publish_up field of the jos_k2_items table.
but because my timezone is +3 hours to UTC the article must be written after 3am ...
my server time is UTC. this cannot be changed
my joomla timezone is set to Europe/Athens
K2 stores UTC time in publish_up field
here is my query, but i start to believe that i need a completely different approach
$nowdate = JFactory::getDate('now', new DateTimeZone('Europe/Athens'));
$curdate = JFactory::getDate('now', new DateTimeZone('Europe/Athens'))->format('Y-m-d', TRUE);
$query->select("distinct ". $db->quoteName('catid'));
$query->from($db->quoteName('*****_k2_items'));
$query->where($db->quoteName('publish_up') .' <= '. $db->quote( $nowdate ));
$query->where('Date('.$db->quoteName('publish_up').')' . ' = '. $db->quote( $curdate ));
$query->where($db->quoteName('published') .' = 1');
$query->where($db->quoteName('trash') .' = 0');
$query->order('id ASC');any ideas would be much appreciated :)
Edited 8 years 2 months ago by Slartibartfast