The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello,
I'm having problems attempting to include global.php inside functions and if statements. I also have problems including global.php outiside if statements and then using the data manager "tools" inside the if statement. The goal is to add a registered user to additional group(s) using the data manager tools if certain conditions are met. When I attempt to include global.php either in a function or if statement and then make a call to fwrite, nothing gets written to my file, and the user is not added to the additional groups. It's like php and/or vbulletin goes in la-la land. Including global.php and $vbulletin works outside any if statements and functions. However, that is assuming one condition is always met. I need to be able to check for multiple conditions and that's why I'd like to be able to at least use if statements and then reference $vbulletin to manipulate the user's groups inside the different if statements (leveraging the data manager "tools"). So I need to be able to do something like (pardon my pseudo-code): include_once(dirname(__FILE__) . "/global.php"); global $vbulletin; $email = "momma@mommashouse.com"; if ($userlikestheHoustonTexans == "yes") { // update membergroupids to add more access $useridq = $vbulletin->db->query_first_slave("SELECT userid FROM " . TABLE_PREFIX . "user WHERE email='{$email}'"); $syd_userinfo = fetch_userinfo($useridq['userid'], 0, 0); $finalmembergroupids = $syd_userinfo['membergroupids'] . ",9"; $file = fopen(dirname(__FILE__) . "/test.txt","a"); fwrite($file, "made it past including global php \r\n"); fclose($file); } else { // remove membergroupids to deny access since they don't like the TEXANS - boo } //do presave //check for errors with presave // if no errors with presave, then really save the users updated information But declaring global.php outside any if statements and then referencing $vbulletin in the different if statements is not working. Thanks for any help you can provide! ![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|