vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Tell A Friend + Automatic Referral Code (https://vborg.vbsupport.ru/showthread.php?t=34031)

Steve_S 01-10-2002 10:00 PM

Tell A Friend + Automatic Referral Code

Edited 1-13-01. JavaScript pop version available at:

https://vborg.vbsupport.ru/showthrea...838#post212838

The JS version permits you to place the link anywhere you want on your board.

This version in this post returns your members to the thread they were reading using the same browser window.



Purpose: Permit members to promote your Board via email using their unique Referral code which is automatically inserted. Reward them for x number of referrals :)

Does not require any modifications to source code but does require hacking.

Requires 3 custom templates and a renamed and hacked version of sendtofriend.php which I have called referbbtofriend.php

1. Create 3 custom templates which are really a save of your current templates with a new name:

sendtofriend saved as referbbtofriend
email_sendtofriend saved as email_referbbtofriend
redirect_sentemail saved as redirect_referbbsentemail

2. Edit your custom templates. See zip for mine

3. Grab your copy of sendtofriend.php and save it as referbbtofriend.php

Edit referbbtofriend.php as follows and place in your forum root:

Code:

Change this line
< $templatesused = "sendtofriend,email_sendtofriend,redirect_sentemail";
--- To this line
> $templatesused = "referbbtofriend,email_referbbtofriend,redirect_referbbsentemail";
Change this line
<  eval("dooutput(\"".gettemplate("sendtofriend")."\");");
--- To This line
>  eval("dooutput(\"".gettemplate("referbbtofriend")."\");");
Change this line
<  eval("\$message = \"".gettemplate("email_sendtofriend",1,0)."\";");
--- To This line
>  eval("\$message = \"".gettemplate("email_referbbtofriend",1,0)."\";");
Change this line
<  eval("standardredirect(\"".gettemplate("redirect_sentemail")."\",\"showthread.php?s=$session[sessionhash]&threadid=".intval($threadid)."\");");
--- To This line
>  eval("standardredirect(\"".gettemplate("redirect_referbbsentemail")."\",\"showthread.php?s=$session[sessionhash]&threadid=".intval($threadid)."\");");

4. Insert this link in your Show Thread Templates >> showthread template

Code:

<a href="referbbtofriend.php?s=$session[sessionhash]&threadid=$threadid">Tell a friend about your Board</a>
Notes: Uses a redirect to return them to the thread they were reading.

Thoughts and comments welcome.

Steve_S 01-11-2002 08:36 PM

The screen capture of the prefilled form:

hypedave 01-11-2002 09:22 PM

Cool, I get to be the first to install this, I am installing it now

hypedave 01-11-2002 09:37 PM

when clicking on the reter to link, I get a blank screen ??

Steve_S 01-11-2002 10:14 PM

Did you create the 3 custom templates and upload the hacked referbbtofriend.php ?

Please remeber that in the template named referbbtofriend (see the zip) you must call referbbtofriend.php

This:

Code:

<!----NOTE NEW NAME BELOW----->
<form action="referbbtofriend.php" method="post">

HTH

Myke O 01-11-2002 10:49 PM

im doing it now ..... i dont have those 2 templates email and the refer one.... i only have sendtoafriend.php.... thats it

Myke O 01-11-2002 11:05 PM

ahh i figured it out now... i love this HACK!!!!! thanks!!!!

Steve_S 01-11-2002 11:17 PM

You welcome :)

Since this is my first effort I could have been just a tad more lucid in my instructions :) Another explanation:

You need to create 3 custom templates as per my instructions :) Here is another way:

1. Download the zip in the first post of this thread and open all 3 files in your editor. I have already edited these templates so if you don't like my stuff just change it.
2. Copy the text to the clipboard
3. Admin >> Templates >> Add
4. Paste the text into the template and name the templates exactly like the file names (no .txt)
5. Click the Save Button

eva2000 01-12-2002 02:31 AM

nice one funkyduck :D

SirSteve 01-12-2002 03:03 AM

Excellent! Thanks!

Steve_S 01-12-2002 05:05 AM

Thanks. A JavaScript Popup version coming tomorrow which might be a little "cleaner" for some folks and faster for the folks on a dial up.

SirSteve 01-12-2002 05:09 AM

great.... after I just installed this one! ;)

DelusionalMind 01-12-2002 06:30 AM

nice :)

on my que for tomorrow :)

Lesane 01-12-2002 10:18 AM

Nice hack, thanks.

Steve_S 01-12-2002 06:27 PM

