MyBB Community Forums

Full Version: Adding a modal login box to MyBB using jQuery
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 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
(2013-04-11, 10:57 AM)Wolfseye Wrote: [ -> ]
(2013-04-11, 10:43 AM)Euan T Wrote: [ -> ]Nope, they'll just be taken to the usual register page Smile

When he tries to login but don't have Java installed, he would be taken to the Register page ? But that would still mean he couldn't login if he didn't have Java (which I think is necessary for the Modal login to work, right ?) but only be taken to the Register page ?

Did I understood that correct ? Wink

Wolfseye

http://kb.mozillazine.org/JavaScript_is_not_Java

It doesn't matter if Java is installed or not. Any modern web browser will support Javascript and the majority of your users will have it enabled. In the even they have it disabled, they will be redirected to the page.
Thanks, just wanted to make sure. Wink

Wolfseye

Another question, can I make that somehow work on the portal ? Lets say I don't want to use the Portal Login block but make myself a new block with just a button to login. Could I make it work the same like for the forum ?

Thanks in advance.

Wolfseye
You should be able to by modifying the portal templates Smile
(2013-04-11, 01:54 PM)Euan T Wrote: [ -> ]You should be able to by modifying the portal templates Smile

Could you give me an example how to do that with the standard Portal syntax ?

<span class="smalltext">{$lang->guest_welcome_registration}</span><br />
<br />
<form method="post" action="{$mybb->settings['bburl']}/member.php"><input type="hidden" name="action" value="do_login" /><input type="hidden" name="url" value="{$portal_url}" />
{$username}<br />&nbsp;&nbsp;<input type="text" class="textbox" name="username" value="" /><br /><br />
{$lang->password}<br />&nbsp;&nbsp;<input type="password" class="textbox" name="password" value="" /><br /><br />
<label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" value="yes" /> {$lang->remember_me}</label><br /><br />
<br /><input type="submit" class="button" name="loginsubmit" value="{$lang->login}" /></form>

Thats the orignal, which already has the Password & Username fields etc. in it. But since I want to use the Modal login Box, how would I start to alter that I can use the Modal login also from the Portal ? Any help is appreciated. Just need an example, the rest I will figure out somehow.

Thanks.

Wolfseye
Could just remove it all and use this:

Welcome guest! Please <a href="{$mybb->settings['bburl']}/member.php?action=login" name="modal" rel="#loginModal">{$lang->welcome_login}</a> or <a href="{$mybb->settings['bburl']}/member.php?action=register">{$lang->welcome_register}</a>

It should open the modal if you've already got it in the header_welcomeblock_guest Smile
With that I overwrite the portal_welcome_guesttext template with ? The above code I posted was that template.
Yeah, it should work I think.
(2013-04-11, 03:18 PM)Euan T Wrote: [ -> ]Yeah, it should work I think.

Well, it works fine in the Forum but not the Portal. If I click on that button that I related to the Login link, nothing happens. Literally. Is it because I have other Javascript things in the Portal main template ?

<script type="text/javascript" src="jscripts/fitonpage.js?ver=230"></script>
<script type="text/javascript">
<!--
	var fitonpage_on = "{$mybb->settings['g33k_fitonpage_enabled']}";
	var fitonpage_resize = "{$mybb->settings['g33k_fitonpage_resize']}";
	var fitonpage_fluid = "{$mybb->settings['g33k_fitonpage_fluid']}";
	var fitonpage_topbar_resized = "{$lang->fitonpage_topbar_resized}";
	var fitonpage_topbar_full = "{$lang->fitonpage_topbar_full}";
	var fitonpage_topbar_text_class = "{$mybb->settings['g33k_fitonpage_topbar_text_class']}";
	var fitonpage_topbar_bground = "{$mybb->settings['g33k_fitonpage_topbar_bground']}";
	var fitonpage_topbar_icon = "{$mybb->settings['g33k_fitonpage_topbar_icon']}";
	var fitonpage_location = "portal";
-->
</script>

That for example ?
It should work I think. URL?
Check your PM.

Thank you so much, Euan T Smile ... really appreciate the help. Works now! Wink
Pages: 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