Welcome "Username"

Hi,
I am currently trying to use the membership login plugin and I was wondering if there was a way to display on any given page once the user has logged in a message that would say something along the lines of welcome"username" or you are logged in as "username" or simply change the "login" link to "Log off" if they are logged in. I can't seem to find anything on this in the forum. Thanks.

Re: [gkornbluth] Welcome "Username"

Thanks Jerry. I tried to get it to work but I still cant get it. I really thought that since the membership plugin was installed that there really wouldn't be that much code involved to get this to work.

Re: [Dan Maitland] Welcome "Username"

By gkornbluth - October 25, 2010 - edited: October 25, 2010

Try this...

<?php if (@$CURRENT_USER): ?> Welcome <?php echo htmlspecialchars($CURRENT_USER['username']); ?> <?php endif ?> You can replace the username with any field name that exists in the accounts record.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [Dan Maitland] Welcome "Username"

By Chris - October 25, 2010

Hi Dan,

What's going wrong? Are you getting errors or is nothing showing up? Can you post the code you're using?
All the best,
Chris

Re: [chris] Welcome "Username"

Works great now thanks Chris.