I need to be able to display the currently logged in username on my clients website (http://www.rdl101.com). You will see when you go to the site there is a dashboard type bar at the top, that says "Hey , welcome to RDL101.COM". I need the username to be displayed just after the Hey.

Thanks to anyone who can come up with a solution in advanced, I've tried using the

print $user->name
but that doesn't show anything.


Try this
global $user;
$name = $user->name;


Thanks but that doesnt work either, but could you expand..

i put

global $user; $name = $user->name;
where i wanted it.. is that right?

You want to concatenate '$name' with the code like
"Hey ".$name." Welcome ..."


Again, thanks but No luck :(

You are on the right track.

Stick <? global $user; ?> somewhere at the top.

Now use

print $user->name
where ever you want to put the user name.

THANK YOU! That works =D

Thank you! :-)

Hello, I have a similar problem. I need to display the user First name and last name instead of the username. How can I do this???

I am assuming you are using the profile module with fields for first name and last name? Have a look at the documentation on customizing the user profile layout. It should tell you how to display your 2 custom fields.

I am actually using the LDAP authentication module to authenticate to Novell. I looked at the documentation but still can't figure out how to display this info from LDAP. Thanks for the help, please let me know if you need more info.

I've never used the LDAP module so you are probably better off posting it the modules' support requests. I imagine it shouldn't be difficult so long as the firstname/lastname are in a table to retrieve based on the uid which you will have once the user logs in.

I found a way to display fname and lname from ldap. Please post if anybody needs solution.

Yes, I am interested in displaying the fname and lname from ldap. I've been reading a thread on mapping profile fields to ldap, but have not had any success to date. Thanks!

Well, if you found the solution, all of us need it. Just post it, b'coz any day, any time, any one will need it.

Know more

Thanks for this answer!
I was looking for this :)
Owner of Diets Wonder - Wondering what kind of diets out there works!

Owner of Diets Wonder - Wondering what kind of diets out there works!