The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
Plugin Vbulletin Variable for Usergroup ID
Hello everyone,
I have wrote a simple plugin script which runs under hook location login_verify_success which is intended to write the current users IP & Host to another MYSQL database on the same server as vbulletin. The code ive formulated is pretty simple to me and working in principle, but when I wanted to add a check for vbulletin usergroups, it all went weird. Basically as you will see in my plugin script, I want to check the usergroup of the member who has logged in successfully, and if they match one defined in the array, then run the MYSQL queries dependant on the output. However to the point, the original variable I tried was the following: Code:
if ($vbulletin->userinfo['usergroupid'] == 'x' || 'y' || 'z') { //Some Code } So I tried another way I knew of: Code:
if ( is_member_of($vbulletin->userinfo, explode(',', X,Y,Z)) { //Some Code } Heres the full script: Code:
// MYSQL Server Domain $mysqldomain = "DOMAIN"; // MYSQL Server Username $mysqluser = "USER"; // MYSQL Server Password $mysqlpass = "PASS"; // MYSQL Database Name $mysqldb = "TABLE"; mysql_connect($mysqldomain, $mysqluser, $mysqlpass) or die(mysql_error()); mysql_select_db($mysqldb) or die(mysql_error()); // Define Key Variables $ip = $_SERVER['REMOTE_ADDR']; $hostname = gethostbyaddr($ip); if ( is_member_of($vbulletin->userinfo, explode(',', 9,10,11,19,12,24,20,13)) { // MYSQL QUERIES }else{ // DIFFERENT MYSQL QUERIES } On a side note, I have used the $vbulletin->userinfo['userid'] variable in the MYSQL queries and there are no problems. Thanks for any help in advance. Matt |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|