Viewing 13 posts - 16 through 28 (of 28 total)
  • Author
    Posts
  • micrantha Friend
    #341786

    Hello,

    For “Last update” I wrote this post, after help of Gray.

    For “Headlines” see this post.

    For Footer text you can find it in this file and change it: template/html/mod_footer/default.php

    “Features” and “Menbers” are titles of modules; you can change them in Module manager.

    Regards,
    Micrantha

    paellas Friend
    #341810

    Thanks, but I don´t see the code to be replaced that mentioned:

    Code:
    return gmdate(“h:i:s A”, $sec+$tz).’ GMT’;with

    I´ve been working on file: layouts/blocks/header.php

    Also,pls notice that I have to express time as local, Mexico City Time:
    Standard time zone: UTC/GMT -6 hours
    Daylight saving time: +1 hour
    Current time zone offset: UTC/GMT -5 hours
    Time zone abbreviation: CDT – Central Daylight Time

    So, still I can´t set proper time on headers.

    micrantha Friend
    #341824

    Hello,

    Look in same thread, 2 posts earlier
    Code for last-update is in file ja_teline_iii/libs/ja.template.helper.php
    I don’t know how to configure “setlocale” for time zone of Mexico City.
    Maybe Gray knows how to find out.

    Regards,
    Micrantha

    Saguaros Moderator
    #341872

    Dear paellas!

    Here is the solution for you :
    you replace:
    [PHP]return gmdate(“h:i:s A”, $sec+$tz).’ GMT’;[/PHP]
    by:

    [PHP]
    $tz=-5;
    return date(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;[/PHP]

    Good luck

    paellas Friend
    #341874

    I think I have to take a step back on the solution proposed by micrantha: it seems that it does not support UTF-8.

    The word “Miércoles” does not show due to the accent … so I have to seek another soluton.

    paellas Friend
    #341889

    <em>@tienhc 176433 wrote:</em><blockquote>Dear paellas!

    Here is the solution for you :
    you replace:
    [PHP]return gmdate(“h:i:s A”, $sec+$tz).’ GMT’;[/PHP]
    by:

    [PHP]
    $tz=-5;
    return date(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;[/PHP]

    Good luck</blockquote>
    Just to confirm …

    At fiel: /templates/ja_teline_iii/layouts/blocks/header.php

    I currently have:

    <p class=”ja-updatetime”><span><?php echo JText::_(‘Actualización’)?></span><em><?php echo $this->getLastUpdate(); ?></em></p>

    You want me to replace

    PHP de Code:
    ———————-
    return gmdate(“h:i:s A”, $sec+$tz).’ GMT’;

    by:

    PHP Code:
    ——————

    $tz=-5;
    return date(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;

    Great … but I don´t see code to be replaced at this file.

    So, could you specify which file should I mofify?

    micrantha Friend
    #341898

    Hello,

    For this you have to look somewhere else: ja_teline_iii/libs/ja.template.helper.php
    Look for this function:

    function getLastUpdate()
    Regards,
    Micrantha

    paellas Friend
    #341935

    🙂

    Original funcion getLastUpdate() PHP Code:
    ————————————————————–
    [PHP]
    function getLastUpdate()
    {
    $db = &JFactory::getDBO();
    $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 ;
    [/PHP]

    SOLUTION:
    ============
    * Thanks to MICRANTHA for function getLastUpdate() I found file ja_teline_iii/libs/ja.template.helper.php
    * I changed: GMT for CDT on the code
    * And thanks to TIENHC changed the following Instruction

    Replaced PHP Code:
    ———————-
    [PHP]
    return gmdate(“h:i:s A”, $sec+$tz).’ GMT’;
    [/PHP]

    With PHP Code:
    ——————
    [PHP]
    $tz=-5;
    return date(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;
    [/PHP]

    So End Result:
    ———————
    [PHP]
    function getLastUpdate(){
    $db = &JFactory::getDBO();
    $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) ) .’ CDT ‘;
    $date =& JFactory::getDate(strtotime($data->created));
    $user =& JFactory::getUser();
    $tz = $user->getParam(‘timezone’);
    $sec =$date->toUNIX(); //set the date time to second
    $tz=-5;
    return date(“h:i:s A”, $sec+ $tz*3600 ).’ CDT’;
    }
    return ;

    [/PHP]
    “Last Update” Problem Solved !
    ———————————
    =================================

    FYI => MEXICO CITY TIME:
    ————————————–
    Standard time zone: UTC/GMT -6 hours
    Daylight saving time: +1 hour
    Current time zone offset: UTC/GMT -5 hours
    Time zone abbreviation: CDT – Central Daylight Time

    Current time is DST
    Daylight Saving Time DST started on domingo, 4 de abril de 2010, 2:00 local standard time
    DST ends on domingo, 31 de octubre de 2010, 2:00 local daylight time

    More info at: http://www.timeanddate.com/worldclock/city.html?n=155

    paellas Friend
    #343764

    I finally came out with a solution – even for Spanish Language accent in certain days of the week … so Thanks to everyone …

    SOLUTION
    ————–
    First, TELINE-III is an English language template so for translation got file:
    “en-GB.tpl_ja_teline_iii.ini”

    Located at “/language/en-GB”

    Translated it, not changing labels, and saved it with name “es-ES.tpl_ja_teline_iii.ini” on Format UTF-8 and uploaded to: “/language/es-ES”

    Date & Time still shows up in English at upper left hand side … so for file header.php,

    I replaced:
    ——————-
    <p class=”ja-day”>
    <?php
    echo “<span class=”day”>”.date (‘l’).”</span>”;
    echo “<span class=”date”>, “.date (‘M’).” “.date (‘d’).date (‘S’).”</span>”;
    ?>
    </p>

    For lines:
    ———–
    <p class=”ja-day”>
    <?php
    setlocale(LC_TIME, “es_ES”);
    echo “<span class=”day”>”.JText::_(date (‘l’)).”</span>”;
    echo strftime(“%d de %B %Y n”);
    ?>
    </p>

    So output is now:
    ———————-
    “Day-of-the-Week” “Day” de “Year”

    Notice that I had the problem that Day-of-the-Week did not showed Spanish Language Accent for Wednesday (Miércoles) and Saturday (Sábado). So, I believe this solves it … I made changes on Sunday, so I´ll on Wednesday if this is really the solution.

    wombat1 Friend
    #347915

    How to apply this to code edit for Madrid GMT +1

    I used

    $tz=+1;
    return date("h:i:s A", $sec+ $tz*3600 ).' GMT';

    but its not working
    do i have to edit the 3600
    Also is this automatically going to change during daylight savings or does it have to be edited manually.

    Thanks in advance.

    <em>@paellas 176511 wrote:</em><blockquote>:)

    Replaced PHP Code:
    ———————-
    [PHP]
    return gmdate(“h:i:s A”, $sec+$tz).’ GMT’;
    [/PHP]

    With PHP Code:
    ——————
    [PHP]
    $tz=-5;
    return date(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;
    [/PHP]

    </blockquote>

    Saguaros Moderator
    #348647

    did you try to use this :

    [PHP]
    $tz=+1;
    return gmdate(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;
    [/PHP]

    wombat1 Friend
    #348713

    ah, i had used the following

    $tz=+1;
    return date(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;

    Perhaps you could clarify so that others that see this thread will know what to do and why.
    Why is this the different with the code that you gave Paellas a few posts earlier

    $tz=-5;
    return date(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;

    in his case it was
    date
    for me it is
    gmdate

    When should users apply one and not the other.

    Also if you can you confirm that this code will work when it is daylight savings. i.e. when the time is moved forward one hour for part of the year.

    I think this would be a great help to others interested in this topic.

    Thanks very much.

    <em>@tienhc 184847 wrote:</em><blockquote>did you try to use this :

    [PHP]
    $tz=+1;
    return gmdate(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;
    [/PHP]</blockquote>

    Saguaros Moderator
    #348919

    Dear wombat1!

    i’m very sorry,

    i had a big mistaken on this,

    here is right:
    [PHP]
    $tz=1;
    return date(“h:i:s A”, $sec+ $tz*3600 ).’ GMT’;
    [/PHP]

    i worked well on my site after i checked this so many time.

Viewing 13 posts - 16 through 28 (of 28 total)

This topic contains 28 replies, has 5 voices, and was last updated by  Saguaros 14 years, 4 months ago.

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