Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support loginbox + control panel
Twenty6
Posted on 17 Feb 2010, 12:30:37

Access: Member
Total Posts: 7
Joined: 2010-02-07

Hello,

I have now a loginbox on my index page on the header
here can users login for posting comments etc....

But when i login the loginbox still remains on my header
How can i change that so it will show something like: Welcome {username}, {inbox} {logout}

And is it possible to have a link on the profile pages for send messages to each other and account settings ? or the whole control panel on the profile pages which you will see only if you are logged in ?

manny thanks for anny help.
#1916
Chris
Posted on 17 Feb 2010, 17:02:09

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

You could control whether the login box gets shown by checking the session variable "userlogged20", this gets set to true whenever a user is logged in.

Code:
<?php
session_name
('n13news');
session_start();
require_once 
'news/db.php';
require_once 
'news/config.php';

if(
$_SESSION['userlogged20'] == "true"){
    
// user is logged in
    
echo 'Welcome ' . $_SESSION['name'] .
    
' <a href="news/admin.php?action=private">Inbox</a>' . 
    
' <a href="news/admin.php?action=logout">Logout</a>';
}else{
    
// user isn't logged in, show the login form
?>
    <form method="post" action="news/admin.php">
    Name: <input type="text" name="name" /><br />
    Pass: <input type="password" name="pass" /><br />
    <input type="hidden" name="n13language" value="langmsg_english" />
    Stay logged in? <input type="checkbox" name="rememberme" /><br />
    <input type="submit" name="B3" value="Login" />
    </form> 
<?php
}
?>
#1919
Last edited by Chris at 2010-02-17 17:19:43 Reason:
Network-13.com © 2013