By wheresmycookie on
Hello all!
Ok I want to do one more thing now...
Is there any way to display the name of the logged in user in a block or page/story title? Like the main menu's title is the username of the logged in user. But I want to be able to display the username in any block or page.
I have tokens installed.. if that helps.. or do i need some next module?
Thank you thank you thank you
:)
Comments
EDIT: clicked on the wrong
EDIT: clicked on the wrong post, sorry.
The answer to YOUR question is:
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
thank you.. but two
thank you.. but two questions still remain
how do i get this to display for a specific block or page/story title?
and is this the easiest way to do it? or can it be done with modules?
Thanks again for your help :)
You can simply place the
You can simply place the code above in a custom bock (use the php code input format).
I'm not sure how to do that with a node title-- maybe the http://drupal.org/project/auto_nodetitle module?
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
one more ?
And if i want do display the user's number, what do i have to do? like for user 20, i would like to display '20'
_
simple...
print $user->uid;-):O Thank uuu! :D again
:O
Thank uuu! :D
again
how to make a link?
ok im still a bit confused.. i went back on my site to test it.. and it works like a charm.. but what if i wanna make a link with it.. like this:
i want to a link to appear for every user to go to their audio list, i have to have the link like this: http://example.com/audio/user/#(where # is their user id)
so how can i have a link so that for every visitor it goes to their audio page??
help is greatly appreciated...
_
For a link you would do
print l($user->name, 'audio/user/' . $user->uid);.token insertion
That's a fantastic module that saves a TONNE of trouble.
Check it out, search in modules for token insertion.
Use Views to do this!
See the pure-views no-code method here: https://drupal.org/comment/8499219#comment-8499219
lunk_rat is Acquia Certified Grand Master