A great add-on would be to add 'x' reputation points to the member who successfully refers a friend that registers. This would add motivation for users to refer new members.
I think this is a great hack. I customized it to include an AIM form for users to AIM friends with the referral link AND e-mail them. If anyone is interested in the code, just PM me.
If someone is not logged in, it will show up as "Unregistered" and referrerid=0. And if they do not have to be logged in, any abuse of the system could go untraceable. If the user is forced to login, and then abuses the system by spamming people, it would at least (unless they edit it out, but not everyone is that smart) have the referrerid link so you could know who it was who abused it in the event that someone complained about it and could send you the e-mail they received.
I spent a good amount of time pulling my hair out searching through calendar.php, private.php, etc. and here on vBulletin.org for a solution, and finally found it. Below, in green, is the code needed to be added to require users to login to see the refer page.
I don't take any credit for this, other than finding and informing everyone of the code. Here is the author's thread.
// Erwin's Refer Hack
if (!$_REQUEST['refer'])
{
if (!($forumperms & CANVIEW) OR !($forumperms & CANEMAIL) OR (($threadinfo['postuserid'] != $bbuserinfo['userid']) AND !($forumperms & CANVIEWOTHERS)))
{
print_no_permission();
}
} if ($bbuserinfo['userid'] == 0)
{
print_no_permission();
}
// Erwin's Refer Hack
I know print_no_permission(); is already in there, but I couldn't get it to work by inserting it with OR or AND into:
if (!($forumperms & CANVIEW) OR !($forumperms & CANEMAIL) OR (($threadinfo['postuserid'] != $bbuserinfo['userid']) AND !($forumperms & CANVIEWOTHERS)))
If anyone has a cleaner or better way, I'm all ears.
Since you have 2 uncached templates, I'm guessing the code has changed slightly between the version of vB3 you are using and RC3. In RC3 I had 1 uncached template and I did this:
In sendmessage.php
Find:
Code:
$globaltemplates = array(
'mailform',
Add below:
Code:
'refertofriend',
Awesome mod Erwin, thanks for sharing.!
great work.
also, for those who are having trouble installing with the permission error: make sure you are REPLACING and not adding in the code!!! thats what happened to me.
also, for those who are having trouble installing with the permission error: make sure you are REPLACING and not adding in the code!!! thats what happened to me.
I don't see it noted, but if someone does refer a friend, will it send their friend a referral link using the member's referral ID?
I think this is a great hack. I customized it to include an AIM form for users to AIM friends with the referral link AND e-mail them. If anyone is interested in the code, just PM me.
If someone is not logged in, it will show up as "Unregistered" and referrerid=0. And if they do not have to be logged in, any abuse of the system could go untraceable. If the user is forced to login, and then abuses the system by spamming people, it would at least (unless they edit it out, but not everyone is that smart) have the referrerid link so you could know who it was who abused it in the event that someone complained about it and could send you the e-mail they received.
I spent a good amount of time pulling my hair out searching through calendar.php, private.php, etc. and here on vBulletin.org for a solution, and finally found it. Below, in green, is the code needed to be added to require users to login to see the refer page.
I don't take any credit for this, other than finding and informing everyone of the code. Here is the author's thread.
// Erwin's Refer Hack
if (!$_REQUEST['refer'])
{
if (!($forumperms & CANVIEW) OR !($forumperms & CANEMAIL) OR (($threadinfo['postuserid'] != $bbuserinfo['userid']) AND !($forumperms & CANVIEWOTHERS)))
{
print_no_permission();
}
} if ($bbuserinfo['userid'] == 0)
{
print_no_permission();
}
// Erwin's Refer Hack
I know print_no_permission(); is already in there, but I couldn't get it to work by inserting it with OR or AND into:
if (!($forumperms & CANVIEW) OR !($forumperms & CANEMAIL) OR (($threadinfo['postuserid'] != $bbuserinfo['userid']) AND !($forumperms & CANVIEWOTHERS)))
If anyone has a cleaner or better way, I'm all ears.
why not just wrap this around the link:
<if condition="$bbuserinfo['userid']"> Refer Link Here </if>
<if condition="$bbuserinfo['userid']"> Refer Link Here </if>
Well, I feel really stupid asking this, but, I'm getting the white screen of "no template" when hitting either "Refer friends" or "Contact us". My templates are in all of my styles, and I've done the php edit without problem. This is a simple hack to install, which is what is making me pull what little hair I have out of my head.
Any suggestions? I know it has to be something simple that I missed.