By Chippe on
This could be a new thread about how to display user picture, user name etc in the custom user profile page.
I had a question about showing the profile fields and got help from nice people but it didn't work out the way you want it to do. You will actually see your own stats when visiting other users profile(user name, picture, profiel fields). In fact I couldn't display anything in a proper way.
Comments
.
I'm not using 6, so I can't offer a lot of help, but here's one tidbit: If you want the user of the profile to use in your code:
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
Thanks
Thanks
Fix
Thanks to WorldFallz the problem is now solved.
Turns out in d6 profile fields moved from $user to $account.
.
You should use always have used $account for the variable to avoid conflict with the global $user variable. This isn't new in D6.
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
Ohh I see. I am wondering
Ohh I see.
I am wondering about your first post:
What does it do?
.
The user profile page will have a URL like user/42. Doesn't matter if you alias it. Drupal still sees that as the path. So $uid = arg(1) sets the variable $uid to 42. The next line loads the user object into the variable $account. Between those two, you have everything you need to refer to the user who's profile you are viewing rather than the user who is doing the viewing.
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
Interesting..
Interesting..
Thank you for explaining, Im impressed.
Let's see if I can figure out how to display users name in a block when viewing their profile.
Edit: I tried with the following code in a block on the profile pages.
I get unexpected t_variable on the $account line. I think I need to se an example.
Oops
My fault. $uid = arg(1) needs a semi colon at the end. I'm forever missing those dang things. Other than that, it looks right.
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
And Im not skilled enough to
And Im not skilled enough to understand it :-)
I used "print theme" instead and it works just like I wan't it to do.
Thank you so much!