NEW: Tell A Friend + Automatic Referral Code via JavaScript Pop Up Instructions edited on 1-13-02 for new features.

NOTE: if you previously installed the "redirect" version but wan't to use the JS pop up version, please start over and download the zip in this post :)

Includes welcome and thank you by member name. Requires 4 custom templates.

1. Please download the .zip first which contains all the custom templates.

2. Grab your copy of sendtofriend.php and save it as referbbtofriend.php

Edit referbbtofriend.php as follows and place in your forum root:

Code:

Change this line
< $templatesused = "sendtofriend,email_sendtofriend,redirect_sentemail";
--- To this line
> $templatesused = "referbbtofriend_pop,email_referbbtofriend,referbbsentemail_thanks,";
Change this line
<  eval("dooutput(\"".gettemplate("sendtofriend")."\");");
--- To this line
>  eval("dooutput(\"".gettemplate("referbbtofriend_pop")."\");");
Change this line
<    eval("standarderror(\"".gettemplate("error_requiredfields")."\");");
--- To this line
>    eval("standarderror(\"".gettemplate("error_referbbtofriend")."\");");
Change this line
<  eval("\$message = \"".gettemplate("email_sendtofriend",1,0)."\";");
--- To this line
>  eval("\$message = \"".gettemplate("email_referbbtofriend",1,0)."\";");
Change this line
<  eval("standardredirect(\"".gettemplate("redirect_sentemail")."\",\"showthread.php?s=$session[sessionhash]&threadid=".intval($threadid)."\");");
--- To this line
>  eval("dooutput(\"".gettemplate("referbbsentemail_thanks")."\");");

REMOVE these 2 lines in referbbtofriend.php:
Code:

$threadid = verifyid("thread",$threadid);
$threadinfo=getthreadinfo($threadid);

2. Create the following 4 custom templates using the files which I have provided in the zip:

referbbtofriend_pop
error_referbbtofriend
email_referbbtofriend
referbbsentemail_thanks

Change my text in these templates to fit your site.

3. Insert the following JavaScript code anywhere on your Board you wish. Try header, footer, top of forums, user cp. Anywhere.

Code:

<!------NEW JS POP BELOW---->
<!-----begin pop up link---->
<script>

function openpopup(){
var popurl="referbbtofriend.php?s=$session[sessionhash]"
winpops=window.open(popurl,"","width=700,height=525,")
}

</script>

<a href="javascript:openpopup()">Tell a friend about your board</a>

<!------end pop up link---><!------END NEW----->

NOTE: In the last line (href) of the JS code above remove the space between java script so it reads javascript

Edited 1-13-02 for new features.


Enjoy :)

Steve_S 01-12-2002 06:33 PM

The screen shot:

SirSteve 01-12-2002 08:48 PM

Pop-up works great BUT can you make it where JUST the e-mail box shows up and not the vB header/footer. As it is now, you could have achieved the same affect by just using a TARGET="_BLANK" in the <A HREF> tag. It would load even faster without all that unneeded stuff.

Steve_S 01-12-2002 09:04 PM

:)

Thanks.

If you used my template from the last zip I posted today for the form you have NO header or fotter for the form. See the file in the zip named referbbtofriend_pop.txt

You need to download the zip I posted for the JS version.

About the only thing I couldn't get just the way I want it is the error if fields are left blank.

HTH

SirSteve 01-12-2002 09:18 PM

Oh, ok. I didn't see any different instructions for those that already had it installed so I just used the code above. Thanks. I am going to check it out now.

SirSteve 01-12-2002 10:15 PM

Ok better, but once you submit the e-mail, it takes you back to the thread in that same window and that page will not fit in there...

Steve_S 01-12-2002 11:19 PM

Nope. You need to start over and properly set up ALL the templates and properly edit referbbtofriend.php file.

NOTE: if you previously installed the "redirect" version but wan't to use the JS pop up version, please start over and download the last zip in this thread :)

At the conclusion of a submit you see the template named:
referbbsentemail_thanks. Check the screen capture I posted today. It works perfectly.

SirSteve 01-12-2002 11:25 PM

I feel stupid... I guess I jumped the gun again. :)

Thanks!

Lucky 01-13-2002 03:17 AM

Great idea!

Loving this one.

Thanks.

Stretchr 01-13-2002 08:53 AM

Hope this isn't a stupid question but is there a way to place this link on the login page, without a user being in a thread? We're going to run a contest but, as a new board, it would be nice to be able to place a referral link there when a user logs in. Thanks :D

