Great Lakes Designs
Toggle Content Welcome Guest! Please Register or Login
Toggle Content Contributions
Due Date: Jul 31
July Goal: 50.00
Gross Amount: 0.00
PayPal Fees: 0.00
Net Balance: 0.00
Below Goal: 50.00
Site Currency: USD
 0%

Toggle Content Main Menu

Toggle Content User Info

Welcome Anonymous

Nickname
Password

Membership:
Latest: jiajia
New Today: 0
New Yesterday: 0
Overall: 11

People Online:
Members: 0
Visitors: 1
Total: 1
Who Is Where:
 Visitors:
01: Theme Store

Staff Online:

No staff members are online!

Toggle Content Preview theme
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.

Toggle Content Shopping Cart
Your cart is empty.

[ Browse ]

Support Forums › DragonFlyCMS Themes › Dragonfly Theming Tips & Tricks › Login form in Header

    Forum IndexDragonfly Theming Tips & Tricks
Login form in Header

Post new topic   Reply to topic   Printer Friendly Page
View previous topic :: View next topic  
Author Message
rlgura
Site Admin
Site Admin


Joined: Dec 13, 2007
Posts: 25
Location: Cleveland, OH USA

PostPosted: Sat Jun 20, 2009 2:05 am    Post subject: Login form in Header Reply with quote

[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,

_________________
Site Admin - Great Lakes Web Designs
Theme Designer - WebSite Guru Designs
Site Admin - Families with Food Allergies
Back to top
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexDragonfly Theming Tips & Tricks All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Cardinal Theme orginally By: Lorkan Themes. - Ported to DragonflyCMS by: WebSiteGuru Designs
Version 9.2.1.2 - July 1, 2008