By dmjossel on
Is there a way to refer to the UID of a user referred to in a CCK node within a computed field in that same node?
Right now I've got a custom CCK content type with two user references in it. I want to compute the values of certain other fields by using the UIDs of those users. However, the value of that field, as referred to in the usual way:
$node->field_a[0]['value']
where "field_a" is the field name, does not return the uid, but rather the username. I could do a query against the users table, but is there a Drupal function that will return the UID from an arbitrary username, rather than just the current logged in user's UID?
Comments
More CCK user reference computed unanswered
http://drupal.org/node/357998 is the same type of question but remains unanswered
I was helped out on this for D6 and wrote about it here...
http://drupal.org/node/357998#comment-1201524