Login form in Header
-> Dragonfly Theming Tips & Tricks

#1: Login form in Header Author: rlguraLocation: Cleveland, OH USA PostPosted: Sat Jun 20, 2009 2:05 am
    ----
[Thanks to DJDevon for compiling this info]

Add to header.html where you want the login form.

Code::
<!-- IF S_IS_USER -->
{WELCOME}
<!-- ELSE -->
<form action="" method="post" enctype="multipart/form-data" accept-charset="utf-8">
	<input type="text" class="headerlogin" id="ulogin" name="ulogin" size="14" maxlength="25" />
	<input type="password" class="headerlogin" id="user_password" name="user_password" size="8" maxlength="15" />
	<input type="submit" value="Login" /></form>
<!-- ENDIF -->

Add the global for userinfo in function themeheader() in theme.php
It should look something like this:
Code::
function themeheader() {
	global $slogan, $sitename, $banners, $mainindex, $adminindex, $cpgtpl, $site_logo, $CPG_SESS, $userinfo;

and assign the WELCOME variable in theme.php
This will show a welcome message if someone is already logged in.
Code::
'WELCOME'      => is_user() ? 'Welcome '.$userinfo['username'] : 'Welcome '._ANONYMOUS,



-> Dragonfly Theming Tips & Tricks

All times are GMT

Page 1 of 1