ResaleBroker |
06-22-2005 10:00 PM |
Referral ID in User CP
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
Find:
HTML Code:
<!-- ############## SUBSCRIBED THREADS ############## -->
Above that add:
HTML Code:
<!-- ############### REFERRALS ############### -->
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center"
style="background-color:white">
<thead>
<tr>
<td class="tcat">
<a style="float:right" href="#top" onclick="return toggle_collapse('referral')"><img id="collapseimg_referral" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_my_table].gif" alt="" border="0" /></a>
$vboptions[bbtitle] $vbphrase[referrals]: <span class="normal">($referrals)</span>
</td>
</tr>
</thead>
<tbody id="collapseobj_referral" style="">
<tr>
<td class="page" align="left" width="100%">
<phrase 1="$vboptions[bbtitle]" 2="member.php?$session[sessionurl]do=getinfo&userid=$bbuserinfo[userid]" 3="$vbphrase[profile]" 4="$bbuserinfo[username]" 5="$vboptions[bburl]/index.php?referrerid=$bbuserinfo[userid]" >$vbphrase[refid_usercp]</phrase>
</td>
</tr>
</tbody>
</table>
<br />
<!-- ############# END REFERRALS ############# -->
2) Add the Required Phrase
Admin CP >> Language & Phrases >> Phrase Manager >> Add New Phrase
Phrase Type: Varname: 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>
|
3) Modify usercp.php file [VB versions 3.0.x]
Open usercp.php and Find:
Code:
eval('$HTML = "' . fetch_template('USERCP') . '";');
Above that add:
Code:
// REFERRALS
$refcount = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE referrerid = '".$bbuserinfo['userid']."'");
$referrals = vb_number_format($refcount['count']);
4) That's it! You're Done! :)
*A special thanks to Noppid for helping out and getting the referral counts to appear in the UserCP for 3.0.x and 3.5.x versions. ;)
*A special thanks to Boofo for packaging this product for 3.5.x ;)
|