Need this function modified - same project you worked on

Hi, this is same project you have been working on for me, I just need this function modified so instead of it creating new user, it will chose existing random user from vb database.

function newuser($data) {

global $vbulletin;

$userid = 0;

if (!isset($data['yahoo_usernick']) OR empty($data['yahoo_usernick'])) return false;

$username = $data['yahoo_usernick'];

$email_user = create_random_string(6) . create_another_random_string(8);

$email_domain = substr($vbulletin->options['webmasteremail'], strpos($vbulletin->options['webmasteremail'], "@"));

$email = $email_user . $email_domain;

if (!strpos($email, "@"))


$unick = explode(" ", $username);

$email = $unick[0] . '@[url removed, login to view]';


$password = create_random_string(18);

$ip = random_ip();

$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);

$userdata->set('username', $username);

$userdata->set('email', $email);

$userdata->set('password', $password);

$userdata->set('ipaddress', $ip);

$userdata->set('signature', $vbulletin->options['icc_yahoo_attribution']);

$userdata->set('usergroupid', $vbulletin->options['icc_usergroup_id']);


if (!empty($userdata->errors)) return false;

$userid = $userdata->save();


// now add an av

if ($vbulletin->options['icc_import_avatars'])


if (isset($data['yahoo_user_photo_url']) AND !empty($data['yahoo_user_photo_url']))


// begin custom avatar code

require_once(DIR . '/includes/[url removed, login to view]');

require_once(DIR . '/includes/[url removed, login to view]');

$upload = new vB_Upload_Userpic($vbulletin);

$upload->data =& datamanager_init('Userpic_Avatar', $vbulletin, ERRTYPE_STANDARD, 'userpic');

$upload->userinfo['userid'] = $userid;

$upload->image =& vB_Image::fetch_library($vbulletin);

$upload->maxwidth = $vbulletin->userinfo['permissions']['avatarmaxwidth'];

$upload->maxheight = $vbulletin->userinfo['permissions']['avatarmaxheight'];

$upload->maxuploadsize = $vbulletin->userinfo['permissions']['avatarmaxsize'];

$upload->allowanimation = ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cananimateavatar']) ? true : false;




return array('userid' => $userid, 'ip' => $ip);


Compétences : vBulletin

en voir plus : vb this, signature database, same, modified, function, av, custom function php, code function, avatar image php, need modified, yahoo options data, vbulletin random, vbulletin custom code, php save signature, strpos array php, yahoo vbulletin, php strpos array, global email database, vbulletin image, vbulletin custom permissions, upload image vbulletin, vbulletin add, email signature project, vbulletin avatar php, upload image save

Concernant l'employeur :
( 4 commentaires ) Toronto, Canada

Nº du projet : #1682877