If statement

Discussion forum for MOD Writers regarding MOD Development.
calle08
Registered User
Posts: 27
Joined: Tue Mar 11, 2008 3:15 pm

If statement

Post by calle08 »

I want to add my own If statement in the phpbb3 code, so that every time you login it will run. What file can i change to make that work?

User avatar
AmigoJack
Registered User
Posts: 5680
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: If statement

Post by AmigoJack »

calle08 wrote:every time you login
What does that mean to you?
  1. Whenever someone clicks "Login"?
  2. Whenever someone has clicked on "Submit" after entering username and password?
  3. Whenever someone is re-visiting the board after a given time?
  4. With each site that opens and the requester is logged in?
More details, more precise help is possible.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

calle08
Registered User
Posts: 27
Joined: Tue Mar 11, 2008 3:15 pm

Re: If statement

Post by calle08 »

Ok... i mean

Whenever someone has clicked on "Submit" after entering username and password!

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51910
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: If statement

Post by Brf »

How about changing this in language/en/ucp.php:

Code: Select all

	'LOGIN_REDIRECT'			=> 'You have been successfully logged in.',
That is the message that is shown after you login.

calle08
Registered User
Posts: 27
Joined: Tue Mar 11, 2008 3:15 pm

Re: If statement

Post by calle08 »

How do i include my own page insted of message?

calle08
Registered User
Posts: 27
Joined: Tue Mar 11, 2008 3:15 pm

Re: If statement

Post by calle08 »

Ok new question how do i change the redirect to go to example www.mypage.com? There is also a timer that move you to forum index after a few sek how do i remove that timer?

calle08
Registered User
Posts: 27
Joined: Tue Mar 11, 2008 3:15 pm

Re: If statement

Post by calle08 »

Ok new question. After 'You have been successfully logged in.', messeage you get moved to the forum index page. How can i change that so you get moved to other page?

User avatar
AGC
Registered User
Posts: 292
Joined: Sat Sep 15, 2007 10:26 pm
Contact:

Re: If statement

Post by AGC »

look for the redirect function (in the function.php file) there check fir the page you will be redirect.
(phpBB 2.0.x): []Admin Topics List[] MOD. << Description & Download. , []Highlight Author[] MOD.

Donate-paypal
(phpBB 3.0.x)[ver] MODs: [RC1] >Import old *.pak files MOD. + . . .[8] > ACP - Modules Quick Access (MQA) MOD. + . . . [7-PL1] > Multi Smile (actions) MOD

calle08
Registered User
Posts: 27
Joined: Tue Mar 11, 2008 3:15 pm

Re: If statement

Post by calle08 »

There are so many redirect in the file. Can you tell what line to change if i want to be moved to the file test.php that is in my public_html directory. Thanks...

calle08
Registered User
Posts: 27
Joined: Tue Mar 11, 2008 3:15 pm

Re: If statement

Post by calle08 »

Someone know what line i can edit so when after the '

Code: Select all

LOGIN_REDIRECT'         => 'You have been successfully logged in.',

text move you to my own page insted of the forum index?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: If statement

Post by RMcGirr83 »

calle08 wrote:Someone know what line i can edit so when after the '

Code: Select all

LOGIN_REDIRECT'         => 'You have been successfully logged in.',

text move you to my own page insted of the forum index?
includes/functions.php

Code: Select all

		if ($result['status'] == LOGIN_SUCCESS)
		{
			$redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");
			$message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

calle08
Registered User
Posts: 27
Joined: Tue Mar 11, 2008 3:15 pm

Re: If statement

Post by calle08 »

So this code will move users to mypage.php in the phpbb root directory? (don,t want to mess it up)

Code: Select all

 if ($result['status'] == LOGIN_SUCCESS)
      {
         $redirect = request_var('redirect', "{$phpbb_root_path}mypage.php");
         $message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: If statement

Post by RMcGirr83 »

Change it to this

$redirect = request_var('redirect', "{$phpbb_root_path}mypage.$phpEx");

..and yes.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

topthisfact
Registered User
Posts: 146
Joined: Mon Dec 21, 2009 4:15 am

Re: If statement

Post by topthisfact »

Wait so replace the whole

Code: Select all

if ($result['status'] == LOGIN_SUCCESS)
      {
         $redirect = request_var('redirect', "{$phpbb_root_path}mypage.php");
         $message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];
With the code below? but changing mypage to the page name


$redirect = request_var('redirect', "{$phpbb_root_path}mypage.$phpEx");


NOTE: If im currently using an auto redirect on login confirm page to index, will it effect the use of this?

User avatar
AGC
Registered User
Posts: 292
Joined: Sat Sep 15, 2007 10:26 pm
Contact:

Re: If statement

Post by AGC »

He meant not to use .php extension but instead use .$phpEx
(phpBB 2.0.x): []Admin Topics List[] MOD. << Description & Download. , []Highlight Author[] MOD.

Donate-paypal
(phpBB 3.0.x)[ver] MODs: [RC1] >Import old *.pak files MOD. + . . .[8] > ACP - Modules Quick Access (MQA) MOD. + . . . [7-PL1] > Multi Smile (actions) MOD

Locked

Return to “[3.0.x] MOD Writers Discussion”