mam taką funkcję:
<?php
function date_format($format, $data, $no_today = 0)
{
$tz = 1;
$auto = 1;
$tz_add = ($auto) ?
(3600
* ($tz + (@date('I', $data) && @date('I', time())))) : (3600
* $tz);
$epoch_time = $data + $tz_add;
$current_time = time() + $tz_add;
$cyear = @gmdate('Y', $current_time); $cmonth = @gmdate('n', $current_time); $cday = @gmdate('j', $current_time); $chour = @gmdate('G', $current_time); $cmin = @gmdate('i', $current_time);
$today_begin = @gmmktime(0
, 0
, 0
, $cmonth, $cday, $cyear, @date('I', $current_time)); $today_end = @gmmktime(23
, 59
, 59
, $cmonth, $cday, $cyear, @date('I', $current_time)); $yesterday_begin = $today_begin - 86400;
if ($epoch_time > $yesterday_begin && $epoch_time < $today_end && !$no_today)
{
if ($epoch_time < $today_begin)
{
return 'Wczoraj '.@gmdate('H:i', $epoch_time); }
else
{
return 'Dzisiaj '.@gmdate('H:i', $epoch_time); }
}
return gmdate($format, $epoch_time);
}
?>
i mi ciągle wywala taki błąd:
Fatal error: Cannot redeclare date_format() in /home/gta4life/public_html/stroju/pliki/funkcje.php on line 311
co jest winą