Verfasst: 24.08.2004 08:21
also ich habe eine uraltversion des today/yesterday mod am laufen. bisher ohne probleme...
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * ($tz+date("I")))), $translate) : @gmdate($format, $gmepoch + (3600 * ($tz+date("I"))));
Code: Alles auswählen
$thetime = ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * ($tz+date("I")))), $translate) : @gmdate($format, $gmepoch + (3600 * ($tz+date("I"))));
$L_Today = 'Heute';
$L_Yesterday = 'Gestern';
$time_format = " H:i ";// - hour:minute am/pm
$date = getdate();
$today = $date['mday'];
$month = $date['mon'];
$year = $date['year'];
$forum_date_today = @gmdate ("d", $gmepoch);
$forum_date_month = @gmdate ("m", $gmepoch);
$forum_date_year = @gmdate ("Y", $gmepoch);
if ($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Today . @gmdate ($time_format, $gmepoch + (3600 * ($tz+date("I"))));//today
else
if ($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch + (3600 * ($tz+date("I"))));//yesterday
else
//if today is 1 and the month is not 1, then we have to check how many days in the previews month
//and then set $yesterday to the last day in the previews month
if ($today == 1 && $month != 1)
{
$yesterday = date ("t", mktime(0,0,0,($month-1),1,$year));//returns how many days in the previews month
if ($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch + (3600 * ($tz+date("I"))));//yesterday
}
else
//if we are in the first day in the year
if ($today == 1 && $month == 1)
{
$yesterday = date ("t", mktime(0,0,0,12,1,($year -1)));
if ($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch + (3600 * ($tz+date("I"))));//yesterday
}
return ($thetime);
Code: Alles auswählen
$thetime = ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * ($tz+date("I")))), $translate) : @gmdate($format, $gmepoch + (3600 * ($tz+date("I"))));
$L_Today = 'Heute';
$L_Yesterday = 'Gestern';
$time_format = " H:i ";// - hour:minute am/pm
$date = getdate();
$today = $date['mday'];
$month = $date['mon'];
$year = $date['year'];
$forum_date_today = @gmdate ("d", $gmepoch);
$forum_date_month = @gmdate ("m", $gmepoch);
$forum_date_year = @gmdate ("Y", $gmepoch);
if ($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Today . @gmdate ($time_format, $gmepoch + (3600 * ($tz+date("I"))));//today
else
if ($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch + (3600 * ($tz+date("I"))));//yesterday
else
//if today is 1 and the month is not 1, then we have to check how many days in the previews month
//and then set $yesterday to the last day in the previews month
if ($today == 1 && $month != 1)
{
$yesterday = date ("t", mktime(0,0,0,($month-1),1,$year));//returns how many days in the previews month
if ($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch + (3600 * ($tz+date("I"))));//yesterday
}
else
//if we are in the first day in the year
if ($today == 1 && $month == 1)
{
$yesterday = date ("t", mktime(0,0,0,12,1,($year -1)));
if ($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch + (3600 * ($tz+date("I"))));//yesterday
}
return ($thetime);