Verfasst: 29.07.2004 11:16
ich habe das daytime() in die admin_quiz.php eingefügt und bekomme jetzt den fehler "Call to undefined function: daytime() in...." wo finde ich denn den codeschnipsel um die funktion zu definieren??
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
//
// Create date/time from format and timezone
//
function create_date($format, $gmepoch, $tz)
{
global $board_config, $lang, $userdata;
static $translate;
if ( empty($translate) && $board_config['default_lang'] != 'english' )
{
@reset($lang['datetime']);
while ( list($match, $replace) = @each($lang['datetime']) )
{
$translate[$match] = $replace;
}
}
// Start replacement - Advanced time management MOD
if ( $userdata['user_id'] != ANONYMOUS )
{
switch ( $userdata['user_time_mode'] )
{
case 1:
$dst_sec = $userdata['user_dst_time_lag'] * 60;
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz) + $dst_sec), $translate) : @gmdate($format, $gmepoch + (3600 * $tz) + $dst_sec);
break;
case 2:
$dst_sec = date('I', $gmepoch) * $userdata['user_dst_time_lag'] * 60;
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz) + $dst_sec), $translate) : @gmdate($format, $gmepoch + (3600 * $tz) + $dst_sec);
break;
case 3:
return ( !empty($translate) ) ? strtr(@date($format, $gmepoch), $translate) : @date($format, $gmepoch);
break;
case 4:
case 5:
if ( !($board_config['gzip_compress']==1 && ob_get_level()==0) )
{
@ini_set('arg_separator.output', '&');
session_start();
}
if ( isset($HTTP_SESSION_VARS['pc_timezoneoffset']) )
{
$tzo_sec = $HTTP_SESSION_VARS['pc_timezoneoffset'] * (-60);
} else
{
$tzo_sec = $userdata['user_pc_time_offset'];
}
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + $tzo_sec), $translate) : @gmdate($format, $gmepoch + $tzo_sec);
break;
case 6:
if ( !($board_config['gzip_compress']==1 && ob_get_level()==0) )
{
@ini_set('arg_separator.output', '&');
session_start();
}
if ( isset($HTTP_SESSION_VARS['pc_time_offset']) )
{
$tzo_sec = $HTTP_SESSION_VARS['pc_time_offset'];
} else
{
$tzo_sec = $userdata['user_pc_time_offset'];
}
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + $tzo_sec), $translate) : @gmdate($format, $gmepoch + $tzo_sec);
break;
default:
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));
break;
}
} else
{
switch ( $board_config['default_time_mode'] )
{
case 1:
$dst_sec = $board_config['default_dst_time_lag'] * 60;
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz) + $dst_sec), $translate) : @gmdate($format, $gmepoch + (3600 * $tz) + $dst_sec);
break;
case 2:
$dst_sec = date('I', $gmepoch) * $board_config['default_dst_time_lag'] * 60;
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz) + $dst_sec), $translate) : @gmdate($format, $gmepoch + (3600 * $tz) + $dst_sec);
break;
case 3:
return ( !empty($translate) ) ? strtr(@date($format, $gmepoch), $translate) : @date($format, $gmepoch);
break;
case 4:
case 5:
if ( !($board_config['gzip_compress']==1 && ob_get_level()==0) )
{
@ini_set('arg_separator.output', '&');
session_start();
}
if ( isset($HTTP_SESSION_VARS['pc_timezoneoffset']) )
{
$tzo_sec = $HTTP_SESSION_VARS['pc_timezoneoffset'] * (-60);
} else
{
$tzo_sec = $userdata['user_pc_time_offset'];
}
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + $tzo_sec), $translate) : @gmdate($format, $gmepoch + $tzo_sec);
break;
case 6:
if ( !($board_config['gzip_compress']==1 && ob_get_level()==0) )
{
@ini_set('arg_separator.output', '&');
session_start();
}
if ( isset($HTTP_SESSION_VARS['pc_time_offset']) )
{
$tzo_sec = $HTTP_SESSION_VARS['pc_time_offset'];
} else
{
$tzo_sec = $userdata['user_pc_time_offset'];
}
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + $tzo_sec), $translate) : @gmdate($format, $gmepoch + $tzo_sec);
break;
default:
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));
break;
}
}
// End replacement - Advanced time management MOD
}
Code: Alles auswählen
function get_tz_offset($tz)
{
global $board_config, $lang, $userdata;
switch ( $userdata['user_time_mode'] )
{
case 1:
return (3600 * $tz) + $userdata['user_dst_time_lag'] * 60;
break;
case 2:
return (3600 * $tz) + date('I', $gmepoch) * $userdata['user_dst_time_lag'] * 60;
break;
case 3:
return 3600 * $tz;
break;
case 4:
case 5:
if ( isset($HTTP_SESSION_VARS['pc_timezoneoffset']) )
{
return $HTTP_SESSION_VARS['pc_timezoneoffset'] * (-60);
} else
{
return $userdata['user_pc_time_offset'];
}
break;
case 6:
if ( isset($HTTP_SESSION_VARS['pc_time_offset']) )
{
return $HTTP_SESSION_VARS['pc_time_offset'];
} else
{
return $userdata['user_pc_time_offset'];
}
break;
default:
return 3600 * $tz;
break;
}
}
Code: Alles auswählen
( 3600 * $board_config['board_timezone'] )
Code: Alles auswählen
get_tz_offset($board_config['board_timezone'])
Code: Alles auswählen
$next_quiz = mktime($HTTP_POST_VARS['next_quiz_hour'], $HTTP_POST_VARS['next_quiz_minute'], 0, $HTTP_POST_VARS['next_quiz_month'], $HTTP_POST_VARS['next_quiz_day'], $HTTP_POST_VARS['next_quiz_year']) - get_tz_offset($board_config['board_timezone']) + date('Z');