How To Login from bootstrap modal?
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #14
RE: How To Login from bootstrap modal?
I think I remember why I have you on my "list" at MyBB Community....

Please answer the question:

1) Why are you wanting to use the bootstrap modal when there is a modal included with the MyBB core?

Try this code in your template:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<div class="dropdown">
  <span id="User-dropdown" role="button" data-toggle="dropdown" data-target="#">
    	<img src="images/defaultavatar.png" alt="Guest" class="avatar" />
    	Hi, Guest
  </span>
  <ul class="dropdown-menu" role="menu" aria-labelledby="User-dropdown">
    	<li><a href="{$mybb->settings['bburl']}/member.php?action=login" onclick="$('#quick_login').modal({ fadeDuration: 250, keepelement: true }); return false;" class="login">{$lang->welcome_login}</a></li>
    	<li><a href="{$mybb->settings['bburl']}/member.php?action=register" class="register">{$lang->welcome_register}</a> &mdash; <a href="{$mybb->settings['bburl']}/myfbconnect.php?action=login">{$lang->myfbconnect_login}</a></li>
  </ul>
</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" />
 	<div class="modal-dialog">
		<div class="modal-content">

						<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>
</div></div>
				<script type="text/javascript">
					$("#quick_login input[name='url']").val($(location).attr('href'));
				</script>



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 09-23-2015 09:37 PM by leefish.)
09-23-2015 09:35 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: How To Login from bootstrap modal? - leefish - 09-23-2015 09:35 PM

 Standard Tools
Forum Jump: