View previous topic :: View next topic |
Author |
Message |
ghoti
Joined: 27 Jul 2004 Posts: 8
|
Posted: Thu Aug 12, 2004 2:59 pm Post subject: php code for "logged in as" on blog main page |
|
|
I'm trying to put a "logged in as user" on my main blog page. I've tried this:
logged in as: <b> <?php the_author() ?> <b/>
and
logged in as: <b> <?php echo $user_login; ?> <b/>
but neither one works.
What am I doing wrong? |
|
Back to top |
|
 |
sh0ck
Joined: 02 May 2004 Posts: 58 Location: Norway
|
Posted: Thu Aug 12, 2004 4:09 pm Post subject: |
|
|
Those values are supposed to be in the b2 loop!. You must fetch the b2 cookie value like this:
add this to b2functions:
Code: |
function logintext(){
global $siteurl;
$logincookie = $_COOKIE['cafeloguser'];
if(!isset($_COOKIE['cafeloguser']) || $_COOKIE['cafeloguser'] == '') {
print("you are not logged in");
}
else {
print("you are logged in as ".$logincookie." ");
}
}
|
then add this function to your blog page:
Code: |
<?php logintext(); ?>
|
|
|
Back to top |
|
 |
|