Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • daigalean Friend
    #195986

    Could someone advise on the Last Update at the top of the homepage.
    Does it work with adding K2 articles and uses that information as it was updated or is it just for joomla articles.
    I have added many articles to test and nothing seems to change.

    I have cleared both cache and browser cache. Also I am runing in development mode so would this affect it as well?

    Darren

    Ninja Lead Moderator
    #527633

    Hi Darren,

    The getLastUpdate function only checks and gets date from com_content (default Joomla, not K2 component)

    daigalean Friend
    #527865

    Thanks again Ninja, I do not suppose there is a way to get it to update off k2 that you might know off?

    Darren

    Ninja Lead Moderator
    #528039

    <em>@daigalean 417835 wrote:</em><blockquote>Thanks again Ninja, I do not suppose there is a way to get it to update off k2 that you might know off?

    Darren</blockquote>

    If you are familiar with programming, you can change code in the templates/ja_teline_iv_t3/templateHelper.php file. Instead of query from com_content, change it to K2 component.


    public static function getLastUpdate($fieldname = null)
    {
    if (! $fieldname) $fieldname = 'created';
    $db = JFactory::getDBO();
    $query = "SELECT `$fieldname` FROM #__content ORDER BY `$fieldname` DESC LIMIT 1";
    $db->setQuery($query);
    $data = $db->loadObject();
    if ($data != null && $data->$fieldname) {
    $date = JFactory::getDate($data->$fieldname);
    //get timezone configured in Global setting
    $app = JFactory::getApplication();
    // Get timezone offset
    $tz = $app->getCfg('offset');
    // Set timezone offset for date
    $date->setTimezone(new DateTimeZone($tz));
    //return by the format defined in language
    return $date->format(JText::_('T3_DATE_FORMAT_LASTUPDATE'), true);
    }
    return;
    }

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 2 voices, and was last updated by  Ninja Lead 10 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum