variable that indicates session is on Login page

Discussion forum for MOD Writers regarding MOD Development.
Locked
techman41973
Registered User
Posts: 410
Joined: Thu Mar 28, 2013 10:27 pm

variable that indicates session is on Login page

Post by techman41973 » Tue Jul 23, 2013 3:15 am

Similar to S_REGISTRATION, which indicates that the sessions is currently showing the PHPBB registration page,
is there a variable that indicates the session is on the Login page?
For my application, there is an item in the overall header I don't want visible when I'm on the login page.

User avatar
Tom
Former Team Member
Posts: 2665
Joined: Tue Jun 20, 2006 2:12 am
Name: Tom Catullo
Contact:

Re: variable that indicates session is on Login page

Post by Tom » Tue Jul 23, 2013 5:31 am

You can add such a variable yourself by editing the /includes/functions.php file. Open this file and find the following lines (within the login_box() function definition):

Code: Select all

    $template->assign_vars(array(
        'LOGIN_ERROR'        => $err,
        'LOGIN_EXPLAIN'        => $l_explain,

        'U_SEND_PASSWORD'         => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '',
        'U_RESEND_ACTIVATION'    => ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
        'U_TERMS_USE'            => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
        'U_PRIVACY'                => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),

        'S_DISPLAY_FULL_LOGIN'    => ($s_display) ? true : false,
        'S_HIDDEN_FIELDS'         => $s_hidden_fields, 
On a new line after this, add the following:

Code: Select all

        'S_LOGIN_PAGE'             => true, 
Now, you can use S_LOGIN_PAGE in the same way you would use S_REGISTRATION to detect whether the user is on the login page.
Tom Catullo - Former Moderator Team Member
phpBB3 Smiley Pak Generator | Legend Repositioning MOD | My GitHub | My Site

techman41973
Registered User
Posts: 410
Joined: Thu Mar 28, 2013 10:27 pm

Re: variable that indicates session is on Login page

Post by techman41973 » Tue Jul 23, 2013 7:25 am

thanks!

Locked

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