vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   How to make Referral field in registration required? (https://vborg.vbsupport.ru/showthread.php?t=60186)

digitalSite 01-14-2004 01:41 AM

How to make Referral field in registration required?
 
Anyone know how to make the referral link in registration required or at least to not allow people signing up who were not referred?

I would like to also prevent someone from stealing an email with a referral link and trying to sign up that way. Basically, I only want intended recipients accessing the referral link and not someone else.

Any ideas or help on this?? ANY suggestions is GREATLY appreciated. Thanks!

Freddie Bingham 01-14-2004 04:35 AM

Quote:

Originally Posted by digitalSite
Anyone know how to make the referral link in registration required or at least to not allow people signing up who were not referred?

I would like to also prevent someone from stealing an email with a referral link and trying to sign up that way. Basically, I only want intended recipients accessing the referral link and not someone else.

Any ideas or help on this?? ANY suggestions is GREATLY appreciated. Thanks!

To require referrals, edit register.php and find this code:
PHP Code:

         if ($_POST['referrername'])
         {
            if (!
$testreferrerid $DB_site->query_first("SELECT userid FROM " TABLE_PREFIX "user WHERE username = '" addslashes(htmlspecialchars_uni($_POST['referrername'])) . "'"))
            {
                eval(
'$errors[130] = "' fetch_phrase('badreferrer'PHRASETYPEID_ERROR) . '";');
            }
         } 

add this after it:

PHP Code:

         else
         {
             
$errors[131] = 'You must be referred by an existing user to register';
         } 

Untested though.

Link14716 01-14-2004 09:56 AM

freddie: I believe digitalSite wants this for vB2, hence why it is in the vB2 Requests forum. ;)

Freddie Bingham 01-14-2004 01:14 PM

Quote:

Originally Posted by Link14716
freddie: I believe digitalSite wants this for vB2, hence why it is in the vB2 Requests forum. ;)

Oh, well he has a reason to upgrade now.

digitalSite 09-25-2005 06:07 PM

Quote:

Originally Posted by Freddie Bingham
To require referrals, edit register.php and find this code:
PHP Code:

         if ($_POST['referrername'])
         {
            if (!
$testreferrerid $DB_site->query_first("SELECT userid FROM " TABLE_PREFIX "user WHERE username = '" addslashes(htmlspecialchars_uni($_POST['referrername'])) . "'"))
            {
                eval(
'$errors[130] = "' fetch_phrase('badreferrer'PHRASETYPEID_ERROR) . '";');
            }
         } 

add this after it:

PHP Code:

         else
         {
             
$errors[131] = 'You must be referred by an existing user to register';
         } 

Untested though.


Hi:

I have since upgraded to 3.x, and tried the code above just to see if it works...it doesn't work. So I 'm still trying to figure out how to make the referral field required AND check to make sure the username EXISTS.


All times are GMT. The time now is 12:52 AM.

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.01746 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete