vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   Referral ID in User CP (https://vborg.vbsupport.ru/showthread.php?t=90849)

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&amp;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:
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}&nbsp;</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 ;)

Zachery 06-22-2005 10:54 PM

Should really be in a phrase if we want to get technical :)

boo.3 06-22-2005 11:28 PM

thx

/me clicks install

Marco van Herwaarden 06-23-2005 04:00 AM

Thanks for sharing this with us. Could you please also provide the instructions in a (zipped) textfile. This makes it easier for those who installed it to use for future vB upgrades.

GetGamer.com 06-23-2005 04:07 AM

I agree with Zachery regarding the use of phrases. I'm in the midst of adding a second language to one of my sites. Anyone have some pointers on how-to modify this mod to use phrases?

Crow 06-23-2005 04:26 AM

/me clicks install.

ResaleBroker 06-23-2005 04:28 AM

Quote:

Originally Posted by MarcoH64
Thanks for sharing this with us. Could you please also provide the instructions in a (zipped) textfile. This makes it easier for those who installed it to use for future vB upgrades.

Sure, no problem. ;)

Marco van Herwaarden 06-23-2005 06:31 AM

Thank you for the fast reaction.

ResaleBroker 06-23-2005 07:29 AM

Quote:

Originally Posted by MarcoH64
Thank you for the fast reaction.

Happy to be of help. :)

Snake 06-23-2005 09:28 AM

Quote:

Originally Posted by Zachery
Should really be in a phrase if we want to get technical :)

I agree with you. That would be alot better. But thanks for the hack. :)


All times are GMT. The time now is 10:56 PM.

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.01535 seconds
  • Memory Usage 1,747KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_html_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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