also zuerst folgedes in die includes/funtions.php einfügen:
Code: Alles auswählen
<?php
/*
falls die MCAL-Funktionen nicht verfügbar sind,
müssen diese Funktion hier zusätzlich eingebaut
werden.
einige Formeln stammen von
http://www.th-o.de/kalender.htm
*/
function SGN($x) {
if ($x < 0) $y = -1;
if ($x == 0) $y = 0;
if ($x > 0) $y = 1;
return $y;
}
function is_leap_year($year) {
$JG = $year;
$JJ = $JG - floor($JG/100)*100;
$JH = $JG - $JJ;
return SGN($JG % 100) - SGN($JJ % 4) + 1 - SGN($JG % 400);
}
function day_of_year($year,$month,$day) {
$days_in_month_data = array(
0 => array(31,28,31,30,31,30,31,31,30,31,30,31),
1 => array(31,29,31,30,31,30,31,31,30,31,30,31)
);
$days_in_month = $days_in_month_data[is_leap_year($year)];
for ($i=1;$i<$month;$i++) {
$day += $days_in_month[$i];
}
return $day;
}
/*
Sternzeit-Berechnung
Florian Heidinger
14.09.2002
Version 2.0
*/
function stardate($year = false, $month = false, $day = false, $hour = false, $minute = false, $second = false)
{
$timestamp = time();
$thistime = getdate($timestamp);
if (empty($year)) $year = $thistime["year"];
if (empty($month)) $month = $thistime["mon"];
if (empty($day)) $day = $thistime["mday"];
if (empty($hour)) $hour = $thistime["hours"];
if (empty($minute)) $minute = $thistime["minutes"];
if (empty($second)) $second = $thistime["seconds"];
// mit MCAL:
// $daysinyear = 365 + mcal_is_leap_year($year);
// ohne MCAL:
$daysinyear = 365 + is_leap_year($year);
// mit MCAL:
// $dayofyear = mcal_day_of_year($year,$month,$day) + 1;
// ohne MCAL:
$dayofyear = day_of_year($year,$month,$day) + 1;
$thestardate = round((($year-2323)+(($dayofyear+($hour/24)+($minute/1440)+($second/86400))/$daysinyear))*100000)/100;
return $thestardate;
}
?>
suchen:
Code: Alles auswählen
function create_date($format, $gmepoch, $tz)
{
global $board_config, $lang;
static $translate;
if ( empty($translate) && $board_config['default_lang'] != 'english' )
{
@reset($lang['datetime']);
while ( list($match, $replace) = @each($lang['datetime']) )
{
$translate[$match] = $replace;
}
}
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));
}
ersetzen durch
Code: Alles auswählen
/*
function create_date($format, $gmepoch, $tz)
{
global $board_config, $lang;
static $translate;
if ( empty($translate) && $board_config['default_lang'] != 'english' )
{
@reset($lang['datetime']);
while ( list($match, $replace) = @each($lang['datetime']) )
{
$translate[$match] = $replace;
}
}
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));
}
*/
function create_date($format, $gmepoch, $tz)
{
$thistime = getdate($gmepoch);
$year = $thistime["year"];
$month = $thistime["mon"];
$day = $thistime["mday"];
$hour = $thistime["hours"];
$minute = $thistime["minutes"];
$second = $thistime["seconds"];
// mit MCAL:
// $daysinyear = 365 + mcal_is_leap_year($year);
// ohne MCAL:
$daysinyear = 365 + is_leap_year($year);
// mit MCAL:
// $dayofyear = mcal_day_of_year($year,$month,$day) + 1;
// ohne MCAL:
$dayofyear = day_of_year($year,$month,$day) + 1;
$thestardate = round((($year-2323)+(($dayofyear+($hour/24)+($minute/1440)+($second/86400))/$daysinyear))*100000)/100;
return $thestardate;
}
ah