Tag Archives: API

VBulletin API for auto updating user details

1) Create a file with desired name (let it be vb_update.php) with the following code
require_once(‘class.forumops.php’);
$clientdata = unserialize($_POST[‘post’]);
foreach($clientdata as $key => $value)
{
$userdata[$key]=$value;
}
$forum = new ForumOps();
$errmsg = $forum->update_user($userdata);
if ($errmsg) echo $errmsg;
else echo “User Updated successfully.
n”;

NOTE :You can download the script using the url http://wp.me/p1aZaf-1d

2)Upload the file to the server the vBulletin installed

3)Paste the below given code , immediately after the code that update the user details .

$clientdata = array( ‘username’ =>$Username);
$clientdata[‘newusername’] = $newUsername;
$clientdata[‘password’] = $password;
$clientdata[’email’] = $email;
$url=”http://www.example.com/forum/vb_update.php”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, array(“post” => serialize($clientdata)));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
curl_close ($ch);

// http://www.example.com/forum/ is the location where vbulletin is installed