How do you put a login form at the top of the site?

Hi,  way back in Dolphin 6 I used a mod that was done by the late Darren Powless that put a membership login box in the upper right hand corner of the site.  Unfortunately, while parts of Mrpowless's blog and tutorial are still online, that one leads to a broken link.  This was really nice because the username would be saved already filled in, as well as the password - with asterisks.   By any chance does someone happen to have this code?  - or has anyone done it.  As I recall it wasn't too complicated.  If no one has it, could someone remind me what file is involved - their is a chance I still have it in an old backup file for D6 - and I think this one would work on D7 - though I am not positive.

Quote · 19 Jan 2012

i are you talking about this www.buddy-net.co.cc  login area at top right?

i have just done this for someone.

so much to do....
Quote · 19 Jan 2012

Rob,

 

I didn't use MrPowless's mod but I had managed to get a login box in the top corner of my D6 sites by editing:

 

/templates/tmpl_uni/scripts/functions.php

 

In that file is the function that displays that little "hello" box in the top corner. I added this in the else/if part for people who weren't logged in, it displays login and join buttons and used "*" for the password:

 

        else
        {
                $ret .= '<div class="login_block">';
             
                        $ret .= '<form method="post" action="' . $site['url'] . 'member.php">';
                                $ret .= '<div class="clear_both"></div>';
                                $ret .= '<div class="login_line">';
                                        $ret .= _t('_Nickname') . ':';
                                        $ret .= '<input  name="ID" value="" type="text"class="login_area" />';
                                $ret .= '</div>';
                                $ret .= '<div class="login_line">';
                                        $ret .= _t('_Password') . ':';
                                        $ret .= '<input name="Password" value="" type="password" class="login_area" />';
                                $ret .= '</div>';
                                $ret .= '<div class="forgotDiv">';
                                        $ret .= '<a href="' . $site['url'] . 'forgot.php">' . _t('_forgot_your_password') . '?</a>';
                                $ret .= '</div>';
                                $ret .= '<input class="login_button" type="image" src="' . $site['images'] . 'button_login_index.gif" />';
                       
                                $ret .= '<div class="join_now">' . _t('_or') . ' <a href="' . $site['url'] . 'join_form.php">' . _t( '_Join now' ) . '</a></div>';

                                $ret .= '<div class="clear_both"></div>';
                        $ret .= '</form>';
                $ret .= '</div>';
        }

 

Hopefully this helps some! I haven't gotten around to attempting it with D7 yet.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 19 Jan 2012

Oh cool - thank Mssott.  Do you think that will work for D7?  I could be wrong but I don't think it was the functions.php file - I thought it was a template file or many the html file, but I am not sure

@Prashank - yes, it was just like that - can you tell us how it was done?

Quote · 19 Jan 2012

here is the steps.

open phpMyadmin
open dolphin DB
open sys_injection
click sql and run this query
INSERT INTO `sys_injections` (`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES
('header_login', '0', 'injection_logo_after', 'php', 'replace me', '0', '1')
now edit the created row "name = header_login" and replace data field with below code replacing "replace me"
if (!isMember()) {
echo '<div style="float:right;margin-top:10px"><form onsubmit="validateLoginForm(this); return false;" method="post" action="member.php" id="login_box_form">
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tbody><tr>
<td width="78">Username</td>
<td>&nbsp;</td>
<td width="78">Password</td>
</tr>
<tr>
<td width="150"><div class="input_wrapper input_wrapper_text" style="width:150px"><input name="ID" type="text" class="form_input_text"><div class="input_close input_close_text"></div></div></td>
<td>&nbsp;</td>
<td width="150"><div class="input_wrapper input_wrapper_password" style="width:150px"><input name="Password" type="password" class="form_input_password"><div class="input_close input_close_password"></div></div></td>
<td>&nbsp;</td>
<td><input name="LogIn" type="submit" tabindex="3" value="Login"></td>
<td>&nbsp;</td>
</tr>
</tbody></table>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tbody><tr>
<td width="135"><input type="checkbox" name="rememberMe"> Keep me logged in</td>
<td width="200"><a href="forgot.php">Forgot password?</a></td>
</tr>
</tbody></table>
</form></div>';
}
now hit "Go" and clear the cache and you can customize its code as per your need.
Good luck.
so much to do....
Quote · 19 Jan 2012

Hey - wonderful Prashank - thank you so much for sharing that!

Quote · 19 Jan 2012

hey there i can not get that sql code to work sorry :( :( 

join www.double-click-it.info
Quote · 19 Jan 2012

I just poked around the 7.0.8 version of the functions file and I couldn't find a good spot to stick my code.. so looks like Prashanks is the way to go.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 19 Jan 2012

yer i tryed both codes and they both did not work ? 

join www.double-click-it.info
Quote · 19 Jan 2012

any specific error?

so much to do....
Quote · 19 Jan 2012

Error

SQL query:

 

`sys_injections` (`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES ('header_login', '0', 'injection_logo_after', 'php', 'replace me', '0', '1') now edit the created row "name = header_login" and replace data field with below code replacing "replace me" if (!isMember()) { echo '<div style="float:right;margin-top:10px"><form onsubmit="validateLoginForm(this); return false;" method="post" action="member.php" id="login_box_form"> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1"> <tbody><tr> <td width="78">Username</td> <td>&nbsp;</td> <td width="78">Password</td> </tr> <tr> <td width="150"><div class="input_wrapper input_wrapper_text" style="width:150px"><input name="ID" type="text" class="form_input_text"><div class="input_close input_close_text"></div></div></td> <td>&nbsp;</td> <td width="150"><div class="input_wrapper input_wrapper_password" style="width:150px"><input name="Password" type="password" class="form_input_password"><div cl[...]

 

MySQL said: 

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`sys_injections` (`name`, `page_index`, `key`, `type`, `data`, `replace`, `activ' at line 1 

join www.double-click-it.info
Quote · 19 Jan 2012

lol wrong query

do this

INSERT INTO `sys_injections` (`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES
('header_login', '0', 'injection_logo_after', 'php', 'replace me', '0', '1')
and then edit the row and insert this.
if (!isMember()) {
echo '<div style="float:right;margin-top:10px"><form onsubmit="validateLoginForm(this); return false;" method="post" action="member.php" id="login_box_form">
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tbody><tr>
<td width="78">Username</td>
<td>&nbsp;</td>
<td width="78">Password</td>
</tr>
<tr>
<td width="150"><div class="input_wrapper input_wrapper_text" style="width:150px"><input name="ID" type="text" class="form_input_text"><div class="input_close input_close_text"></div></div></td>
<td>&nbsp;</td>
<td width="150"><div class="input_wrapper input_wrapper_password" style="width:150px"><input name="Password" type="password" class="form_input_password"><div class="input_close input_close_password"></div></div></td>
<td>&nbsp;</td>
<td><input name="LogIn" type="submit" tabindex="3" value="Login"></td>
<td>&nbsp;</td>
</tr>
</tbody></table>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tbody><tr>
<td width="135"><input type="checkbox" name="rememberMe"> Keep me logged in</td>
<td width="200"><a href="forgot.php">Forgot password?</a></td>
</tr>
</tbody></table>
</form></div>';
}
Read the post properly. 
EDIT : Spaces are disappearing when posting here.
so much to do....
Quote · 19 Jan 2012

thanks were do i put spaces then can u give me a example :) 

join www.double-click-it.info
Quote · 19 Jan 2012

 steps are in txt file

thanks were do i put spaces then can u give me a example :) 

 

steps.txt · 1.6K · 398 downloads
so much to do....
Quote · 19 Jan 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.