AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Vbulletin 4.X Integration with Sourcebans! FINALLY HERE! (https://forums.alliedmods.net/showthread.php?t=139212)

bouncer 09-27-2010 19:07

Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
1 Attachment(s)
Ever wanted to get your Vbulletin 4.X hooked up with Sourcebans 1.4.7 (Only 1.4.7 currently supported)?

Well this php script does the following!
  1. Copies vbulletin members from specific usergroups to specific sourcebans WEB AND SERVER ADMIN GROUPS
  2. Sends PM to the vbulletin user once an account has been created for him on sourcebans
  3. Includes a random generated password and his login username (which they can then change)
  4. Copies the following: Email, Username, Steam ID
  5. Sends PM to vbulletin user when he has been promoted or demoted through vbulletin usergroups

This script auto-detects when someone is promoted or demoted on your vbulletin site. This is a very handy script for those of large communities who want to use sourcebans and vbulletin together.

You define the usergroup ids on vbulletin and their rank names as well as the sourcebans matching web and server admin group ids. The script then copies users to their respective usergroups.

NOTE!:
"CServerRcon.php"; //This file can be found in Sourcebans_web/includes/ and must be COPIED and pasted in the same location as this php script lies.

Put the php script in your-vbulletin-directory/includes/cron and put that file in the same directory.

Add the cron job to your task manager through VBULLETIN. This php script is made to be run through vbulletin only.

It is recommended you run the cron job every half hour to an hour. Or however you would like depending on the number of users your vbulletin forum holds.

This has only been tested on 4.0.7 and with sourcebans 1.4.7. Therefore it should work on all vb 4.X versions. Older versions haven't been tested.

Known bugs:
NONE

Credits: [GM] Geit User's Website For coding the php script
[B-O-G][M]Mr. Bouncer Website For requesting the script :D

Please let me know if you have any issues with this php script. I have long waited to create this and finally got it. Even though I paid Geit to code it, I feel it is necessary to share it as many communities have always begged for this. Well now it's possible :)

PM IMAGES ON VBULLETIN:

http://i229.photobucket.com/albums/e...4Sep271846.gif

http://i229.photobucket.com/albums/e...3Sep271845.gif

http://i229.photobucket.com/albums/e...2Sep271845.gif

http://i229.photobucket.com/albums/e...1Sep271844.gif

Be sure to remove the .txt at the end of the filename!

All the information on what needs to be edited is commented in the filename, simply look through it and input your SOURCEBANS mysql user and pass at the top and edit all necessary usergroup informations.
Also make sure you edit the field ID for your profile field for steam id. You have to create a Profile Field on your site for the steam id. It is recommended that you require this profile field filled out upon registration. Otherwise people will be able to edit their steam ids and give admin to those who aren't supposed to have it. In this case in the php file, the field id is : field5

bouncer 09-27-2010 19:16

Re: Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
Re-uploaded file, had to fix a comment that was made in there. Please re-download.

NoS 09-27-2010 22:34

Re: Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
Sounds awesome. I havn't tested it, but thats great!

KyleS 09-28-2010 02:02

Re: Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
Quote:

Originally Posted by NoS (Post 1310327)
Sounds awesome. I havn't tested it, but thats great!


Peace-Maker 09-28-2010 12:16

Re: Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
Thanks for sharing this. Great job!

If you really want this script to be used by other communities, you should extract all the custom variables to the top of the script into the config area. Like an own var $vbSteamID = 'field5'; for everyone to easily edit instead of having to run through the whole script.

I still have to notice, that this script is only a one-way solution. So no change done via the sourcebans webpanel is permanent, but only lasts until the script is ran again. So it's not a complete bridge, but at least it's quite helpful.

I strongly recommend to use/modify the SendRconSilent() function in /includes/system-functions.php to handle any errors occuring with rcon.
At least add
Code:

$rcon->Auth();
to the rehashing part to get it working;)

Original

bouncer 09-28-2010 15:55

Re: Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
well i think if you add extra flags, they will probably stay. dont know though.

Geit 09-28-2010 16:14

Re: Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
1 Attachment(s)
Update to the script attached, Managed to get the vBulletin private message data manager working properly after doing some debugging on my local install, so sending PM's now generates email notifications and the script doesn't require MYSQL information for both databases.
Added some escaping to variable input, just in case.
Did as suggested above and moved the variables that can vary per install into their own variables at the top of the script.
Changed the Server Rehash so it now uses the Auth function from CServerRcon.

Quote:

Originally Posted by Peace-Maker (Post 1310625)
I still have to notice, that this script is only a one-way solution. So no change done via the sourcebans webpanel is permanent, but only lasts until the script is ran again. So it's not a complete bridge, but at least it's quite helpful.

I had a think about this, and I couldn't think of doing it any other way really. - As Bouncer has said, If you were to set custom permissions for a user, they would always be preserved, the only thing that the script is supposed to change when a user is promoted is their Web Group, Server Group and Server Access Group.

bouncer 10-18-2010 20:04

Re: Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
Hey anyone got any idea what this error means when I run the task manager job from vbulletin??

Quote:

Vbulletin to Sourcebans

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Respectin''' at line 1

psychonic 10-18-2010 20:09

Re: Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
Quote:

Originally Posted by bouncer (Post 1328903)
Hey anyone got any idea what this error means when I run the task manager job from vbulletin??

It means you have an error in your SQL syntax near ''Respectin'' at line 1.

bouncer 10-18-2010 20:12

Re: Vbulletin 4.X Integration with Sourcebans! FINALLY HERE!
 
Well I didn't edit any files or anything that has to do with this at all. And how would I find out which file to edit?


All times are GMT -4. The time now is 13:42.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.