The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Special link invite, when user joins is automatic dropped into usergroup #
Setting :
Make a campagn for promotion of your site! In that campaign there is a invitation code or link When a user clicks that and is ofcourse directed to your site's register page when the potential user is done registering, the user is automatic put in a specifik Usergroup, instead of where the other normal registrations go. Other : Ive seen this discussed before, but i cant located or find if its a mod allready existing, but that could be quite usefull, also for the gameing community, would like to know the difference between random registrants and "known" so make that promotion link availible to frinds/clan buddys or in a campagin, and this will auto sort users in those specifik groups.. okay,, what do you guys think. Im sure its quite complicated, and im nothing more than a scriptkiddie, hmm more like script adult, anyway the case is i have noway atm of completing or starting such a project. :up: |
#2
|
||||
|
||||
okay, guess noone could use this..
does anyone know, would it be possible to make a duplicate registration form, and simply edit it to fit whats needed. removed alot, but most importent added 1 item the invitation code that is checked against a reference preferable in db then dropping the user in a usergroup for that code.. exsample user : tom, registrates with the invitation code "offer31" if invitation code = true add user to usergroup = "special group else add user to usergroup = "normal /if |
#3
|
|||
|
|||
This addon actually isn't that hard...
If you work with a new plugin for the hook register_addmember_process (or just find this in register.php) you'll basically need to add to get the invite code, check it and update the group. This code will preform a basic check and move a user, you'll have to get a bit more advanced if you want to compare codes against a database table. Code:
// parse the form field $vbulletin->input->clean_gpc('r', 'invitecode', TYPE_NOHTML); // check if they entered the code "secret code" if ($vbulletin->GPC['invitecode'] == 'Secret Code'){ $userdata->set('usergroupid', '5'); // change the usergroup from 5 to whatever } |
#4
|
||||
|
||||
Quote:
Thank you so much for this codebit,, it works like a charm running it on a local test board, and its impressive... LOVELy.. any tips on where i can read up on importing data from the database ? and saveing to the db using php, was thinking maybe making a admin control to set usergroup and invitation code |
#5
|
|||
|
|||
I love it when people take iniative! It makes everyone so much more willing to help you along.
Databases are actually pretty simple when used for a straight compare... A query for your code could read something like: Code:
$vbulletin->input->clean_gpc('r', 'invitecode', TYPE_NOHTML); if($vbulletin->GPC['invitecode']){ $invitegroupid = $db->query_first_slave(" SELECT usergroupid FROM " . TABLE_PREFIX . "invitecodes WHERE invite = " . $db->escape_string($vbulletin->GPC['invitecode'])) if($invitegroupid){ $userdata->set('usergroupid', $invitegroupid); } else { // no group found, bad code! echo "no group found, try another code next time"; } } As far as adding an admin page that too is pretty straight forward. I'd suggest looking at the code in one of the more basic admin areas like Paid Memberships to see how it calls up the existing records and prints them out. |
#6
|
||||
|
||||
Quote:
Tx again ted, well this code snippet is excaktly what i needed gonna modify it a little, but excaktly whats missing to move bump me along.. got the templaate edits working got the plugins for phrases + registration modifications working should get that working today todo : - admin panel where admin can see which invitation codes run + usergroupid's view,edit,save,delete,add well aparently this is gonna turn into a mod thanks to Ted S. --------------- Added [DATE]1233657299[/DATE] at [TIME]1233657299[/TIME] --------------- FROM " . TABLE_PREFIX . " isent something to change correct ? thats the prefix admin sets when seting up board correct ? trying to debug, cause getting a parse error... |
#7
|
|||
|
|||
No that's not something you need to change, that will automatically call in your table prefix if you have one.
What was the parse error? |
#8
|
||||
|
||||
ahh yes, went along the process now...
currently stuck in a parse error execution side.. https://vborg.vbsupport.ru/showthread.php?t=204054 so went to complete the admincp - add new code (complete) - delete code ( complete) - edit page.. kinda stuck atm.. ' https://vborg.vbsupport.ru/showthread.php?t=204084 - database installation (complete) - database uninstallation table drops (complete) so only missing that if statement to work proberly before im gonna upload it to a live server for prober testing The Edit codeCP is a minor issue, no need really just nice to have.. EDIT : only 60% phrases done. |
#9
|
|||
|
|||
thats a great plugin-idea, i am looking forward to the first test of the mod
|
#10
|
||||
|
||||
Quote:
AdminCP - 95% done; add+del works, edit fails atm. Phrases - Done Database - Done Templates - Done File edits - Done And it works. only one task left before release, I works fine and as intended on a board that does not require Email verification but boards that DO require email verification it fails, the usergroup ID gets lost dureing the board (invitation.php) -> mail -> board (register.php) |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|