-
AuthorPosts
-
September 13, 2009 at 9:54 am #144158
Hi, i just want to know how can i modify the date in italian language and also for disability last update.
I also see that i can’t customize the html template ‘cos i’ve only this code:
<?php
/**
* @copyright Copyright (C) 2005 – 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/// no direct access
defined( ‘_JEXEC’ ) or die( ‘Restricted access’ );include_once (dirname(__FILE__).DS.’libs’.DS.’ja.template.helper.php’);
$tmplTools = JATemplateHelper::getInstance($this, array(‘ui’));
# Auto Collapse Divs Functions ##########
$ja_left = $this->countModules(‘left’) || ($tmplTools->getParam(JA_TOOL_MENU) == 1);
$ja_right = $this->countModules(‘right’);if ( $ja_left && $ja_right ) {
$divid = ”;
} elseif ( $ja_left ) {
$divid = ‘-fr’;
} elseif ( $ja_right ) {
$divid = ‘-fl’;
} else {
$divid = ‘-f’;
}
$tmplTools->setParam (‘divid’, $divid);$curidx = $tmplTools->getCurrentMenuIndex();
//if ($curidx) $curidx–;//Calculate the width of template
$tmplWidth = ”;
$tmplWrapMin = ‘100%’;
switch ($tmplTools->getParam(JA_TOOL_SCREEN)){
case ‘auto’:
$tmplWidth = ‘97%’;
break;
case ‘fluid’:
$tmplWidth = intval($tmplTools->getParam(‘ja_screen_width’));
$tmplWidth = $tmplWidth ? $tmplWidth.’%’ : ‘90%’;
break;
case ‘fix’:
$tmplWidth = intval($tmplTools->getParam(‘ja_screen_width’));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).’px’ : ‘751px’;
$tmplWidth = $tmplWidth ? $tmplWidth.’px’ : ‘750px’;
break;
default:
$tmplWidth = intval($tmplTools->getParam(JA_TOOL_SCREEN));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).’px’ : ‘751px’;
$tmplWidth = $tmplWidth ? $tmplWidth.’px’ : ‘750px’;
break;
}$tmplTools->setParam (‘tmplWidth’, $tmplWidth);
$tmplTools->setParam (‘tmplWrapMin’, $tmplWrapMin);//Main navigation
$ja_menutype = $tmplTools->getParam(JA_TOOL_MENU);
$jamenu = null;
if ($ja_menutype != ‘none’) {
$japarams = new JParameter(”);
$japarams->set( ‘menutype’, $tmplTools->getParam(‘menutype’, ‘mainmenu’) );
$japarams->set( ‘menu_images_align’, ‘left’ );
$japarams->set( ‘menupath’, $tmplTools->templateurl() .’/ja_menus’);
$japarams->set(‘menu_title’, 0);$tmplTools->loadMenu($japarams);
}//End for main navigation
$layout = $tmplTools->getLayout ();
if ($layout) {
$tmplTools->display ($layout);
}————————-
I think that is missing something….
Can you help me ?
Many thanks !:)
zipper Friendzipper
- Join date:
- January 2006
- Posts:
- 62
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 11
- Thanked:
- 30 times in 10 posts
September 13, 2009 at 10:15 am #317218I have changed the date to dutch, you can use this also for Italian. I think you mean the date in the top header?
Go to templatesja_teline_iiilayoutsblocksheader.php
Search for:
<p class="ja-day">
<?php
echo "<span class="day">".date ('l')."</span>";
echo "<span class="date">, ".date ('M')." ".date ('d').date ('S')."</span>";
?>
</p>And change to this:
<p class="ja-day">
<?php
$datum = date("j F Y");
$dagvanweek = date("l");
$arraydag = array(
"Domenica",
"Lunedi",
"Martedi",
"Mercoledì",
"Giovedi",
"Venerdi",
"Sabato"
);
$dagvanweek = $arraydag;
$arraymaand = array(
"Gennaio",
"Febbraio",
"Marzo",
"Aprile",
"Maggio",
"Giugno",
"Luglio",
"Agosto",
"Settembre",
"Ottobre",
"Novembre",
"Dicembre"
);
$datum = date("j ") . $arraymaand
. date(" Y");
echo "$dagvanweek, $datum";
?>
</p>Too disable lastupdate, pull this line out:
<p class="ja-updatetime"><span>Last update:</span><em><?php echo JATemplateHelper::getLastUpdate(); ?></em></p>
I changed the day format for you too Italian.. hope that this helps you out.
16 users say Thank You to zipper for this useful post
September 13, 2009 at 11:41 am #317224Ok, i try it.
Many thanks for your fast help !santoshalom Friendsantoshalom
- Join date:
- February 2009
- Posts:
- 119
- Downloads:
- 0
- Uploads:
- 22
- Thanks:
- 67
- Thanked:
- 14 times in 1 posts
September 16, 2009 at 4:36 am #317488thank you zipper for the helpful tip
September 24, 2009 at 11:27 am #318396Hi,
Thank you for the code, very helpful.
However, I’ve changed our one to Afrikaans but on Thursday the 24/09 it showed Friday.
Here is the code and any help appreciated.
<?php
$datum = date(“j F Y”);
$dagvanweek = date(“l”);
$arraydag = array(
“Maandag”,
“Dinsdag”,
“Woensdag”,
“Donderdag”,
“Vrydag”,
“Saterdag”,
“Sondag”
);
$dagvanweek = $arraydag;
$arraymaand = array(
“Januarie”,
“Februarie”,
“Maart”,
“April”,
“Mei”,
“Junie”,
“Julie”,
“Augustus”,
“September”,
“Oktober”,
“November”,
“Desember”
);
$datum = date(“j “) . $arraymaand
. date(” Y”);
echo “$dagvanweek, $datum”;
?>
</p>hariorama Friendhariorama
- Join date:
- April 2009
- Posts:
- 174
- Downloads:
- 0
- Uploads:
- 33
- Thanks:
- 50
- Thanked:
- 15 times in 1 posts
September 24, 2009 at 11:34 am #318398german version:
<?php
$day = date(“l”);
$daynum = date(“j”);
$month = date(“M”);
$year = date(“Y”);switch($day)
{
case “Monday”: $day = “Montag”; break;
case “Tuesday”: $day = “Dienstag”; break;
case “Wednesday”: $day = “Mittwoch”; break;
case “Thursday”: $day = “Donnerstag”; break;
case “Friday”: $day = “Freitag”; break;
case “Saturday”: $day = “Samstag”; break;
case “Sunday”: $day = “Sonntag”; break;
}switch($month)
{
case “January”: $month = “Januar”; break;
case “February”: $month = “Februar”; break;
case “March”: $month = “Maerz”; break;
case “April”: $month = “April”; break;
case “May”: $month = “Mai”; break;
case “June”: $month = “Juni”; break;
case “July”: $month = “Juli”; break;
case “August”: $month = “August”; break;
case “September”: $month = “September”; break;
case “October”: $month = “Oktober”; break;
case “November”: $month = “November”; break;
case “December”: $month = “Dezember”; break;
}echo $day . “, ” . $daynum . “. ” . $month . ” ” . $year;
?>zipper Friendzipper
- Join date:
- January 2006
- Posts:
- 62
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 11
- Thanked:
- 30 times in 10 posts
September 24, 2009 at 1:31 pm #318422<em>@igmar 146042 wrote:</em><blockquote>Hi,
Thank you for the code, very helpful.
However, I’ve changed our one to Afrikaans but on Thursday the 24/09 it showed Friday.
Here is the code and any help appreciated.
<?php
$datum = date(“j F Y”);
$dagvanweek = date(“l”);
$arraydag = array(
“Sondag”,
“Maandag”,
“Dinsdag”,
“Woensdag”,
“Donderdag”,
“Vrydag”,
“Saterdag”,
);
$dagvanweek = $arraydag;
$arraymaand = array(
“Januarie”,
“Februarie”,
“Maart”,
“April”,
“Mei”,
“Junie”,
“Julie”,
“Augustus”,
“September”,
“Oktober”,
“November”,
“Desember”
);
$datum = date(“j “) . $arraymaand
. date(” Y”);
echo “$dagvanweek, $datum”;
?>
</p></blockquote>Changed the code a little bit, you had Sondag at the end, had to be at the start. Tell me if it worked out ok. Altough Afrikaans almost similar to Dutch, some little things are different regarding the C’s and Z’s.
September 24, 2009 at 4:59 pm #318452zipper,
Thank you for the update!
However, when I changed it to “Sondag” at the top my page failed to load. I only got a blank on my homepage.
Thank you again and your help is appreciated.
Schwoelm FriendSchwoelm
- Join date:
- June 2006
- Posts:
- 20
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 10 times in 3 posts
October 13, 2009 at 5:35 pm #320395Hi,
thx for your helpfull posts. I tried by myself the following code and it functions well (you have only to change the language-code “de_DE” for your needs and your country):
<p class="ja-day">
<?php
setlocale(LC_TIME, "de_DE");
echo strftime(" %A, %d. %B %Y n");
?>
</p>Hope, its helpfull for u guys.
Hendrik
7 users say Thank You to Schwoelm for this useful post
zorroh Friendzorroh
- Join date:
- November 2006
- Posts:
- 422
- Downloads:
- 20
- Uploads:
- 43
- Thanks:
- 88
- Thanked:
- 80 times in 1 posts
October 14, 2009 at 1:03 pm #320484wow, thanks man. last one was really helpful!
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
October 16, 2009 at 7:13 am #320681<em>@Schwoelm 148676 wrote:</em><blockquote>Hi,
thx for your helpfull posts. I tried by myself the following code and it functions well (you have only to change the language-code “de_DE” for your needs and your country):
<p class="ja-day">
<?php
setlocale(LC_TIME, "de_DE");
echo strftime(" %A, %d. %B %Y n");
?>
</p>Hope, its helpfull for u guys.
Hendrik</blockquote>
It doesn’t work for UTF8 (and probably depends on server). In case of German language, in my case (localhost – Windows NT WS08 5.1 build 2600, MySQL 5.1.33-community,utf8_general_ci, PHP 5.2.9, Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9), it worked only with “ge”
But for general purposes, the above code could be enriched.
[php]
setlocale(LC_TIME, array(‘de_DE’,’de_DE.UTF8′,’de_DE@euro’, ‘de’, ‘ge’));
echo strftime(” %A, %d. %B %Y n”);[/php]Still, for Cyrillic languages this approach would not work. Personally I stopped at:
[php]
<p class=”ja-day”>
<?php
echo “<span class=”day”>”.JText::_(date (‘l’)).”</span>”;
echo “<span class=”date”>, “.date (‘d’).’ ‘.JText::_(date (‘F’)).’ ‘.date (‘Y’).”</span>”;
?>
</p>
[/php]4 users say Thank You to gray for this useful post
Schwoelm FriendSchwoelm
- Join date:
- June 2006
- Posts:
- 20
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 10 times in 3 posts
October 16, 2009 at 3:50 pm #320735Hi gray,
thx for your “enriched” code. I´ve tried it now on our servers and it works fine too.
I wonder, why “my” code should not work with UTF8!? Because all of our sites are in UTF8 and the code works fine…
But to “get sure” that it works on every server (except cyrillic languages) I would prefer and recommend YOUR enriched code.
Thx, Hendrik
October 25, 2009 at 8:07 pm #321505Hi, 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>October 31, 2009 at 12:08 am #322165I want change date in french version. can you help me?
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
October 31, 2009 at 5:10 am #322175<em>@kha007 151013 wrote:</em><blockquote>I want change date in french version. can you help me?</blockquote>
try
[php]
setlocale(LC_TIME, array(‘fr_FR’, ‘fr’, ‘fre’, ‘fr_FR.UTF8’));
echo strftime(” %A, %d. %B %Y n”);
[/php] -
AuthorPosts
This topic contains 61 replies, has 30 voices, and was last updated by euroadvltd 12 years, 5 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum