MyBB Community Forums

Full Version: Login Field Change 1.4.3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am looking for help making a proper login field on my board 1.4.3

This is the login on the board when you first visit the index
[Image: jzgv4k.jpg]

This is what you get after clicking on the login link
[Image: 2ailob8.jpg]

What i would like is to get rid of that first part.
Just have the login field only when you view the index page to log in.. the second one.

I was looking at the index_loginform template

<br /><br />
<form action="member.php" method="post">
	<input type="hidden" name="action" value="do_login" />
	<span class="smalltext"><strong>{$lang->quick_login}</strong></span>
	<input type="text" class="textbox" name="username" title="{$lang->login_username}" value="{$lang->login_username}" onfocus="if(this.value == '{$lang->login_username}') { this.value=''; }" onblur="if(this.value=='') { this.value='{$lang->login_username}'; }" />
	<input type="password" class="textbox" name="password" title="{$lang->login_password}" value="{$lang->login_password}" onfocus="if(this.value == '{$lang->login_password}') { this.value=''; }" onblur="if(this.value=='') { this.value='{$lang->login_password}'; }" />
	{$gobutton}
</form>

Is this where its done? Is so, can you tell me whats needed to do this?

Browsers seam to remember login info much better when having the login box only.

See here http://www.et-buzz.com/community/index.php

Thanks guys Smile
I think i found whats needed on my friends 1.2 board.

He has a template called loginbox
<tr>
<td class="trow2"><strong>{$lang->username}</strong></td>
<td class="trow2"><input type="text" class="textbox" name="username" size="30" value="{$username}" /></td>
</tr>
<tr>
<td class="trow1"><strong>{$lang->password}</strong></td>
<td class="trow1"><input type="password" class="textbox" name="password" size="30" value="{$password}" /></td>
</tr>

This is what he has at the footer of his index
[Image: mu9a36.jpg]

This is perfect, i just need to add that at the top of my board.
Will adding that loginbox template he has somewhere in my theme do it?

If so.. how?

Thanks Smile
Is this a tough one? ..hehe
Still needing help from someone on this.
There is a loginbox template in your ungrouped templates, although I'll be honest and say I haven't checked where it's defined... so to be entirely crazy, go and add a new template (like we did before - call it poplogin) and paste this into it:

<form action='member.php' method='post'>
Username: <input type='text' name='username' size='25' maxlength='30' /><br />
Password: <input type='password' name='password' size='25' />
<input type='hidden' name='action' value='do_login'>
<input type='submit' class='submit' name='submit' value='Login' /></form>

Let's add this template to be used anywhere on your forum. Open global.php, and find: unset($admincplink);, and add after:

// Attempt to include our custom template
$poplogin = '';
	eval("\$poplogin = \"".$templates->get("poplogin")."\";");

Then you can plonk {$poplogin} wherever you want your login box to appear (in the footer, header, wherever). You can also use: <input type='hidden' name='url' value='index.php' />, changing index.php, to redirect to a certain page on your forum.

Hopefully this has worked out better than my last attempt to decode javascript... Undecided
Header Templates > header_welcomeblock_guest

I would make the changes there instead of editing core mybb files.
Super.. that worked perfect. Thanks again Tom for your help.

I only have 1 question, is it easy to change the color of the box's to match my board?
If so, how?

Here is a pic
[Image: 1zm1rv4.jpg]

If possible, i would like it to match up like the default one.. size and color
[Image: jp8y85.jpg]

Again.. fantastic!!
(2008-11-30, 12:46 AM)monacelli Wrote: [ -> ]I would make the changes there instead of editing core mybb files.

And give up the quick login option?... the whole point of open source is to be able to edit the software to your needs...

You can edit the CSS littleg - the best option would be to open global.css in your theme, and at the bottom, add something like:

.poplog{
     background-color:#000;
     border:1px solid #CCC;
}

The, change the username/password textboxes to say class="poplog". Change the CSS variables to whatever you want to match your theme...
Not sure i follow you Tom, sorry.

I made the change to the global.css, now i have this
[Image: 2i7vh8n.jpg]

The username/password textboxes to say class="poplog" i do not understand quite what you mean.
As in, change the textboxes so that they look like <input type='password' name='password' size='25' class='poplog' />, and change the CSS...

Go into "Advanced Mode" when editing the CSS, and remove the &nbsp; tags, so that it just looks like the rest of the CSS... that should change the boxes and their look.
(2008-11-30, 01:19 AM)Tom.M Wrote: [ -> ]And give up the quick login option?... the whole point of open source is to be able to edit the software to your needs...

No need to give up the quick login option. Here's how you do it just by editing the header_welcomeblock_guest template. Notice the changes I made in <span id="quick_login">..</span>

<script type="text/javascript">
<!--
	lang.username = "{$lang->login_username}";
	lang.password = "{$lang->login_password}";
	lang.login = "{$lang->login}";
	lang.lost_password = " &mdash; <a href=\"{$mybb->settings['bburl']}/member.php?action=lostpw\">{$lang->lost_password}<\/a>";
	lang.register_url = " &mdash; <a href=\"{$mybb->settings['bburl']}/member.php?action=register\">{$lang->welcome_register}<\/a>";
// -->
</script>
<span style="float: right;">{$lang->welcome_current_time}</span>
<span id="quick_login">
<script type="text/javascript">
<!--
  MyBB.quickLogin();
// -->
</script>
</span>
Got, it's now perfect.

Here is what i am going with now
[Image: 2vto7pw.jpg]

Tom's method works perfect monacelli , but thanks anyways bro

Now there will be no more login issues with browsers not liking the "Hello there guest" quick login.

THIS is a "real" ..quick login
Why not just remove the javascript altogether? Because that is what your changes are doing...

Adding a seperate template means users can have both the async-login, AND seperate login fields on their forums.
Pages: 1 2