[support] How to access a user id & nickname from PHP ?

Brian Choc bchoc at t4tcolorado.org
Tue May 11 00:31:58 UTC 2010


Not entirely sure what you're looking at there, but first take a look at the
$node object to see what you have available for those fields.  There would
presumably be a UID or somesuch you could use to load a user object if you
need to grab more details.



On Fri, May 7, 2010 at 8:24 AM, Xavier Bestel <xavier.bestel at free.fr> wrote:

> Hi again,
>
> So I've build this CCK node with various fields, some of them are
> userreferences. I want to access some values from PHP (in a custom CCK
> computedfield), but it doesn't seem to work:
>
> - I can access e.g. the date from my field_date using
> $node->field_date[0]['value'];
>
> - If I try to access a user from field_proprio, I get nothing. I tried
> $node->field_proprio[0]['value'] and
> $node->field_proprio_uid[0]['value'] but none of them work.
>
> Could anyone tell me how I can access a user, or which bit of the
> copious Drupal doc I should look at ?
>
> Thanks,
>        Xav
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100510/2d93800f/attachment.html 


More information about the support mailing list