By eviljoker7075 on
Hey there. I'm trying to display information taken from the profile of the user who posted the node being viewed. I've installe dthe contemplate and prfile modules but just cannot figure it out.
To start of with a simple example I have made a field in the profile for the users real name. I tried adding the following code to my node template (which is the only thing I could think of that would work...) But nothing shows up:
<?php print $node->profile_realname ?>
Can anyone help at all?
Comments
You need to use a user
You need to use a user object, so you need something like
Genius! Thanks very much!
Genius!
Thanks very much! Work's a treat!!
While I've got you here I might as well ask. I want to use this to allow my users to share ad revenue from google ads on my pages. If I provide a field in their profile to add their google adsense ID to can I use this script to call up the id from the profile and enter it into the adblock code from google?
Yes but it depends on
Yes but it depends on context. Your original question was relative to a node. I am guess you have the ads in blocks so you need a way of determining which user to use for the ad. Given you have detemined that you can do what you want.
No, I am placing the ads in
No, I am placing the ads in the node itself. I've placed my google code into the template for my nodes... will it work ok there?
Yes, that means you have
Yes, that means you have code in the template that looks something like this.
So you can then do something like