PHPbb重定向到某个页面,如果该页面是当月的第一个页面
全部,, 我一直在尝试让我的PHPBB实例重定向到某个页面(如果是本月的第一个页面)。这个月的所有其他日子我都希望重定向到索引页面 我尝试修改includes/functions.php以包含重定向,修改ucp.php页面以包含新的重定向 包括/functions.php:PHPbb重定向到某个页面,如果该页面是当月的第一个页面,php,html,redirect,phpbb,Php,Html,Redirect,Phpbb,全部,, 我一直在尝试让我的PHPBB实例重定向到某个页面(如果是本月的第一个页面)。这个月的所有其他日子我都希望重定向到索引页面 我尝试修改includes/functions.php以包含重定向,修改ucp.php页面以包含新的重定向 包括/functions.php: // The result parameter is always an array, holding the relevant information... if ($result['status'] ==
// The result parameter is always an array, holding the relevant information...
if ($result['status'] == LOGIN_SUCCESS)
{
date_default_timezone_set('EST');
$firstday = date('Y-m-01');
$today = date('Y-m-d');
if ($firstday == $today){
$redirect = request_var('redirect', "{$phpbb_root_path}projects/index.$phpEx");
$message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];
$l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "{$phpbb_root_path}projects/index.$phpEx" || $redirect === "projects/index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']);
}
else{
$redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");
$message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];
$l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "{$phpbb_root_path}index.$phpEx" || $redirect === "index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']);
}
// append/replace SID (may change during the session for AOL users)
$redirect = reapply_sid($redirect);
以及ucp.php:
case 'login':
date_default_timezone_set('EST');
$firstday = date('Y-m-30');
$today = date('Y-m-d');
if (($user->data['is_registered']) && ($today == $firstdate))
{
redirect(append_sid("{$phpbb_root_path}projects/index.$phpEx"));
}
else{
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
login_box(request_var('redirect', "index.$phpEx"));
break;
但是,使用其中一个或两个不会返回成功的重定向。用户已登录,并且
无法显示此页面
消息出现了
有更好的方法吗?
如果(date('d')==1){}date只接受格式30或1不是格式,您认为使用
会很复杂。因此,只需将天(d)与1.0进行比较即可。同样的事情。重定向无法正确执行。此外,php中的d返回2个数字值'd'==1将不会呈现'd'==01 willtry$redirect=request\u var('redirect',$phpbb\u root\u path.'projects/index'.$phpEx)代码>使用j
而不是d