Raised This Month: $ Target: $400
 0% 

PHP Script to copy data from mysql to sourcebans mysql


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bouncer
Veteran Member
Join Date: Apr 2009
Old 10-29-2010 , 20:39   PHP Script to copy data from mysql to sourcebans mysql
Reply With Quote #1

Was wondering if anyone would care to create a simple php script that copies information from one mysql database to sourcebans database. Here are the steps and pictures for easier explanation.

1. Copy from donator database table 'users' information in the following columns only if 'membership_id' is set to 2:
  • 'username'
  • 'email'

2. Then create a new user in sourcebans database using the:
-email from donator database will be used as the sourceban's admin email.
-username from donator database will be used as sourceban's admin Username AND as their Steam ID.
(username column in donator database contains steam ids
-Create the same password for all users. Password will be: applepie
(I'll change it later in php file for security)

3. Add the user to:
  • Server Admin Group: Premium Gamers (exactly as written)
  • Web Admin Group: Premium Gamers Web (exactly as written)
  • Server Group: All Servers Group (exactly as written)

4. Rehash the admins on all servers- instant activation

5. If user's membership_id has changed from 2 to 1 in donator mysql database, delete the user from sourcebans completely.

Here is the donator database structure:


There is a code that already does ALL of the above, except it has a bunch of extra features I do NOT need. And it is made to copy from vbulletin instead.

You can use it for reference to create this php script. You can find it here:
http://forums.alliedmods.net/showthread.php?t=139212

Thanks, I hope someone can make this. shouldn't be too hard, i tried editing the existing vbulletin to sourcebans and only broke it
__________________


bouncer is offline
Rizla
SourceMod Donor
Join Date: Jun 2010
Old 10-30-2010 , 10:36   Re: PHP Script to copy data from mysql to sourcebans mysql
Reply With Quote #2

i could write a simple version of this if you wanted, might take me some time as im working on my own version and it involves buttons so isnt fully automatic
Rizla is offline
bouncer
Veteran Member
Join Date: Apr 2009
Old 10-30-2010 , 10:46   Re: PHP Script to copy data from mysql to sourcebans mysql
Reply With Quote #3

Yeah it would be nice if you could write up a php script that does this
I'm currently learning php but don't know enough to do this.
__________________


bouncer is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:19.


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