Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2009, 02:05 PM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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:
Reply With Quote
  #2  
Old 02-02-2009, 08:14 PM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 02-02-2009, 09:31 PM
Ted S Ted S is offline
 
Join Date: Dec 2003
Location: SoCal
Posts: 3,954
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
}
Playing around with the code you can do other things like send a special email out, show a different thank you message and so forth.
Reply With Quote
  #4  
Old 02-02-2009, 11:23 PM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ted S View Post
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
}
Playing around with the code you can do other things like send a special email out, show a different thank you message and so forth.

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
Reply With Quote
  #5  
Old 02-03-2009, 12:29 AM
Ted S Ted S is offline
 
Join Date: Dec 2003
Location: SoCal
Posts: 3,954
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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";
 
 }
 
}
With this code you would just need a simple table with the fields invite,usergroupid which you could create through a program like phpmyadmin. Again the sky is the limit and you may want to add more things but this should help you trudge along.

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.
Reply With Quote
  #6  
Old 02-03-2009, 07:28 AM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
With this code you would just need a simple table with the fields invite,usergroupid which you could create through a program like phpmyadmin. Again the sky is the limit and you may want to add more things but this should help you trudge along.

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.
awn... . just got out of bed.

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...
Reply With Quote
  #7  
Old 02-03-2009, 03:31 PM
Ted S Ted S is offline
 
Join Date: Dec 2003
Location: SoCal
Posts: 3,954
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 02-03-2009, 03:36 PM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 02-04-2009, 01:02 PM
knoffs knoffs is offline
 
Join Date: Jan 2009
Location: Austria / Bosnia
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thats a great plugin-idea, i am looking forward to the first test of the mod
Reply With Quote
  #10  
Old 02-04-2009, 02:20 PM
Vaupell's Avatar
Vaupell Vaupell is offline
 
Join Date: Apr 2008
Location: Esbjerg, Denmark
Posts: 1,036
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by knoffs View Post
thats a great plugin-idea, i am looking forward to the first test of the mod
im actually done.. only missing to get that last If statement working..

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)
Reply With Quote
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. The time now is 07:11 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05077 seconds
  • Memory Usage 2,269KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete