About the warning message for visitors

Started by hatmak, April 28, 2024, 09:13:57 PM

Previous topic - Next topic

hatmak

Hello;

To prevent visitors from seeing the forum, I removed the "Allow guests to browse the forum" tick. Now, when visitors click on the forum menu, they cannot see the forum and a warning and login page appears as below. But I have a login menu and I don't want a separate login page to appear again when they click on the forum menu. I just I want the warning to appear. I want to delete the log in section. How can I do this?


Arantor

You can't without a very nasty set of changes - the login popup shares the same code as the login page for showing the form.

Sir Osis of Liver

Quote from: hatmak on April 28, 2024, 09:13:57 PMBut I have a login menu

Hmm, not sure what this means, but if you remove the login section from the warning window in Login.template.php, the header Login button still works.  Maintenance mode admin login is not affected.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

The one he's talking about is not the maintenance mode one, but the registered login one.

Though... actually now that I'm not on iPad I can check the template, I honestly thought kickguest used the main login template but it looks like one could actually safely remove the innards of the form in template_kick_guest() in Login.template.php without a huge drama.

I mean, it'd still be a usability loss, but whatever.

Sir Osis of Liver

Looks like kick_guest has it's own code, nothing else seems to be broken -


/* // And now the login information.
echo '
<div class="cat_bar">
<h3 class="catbg">
<span class="main_icons login"></span> ', $txt['login'], '
</h3>
</div>
<div class="roundframe">
<dl>
<dt>', $txt['username'], ':</dt>
<dd><input type="text" name="user" size="20"></dd>
<dt>', $txt['password'], ':</dt>
<dd><input type="password" name="passwrd" size="20"></dd>
<dt>', $txt['time_logged_in'], ':</dt>
<dd>
<select name="cookielength" id="cookielength">';

foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt)
echo '
<option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>';

echo '
</select>
</dd>
</dl>
<p class="centertext">
<input type="submit" value="', $txt['login'], '" class="button">
</p>
<p class="centertext smalltext">
<a href="', $scripturl, '?action=reminder">', $txt['forgot_your_password'], '</a>
</p>
</div>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '">
</div><!-- .login -->
</form>';
*/



Warning text can be edited as needed in Login.english.php -


$txt['only_members_can_access'] = 'Only registered members are allowed to access this section.';
$txt['login_below'] = 'Please login below.';


Should do what OP wants.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

hatmak

Quote from: Sir Osis of Liver on April 29, 2024, 01:41:15 PMLooks like kick_guest has it's own code, nothing else seems to be broken -


/* // And now the login information.
echo '
<div class="cat_bar">
<h3 class="catbg">
<span class="main_icons login"></span> ', $txt['login'], '
</h3>
</div>
<div class="roundframe">
<dl>
<dt>', $txt['username'], ':</dt>
<dd><input type="text" name="user" size="20"></dd>
<dt>', $txt['password'], ':</dt>
<dd><input type="password" name="passwrd" size="20"></dd>
<dt>', $txt['time_logged_in'], ':</dt>
<dd>
<select name="cookielength" id="cookielength">';

foreach ($context['login_cookie_times'] as $cookie_time => $cookie_txt)
echo '
<option value="', $cookie_time, '"', $modSettings['cookieTime'] == $cookie_time ? ' selected' : '', '>', $txt[$cookie_txt], '</option>';

echo '
</select>
</dd>
</dl>
<p class="centertext">
<input type="submit" value="', $txt['login'], '" class="button">
</p>
<p class="centertext smalltext">
<a href="', $scripturl, '?action=reminder">', $txt['forgot_your_password'], '</a>
</p>
</div>
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '">
</div><!-- .login -->
</form>';
*/



Warning text can be edited as needed in Login.english.php -


$txt['only_members_can_access'] = 'Only registered members are allowed to access this section.';
$txt['login_below'] = 'Please login below.';


Should do what OP wants.


Thx, that worked...

Advertisement: