jacob115 |
02-26-2010 12:08 PM |
I am working on some codes and have a question. I am editing my point store to make it work perfectly for me, but I have a question. Here is the code for changing username:
Code:
// *********** Change Username ************
if ($itembuy[marketid] == 13) {
$findother = $vbulletin->db->query_read("SELECT * from " . TABLE_PREFIX . "user where username='".addslashes($new_username)."'");
$findother = $vbulletin->db->fetch_array($findother);
if ($findother) {
$error = 10; // Someone has that username.
}
$minchar = $vbulletin->options[minuserlength];
$maxchar = $vbulletin->options[maxuserlength];
if ($minchar > strlen($new_username)) {
$error = 11;
}
if ($maxchar < strlen($new_username)) {
$error = 12;
}
if ($error == 0) {
$vbulletin->db->query_read("update " . TABLE_PREFIX . "user set `username`='".addslashes($new_username)."', `$pointfield`=$points-$amount where userid='$userid'");
$vbulletin->db->query_read("insert into " . TABLE_PREFIX . "market_transactions set `date`='$time', marketid='$itembuy[marketid]', userid='$userid', affecteduser='$userid', amount='$amount'");
$points = $points - $amount;
$purchases = $purchases+1;
}
}
//
I understand I need to change the market ID, but what would the code be to add a specific usergroup (chosen by me, not user, like I would specify the additional usergroup in the code)
Thanks!
|