test
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • teneraerbetta Friend
    #160450

    Hello. I don’ t use the article system inside joomla core. I use only K2 for my content.
    In the header of template there is a write, “last update” follow to a date ( that i suppose is the date of last modify or new article from article component of joomla ). In my site i have 0 joomla article, the data is empty ……..
    There is a solution?

    Sherlock Friend
    #377708

    Dear teneraerbetta,

    Currently the last update time is based on the update time of joo mla articles ,you can try as following to change to the update time of k2 articles as following
    Open the file of templatesja_teline_ivblockstopbar.php,you would see a block of code like this
    [PHP]
    <?php
    echo “<span class=”day”>”.date (‘D’).”</span>”;
    echo “<span class=”date”>”.date (‘d’).”</span>”;
    echo “<span class=”month”>”.date (‘m’).”</span>”;

    echo “<span class=”year”>”.date (‘Y’).”</span>”;
    ?>
    [/PHP]

    change it to
    [PHP] <?php

    function getLastUpdate(){
    $db = &JFactory::getDBO();
    $query = ‘SELECT created FROM #__k2_items a ORDER BY created DESC LIMIT 1’;
    //$query = ‘SELECT created FROM #__content a ORDER BY created DESC LIMIT 1’;
    $db->setQuery($query);
    $data = $db->loadObject();
    if( $data->created ){ //return gmdate( ‘h:i:s A’, strtotime($data->created) ) .’ GMT ‘;
    $date =& JFactory::getDate(strtotime($data->created));
    $user =& JFactory::getUser();
    $tz = $user->getParam(‘timezone’);
    $sec =$date->toUNIX(); //set the date time to second
    return gmdate(“h:i:s A”, $sec+$tz).’ GMT’;
    }
    return ;
    }

    echo “<span class=”day”>”.date (‘D’).”</span>”;
    echo “<span class=”date”>”.date (‘d’).”</span>”;
    echo “<span class=”month”>”.date (‘m’).”</span>”;

    echo “<span class=”year”>”.date (‘Y’).”</span>”;
    ?> [/PHP]

    Then look for this
    [PHP] <?php echo T3Common::getLastUpdate(); ?>[/PHP]
    Change to
    [PHP] <?php echo getLastUpdate(); ?>[/PHP]

    I hope it would help !

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

This topic contains 2 replies, has 2 voices, and was last updated by  Sherlock 13 years, 9 months ago.

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