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. :)

bigcurt 06-23-2005 10:33 AM

Yea,I love this but I would much rather have phrases..but eh, thanks alot either way ;).

ResaleBroker 06-23-2005 03:58 PM

Quote:

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

I'll work on putting it into a phrase today. ;)

bigcurt 06-23-2005 04:40 PM

Oh great, thanks alot

ResaleBroker 06-24-2005 03:33 AM

Ok, v1.1 is now available. ;)

Snake 06-24-2005 03:10 PM

Can I have a full 100% screenshot please? That first screeny looks like a bit messed up.

ResaleBroker 06-24-2005 04:34 PM

Quote:

Originally Posted by Snake
Can I have a full 100% screenshot please? That first screeny looks like a bit messed up.

I've uploaded a new screenshot. ;)

bigcurt 06-24-2005 07:17 PM

thanks a MILLION, installing now

/me installs

King Kovifor 06-24-2005 07:18 PM

/me installed this hack...

Chris Etc 06-25-2005 04:32 PM

Excellent idea, thank you.

ResaleBroker 06-28-2005 04:06 PM

Quote:

Originally Posted by Chris Etc
Excellent idea, thank you.

Happy to be of help. :)

Borgs8472 07-04-2005 07:38 PM

Thanks for this easy mod.

/me installed

MichaelJM13k 07-05-2005 06:02 AM

Installed. Thanks man!

ResaleBroker 07-08-2005 07:48 AM

My pleasure! ;)

Caveman2k2 07-11-2005 04:44 PM

/me clicks install

ResaleBroker 07-13-2005 02:00 PM

Quote:

Originally Posted by Caveman2k2
[high]* Caveman2k2 clicks install[/high]

Thanks! :)

bi11i 07-19-2005 12:14 AM

Hey, great job! This combined with the CMPS Banner Manager makes a great referral system which doesn't require too many edits (and zero code edits, i believe...)

http://www.vbadvanced.com/forum/show...ghlight=banner

King Kovifor 07-19-2005 12:39 AM

Any way to make it so that the background isn't transparent?

bi11i 07-19-2005 02:04 AM

I changed
Code:

<td class="page" align="left" width="100%">
to
Code:

<td class="alt1" align="left" width="100%">
In fact, I changed the top line and another to standardize it a bit...:
Code:

<!-- ############### REFERRALS ############### -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<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]: <strong>$referrals</strong>
</td>
</tr>
</thead>
<tbody id="collapseobj_referral" style="">
<tr>
<td class="alt1" 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 ############# -->

but a fantastic mod, much appreciated!

ResaleBroker 07-19-2005 08:45 PM

My pleasure! :)

noppid 08-10-2005 10:31 PM

Nice work. :)

ResaleBroker 08-11-2005 12:57 AM

Thank you for the positive feedback. :)

Boofo 08-11-2005 01:15 AM

Works great on 3.5 RC 2, also. Good job! ;)

Snake 08-12-2005 11:42 AM

I'm waiting for a 3.5 version of this great hack. :)

Boofo 08-12-2005 11:48 AM

Quote:

Originally Posted by Snake
I'm waiting for a 3.5 version of this great hack. :)

Read the post above. ;)

Works as is. ;)

Snake 08-12-2005 12:20 PM

Oh my bad. I'm kinda sleepy here. :p

Hoojie 08-12-2005 02:37 PM

Thanks Jeff. Nice one & the very first thing anybody who asks "How can I promote my forum" should do.

* Hoojie installed

ResaleBroker 08-12-2005 11:15 PM

Quote:

Originally Posted by Boofo
Works great on 3.5 RC 2, also. Good job! ;)

Thanks for the kind words. :)

GT2.0 08-22-2005 09:50 PM

Thanks so much for this!! Good work indeed!

MillerLight 08-28-2005 05:48 PM

Works Great on VB Ver 3.0.8.

How would I go about changing the displayed text to, "White"?

Great Work!

ResaleBroker 08-30-2005 10:36 PM

Quote:

Originally Posted by MillerLight
How would I go about changing the displayed text to, "White"?

Admin Control Panel >> Style Manager >> All Style Options

<td>, <th>, <p>, <li> (Customized in this Style)

Font Color #FFFFFF

...and if you want to change the color of "Referral Link for (User X)"

<legend> (Customized in this Style)
Font Color #FFFFFF


All times are GMT. The time now is 04:52 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.01418 seconds
  • Memory Usage 1,826KB
  • 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
  • (5)bbcode_code_printable
  • (2)bbcode_html_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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