Welcome "Username"
6 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: October 25, 2010 (RSS)
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: [Dan Maitland] Welcome "Username"
By gkornbluth - October 25, 2010 - edited: October 25, 2010
If memory serves me, you can just echo the username field in the accounts editor for $CURRENT_USER.
Look at this post which might give you an idea: http://www.interactivetools.com/forum/gforum.cgi?post=84028
Sorry I can't access the code I used right now, but do a search on the forum for $CURRENT_USER and you should find other stuff.
I actually added a first_name and last_name field to replace the full_name field and use that to make my communications more friendly.
Hope that works for you.
Best,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
Re: [gkornbluth] Welcome "Username"
Re: [Dan Maitland] Welcome "Username"
By gkornbluth - October 25, 2010 - edited: October 25, 2010
<?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
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
What's going wrong? Are you getting errors or is nothing showing up? Can you post the code you're using?
Chris