Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • cyprusmedya Friend
    #164902

    i have searched the forum for this but there is no clear answer and everyone is saying different things about this issue. the main problem with ja teline iv is to how to change & localize the date and time on the top of page.

    can anyone help me and tell me how to localize the date and last update time please?? i am using ja teline & joomla 1.5.23 with turkish language.

    i want to put 24 H format on time and D/M/Y date format with turkish day names and to change the text Last Update to turkish too.

    khoand Friend
    #395071

    Hi,

    24 H format

    You replace this code from pluginssystemjat3corecommon.php


    $date =& JFactory::getDate(strtotime($data->created));
    $user =& JFactory::getUser();
    $tz = $config->get('offset');

    $sec =$date->toUNIX(); //set the date time to second
    return gmdate("h:i:s A", $sec).' GMT';

    with


    return JHTML::date($data->created, "%H:%M:%S");

    D/M/Y date format with turkish day names

    You replace this code from templatesja_teline_ivblockstopbar.php

    echo "<span class="day">".date ('D')."</span>";
    echo "<span class="month">".date ('m')."</span>";
    echo "<span class="date">".date ('d')."</span>";

    with


    echo "<span class="day">".JText::_(date ('D'))."</span>";
    echo "<span class="date">".date ('d')."</span>";
    echo "<span class="month">".date ('m')."</span>";

    Find this code from languageen-GBen-GB.ini


    SAT=Sat
    SUN=Sun
    MON=Mon
    TUE=Tue
    WED=Wed
    THU=Thu
    FRI=Fri

    Change bold texts as you want to.

    to change the text Last Update to turkish too.

    Find this code from languageen-GBen-GB.ini

    LAST UPDATED=Last Updated <change this value

    cyprusmedya Friend
    #395085

    Thank you for your detailed answer.

    i have changed the date to Turkish format, it is perfect. but even if i have changed the text on en-GB.ini file the Last Update is not changing, any tips??

    also i cannot change the time to 24H forrmat because the code on /plugins/system/jat3/core/common.php is as the code below, not like you wrote. how to change it?

    function getLastUpdate($fieldname=null){

    if (!$fieldname) $fieldname = 'created';

    $db = &JFactory::getDBO();

    $query = "SELECT `$fieldname` FROM #__content a ORDER BY `$fieldname` DESC LIMIT 1";

    $db->setQuery($query);

    $data = $db->loadObject();

    if( $data->$fieldname ){ //return gmdate( 'h:i:s A', strtotime($data->created) ) .' GMT ';

    $date =& JFactory::getDate(strtotime($data->$fieldname));

    //get timezone configured in Global setting

    $app = & JFactory::getApplication();

    $tz = $app->getCfg('offset')*60*60;

    $sec =$date->toUNIX(); //set the date time to second

    //return by the format defined in language

    return strftime (JText::_('T3_DATE_FORMAT_LASTUPDATE'), $sec+$tz);

    }

    return ;

    }

    khoand Friend
    #395226

    but even if i have changed the text on en-GB.ini file the Last Update is not changing, any tips??

    You replace this code from templatesja_teline_ivblockstopbar.php

    <?php echo JText::_('Last update')?>
    with

    <?php echo JText::_('Last_update')?>
    Add this code into languageen-GBen-GB.ini

    LAST_UPDATE=last update

    khoand Friend
    #395233

    also i cannot change the time to 24H forrmat because the code on /plugins/system/jat3/core/common.php is as the code below, not like you wrote. how to change it?

    You replace this code

    $date =& JFactory::getDate(strtotime($data->$fieldname));

    //get timezone configured in Global setting

    $app = & JFactory::getApplication();

    $tz = $app->getCfg('offset')*60*60;

    $sec =$date->toUNIX(); //set the date time to second

    //return by the format defined in language

    return strftime (JText::_('T3_DATE_FORMAT_LASTUPDATE'), $sec+$tz);
    with

    return JHTML::date($data->$fieldname , "%H:%M:%S");

    cyprusmedya Friend
    #395346

    i did it but now it shows 00:00:00.

    khoand Friend
    #395436

    Could you give me username+password of ftp and a link to your website?

    balgev Friend
    #395620

    <em>@cyprusmedya 245414 wrote:</em><blockquote>Thank you for your detailed answer.

    i have changed the date to Turkish format, it is perfect. but even if i have changed the text on en-GB.ini file the Last Update is not changing, any tips??

    also i cannot change the time to 24H forrmat because the code on /plugins/system/jat3/core/common.php is as the code below, not like you wrote. how to change it?

    function getLastUpdate($fieldname=null){

    if (!$fieldname) $fieldname = 'created';

    $db = &JFactory::getDBO();

    $query = "SELECT `$fieldname` FROM #__content a ORDER BY `$fieldname` DESC LIMIT 1";

    $db->setQuery($query);

    $data = $db->loadObject();

    if( $data->$fieldname ){ //return gmdate( 'h:i:s A', strtotime($data->created) ) .' GMT ';

    $date =& JFactory::getDate(strtotime($data->$fieldname));

    //get timezone configured in Global setting

    $app = & JFactory::getApplication();

    $tz = $app->getCfg('offset')*60*60;

    $sec =$date->toUNIX(); //set the date time to second

    //return by the format defined in language

    return strftime (JText::_('T3_DATE_FORMAT_LASTUPDATE'), $sec+$tz);

    }

    return ;

    }
    </blockquote>

    you should change
    if (!$fieldname) $fieldname = ‘created’;

    with

    if (!$fieldname) $fieldname = ‘modified’;

    cyprusmedya Friend
    #395622

    Thank you all the problem is now solved and everything is fine 🙂 special thanks to balgev 🙂

    gray Friend
    #399619

    So, what I got finally is the below function in /plugins/system/jat3/jat3/core/common.php file

    [php]
    function getLastUpdate($fieldname=null){
    if (!$fieldname) $fieldname = ‘created’;
    $db = &JFactory::getDBO();
    $query = “SELECT `$fieldname` FROM #__content a ORDER BY `$fieldname` DESC LIMIT 1”;
    $db->setQuery($query);
    $data = $db->loadObject();
    if( $data->$fieldname ){
    //return by the format defined in language file with server offset
    return JHTML::date($data->$fieldname, JText::_(‘T3_DATE_FORMAT_LASTUPDATE’));
    }
    return;
    }
    [/php]

    Please note that T3_DATE_FORMAT_LASTUPDATE in en-GB.plg_system_jat3.ini should correspond to formatting of the PHP date function (without %). In my case it is:
    [php]T3_DATE_FORMAT_LASTUPDATE=”Y-m-d H:i”[/php]

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

This topic contains 10 replies, has 4 voices, and was last updated by  gray 13 years, 4 months ago.

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