Skip to main content
Topic: Kick guest (Read 1757 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Kick guest

Just noticed that there is an option requesting guest to register in Login.template.php

Code: [Select]
function template_kick_guest()
{
global $context, $scripturl, $modSettings, $txt;

// This isn't that much... just like normal login but with a message at the top.
echo '
<form action="', $scripturl, '?action=login2" method="post" accept-charset="UTF-8" name="frmLogin" id="frmLogin"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<div class="login">
<h2 class="category_header">', $txt['warning'], '</h2>';

// Show the message or default message.
echo '
<p class="information centertext">
', empty($context['kick_message']) ? $txt['only_members_can_access'] : $context['kick_message'], '<br />';

if ($context['can_register'])
echo sprintf($txt['login_below_or_register'], $scripturl . '?action=register', $context['forum_name_html_safe']);
else
echo $txt['login_below'];

// And now the login information.
echo '
<h3 class="category_header hdicon cat_img_login">
', $txt['login'], '
</h3>
<div class="roundframe">
<dl>
<dt><label for="user">', $txt['username'], '</label>:</dt>
<dd>
<input type="text" name="user" id="user" size="20" class="input_text" />
</dd>
<dt><label for="passwrd">', $txt['password'], '</label>:</dt>
<dd>
<input type="password" name="passwrd" id="passwrd" size="20" class="input_password" />
</dd>';

if (!empty($modSettings['enableOpenID']))
echo '
</dl>
<p><strong>—', $txt['or'], '—</strong></p>
<dl>
<dt><label for="openid_identifier">', $txt['openid'], '</label>:</dt>
<dd>
<input id="openid_identifier" type="text" name="openid_identifier" class="input_text openid_login" size="17" />
</dd>
</dl>
<hr />
<dl>';

echo '
<dt><label for="cookielength">', $txt['mins_logged_in'], '</label>:</dt>
<dd>
<input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '" class="input_text" />
</dd>
<dt><label for="cookieneverexp">', $txt['always_logged_in'], '</label>:</dt>
<dd>
<input type="checkbox" name="cookieneverexp" id="cookieneverexp" class="input_check" onclick="this.form.cookielength.disabled = this.checked;" />
</dd>
</dl>
<p class="centertext">
<input type="submit" value="', $txt['login'], '" class="button_submit" />
</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'], '" />
<input type="hidden" name="hash_passwrd" value="" />
</div>
</form>';

// Do the focus thing...
echo '
<script><!-- // --><![CDATA[
document.forms.frmLogin.user.focus();
// ]]></script>';
}

How can we enable " kick message " ? Where to set the " kick message " ? How to customize it's appearance ? Thanks.

Re: Kick guest

Reply #1

This template is used when guests cannot browse the forum, the option to enable it is... I think in config > general (usually I use the search and I'm not sure where settings are lol).
Bugs creator.
Features destroyer.
Template killer.