open includes/functions.php
Code: Select all
$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']);
Code: Select all
if (!empty($config['new_user_welcome_topic_id']) && $config['new_user_welcome_topic'] == true && $user->data['user_lastvisit'] == 0)
{
$sql = 'SELECT topic_id
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . $config['new_user_welcome_topic_id'];
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($config['new_user_welcome_topic_id'] == $row['topic_id'])
{
$redirect = "{$phpbb_root_path}viewtopic.$phpEx?t=" . $config['new_user_welcome_topic_id'];
$message = ($l_success) ? $l_success : $user->lang['LOGIN_NEW_USER_WELCOME_TOPIC_REDIRECT'];
$l_redirect = $user->lang['RETURN_NEW_USER_WELCOME_TOPIC'];
}
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']);
}
}
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']);
}
Code: Select all
'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
Code: Select all
'new_user_welcome_topic' => array('lang' => 'NEW_USER_WELCOME_TOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'new_user_welcome_topic_id' => array('lang' => 'NEW_USER_WELCOME_TOPIC_ID', 'validate' => 'int:0', 'type' => 'text:4:8', 'explain' => true),
Code: Select all
'NO_NONMEMBER' => 'No non-member groups',
Code: Select all
'LOGIN_NEW_USER_WELCOME_TOPIC_REDIRECT' => 'You have been successfully logged in. As this is your first visit you will be redirected to our welcome topic.',
'RETURN_NEW_USER_WELCOME_TOPIC' => '%sProceed to welcome topic%s',
Code: Select all
'JAB_USERNAME_EXPLAIN' => 'Specify a registered username or a valid JID. The username will not be checked for validity. If you only specify a username, then your JID will be the username and the server you specified above. Else, specify a valid JID, for example user@jabber.org.',
));
Code: Select all
// New User Welcome Topic Redirect
$lang = array_merge($lang, array(
'NEW_USER_WELCOME_TOPIC' => 'New User Welcome Topic Redirect',
'NEW_USER_WELCOME_TOPIC_EXPLAIN' => 'Redirect all new users to a specific topic upon first login on the board.',
'NEW_USER_WELCOME_TOPIC_ID' => 'New User Welcome Topic ID',
'NEW_USER_WELCOME_TOPIC_ID_EXPLAIN' => 'Enter the ID of the topic you wish to redirect all new users to.',
));