Lucky 01-13-2002 02:56 PM

I like that idea.

Steve_S 01-13-2002 03:31 PM

I like the idea but the .php file would need additional hacking so it does not require "&threadid=$threadid" With additional hacking you could place it anywhere as you suggest.

Anyone?

Stretchr 01-13-2002 03:52 PM

That was the problem I ran into. The only way I could think to do it was to make a separate hack, otherwise, modifying the php file would then disable the original hack. Maybe this would be a good suggestion for the next version of VB. Certainly seems like a feature a lot of folks could use.

Stretchr 01-13-2002 03:54 PM

BTW, thank you for this excellent hack. It really is useful. :)

Steve_S 01-13-2002 04:43 PM

You welcome. Your idea is implemented :)

Issue resolved and tested with the JS version. Permits you to place the JS link anywhere you wan't

1. Remove the next 2 lines from referbbtofriend.php

Code:


$threadid = verifyid("thread",$threadid);
$threadinfo=getthreadinfo($threadid);

2. Edit the JS link to read:

Code:


var popurl="referbbtofriend.php?s=$session[sessionhash]"

Place the new JS code anywhere you want and loged in user can use it.

Stretchr 01-13-2002 05:23 PM

Great! Thank you once again! :)

Steve_S 01-13-2002 06:14 PM

This hack is really meant for members who must be loged in. I think this is your issue. Log in and test. Set forum permissions appropriately for Guests so they can't use this form.

HTH

Myke O 01-13-2002 08:22 PM

your missing two semicolins in that script code

Lucky 01-14-2002 01:36 AM

Quote:

Originally posted by Steve_S
You welcome. Your idea is implemented :)

Issue resolved and tested with the JS version. Permits you to place the JS link anywhere you wan't

1. Remove the next 2 lines from referbbtofriend.php

Code:


$threadid = verifyid("thread",$threadid);
$threadinfo=getthreadinfo($threadid);

2. Edit the JS link to read:

Code:


var popurl="referbbtofriend.php?s=$session[sessionhash]"

Place the new JS code anywhere you want and loged in user can use it.

Thanks:)

nafae 01-15-2002 04:33 PM

Ok thanks I got it working! (THX for clarification)

Stretchr 01-15-2002 08:21 PM

You need to look closely at the instructions again. Those are TEMPLATES, not files and referbbtofriend.php is originally sendtofriend.php which you edit and rename and which comes with vB. It gets confusing sometimes, especially when you run into templates named similarly to files. Once I went through carefully and followed the instructions exactly it works great! HTH

Stretchr 01-16-2002 01:44 AM

How do you retrieve the information on the referrals? Does it use the same table as the original referrals under Users in Admin CP?
Thanks to nafae for reminding me to ask an obvious question :D

nafae 01-16-2002 01:57 AM

When I tried to refer someone, they registered, then when i check that referal thing in the admin cp it hasnt changed.. "no referrals for that time period"

hondastyle 01-17-2002 02:02 AM

I just installed this hack on my boards.... verrrrry nice... Now I don't have to keep answering the same question over and over ('how do I get credit for referring somebody... how can I make a direct link to get referral credit..) lol...

Great job - js version is very nice. Thank you for this.

Chris

Steve_S 01-17-2002 04:35 PM

The compliment to my "hacklette" is written by a real coder.

His royal hackness FiireFly. See:

https://vborg.vbsupport.ru/showthrea...threadid=25173

Iv'e not installed his hack but it looks like it lets' you put all the referral data on your board which will continue to encourage folks.

The referral code in my hack works perfectly. Log in and try it. Depending on your Forum Permissions for guests. See member hondastyle Board and thats the way it;s supposed to work.

Note: You can also put the referral link in your email templates and user cp if you wan't to remind your members.

Gutspiller 01-30-2002 08:50 PM

I noticed when I tested this that when the person receiving the email it says something like "blahforum mailer" Is there a way to replace this with the variable that was placed in the "Send To:
(Person's Name)" field? This way they don't think it's a forum mailer and delete it? If this is possible it would be really cool.

Thanks.

BTW if anybody wants to see a demo they can check out my tweaked version of it here:

http://www.theforumz.com/forumz/index.php

You can see it a little lower than the top right. It doesn't work perfectly if you aren't registered, but you still get the idea. Mine is modified a good deal as well.


All times are GMT. The time now is 02:46 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.01264 seconds
  • Memory Usage 1,828KB
  • 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
  • (10)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete