Register Awards FAQ Search Today's Posts Mark Forums Read

RSS Feeds Place where RSS feeds get posted

Upper Navigation
Go Back   Forum Coding > General > General Discussion > RSS Feeds

advertisement



Reply
 
LinkBack Thread Tools Display Modes
Old 11-01-2009, 11:15 AM   #1 (permalink)
Admin
 
AWJunkies's Avatar
 
Status: Admin
Join Date: Feb 2008
Location: San Diego, CA
Posts: 11,091
Chats: 22043
Donation Level 2 
Branding Free  Donation System  Subscription System  Chatbox Evo Package 
Send a message via AIM to AWJunkies Send a message via MSN to AWJunkies Send a message via Yahoo to AWJunkies Send a message via Skype™ to AWJunkies
Default I'm having problems adding a custom feature

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...
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Lower Navigation
Go Back   Forum Coding > General > General Discussion > RSS Feeds

advertisement



Thread Tools
Display Modes


All times are GMT -7. The time now is 07:08 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright ©2000 - 2009 AWNetwork, Inc.
Copyright Notice | License for Reuse | Terms of Use
no new posts