Active
Project:
User picture API
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2011 at 13:15 UTC
Updated:
16 Aug 2011 at 13:21 UTC
Hi,
How can I load user picture programmatically ı searched at google ı find this code but ı can t load user picture in Drupal 7 help please
$newUser = array(
'name' => 'username',
'pass' => 'password', // note: do not md5 the password
'mail' => 'email address',
'status' => 1,
'init' => 'email address'
);
user_save(null, $newUser);
// load user object
$existingUser = user_load('USERID');
// update some user property
$existingUser->some_property = 'blah';
// save existing user
user_save((object) array('uid' => $existingUser->uid), (array) $existingUser);
// load user object
$existingUser = user_load('USERID');
// create an array of properties to update
$edit = array(
'profile_first_name' => 'Eric'
);
// save existing user
user_save(
(object) array('uid' => $existingUser->uid),
$edit,
'Personal Information' // category
);