MyBB Community Forums

Full Version: Quick login not available after upgrade to 1.8?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just upgraded from 1.6 to 1.8.15.  The quick login feature which had been used (enabled by updating jscripts/general.js) does not seem to be available.  Login always opens a separate page from the portal.  Is there a way to resurrect it, so clicking on "login" inserts a line in the portal for username and password as in 1.6? I found no help in the forums and don't see an obvious way in the code.

Thanks in advance.
Quick login is placed in Styles & Templates - Templates - Your Template - Header - Header_welcomeblock_guest. Do you have (at the very end) code like this?
<script type="text/javascript">
					$("#quick_login input[name='url']").val($(location).attr('href'));
				</script>

I can give you my header_welcomeblock_guest if you want, it works for me.
^ Also please make sure you have this code in your global.css if you don't add it.

/** Modal Start **/

.blocker {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.75);
    text-align: center;
}

.blocker:before{
    content: "";
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-right: -0.05em;
}

.blocker.behind {
    background-color: transparent;
}

.modal {
    width: 400px;
    text-align: left;
    background: #fff;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    z-index: 2;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -o-border-radius: 8px;
    -ms-border-radius: 8px;
    border-radius: 8px;
    -webkit-box-shadow: 0 0 10px #000;
    -moz-box-shadow: 0 0 10px #000;
    -o-box-shadow: 0 0 10px #000;
    -ms-box-shadow: 0 0 10px #000;
    box-shadow: 0 0 10px #000;
}

.modal a.close-modal {
    position: absolute;
    top: -12.5px;
    right: -12.5px;
    display: block;
    width: 30px;
    height: 30px;
    text-indent: -9999px;
    background: url(images/close.png) no-repeat 0 0;
}

.modal-spinner {
    display: none;
    width: 64px;
    height: 64px;
    position: fixed;
    top: 50%;
    left: 50%;
    margin-right: -32px;
    margin-top: -32px;
    background: url(images/spinner_big.gif) no-repeat center center;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    -o-border-radius: 8px;
    -ms-border-radius: 8px;
    border-radius: 8px;
}

/** Modal End **/ 
QuatZo- perhaps seeing your header_welcomeblock_guest in its entirety would help.  I have added the code you suggested to mine without impact; I have insured the css code Brian said was required is in place, and I added the MyBB variable quickLogin to general.js but see no change in function.  In version 1.6 the login took place right on the portal page and I would like to continue that with 1.8.  

Thanks
Oh sorry, now I see, there is more about quick login. Here you have full header_welcomeblock_guest, without modifications iirc: 

						<!-- Continuation of div(class="upper") as opened in the header template -->
						<span class="welcome">{$lang->welcome_guest} <a href="{$mybb->settings['bburl']}/member.php?action=login" onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;" class="login">{$lang->welcome_login}</a> <a href="{$mybb->settings['bburl']}/member.php?action=register" class="register">{$lang->welcome_register}</a></span>
					</div>
				</div>
				<div class="modal" id="quick_login" style="display: none;">
					<form method="post" action="{$mybb->settings['bburl']}/member.php">
						<input name="action" type="hidden" value="do_login" />
						<input name="url" type="hidden" value="" />
						<input name="quick_login" type="hidden" value="1" />
						<table width="100%" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" border="0" class="tborder">
							<tr>
								<td class="thead" colspan="2"><strong>{$lang->login}</strong></td>
							</tr>
							<tr>
								<td class="trow1" width="25%"><strong>{$login_username}</strong></td>
								<td class="trow1"><input name="quick_username" id="quick_login_username" type="text" value="" class="textbox initial_focus" /></td>
							</tr>
							<tr>
								<td class="trow2"><strong>{$lang->password}</strong></td>
								<td class="trow2">
									<input name="quick_password" id="quick_login_password" type="password" value="" class="textbox" /> <a href="{$mybb->settings['bburl']}/member.php?action=lostpw" class="lost_password">{$lang->lost_password}</a>
								</td>
							</tr>
							<tr>
								<td class="trow1">&nbsp;</td>
								<td class="trow1 remember_me">
									<input name="quick_remember" id="quick_login_remember" type="checkbox" value="yes" class="checkbox" checked="checked" />
									<label for="quick_login_remember">{$lang->remember_me}</label>
								</td>
							</tr>
							<tr>
								<td class="trow2" colspan="2">
									<div align="center"><input name="submit" type="submit" class="button" value="{$lang->login}" /></div>
								</td>
							</tr>
						</table>
					</form>
				</div>
				<script type="text/javascript">
					$("#quick_login input[name='url']").val($(location).attr('href'));
				</script>
Thank you QuatZo- I was onthe wrong track. Using your code and the 1.8 Index.php I was able to get the modal functioning properly.