MyBB Community Forums

Full Version: quick login box - HELP!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi I am trying to make a small quick login box on the top right side. Please see the attached picture. I want something small that doesn't change the layout of my page. I don't know where to add the code for such a login box neither....in which template?

Thanks,
Georges
heloo george sorry for not sending that yesterday, but my connection went off.

anyway, as u told me , u wanted a login in the welcomeblock
so follow below

go to template manager > header_welcomeblock_guest

replace it with

	
<form action="member.php" method="post">

<span style="float:right;">$lang->welcome_current_time</span>
		<tr>
<td align="right" class="trow">

<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right" valign="middle" width="100%" class="trow"><span class="smalltext"><strong> $lang->quick_login</strong></span> <div>
  <div align="left">$lang->welcome_guest </div>
<div align="center">
<span class="style1">Welcome to our forums! To post messages or view some specific sections, you will need to register.


</span>

<br />

<a href="$settings[bburl]/member.php?action=register"><span class="style2"> Create your free account here!</span></a>
<br />
<br />
<span class="style1">You can also start viewing messages by selecting the forum you want from the selection below.</span>
</div>
</div></td>
<td align="right" valign="top" nowrap="nowrap">
  <p>
  <input type="text" name="username" title="$lang->login_username" value="$lang->login_username" onfocus="this.value=''" />
  <input type="password" name="password" title="$lang->login_password" value="$lang->login_password" onfocus="this.value=''" />
  <input type="submit" name="go" value="Go" />
   <br /><a href="$settings[bburl]/member.php?action=register">
   <input type="hidden" name="action" value="do_login" />
   $lang->welcome_register</a> </td>
</p>

</tr>
</table>
</form>
</td>
</tr>

many regards
zaher1988 can you look at my site http://www.amatorbalikci.net/ I just made some modifications on your code but I want the login box at the right side

Quote:<br />
Kullanıcı Adı : <input type="text" name="username" title="$lang->login_username" value="$lang->login_username" onfocus="this.value=''" /><br />
Şifre.......... : <input type="password" name="password" title="$lang->login_password" value="$lang->login_password" onfocus="this.value=''" />
<input type="submit" name="go" value="Tamam" />
<input type="hidden" name="action" value="do_login" />
</a>

But it does not work


Just added in to header_welcomeblock_guest

And also how can I put User name in to login boxes
well with the original code it's already on the right

however modifiying the code u provided , i have edit it , and aligned it to the right

<br />
<div align="right">Kullanıcı Adı : <input type="text" name="username" title="$lang->login_username" value="$lang->login_username" onfocus="this.value=''" /><br />
Şifre.......... : <input type="password" name="password" title="$lang->login_password" value="$lang->login_password" onfocus="this.value=''" />
<input type="submit" name="go" value="Tamam" />
<input type="hidden" name="action" value="do_login" />
</a></div>


regards
But can not login. Should I add something ?
And also in th boxes can there be "User Name" and "Password"
ow sorry , i haven't realized that before , u have removed the <form ....>, so it's not a form anymore.


use this
<form action="member.php" method="post">

<span style="float:right;">$lang->welcome_current_time</span>
<tr>
<td align="right" class="trow">

<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right" valign="middle" width="100%" class="trow"><span class="smalltext"><strong> $lang->quick_login</strong></span> <div>
<div align="left">$lang->welcome_guest </div>
<div align="center">
</div>
</div></td>
<td align="right" valign="top" nowrap="nowrap">
<p>
<input type="text" name="username" title="$lang->login_username" value="$lang->login_username" onfocus="this.value=''" />
<input type="password" name="password" title="$lang->login_password" value="$lang->login_password" onfocus="this.value=''" />
<input type="submit" name="go" value="Go" />
<br /><a href="$settings[bburl]/member.php?action=register">
<input type="hidden" name="action" value="do_login" />
$lang->welcome_register</a> </td>
</p>

</tr>
</table>
</form>
</td>
</tr>

regards
Hey Zaher. Can you read my PM? Wink

I need something more specific as shown in the picture, where I can put a very small box similar to the one found on www.melodyhits.tv (roughly the same size) under the welcome message.

Thanks,
Georges
ok sorry i wasn't at home when u were on msn

anyway , a quick solution as i'm in a hurry

open global.php

find

PHP Code:
eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_guest")."\";"); 

below it add

PHP Code:
eval("\$loginbox = \"".$templates->get("header_loginbox")."\";"); 

now create a new template called header_loginbox put this code in it ( melody hits never worked for me, so i couldnt figure out the look)

Code:
<tr>
<td align="right" class="trow">
<form action="member.php" method="post">
<input type="hidden" name="action" value="do_login" />
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right" valign="middle" width="100%" class="trow"><span class="smalltext"><strong>$lang->quick_login</strong></span></td>
<td align="right" valign="middle" nowrap="nowrap">
��<p>
������<input type="text" name="username" title="$lang->login_username" value="$lang->login_username" onfocus="this.value=''" />
������<br />
������<input type="password" name="password" title="$lang->login_password" value="$lang->login_password" onfocus="this.value=''" />
��<br/><input type="submit" name="go" value="Go" />
</p>��</td>
</tr>
</table>
</form>
</td>
</tr>

u might need to do some modification to suit ur look.

then go to header template find <div id="content">

and put this below $loginbox


regards
It works except that:

$lang->login_username
$lang->login_password

do not work...any explanation?

It would be great if it can remembers what username you entered last time. Is that possible to do that in mybb???

I also would like to know how this $lang works. Where is it declared? Where is the file included?

Thanks,
Georges
Pages: 1 2