Various modifications for phpBB3Redirects all new users to a specific topic

Snippets for phpBB3
Previous topicNext topic
User avatar

Topic Author
dmzx
Founder
Founder
Magic user status: Offline
Posts: 5974
Joined: Jan 13th, '14, 20:45
    unknown unknown

Redirects all new users to a specific topic

Post by dmzx »

Redirects all new users to a specific topic within the forum when they first log in to the board.

open includes/functions.php
Find This may be a partial find and not the whole line

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']);
Replace with Replace the preceding lines with the following

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']);
			}
open includes/acp/acp_board.php
Find This may be a partial find and not the whole line

Code: Select all

'allow_quick_reply'		=> array('lang' => 'ALLOW_QUICK_REPLY',		'validate' => 'bool',	'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
Add after Add these lines on a new blank line after the preceding line(s) to find

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),
open language/en/ucp.php
Find This may be a partial find and not the whole line

Code: Select all

'NO_NONMEMBER'	=> 'No non-member groups',
Add after Add these lines on a new blank line after the preceding line(s) to find

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',
open language/en/acp/board.php
Find This may be a partial find and not the whole line

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.',
));
Add after Add these lines on a new blank line after the preceding line(s) to find

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.',
   ));
Configure the ID of the topic you wish to redirect to on the board features page of the ACP.
binance.com ;) try it!
User avatar

clight77
Users
Users
Magic user status: Offline
Posts: 443
Joined: Sep 24th, '15, 14:23
    Windows 10 Firefox

Re: Redirects all new users to a specific topic

Post by clight77 »

Thanks I am trying it :)

Is it possible to force new member to have to make a post before they can use the rest of the site ?
User avatar

martin
Admin
Admin
Magic user status: Offline
Posts: 4818
Joined: Apr 6th, '14, 14:12
    Windows 10 Chrome

Re: Redirects all new users to a specific topic

Post by martin »

clight77 wrote: Oct 9th, '15, 21:08 Thanks I am trying it :)

Is it possible to force new member to have to make a post before they can use the rest of the site ?
There was a mod for doing that you needed set post count b4 you could enter to forums so the out come was you had to post in the introductions form first then you got board access.
Use this to install an ext on your board no more ftp or path making.
Path too install this ext is ext/boardtools/upload
Download is here Make it easy for us to solve your issues
User avatar

mh254
Users
Users
Magic user status: Offline
Posts: 12
Joined: Jan 28th, '16, 08:23
    Windows 10 Chrome

Re: Redirects all new users to a specific topic

Post by mh254 »

Mod means it was for 3.0.x not for 3.1.x? I'm looking for an extension for 3.1.x to force users to post in the introductions form first before they can access the whole forum.
User avatar

martin
Admin
Admin
Magic user status: Offline
Posts: 4818
Joined: Apr 6th, '14, 14:12
    Windows 10 Chrome

Re: Redirects all new users to a specific topic

Post by martin »

Just as i said there is a MOD that will need porting. (i do know the diff from a mod and extention)
User avatar

Scanialady
Users
Users
Magic user status: Offline
Posts: 307
Joined: Apr 6th, '15, 16:04
    Windows 10 Chrome

Re: Redirects all new users to a specific topic

Post by Scanialady »

There is an extension to redirect users (or groups) to specific topics by david63

https://www.phpbb.com/customise/db/exte ... _redirect/
-
If you want to get German translations for extensions: ask me. Deutscher Arcade Wiki im Aufbau
User avatar

jan_2017
Donator
Donator
Magic user status: Offline
Posts: 203
Joined: Feb 5th, '17, 09:21
    Android Chrome

Re: Redirects all new users to a specific topic

Post by jan_2017 »

Scanialady wrote: Aug 3rd, '16, 12:54 There is an extension to redirect users (or groups) to specific topics by david63

https://www.phpbb.com/customise/db/exte ... _redirect/
does not work with 3.1.10 :wall: Alternativ?

bye Jan

[ Post made via Android ] Image
User avatar

Topic Author
dmzx
Founder
Founder
Magic user status: Offline
Posts: 5974
Joined: Jan 13th, '14, 20:45
    Windows 10 Chrome

Re: Redirects all new users to a specific topic

Post by dmzx »

jan_2017 wrote: Apr 20th, '17, 16:20
Scanialady wrote: Aug 3rd, '16, 12:54 There is an extension to redirect users (or groups) to specific topics by david63

https://www.phpbb.com/customise/db/exte ... _redirect/
does not work with 3.1.10 :wall: Alternativ?

bye Jan

[ Post made via Android ] Image
That extension is valid for "phpbb/phpbb": ">=3.1.4,<3.2.*@dev" so why does it not work?
User avatar

jan_2017
Donator
Donator
Magic user status: Offline
Posts: 203
Joined: Feb 5th, '17, 09:21
    Android Chrome

Re: Redirects all new users to a specific topic

Post by jan_2017 »

OK I will try this:

https://www.phpbb.com/customise/db/exte ... 31#p552231

I saw it yesterday. :mml:

[ Post made via Android ] Image
Previous topicNext topic