|
| RSS Feeds Place where RSS feeds get posted |
Upper Navigation
|
||||||
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Admin
|
Hello, all.
The system over at n00bsalad.net is working wonders, but the community's administrators is having time-related issues entering people into a different database (SourceBans) other than vBulletin's database, so I decided to help the community out and possible implement a new feature into the donation system. I decided to do a bit of code reading on your system, and attempted, but failed. =( It still adds the user in there, so I know that the function or the file does not have a PHP error. The code is placed inside add() function in the awcoding/methods/paypal.php file right after the line: PHP Code: $vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "awc_payments(" . $db_string['FIELD_NAMES'] . ") VALUES (" . $db_string['FIELD_VALUES'] . ")"); Here's the code I implemented myself: PHP Code: if ($AWC['IN']['mc_gross'] >= 10.00) { // Automatic VIP $query = "SELECT * FROM `userfield` WHERE `user_id` = '". $AWC['IN']['userid'] ."'"; $result = mysql_query($query); $steam_id = mysql_result($result, 0, 'field5'); // New MySQL Connection $new_conn = mysql_connect("localhost", $db_username, $db_password); mysql_select_db ($source_bans_db, $new_conn); $query1 = "SELECT * FROM `sb_admins` WHERE `authid` = '". $steam_id ."'"; $result1 = mysql_query($query, $new_conn); if (mysql_num_rows($result) == FALSE || mysql_num_rows($result) !== TRUE) { $query2 = "INSERT INTO `sb_admins` (`user`, `password`, `authid`, `gid`, `email`, `validate`, `extraflags`, `immunity`, `srv_group`, `srv_flags`, `srv_password`) VALUES ('". $AWC['IN']['username'] ."', 'c737a5714bbc48180597c9e0322750827d2cf2e2', '". $steam_id ."', '-1', '". $AWC['IN']['payer_email'] ."', '0', '0', 'VIP Slot Access', '', '')"; $result2 = mysql_query($query2, $new_conn); } mysql_close($new_conn); // End automatic VIP } I just need to know if that $AWC['IN']['mc_gross'] variable is being compared correctly, and if my code placement is correct. I thought about placing it somewhere in the verify() function in the same file, but I'm just not entirely sure. If you could, please help me out and point me in the right direction of adding this small custom feature. Thank you, w4d More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... More... |
|