View Full Version : Refer Friends!
Unknown553
06-26-2002, 10:00 PM
First off, I need to thank c-pr0mpt's template driven pages (https://vborg.vbsupport.ru/showthread.php?s=&threadid=36600) hack for helping me with the online bit and template help.
Second, I must add a disclaimer. I am NOT fluent in PHP and this is my first publicly released hack. This may not be perfectly coded or the most efficient, but I have tested this numerous times on fresh vB's as well as hacked vB's and installation went smoothly every time, so I hope it works for you. I tried my best to make this hack as compatible as possible but I am sure I could have messed up somewhere. This is mostly an addon but optional integration is also supplied in the hack. If installation gets messed up it's not hard to revert, but it never hurts to backup your database first.
Now onto the details of the hack. This hack creates a new page for members that will send out emails to people of their choice with their referral links in them. It's a great way to get your members to promote your site. You could also start a referral contest and grant special prizes, like a custom title or avatar, to whomever gets the most referrals. You do not have to have referrals on, but it would help if you wanted to keep track of who has referred the most members. :)
Features:
1) Only registered members can use the referral page, guests will get an error page.
2) An error will also occur if a required field is left blank
3) Users can refer 3 friends at a time
4) Users can edit the title and message of their outgoing referral email
5) The user's referral link is in the email message by default (index.php?s=&referrerid=xxx)
6) Default title and message can be edited in the refer.php page
7) "Referring Friends" link appears in the who's online page when a member is referring people
Only 1 file edit (optional)
Only 1 template edit (optional)
3 new templates
1 new PHP file
4 screenshots in my next posts.
Support will be given, but as I said before, I am not fluent in PHP or MySQL, so I can't guarantee that I can make every addon or fix every error.
UPDATE: If you get a bug that sends you straight to the error page, install version 2.0 (https://vborg.vbsupport.ru/attachment.php?s=&postid=280848). If the hack is already working for you, do not install version 2.0. This is just a bug fix, a patch, and is only needed if you can't get the original hack to work properly.
Enjoy.
-Marcus
Unknown553
06-27-2002, 08:01 PM
Main referral page.
Unknown553
06-27-2002, 08:01 PM
Successfully sent
Unknown553
06-27-2002, 08:02 PM
Error
Unknown553
06-27-2002, 08:02 PM
In the online page...
zachb
06-27-2002, 08:03 PM
Very nice, adding right now. :)
*clicks install button* :)
pseudocode
06-27-2002, 08:37 PM
Maybe I'm missing something. But, when I click on Refer Friends, I go directly to the error page. What could be wrong?
Unknown553
06-27-2002, 08:50 PM
Check the link and make sure it is pointing to "refer.php?s=$session[sessionhash]"
Also make sure you're logged in. I tried linking directly to &action=compose and it took me directly to the error page too. When I took it out, it worked. If it still doesn't work try removing ?s=$session[sessionhash] too.
afterlab
06-27-2002, 09:07 PM
Good job, i'll install it after a good 'ol game of B-Ball i'm in. Be back in 3 hours! :D
pseudocode
06-27-2002, 09:16 PM
Originally posted by Unknown553
Check the link and make sure it is pointing to "refer.php?s=$session[sessionhash]"
Also make sure you're logged in. I tried linking directly to &action=compose and it took me directly to the error page too. When I took it out, it worked. If it still doesn't work try removing ?s=$session[sessionhash] too. Tried all of the above to no avail. :ermm:
Razor
06-27-2002, 09:54 PM
Works great. Nice job. :install:
Unknown553
06-28-2002, 08:06 PM
Originally posted by pseudocode
Tried all of the above to no avail. :ermm:
Hmm. Can I get a link to your site so I can see if I can find out what's wrong?
Xelation
06-28-2002, 08:33 PM
just installed, no problems easy as cake to install :D Great Hack my friend!
I just installed this. Now where do I find the "refer friends" link on my page? I can't see it anywhere....
Unknown553
06-29-2002, 07:25 PM
If you did the optional steps it should be in your footer. See the screenshots. It can be moved though, put it wherever you want. :)
<a href="refer.php">Refer Friends</a>
Doesn't have to be in any specific template or anything. :)
bpuetz
06-30-2002, 04:47 AM
I've been looking for a good way to promote referrals -- I'll be installing this shortly. Thanks!
I would also be interested in hearing about ideas for promotions related to referrals. Since my site is based on ancient coins and antiquities, I expect I'll give away ancient coins for the top three referrers over some period. Is 90 days too long? Other ideas?
Bill
Unknown553
06-30-2002, 03:56 PM
90 days sounds good to me. Since I don't have anything to offer I just give away custom titles and avatars...Not much but at least it's some kind of motivation.
Ryan McBain
06-30-2002, 04:25 PM
the hack looks awesome, i want to install it but I would need some button icons for the refer link. can anyone help me?
http://www.ryanmcbain.com/forums
bpuetz
06-30-2002, 07:33 PM
Ryan,
Have you looked at this: vButtonPro (http://www.vbulletin.com/forum/showthread.php?s=&threadid=48870)
Makes buttons a piece of cake, as long as you have PhotoShop 7.
Bill
Works great! Last question, I swear.
Where do I go to see who referred who?
Ryan McBain
07-01-2002, 05:23 AM
Originally posted by bpuetz
Ryan,
Have you looked at this: vButtonPro (http://www.vbulletin.com/forum/showthread.php?s=&threadid=48870)
Makes buttons a piece of cake, as long as you have PhotoShop 7.
Bill
i dont have photoshop 7 lol
Unknown553
07-01-2002, 07:51 PM
Originally posted by Ryan McBain
the hack looks awesome, i want to install it but I would need some button icons for the refer link. can anyone help me?
http://www.ryanmcbain.com/forums
I'm not much of a button maker myself, so I can't help you. I'd ask whoever made your other buttons to make you another custom one, or just put a text link in the footer.
Unknown553
07-01-2002, 07:56 PM
Originally posted by Mr H
Works great! Last question, I swear.
Where do I go to see who referred who?
This requires more hacking. It's very small though. I have it added on my forum as well.
http://www.vbulletin.com/forum/showthread.php?s=&postid=152325#post152325
In a members profile it will say something like
Referrals: 2 (username1, username2)
Or you can use FireFly's "Full List of Referrers and Referrals (https://vborg.vbsupport.ru/showthread.php?s=&threadid=25173&highlight=top+referrer)" hack :)
Pilot
07-03-2002, 07:07 PM
VBstats hack shows top referrers etc
Unknown553
07-04-2002, 05:53 PM
I don't believe it shows an entire list though. I don't use it so I'm not familiar with it.
Okay, I added the Firefly referreal hack. It works :)
Is there anywhere to go to find a "top referrers" link or do I have to click on everyones profile to see who was the top referrer?
Unknown553
07-05-2002, 07:40 PM
The last link I posted does exactly that. FireFly's Top Referrers list. See one in action here (slightly modified):
http://moacsupreme.com/forum/reflist.php
thenetbox
07-26-2002, 01:51 PM
VERY nice :) its running on my site
http://www.darkforum.com/darkforum
X-Fan
07-28-2002, 03:21 PM
I'm having the same problem - clicking the Refer Friends link brings up the error page straight away, even though I'm logged in.
I tried removing the sessionhash bit from the link, but the error page still came up.
Any ideas?
Unknown553
07-28-2002, 08:15 PM
Hmm, try this:
in refer.php, find
// check to see if they're logged in
if ($bbuserinfo[userid]) {
and change it to
// check to see if they're logged in
then find
} else {
// if guest/not logged in, show error
eval("dooutput(\"".gettemplate('refer_error')."\");");
}
and delete it all. This will give guests access to the page, but I think it will fix your problem, I removed it from my site and haven't gotten any error reports. Let me know if that works.
X-Fan
07-29-2002, 02:05 AM
Still getting the error page.
Unknown553
07-30-2002, 05:44 PM
Odd....Are you linking to refer.php or refer.php?action=compose? If one doesn't work try the other....
BaluX
08-01-2002, 07:24 PM
would it run with 2.2.1 also ???
Unknown553
08-02-2002, 04:20 AM
Yes, it should run fine on 2.2.1.
Destee
08-03-2002, 10:04 PM
Unknown ... great hack and thank you!
I installed it on my test forum and it worked perfectly but when I tried doing the same on my live forum (same server), I am going directly to the error page! :( I tried the suggestions already provided, as well as going back through the steps several times. I can't see what is causing it to respond differently.
Destee
Unknown553
08-04-2002, 03:52 AM
I have no idea why it works on some servers and not on others. Your situation is even more strange considering that it's the same server. I don't know what else there is to do, maybe try an uninstall and re-install? Also, did you do the optional steps? If so, which ones? Maybe that has something to do with it...
Destee
08-04-2002, 04:42 PM
Unknown ... thanks for your response. Yes, my experience is really weird and very frustrating because I know this hack works and I want it on my forum!
I've uninstalled / reinstalled, all of that, and can't get it to work properly on my live forum. I even tried editing the file(s), putting the refer template content into the refer_error template (since that is the one it gets), but it didn't include any of the default text (email heading, body, userid, etc.) only the blank form, which worked but looked too much like a spammer's heaven for me to leave this way. I'm not familiar enough w/php to be twisting things like this ... so I'm going to look jealously at those who are using this as I think of something to replace my new and never used Refer Your Friends link.
Thanks Again.
Destee
ps ... I didn't do any of the optional steps.
Unknown553
08-04-2002, 06:19 PM
Ok, try installing this new version 2.0. Erwin found out the problem and this should fix it. Upload the two new files (overwrite refer.php if you still have it uploaded) and copy/paste the new "refer" template. The other two templates are unchanged. Hope it works!
Destee
08-04-2002, 06:58 PM
Thank You Very Much Unknown and Erwin!
It works perfectly for me now !!!!
:cool:
Destee
Unknown553
08-04-2002, 07:31 PM
Great! Glad you like it. :D
Destee
08-04-2002, 11:57 PM
Unknown ... can you tell me how to include a bcc of each referal to myself? I'd like to monitor it since the fields can be edited and used for any purpose.
Thanks,
Destee
Unknown553
08-05-2002, 04:33 AM
Edited...Fixed code in my next reply.
Destee
08-05-2002, 05:46 AM
Thanks Unknown ... I rec'd the following:
Parse error: parse error in ... /forums/refer_send.php on line 25
Unknown553
08-05-2002, 09:05 PM
I'm sorry, scrap that whole idea.
Just change this
// if error free, then send mail
mail($to,$title,$message,"From: $bbuserinfo[email] ($name)");
to this
// if error free, then send mail
mail($to,$title,$message,"From: $bbuserinfo[email] ($name)\r\n"."Bcc: $webmasteremail");
Destee
08-05-2002, 09:21 PM
Unknown ... you are Da Man !!! ... if you're male ... hehehe :)
Thank you very much !!! This worked !!!
Simply Loving Your Hack!
Destee
Unknown553
08-06-2002, 01:51 AM
Great, glad you like it! :)
And yes, I am a male. ;)
Destee
08-08-2002, 09:19 AM
Hi Unknown ... it's me again ... :) ... All of my referals are including my userid (1) and username in the email body ... and not the actual user's id/name ... I tested it with a few other usernames/id's ... can you tell me what code I need to change to correct this (so that it picks up the actual user's id)?
FYI ... this is what I have in refer.php ...
$bburl/index.php?s=&referrerid=$bbuserinfo[userid]
\n\nThanks, and I hope to see you soon.
\n\n-$bbuserinfo[username]";
Thanks,
Destee
ps ... I promise, this will probably be the last time I bother you ... for this particular hack ... :)
Unknown553
08-08-2002, 10:34 PM
Make sure you have require('./global.php'); at the top of the file. Also maybe try changing $bbuserinfo[userid] to $bbuserinfo['userid'].
Destee
08-08-2002, 11:26 PM
Unknown ... thank you for responding. I'm sure folk like me make folk like you think twice about sharing a hack.
The reason I was experiencing the above was because I had hard coded the text in the refer template (including my userid and everything). My Bad.
I promise ... no more questions from me ... and who knows, now that you've spent countless moments with me regarding this hack ... I may be able to help someone else. :)
All is well.
Destee
Unknown553
08-08-2002, 11:39 PM
No problem. I am aware that support comes along with releasing hacks. Just glad it finally works 100% for you. :)
snoopy2
10-30-2002, 02:12 AM
works great, thx!
esawdust
11-09-2002, 04:13 PM
Great Hack!
One Question.. how would I go about adding the # of referals to part of a users stats within their posts?
For instance
adding "Referrals: "
under the registered date, location, and posts?
I think this would make it a bit more "competitive" and enitice people to refer more.
Thanks
Greg
NuclioN
12-02-2002, 10:16 AM
huh? Can't open firefly's referrallist page.
Visionray
12-03-2002, 03:37 PM
this is a great hack! I hope to get some new members this way by offering a prize to the first person to refer 10 members. Thanks!
Red Blaze
02-07-2003, 03:37 PM
Excellent, very nice hack, without flaw. :)
Marulatree
03-26-2003, 03:18 PM
06-29-02 at 07:35 PM Mr H said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=267342#post267342)
I just installed this. Now where do I find the "refer friends" link on my page? I can't see it anywhere....
I think you have to create your own link in the navbar. e.g. www.yoursite.com/refer.php.
clicks install! nice one M8!
wolfe
03-29-2003, 08:36 PM
its not sending emails
The Piper
04-24-2003, 05:03 AM
Is there any way to allow non members to also refer friends?
Thanks a lot!
Marulatree
05-27-2003, 03:07 PM
All of my members still get the error page when clicking on refer a friend link. Any ideas. I have installed version 2.0
08-04-02 at 08:19 PM Unknown553 said this in Post #39 (https://vborg.vbsupport.ru/showthread.php?postid=280848#post280848)
Ok, try installing this new version 2.0. Erwin found out the problem and this should fix it. Upload the two new files (overwrite refer.php if you still have it uploaded) and copy/paste the new "refer" template. The other two templates are unchanged. Hope it works!
Oblivion Knight
05-28-2003, 08:42 AM
Thankyou Unknown553,
Installation with the original zip seems to be running perfectly ok, though currently it has only been tested with staff and not members. I'm sure I'll soon get told if it isn't working correctly ;)
Great modification, and finally an incentive to get my members referring their friends (I have custom status' turned off which my members HATE, the idea of winning one will cause a frenzy).
* Oblivion Knight clicks install.
Evil Chris
05-28-2003, 01:57 PM
Installed on bornamerican.com
Many thanks. Cool hack.
Looks great, will it work on 2.2.9?
gmarik
06-10-2003, 12:09 PM
Seems quite useless to me. Does people use the option?
Seems to work well on my 2.2.9...
BTW - any way of adding a disclaimer on the bottom of the e-mail message; stating that the message is sent by MEMBERNAME and replies should be sent to MEMBEREMAIL, and abuse should be reported to WEBMASTEREMAIL?
I've added this manually, however users will be able to alter or completely remove this... In the similar function "email this page", this additional disclaimer text cannot be altered, and is not shown to the user prior to sending the message.
Regards,
TMM
gspot
06-16-2003, 11:05 PM
Ok, I have a problem, when someone refers someone else, where can you tell that each member has sent how many referals? Or is this counted when someone actually signs-up to the board from the link in the referal email? I can't find it anywhere where the referals are actually counted and displayed per user? Does this script actually do this?
dstruct2k
06-16-2003, 11:34 PM
It only counts the number of people that sign up and say $username referred me... It could keep track of how many referrals were sent with a bit of editing. It wouldn't be too hard to do, it would just require a query to be run.
EDIT -- I decided to make this. I'll be done right away, just testing.
gspot
06-17-2003, 12:56 AM
Man, that would be awesome.. Thanks.
dstruct2k
06-17-2003, 11:27 AM
Damnit.... Something's wrong with my code. Anyone willing to take a look at it, here it is.
For some reason when I complete the refer process, the databas has 30 total refers in it, no matter how many have been completed.
Dean C
06-17-2003, 11:40 AM
Try this :)
dstruct2k
06-17-2003, 09:17 PM
Addon has been completed, tested, and now works! Someone send me e-mails saying that the $bbuserinfo var holds all the information in the User table for the current user.... I tried adding another un-needed query... :p
Anyways, here's the addon, just replace the PHP and the template, and run this SQL query:ALTER TABLE `user` ADD `referrals_sent` SMALLINT UNSIGNED DEFAULT '0' NOT NULL ;
Once this addon is installed, you can show the current number of sent referrals on any vB page with $bbuserinfo[referrals_sent]
Enjoy!
dstruct2k
06-17-2003, 09:22 PM
Oh, and Mist, you might wanna get rid of that attachment too.... I think it's kinda screwed on the "Sending Mail" line... :smoke:
Marulatree
07-15-2003, 09:21 AM
My members are still having errors - see quote below:
05-27-03 at 05:07 PM Marulatree said this in Post #60 (https://vborg.vbsupport.ru/showthread.php?postid=400606#post400606)
All of my members still get the error page when clicking on refer a friend link. Any ideas. I have installed version 2.0
gspot
01-12-2004, 10:31 PM
This changed script only counts the number of actual verified/registered referred members for your users. It will also only show registered and verified referred members in the refer page (status page). You can edit it how you like, but I'm new to php coding, so please reply with any comments.
I got tired of it counting referred members that wouldn't actually be registered and verified... This fixed that.
Also thanks to unixman - all the referred members are now clickable to their profile.
Attached are the new revised files.
armani1072
02-03-2004, 11:46 AM
thank you works great !!!
Looks great!
does this work with 2.3.0?
gspot
03-07-2004, 04:01 PM
Yes... It works great for version, 2.3.0. I ran it on mine for over 4 months before stepping up to version 3
Good luck hope it helps you. :)
Thanks for the confirmation Gspot!
Since moving to vb3, have you found many of the hacks you had on your vb2 board were automaticallly built into vb3???
Or are you running it with much less hacks?
gspot
03-08-2004, 03:43 AM
actually, I'm not installing very many hacks in my vb3 until the gold is released. There are many hacks that are being upgraded to work in vb3, such as the refer friends hack, but everytime you upgrade, you are required to over-right the files you have hacked, so kind of pointless to me at this time until gold is out..
do your members miss any of the old hacks???
I personally only started to hack now, over a year after i got vB, so now the hacks are pretty much rock solid.
Thats my reason for not going to vb3 just yet.
clicks install on vb2.3.0
Thanks Unknown553!
Gspot, i havent added yours yet, as its only on my test board. But i also cant see where to add your code? Have i missed something? where are your instrauctions?
gspot
03-12-2004, 10:38 PM
sorry, download the files that the original designer created for this hack and compare the ones that I have attached. If you want to use exactly whay my addition adds-on. Then just go ahead and use the files I have attached in place of the original hackers files.. They are named the same. Then all you have to do is add a link to the page as in the instructions from the original hacker..
:) HOPE THIS HELPS..
ashley53680
04-13-2004, 03:39 AM
I am getting this error...
Fatal error: Call to undefined function: gettemplate() in /home/sbcamp/public_html/forum/refer.php on line 21
What the heck did I do wrong?? It's pointing to where it gets the template 'refer'... that's exactly what I have the template named. Any ideas?
thanks!!
Ashley
ashley53680
04-20-2004, 09:31 PM
Anyone??
gspot
04-20-2004, 10:23 PM
Anyone??
what version are u using this on??
ashley53680
04-21-2004, 03:17 AM
vb3 gold :)
gspot
04-21-2004, 06:14 AM
vb3 gold :)
You could try changing line 21 to this:
eval('print_output("' . fetch_template('refer') . '");');
Or you can just download and install the modified version for VB3 Gold. This would probably save alot of headaches for you.. Here is the link:
https://vborg.vbsupport.ru/showthread.php?t=59708&highlight=refer
ashley53680
04-21-2004, 02:51 PM
Thanks G-Spot (giggle) :)
I thought I had a new version of it... but I will download it again and see if that works!! THANKS A BUNCH!!!
Ash
ashley53680
04-21-2004, 02:53 PM
Hey... isn't that a totally different hack? The one I was interested in was where you could add multiple emails at one time. I mean the other is great too... but I thought that this one would be better. :)
gspot
04-21-2004, 03:00 PM
Hey... isn't that a totally different hack? The one I was interested in was where you could add multiple emails at one time. I mean the other is great too... but I thought that this one would be better. :)
Yes, this one is a little bit better, because if the multiple email address referrals, but the other hacler is working on adding that feature as well. Did that help at all??
ashley53680
04-21-2004, 03:09 PM
Hmm, I got the new one on... and it gives me a blank page when I click on the refer friends in the footer. I better go ask this question in the other thread. ;)
gspot
04-21-2004, 03:13 PM
Hmm, I got the new one on... and it gives me a blank page when I click on the refer friends in the footer. I better go ask this question in the other thread. ;)
Ya, try after the second replacement in sendmessage.php to add an } at the end of the replacement.. That should do it.. I noticed the guy forgot that in his modification instructions.. Let me know.
**I just edited this, wrong filename I had listed before.. :( sorry
ashley53680
04-21-2004, 03:47 PM
Thanks it worked!!!! :cheer: :yippee: lol
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.