Well, I spent some time today to fix this issue. The server I am on is way off time now (see GMT +10). So I did a little modding of the code to accommodate this feature and wanted to pass it on if others are interested...
(Be advised that this code was altered in version 1.2 and I haven't tested it in 1.3 or 1.4)
Add the following lines to the setup_options.php file (I dropped them in right below "$dateFormat='MM DD, YYYY<br>T';"):
---------CLIP---------
//---------------> /* New vars for time off setting and formatting */
$useTimeDescriptor=TRUE; // If set to TRUE it will display the $timeDescriptor at the end of the time. $timeDescriptor='GMT'; // Time Zone descriptor (i.e. GMT, EST, PST...)
$useNewDateFormat=TRUE; // If set to TRUE it will use the $newDateFormat for formatting and will disregard the Lang files. $newDateFormat="M d, Y <br>H:i:s"; // See php docs for format values - date() function, 'string format' parameter
$useOffsetTime=TRUE; // If set to TRUE it will offset the time (and date) by setting the folloing variables. $offsetTimeDays = 0; // Can be a positive or negative integer $offsetTimeHours = -10; // Can be a positive or negative integer $offsetTimeMins = 0; // Can be a positive or negative integer
/* End new vars */ //--------------->
---------END----------
You will also have to alter your bb_functions.php to reflect the following changes in the "convert_date" function (do a search for the function signature):
---------CLIP---------
//---------------> function convert_date ($dateR) { global $useOffsetTime, $useNewDateFormat, $useTimeDescriptor; if ($useOffsetTime) { global $offsetTimeDays, $offsetTimeHours, $offsetTimeMins; $dateInt = strtotime($dateR); $offsetTime = ($offsetTimeDays*86400)+($offsetTimeHours*3600)+($offsetTimeMins*60);
$dateInt += $offsetTime; $dateR = date("Y-m-d H:i:s", $dateInt); } if ($useNewDateFormat) { global $newDateFormat; $dateR = date($newDateFormat, strtotime($dateR)); } else { global $l_months, $dateFormat; $months = explode (':', $l_months); if (sizeof($months)!=12) { $dateR = 'N/A'; } else { list ($currentD, $currentT) = explode (' ', $dateR); $cAll = explode ('-', $currentD); if(substr($cAll[2],0,1)=='0') $cAll[2]=substr($cAll[2],1,strlen($cAll[2])-1); $dateR = str_replace ('DD', $cAll[2], $dateFormat); $dateR = str_replace ('YYYY', $cAll[0], $dateR); $whichMonth = $cAll[1]-1; $dateR = str_replace ('MM', $months[$whichMonth], $dateR); if (substr_count($dateR,'US')>0) { if ($currentT>='12:00:00' and $currentT<='23:59:59') { $times=explode(':',$currentT); $times[0]=$times[0]-12; if ($times[0]<10) $times[0]='0'.$times[0]; $currentT=implode(':',$times); $m='pm'; } else { $m='am'; } } $dateR = str_replace ('US', $m, $dateR); } $dateR = str_replace ('T', $currentT, $dateR); } if ($useTimeDescriptor) { global $timeDescriptor; $dateR .= ' ' . $timeDescriptor; } return $dateR; }
//--------------->
---------END----------
Enjoy...
Perhaps the miniBB developers will add this in for their next release (hint, hint).
:) |