-
AuthorPosts
-
cyprusmedya Friend
cyprusmedya
- Join date:
- May 2011
- Posts:
- 79
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 4
- Thanked:
- 15 times in 14 posts
June 6, 2011 at 7:48 pm #164902i 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 Friendkhoand
- Join date:
- February 2011
- Posts:
- 4500
- Downloads:
- 0
- Uploads:
- 179
- Thanks:
- 169
- Thanked:
- 1166 times in 1060 posts
June 7, 2011 at 9:41 am #395071Hi,
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
1 user says Thank You to khoand for this useful post
cyprusmedya Friendcyprusmedya
- Join date:
- May 2011
- Posts:
- 79
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 4
- Thanked:
- 15 times in 14 posts
June 7, 2011 at 11:14 am #395085Thank 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 Friendkhoand
- Join date:
- February 2011
- Posts:
- 4500
- Downloads:
- 0
- Uploads:
- 179
- Thanks:
- 169
- Thanked:
- 1166 times in 1060 posts
June 8, 2011 at 9:14 am #395226but 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 Friendkhoand
- Join date:
- February 2011
- Posts:
- 4500
- Downloads:
- 0
- Uploads:
- 179
- Thanks:
- 169
- Thanked:
- 1166 times in 1060 posts
June 8, 2011 at 9:43 am #395233also 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");
1 user says Thank You to khoand for this useful post
cyprusmedya Friendcyprusmedya
- Join date:
- May 2011
- Posts:
- 79
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 4
- Thanked:
- 15 times in 14 posts
June 8, 2011 at 6:59 pm #395346i did it but now it shows 00:00:00.
khoand Friendkhoand
- Join date:
- February 2011
- Posts:
- 4500
- Downloads:
- 0
- Uploads:
- 179
- Thanks:
- 169
- Thanked:
- 1166 times in 1060 posts
June 9, 2011 at 7:33 am #395436Could you give me username+password of ftp and a link to your website?
balgev Friendbalgev
- Join date:
- May 2011
- Posts:
- 52
- Downloads:
- 4
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 1 times in 1 posts
June 9, 2011 at 10:37 pm #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’;
1 user says Thank You to balgev for this useful post
cyprusmedya Friendcyprusmedya
- Join date:
- May 2011
- Posts:
- 79
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 4
- Thanked:
- 15 times in 14 posts
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
July 2, 2011 at 3:46 pm #399619So, 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] -
AuthorPosts
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