I m using a content profile node type with CCK and email Field, and would like to make available in the content profile the email of the drupal user related to this content profile type. Each drupal users have a content profile , but they do not edit their content profile. An administrator user does the job, and complete content profile for each users.
The problem is that is i would like to autofill the email cck field with the drupal user's email.
When i use the php code in the default value :
global $user;
return array(
0 => array('your_field_name' => $user->mail),
);
it works but it autofills the email with the admin user email who is logged but not with the user profile i m editing. How can i code this in php, to retrieve the uid of the user i m editing his content profile and get his email field ? I have some useful information in the url http://mysite.com/user/30/profile/profile?uid=30&destination=user%2F30
Thanks in advance for your support
Comments
Comment #1
lorenlang CreditAttribution: lorenlang commentedsubscribing
Comment #2
fishfilet CreditAttribution: fishfilet commentedsubscribing
Comment #3
Bilmar CreditAttribution: Bilmar commentedsubscribing
Comment #4
YK85 CreditAttribution: YK85 commented+1 subscribing
Comment #5
crizTry to load the node's author instead of the active user...
Comment #6
jeffschulerTry this for your field's default value PHP:
Comment #7
amanire CreditAttribution: amanire commentedFYI, if you're using an email CCK field, then the code in #6 will be
Comment #8
1kenthomas CreditAttribution: 1kenthomas commentedSee http://drupal.org/node/586464#comment-4673662. Duplicate?