Actual Quick Login Box
#1
Hey all Smile

I'm looking for some help making a login box that is always present for people to log in quickly without having to log-out beforehand.

Anybody have an idea how to do this?
Reply
#2
With this modification you'll add a Login Box to the right side of your forum.
Go to: ACP > Templates > Header Templates > header_welcomeblock_guest > and find;
<span id="quick_login">{$lang->welcome_guest} (<a href="{$mybb->settings['bburl']}/member.php?action=login" onclick="MyBB.quickLogin(); return false;">{$lang->welcome_login}</a> &mdash; <a href="{$mybb->settings['bburl']}/member.php?action=register">{$lang->welcome_register}</a>)</span>

and add the following code just after that;
<div style="float: right; width:633; height:70">
	<form action="member.php" method="POST">
		<input type="hidden" name="action" value="do_login">
		<input type="hidden" name="url" value="{$url}">
			<table cellspacing="0" cellpadding="0" border="0" width="50%" align="center">
				<tr>
					<td class="tborder">
						<table border="0" cellspacing="{$theme[borderwidth]}" cellpadding="{$theme[tablespace]}" width="100%">
				<tr>
					<td class="thead" colspan="2"><span class="smalltext">
						<strong>{$lang->login}</strong>
							</span>
					</td>
				</tr>
			<tr>
				<td class="trow1">
		<strong>{$lang->username}</strong>
			</td>
				<td class="trow1">
					<input type="text" name="username">
				</td>
			</tr>
			<tr>
				<td class="trow2">
					<strong>{$lang->password}</strong>
				</td>
				<td class="trow2">
					<input type="password" name="password">
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
<td align="right"><input type="submit" value="{$lang->login}"></td>
</tr>
</table>
</form>
</div>
Reply
#3
It works very well and is just what was needed! Thanks very much Big Grin

One thought: Is there any way to get the login function to return the person to the exact page they were browsing upon login? Or must it return them to the index?
Reply
#4
If you want to redirect your users to portal (or any other place) after they logged in to your forum then open ./member.php and find; around line # 1088
redirect(htmlentities($mybb->input['url']), $lang->redirect_loggedin);
and change it to;
redirect("portal.php", $lang->redirect_loggedin);
Reply
#5
Thanks again. It should be fine the way it is Smile
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)