Version: 1.2, by ResaleBroker
Developer Last Online: Feb 2014
Version: 3.0.7
Rating:
Released: 06-22-2005
Last Update: 05-01-2006
Installs: 173
Template Edits
Code Changes
No support by the author.
This simple modification will add a content box in the User CP displaying the user's "Referral Count", "Referral Link" and a "Referral Message" that can can be customized in the Phrase Manager.
For 3.5.x or higher simply install the product.
For 3.0.x follow the instructions below:
1) Modify USERCP template
Admin CP >> Style Manager >> Edit Templates >> User control Panel Templates >> USERCP
2) Add the Required Phrase
Admin CP >> Language & Phrases >> Phrase Manager >> Add New Phrase
Phrase Type:
Quote:
Global
Varname:
Quote:
refid_usercp
Text:
Quote:
<p>Please help us spread the word about "{1}." When referring others to the community you can use the link below which includes your unique referral ID.</p>
<p>Each time someone follows this link to {1} and registers as a new member, your referral count will be incremented by one.</p>
<p>Please be courteous when promoting {1} by not spamming other web sites with your referral link just to gain referrals.</p>
<fieldset id="referrallink"><legend>Referral Link for {4} </legend><a href="{5}">{5}</a></fieldset>
RB, everything seems to work but one thing and I also noticed it in your screen shot, <strong>$referrals</strong> doesn't show any referrals. It's just blank.
RB, everything seems to work but one thing and I also noticed it in your screen shot, <strong>$referrals</strong> doesn't show any referrals. It's just blank.
Crud, I didn't notice that. Thank you for pointing that out.
Hmmm... that data will need to be pulled from the database. To do this the usercp.php file will need to be hacked. I imagine the code would be similar to the "Referrals" script found in members.php. Writing a script for this is beyond my current abilities.
If another member would like to pitch in and provide a working "Referrals" script that would be great. Of course, credit will be given. Otherwise, I'll the best I could do is remove the referrence to referral count from the mod.
Any takers on the "Referral" script for the usercp.php file?
I am still not really sure why this doesn't work. $referrals is a global variable and used elsewhere in the MEMBERINFO template exactly as you have it. It works there. *shrugs*
Here is my fix. (EDIT: This is for 3.5.x) I liked it so much, I just did it without checking the version. I'll post up the 3.0.7 fix too in a bit.
Add a hook at "usercp_complete".
PHP Code:
// REFERRALS
$refcount = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE referrerid = '".$vbulletin->userinfo['userid']."'");
$referrals = vb_number_format($refcount['count']);
Edit the phrase "refid_usercp".
PHP Code:
<p>Please help us spread the word about "{1}". When referring others to the community you can use the link below which includes your unique referral ID.</p>
<p>Each time someone follows this link to {1} and registers as a new member, your referral count will be incremented by one. The number of referrals you have can be viewed in your <a href="{2}"><strong>{3}</strong></a> by other members and guests. You currently have <strong>{6}</strong> referrals.</p>
<p>Please be courteous when promoting {1} by not spamming other web sites with your referral link just to gain referrals.</p>
<fieldset id="referrallink"><legend>Referral Link for {4} </legend>{5}</fieldset>