MyBB Hacks

Full Version: How To Login from bootstrap modal?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
still like a way to use bootstrap modal to send data to the login page though....since i wasted all that time Tongue

How do i remove mybb's modal?
What you can try - is to load the bootstrap js (the standard js, not custom) in the footer. See link below.

<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

Then you will have to edit the templates. Try using the template edit I gave you:

Code:
<div class="modal fade" id="quick_login" style="display: none;"  role="dialog" aria-hidden="true">
<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">

			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<span class="modal-title tl" id="loginModal">Log in</span>

			</div> <!-- /.modal-header -->

			<div class="modal-body">
					<div class="form-group">
						<div class="input-group">
							<input type="text" class="form-control" name="quick_username" id="quick_login_username" placeholder="Login"/>
							<label for="quick_login_username"></label>
						</div>
					</div>

					<div class="form-group">
						<div class="input-group">
							<input type="password" class="form-control" placeholder="Password" name="quick_password" id="quick_login_password" value=""  >
							<label for="quick_login_password"></label>
						</div>
					</div>
<div class="checkbox">
						<label>
							<input name="quick_remember" id="quick_login_remember" type="checkbox" value="yes" class="checkbox" checked="checked" /> {$lang->remember_me}
						</label>
					</div>

			</div><!--modal-body -->

			<div class="modal-footer clearfix">

<a href="{$mybb->settings['bburl']}/member.php?action=lostpw" class="lost_password pull-left">{$lang->lost_password}</a>

				<input name="submit" type="submit" value="{$lang->login}" class="btn btn-action"/>

				
			</div> <!--modal-footer -->
			
		</div><!--modal-content -->
	</div><!--modal-dialog -->
</form></div>
       

				<script type="text/javascript">
					$("#quick_login input[name='url']").val($(location).attr('href'));
				</script>


You will have to do this for every mybb modal - reports, reputation, modcp - everywhere.

first thing i have to do is get the AJAX to send data to to the login page, without that no use removing anywhere else Tongue

I DID remove the myBB modal script call and it still didnt work....if i could get Bootstrap to send data from modal to login page, then everything else falls in place...SO yes i have generated the bootstrap MODAL

hence the initial issue Tongue

YOUR solution is still half and half, which wont work without some sort of no conflict....funny but the site you sent me to looks fully bootstrap?
um, that template - is the one from damnfineshave.com. It works right out of the box; you don't need to remove anything. It uses bootstrap for the modal, but I still have the mybb general.js loading. So it works. Make sure you have the correct js and css files for bootstrap - the version numbers need to match and make sure that you are loading the bootstrap.js last by putting it in the footer not the head; remove the MyBB modal css from the global.css or wherever it is.

IMPORTANT:  these changes will affect EVERY modal on the frontend; ie the templates using a modal will need to be redone. All of them.

What version of bootstrap are you using?

Code:
<script type="text/javascript">
					$("#quick_login input[name='url']").val($(location).attr('href'));
				</script>


what script call did you use? the above is mybb modal

have you tried implementing everything I said? I cannot explain it any different.

You dont change any mybb js files; you put the bootstrap js in the footer, you remove mybb modal css and you use the template.

Yes, that site is one I made; its very bootstrap Smile
which script call did you use for bootstrap modal LOL no script runs without the call Tongue

what i havent done is remove the mybb modal css, which would take too long to chase down Tongue hence the image is my guess
What image? I am sorry, I cant help you further if you dont do the things I say. Tracking down modal is a case of using ctrl+f in the global.css... that is hardly a long time.

Please do all the things I say to do then come back and lol....
what call did you use to activate the bootstrap modal? is that not clear enough?
The MyBB script in the bottom of the template - have you tried all the things I said? or was that not clear enough?

As I am getting a bit exasperated, I should point out that I have this working - you dont - so maybe you are NOT being clear, despite your belief to the contrary. It did take you 6 posts to TRY a custom build of the js and that worked right away. Smile
Pages: 1 2 3 4
Reference URL's