Viewing 15 posts - 16 through 30 (of 61 total)
  • Author
    Posts
  • kha007 Friend
    #322199

    <em>@gray 151023 wrote:</em><blockquote>try
    [php]
    setlocale(LC_TIME, array(‘fr_FR’, ‘fr’, ‘fre’, ‘fr_FR.UTF8’));
    echo strftime(” %A, %d. %B %Y n”);
    [/php]</blockquote>

    where i put this php code? please give me more details. I am novice.

    thank you

    gray Friend
    #322214

    Go to templatesja_teline_iiilayoutsblocksheader.php

    Look for
    [php]
    <p class=”ja-day”>
    <?php
    echo “<span class=”day”>”.date (‘l’).”</span>”;
    echo “<span class=”date”>, “.date (‘M’).” “.date (‘d’).date (‘S’).”</span>”;
    ?>
    </p>
    [/php]

    replace with
    [php]
    <p class=”ja-day”>
    <?php
    setlocale(LC_TIME, array(‘fr_FR’, ‘fr’, ‘fre’, ‘fr_FR.UTF8’));
    echo strftime(” %A, %d. %B %Y n”);
    ?>
    </p>
    [/php]

    kha007 Friend
    #322215

    thank you, it’s work

    cclaerhout Friend
    #322975

    Here’s a code for French, Traditional Chinese (Taiwan) and English language compatible with Joomfish.

    [PHP] <p class=”ja-day”>
    <?php
    if ($this->language==”fr-fr”)
    {
    $date_l = date(“l”);
    $days = array(‘Monday’,’Tuesday’,’Wednesday’,’Thursday’,’Friday’,’Saturday’,’Sunday’);
    $jours = array(‘Lundi’,’Mardi’,’Mercredi’,’Jeudi’,’Vendredi’,’Samedi’,’Dimanche’);
    $date_l = str_replace($days, $jours, $date_l);

    $date_F = date(“F”);
    $months = array(‘January’,’February’,’March’,’April’,’May’,’June’,’July’,’August’,’September’,’October’,’November’,’December’);
    $mois = array(‘janvier’,’février’,’mars’,’avril’,’mai’,’juin’,’juillet’,’août’,’septembre’,’octobre’,’novembre’,’décembre’);
    $date_F = str_replace($months, $mois, $date_F);

    echo “<span class=”day”>”. $date_l .”</span>”;
    echo “<span class=”date”> “.date (‘d’).” “.$date_F.”</span>”;
    }

    if ($this->language==”zh-tw”)
    {
    $date_l = date(“l”);
    $days = array(‘Monday’,’Tuesday’,’Wednesday’,’Thursday’,’Friday’,’Saturday’,’Sunday’);
    $tian = array(‘禮拜一’,’禮拜二’,’禮拜三’,’禮拜四’,’禮拜五’,’禮拜六’,’禮拜天’);
    $date_l = str_replace($days, $tian, $date_l);

    $date_F = date(“F”);
    $months = array(‘January’,’February’,’March’,’April’,’May’,’June’,’July’,’August’,’September’,’October’,’November’,’December’);
    $yue = array(‘一月’,’二月’,’三月’,’四月’,’五月’,’六月’,’七月’,’八月’,’九月’,’十月’,’十一月’,’十二月’);
    $date_F = str_replace($months, $yue, $date_F);

    $date_d = date(“d”);
    $months = array(’01’,’02’,’03’,’04’,’05’,’06’,’07’,’08’,’09’,’10’,’11’,’12’,’13’,’14’,’15’,’16’,’17’,’18’,’19’,’20’,’21’,’22’,’23’,’24’,’25’,’26’,’27’,’28’,’29’,’30’,’31’);
    $hao = array(‘一號’,’二號’,’三號’,’四號’,’五號’,’六號’,’七號’,’八號’,’九號’,’十號’,’十一號’,’十二號’,’十三號’,’十四號’,’十五號’,’十六號’,’十七號’,’十八號’,’十九號’,’二十號’,’二十一號’,’二十二號’,’二十三號’,’二十四號’,’二十五號’,’二十六號’,’二十七號’,’二十八號’,’二十九號’,’三十號’,’三十一號’);
    $date_d = str_replace($months, $hao, $date_d);

    echo “<span class=”date”>”.$date_F.” “.$date_d.”</span>”;
    echo “<span class=”day”> “. $date_l .”</span>”;

    }

    if ($this->language==”en-gb”)
    {
    echo “<span class=”day”>”.date (‘l’).”</span>”;
    echo “<span class=”date”>, “.date (‘M’).” “.date (‘d’).date (‘S’).”</span>”;
    }
    ?>
    </p>[/PHP]

    Just need to fix the GMT per language and it should be perfect.

    berdal Friend
    #324656

    <em>@zipper 144437 wrote:</em><blockquote>
    Too disable lastupdate, pull this line out:

    <p class="ja-updatetime"><span>Last update:</span><em><?php echo JATemplateHelper::getLastUpdate(); ?></em></p>


    </blockquote>

    But how do I change it to my local time?

    micrantha Friend
    #325136

    Hello berdal,

    Maybe this helps on the way to an answer:

    In ja_teline_iii/libs/ja.template.helper.php you can find this code:


    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';
    }

    So it seems to me that these lines define the output of GMT.
    I don’t know how to change these lines in order that the output is local time of Global Configs
    Maybe somebody else can help further.

    gray Friend
    #325156

    <em>@berdal 154234 wrote:</em><blockquote>But how do I change it to my local time?</blockquote>

    This issue is discussed in this thread.
    Hope it helps.

    micrantha Friend
    #325204

    OK, I can be more informative now, after friendly tip of Gray:

    In my case I replaced original code line

    return gmdate("h:i:s A", $sec+$tz).' GMT';

    with

    setlocale(LC_ALL, 'nl_NL'); //set the output in NL-language
    return strftime( "%a %e %b %H:%M %Z" , $sec+$tz).' ';

    Output: donderdag 26 nov 16:02 CET

    This code also gives day and month of last site-update

    As Gray pointed out: for specific php date formats open http://www.php.net/manual/en/ref.datetime.php

    More format-info in:
    gmdate(): http://www.php.net/manual/en/function.gmdate.php
    setlocale(): http://www.php.net/manual/en/function.setlocale.php
    strftime(): http://www.php.net/manual/en/function.strftime.php

    berdal Friend
    #328041

    Thanks alot for the help… I did figure it out. Now I have a different problem. If converting helper.php to UTF-8 (to allow the scandinavian letters æ, ø, å) the entire layout is pushed down apprx. 10px from the top. Do anyone have any idea what to do?

    davidrabinov Friend
    #328301

    <em>@shelsoker 150159 wrote:</em><blockquote>Hi, if someone served the Spanish code, here is:

    <?php
    $datum = date(“j F Y”);
    $dagvanweek = date(“l”);
    $arraydag = array(
    “Domingo”,
    “Lunes”,
    “Martes”,
    “Miercoles”,
    “Jueves”,
    “Viernes”,
    “Sabado”
    );
    $dagvanweek = $arraydag;
    $arraymaand = array(
    “Enero”,
    “Febrero”,
    “Marzo”,
    “Abril”,
    “Mayo”,
    “Junio”,
    “Julio”,
    “Agosto”,
    “Septiembre”,
    “Octubre”,
    “Noviembre”,
    “Diciembre”
    );
    $datum = date(“j “) . $arraymaand
    . date(” Y”);
    echo “$dagvanweek, $datum”;
    ?>
    </p></blockquote>

    This one works, but you’re need to add the Tilde in Miércoles & Sábado

    This is what I’m using for Spanish date

    <?php
    setlocale(LC_TIME, 'es_ES.UTF-8'); // Para el caso necesito UTF-8. Creo que por defecto es ISO-8859-1.
    $fecha= strftime('%A %e de %B de %Y');
    $fecha= ucfirst($fecha);
    echo $fecha; // muestra "Lunes 17 de septiembre de 2007"
    ?>

    The only thing here is i can’t figure out how to make the month start with a capital letter, if any ones knows, please let me know.

    gray Friend
    #328311

    <em>@davidrabinov 159096 wrote:</em><blockquote>
    The only thing here is i can’t figure out how to make the month start with a capital letter, if any ones knows, please let me know.</blockquote>

    The code used in strftime(‘%A %e de %B de %Y’) should display the month capitalized.
    But when ucfirst is applied, it return only first letter capitalized. Try to remove it.

    PS. I’ve looked at php manual, it seems that removing ucfirst would not help….

    bucakli Friend
    #331442

    i m using turkish in my site
    can you tell for turkish?

    Anonymous Moderator
    #331807

    Hi guys

    The below is a way to translate current date to your language use multi languages. the mean is that if you switch to other language, current date will change to that language.

    1. Open templatesja_teline_iiilayoutsblocksheader.php file, find following code section:

    [PHP]<p class=”ja-day”>
    <?php
    echo “<span class=”day”>”.date (‘l’).”</span>”;
    echo “<span class=”date”>, “.date (‘M’).” “.date (‘d’).date (‘S’).”</span>”;
    ?>
    </p>[/PHP]

    and change to:

    [PHP]<p class=”ja-day”>
    <?php
    echo “<span class=”day”>”.JText::_(date (‘l’)).”</span>”;
    echo “<span class=”date”>, “. JText::_(date (‘M’)) .” “.JText::_(date (‘d’)).JText::_(date (‘S’)).”</span>”;
    ?>
    </p>[/PHP]

    2. Open languages/your language / your_language.ini file (ex: languageen-GBen-GB.ini) to define some text
    For an example: you see Saturday, Feb 06th on the frontpage

    You have to translate all days (Saturday) and all short months (ex: Feb) to your language with the structure:

    The structure:
    UPPERCASE WORD = your language

    Example:

    SATURDAY = saturday
    FEB = feb

    Note: you should search this text in the file to make sure that this text is not exist yet.

    With this code, if you switch to other language, the date will change to your language.

    Hope it helps

    bucakli Friend
    #331829

    i changed

    <p class=”ja-day”>
    <?php
    echo “<span class=”date”>”. JText::_(date (‘d’)) .” / “.JText::_(date (‘m’)).” / “.JText::_(date (‘Y’)).”</span>”;
    echo “<span class=”day”> – “.JText::_(date (‘l’)).”</span>”;

    ?>

    i solved 06/02/2010 – Cumartesi but i didnot 06 Şubat 2010 – Cumartesi month language always english

    but thank you my friend

    gray Friend
    #331834

    JA Developer
    I’ve implemented this approach already (I posted here the same solution).

    It would be great to include this code in the next release of Teline III, isn’t it?

Viewing 15 posts - 16 through 30 (of 61 total)

This topic contains 61 replies, has 30 voices, and was last updated by  euroadvltd 11 years, 9 months ago.

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