Быстрый лёгкий надёжный форумный движок
Вы не вошли.
I'm using modal for user log in, so the user can logging in without visiting login.php. I want to change the redirect setting for logging in. In another word, if I am a user and I'm curently reading certain topic then I'm interested to give comment about the topic. So I hit the login modal botton, but I don't want to be redirected to the index page after login, I need to be redirected to the topic that I'm curently read.
What sould i do?
Offline
The code from the login.php file:
1. Redirect address calculation
// Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)
if (!empty($_SERVER['HTTP_REFERER']))
$redirect_url = validate_redirect($_SERVER['HTTP_REFERER'], null);
if (!isset($redirect_url))
$redirect_url = get_base_url(true).'/index.php';
else if (preg_match('%viewtopic\.php\?pid=(\d+)$%', $redirect_url, $matches))
$redirect_url .= '#p'.$matches[1];
2. Adding addresses to the form
<input type="hidden" name="redirect_url" value="<?php echo pun_htmlspecialchars($redirect_url) ?>" />
3. Go to the address after login
// Try to determine if the data in redirect_url is valid (if not, we redirect to index.php after login)
$redirect_url = validate_redirect($_POST['redirect_url'], 'index.php');
redirect(pun_htmlspecialchars($redirect_url), $lang_login['Login redirect']);
Моя сборка FluxBB 1.5, ForkBB · сообщество
Offline
Okay it's done now. Thanks mr Visman
Offline