Closed

Custom Project Jun 7 2012 15:01:59

This project was awarded to developerpmal for $30 USD.

Get free quotes for a project like this
Employer working
Project Budget
$30 USD
Total Bids
1
Project Description

Hi, the project you have worked on for me before, I just need modification to this function, instead of creating new user, i need it to choose existing 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']);

$userdata->pre_save();

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

$userid = $userdata->save();

unset($userdata);

// 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;

$upload->process_upload($data['yahoo_user_photo_url']);

}

}

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

}

/**

* This function creates a new thread from the queue

* given a forumid and a timestamp

* @global

* @param integer $forumid the id of the forum to create a thread in

* @param integer $poststamp the timestamp of the new thread

*/

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online