Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications
Make 'Referrer' field in registration UNeditable if from 'referrerid' in URL Details »»
Make 'Referrer' field in registration UNeditable if from 'referrerid' in URL
Version: 1.00, by timetunnel timetunnel is offline
Developer Last Online: Mar 2007 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 11-16-2005 Last Update: 11-16-2005 Installs: 12
Uses Plugins Template Edits
 
No support by the author.

Hello.

If you'd like to make the 'Referrer' field username UNEDITABLE if a link is followed in a referral URL, here is a solution WITHOUT hacking the 'register.php' file.
(ref: http://www.vbulletin.com/forum/showthread.php?t=132386)


STEP 1: In 'Plugin Manager', assign this new plugin a 'Hook Location' of 'register_form_complete' and give it a 'Title'. You'll then create an arbitrary variable and the conditional statements in which its value will be assigned by doing the following:


Add in the 'Plugin PHP Code' text area this code:
PHP Code:
if (empty($referrername)) {$ref_var 0;}
else {
$ref_var 1;} 
Make this plugin 'Active'.


STEP 2: In the 'register' template,

Find this code:
Code:
<if condition="$show['referrer']">
Modify to this code:
Code:
<if condition="$show['referrer'] && $ref_var == 0">
STEP 3: Find its closing tag a few lines below the line mentioned above in STEP 2:
Code:
</if>
Above it...

Add this code:
Code:
<else />
<input type="hidden" name="referrername" value="$referrername" />
That's it.

In summary, if there is no referrerid on the URL OR if it is but it doesn't match a username in the database, the $referrername var will be empty and therefore, the $ref_var will be assigned the value of '0' whereby the 'Referrer' field in the Registration Form will be visible for manual entry. If the username is found in the database, the 'Referrer' field will not be shown but its data in the form of the username found will be sent to the server upon form submission so that username gets the credit for the new member.

ENJOY!

P.S. Note: My assessment is, once the referrerid is accepted by the software after locating the username in the database, the information is saved in a cookie even if registration is not completed in that session. Therefore, even when all browser windows are closed and PC is turned off, the next time the Registration Form is loaded, that field will be 'hidden' from the form and 'UNeditable'. Once the form is submitted, that credit will be given to that 'username'.

Bottom line: IF YOU'RE USING A SHARED COMPUTER, you may need to remove that 'bbreferrerid' cookie from your computer manually or the credit to that username will be coming from someone else who's registering and who may not have used a 'referred' URL. I'll leave those cookie-removal steps to others to explain.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-17-2005, 09:00 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this. Really useful for my forums.
Reply With Quote
  #3  
Old 11-17-2005, 11:06 PM
timetunnel timetunnel is offline
 
Join Date: Sep 2005
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm glad to hear it.

The whole premise is to put into place, more ways to make the referrer stats more 'tamper-proof.'

Kinda a Part II to this is that which was mentioned in the 'Bottom Line' of the post for SHARED COMPUTER users. That's why I created another thread (https://vborg.vbsupport.ru/showthread.php?t=101027) to begin trying to address the 'bbreferrerid' cookie feature.

Currently, I'm not sure if/how this should be addressed. I hope to get some feedback. In the meantime, I am using this code mod regardless since it addresses the majority of the concern mentioned in the thread referenced at the beginning of the code mod. The rest I'll worry more about as time goes on...

If the 'bbreferrerid' cookie has an expiration, then this would be essentially a non-issue. But the flip side of this is, if a person couldn't finish their registration in that period in which the cookie is 'active', they may not necessarily use the initial URL with referrerid and it becomes a wash, anyway... :squareeyed:

In essence, this whole cookie concern may be a non-issue -- for some, 'so what if the stats are off 2 out of 200'...

I hope to get more feedback about the code mod as well as from those who know more about the infamous 'vb referrer cookie', because I don't know enough about it. :lick:

Take care.
Reply With Quote
  #4  
Old 11-18-2005, 08:11 PM
trackpads's Avatar
trackpads trackpads is offline
 
Join Date: Aug 2003
Location: Armyville
Posts: 1,074
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for this!!
Reply With Quote
  #5  
Old 11-18-2005, 08:20 PM
Moparx Moparx is offline
 
Join Date: Jul 2004
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it can be done without plugins as well (this mod hides the referer field instead of disabling it):
https://vborg.vbsupport.ru/showthread.php?t=98592
Reply With Quote
Reply

Thread Tools

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 02:34 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04184 seconds
  • Memory Usage 2,239KB
  • Queries Executed 20 (?)
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
  • (4)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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