By jibbajabba on
I'm interested in theming user profile page so that I can insert some code for the user viewing their own page. Any advise on how to check to see if user viewing page is same as the profile being viewed?
I was thinking it could be as simple as: if ([uid of logged in user] == $user->uid):
Is there a variable like that that I can use?
Thanks in advance
Comments
.
You can get the logged in user with
global $user;which will make the $user variable come in scope.You can get the user of the profile by looking at the URL:
Michelle
Excellent. Thanks, Michelle
Excellent. Thanks, Michelle
viewed user profile
hi!
how can i print in a block the username of the profile being viewed?
can this be done using views module?
or do i need a code for the body?
please help me with this...
thanks
---
Using the code provided in the previous comment, simply use
print $account->name;.thanks!
hi!
it works!
thanks for the very prompt reply
to my silly question... =)
+++
honestly, i don't know how to do php coding.
but this cms platform makes me confident to make sites.
great and uncomparable support!
drupal rocks!