15
Quote:
That is true for the unpatched version.
With the
patch that reactivates some unreachable code, the date formats are in /modules/newbb/language/english/main.php
function newbb_formatTimestamp($time, $format = "c", $timeoffset = "")
{
/*
if(strtolower($format) == "reg" || strtolower($format) == "") {
$format = "c";
}
if( (strtolower($format) == "custom" || strtolower($format) == "c") && !empty($GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"]) ) {
$format = $GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"];
}
load_functions("locale");
return XoopsLocal::formatTimestamp($time, $format, $timeoffset);
if(class_exists("XoopsLocal") && is_callable(array("XoopsLocal", "formatTimestamp")) && defined("_TODAY")){
return XoopsLocal::formatTimestamp($time, $format, $timeoffset);
}
*/
global $xoopsConfig, $xoopsUser;
if(strtolower($format) == "rss" || strtolower($format) == "r"){
$TIME_ZONE = "";
if(!empty($GLOBALS['xoopsConfig']['server_TZ'])){
$server_TZ = abs(intval($GLOBALS['xoopsConfig']['server_TZ']*3600.0));
$prefix = ($GLOBALS['xoopsConfig']['server_TZ']<0)?" -":" +";
$TIME_ZONE = $prefix.date("Hi",$server_TZ);
}
$date = gmdate("D, d M Y H:i:s", intval($time)).$TIME_ZONE;
return $date;
}
$usertimestamp = xoops_getUserTimestamp($time, $timeoffset);
switch (strtolower($format)) {
case 's':
$datestring = _SHORTDATESTRING;
break;
case 'm':
$datestring = _MEDIUMDATESTRING;
break;
case 'mysql':
$datestring = "Y-m-d H:i:s";
break;
case 'rss':
$datestring = "r";
break;
case 'l':
$datestring = _DATESTRING;
break;
case 'c':
case 'custom':
default:
newbb_load_lang_file("main", "newbb");
$current_timestamp = xoops_getUserTimestamp(time(), $timeoffset);
if(date("Ymd", $usertimestamp) == date("Ymd", $current_timestamp)){
$datestring = _MD_TODAY;
}elseif(date("Ymd", $usertimestamp+24*60*60) == date("Ymd", $current_timestamp)){
$datestring = _MD_YESTERDAY;
}elseif(date("Y", $usertimestamp) == date("Y", $current_timestamp)){
$datestring = _MD_MONTHDAY;
}else{
$datestring = _MD_YEARMONTHDAY;
}
break;
}
return date($datestring, $usertimestamp);
}
Quote:
I altered the functions php as above
Meaning only the change of the second argument or also the rest of the function as here above?