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)

forsakenseye 08-31-2005 02:44 AM

very nice...thank you...installed

Coach_Guru 09-25-2005 09:28 PM

Great!
Thanks ;)

gethinoakes 09-29-2005 07:21 PM

Great mod, works perfect. Thanks :)

ResaleBroker 10-03-2005 12:02 PM

I do appreciate the kind words. Thank you. :)

trancetopia 10-03-2005 07:57 PM

This mod will be useful. Thanks

zendiver 12-07-2005 01:13 AM

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.

ResaleBroker 12-07-2005 04:08 AM

Quote:

Originally Posted by zendiver
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?

zendiver 12-07-2005 01:45 PM

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*

noppid 12-07-2005 04:03 PM

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 new memberyour referral count will be incremented by oneThe number of referrals you have can be viewed in your <a href="{2}"><strong>{3}</strong></aby other members and guestsYou currently have <strong>{6}</strongreferrals.</p>
<
p>Please be courteous when promoting {1by not spamming other web sites with your referral link just to gain referrals.</p>
<
fieldset id="referrallink"><legend>Referral Link for {4}&nbsp;</legend>{5}</fieldset

Edit the template for this referal hack.

PHP 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_referral].gif" alt="" border="0" /></a>
$vboptions[bbtitle$vbphrase[referrals]: <strong>$referrals</strong>
</
td>
</
tr>
</
thead>
<
tbody id="collapseobj_referral" style="$vbcollapse[collapseobj_referral]">
<
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]6="$referrals">$vbphrase[refid_usercp]</phrase>
</
td>
</
tr>
</
tbody>
</
table>
<
br />
<!-- 
############# END REFERRALS ############# --> 

Thanks for a cool hack.

ResaleBroker 12-07-2005 05:04 PM

A great big "Thank You" to Noppid for working out the hack that makes the number of referrals display properly in the UserCP. :up:

noppid 12-07-2005 05:31 PM

Quote:

Originally Posted by ResaleBroker
A great big "Thank You" to Noppid for working out the hack that makes the number of referrals display properly in the UserCP. :up:

Glad to help. I take it you will post the 3.0.x fix I showed you since mine above was for 3.5.x? :rolleyes:

ResaleBroker 12-07-2005 05:39 PM

Quote:

Originally Posted by noppid
Glad to help. I take it you will post the 3.0.x fix I showed you since mine above was for 3.5.x? :rolleyes:

Yes, I have already revised the code in the original mod to reflect your changes. Thanks again! :)

zendiver 12-07-2005 05:51 PM

You said to add a hook at 'user_complete'. Not sure where you mean to add it. Sorry for the stupidity.

noppid 12-07-2005 05:54 PM

Quote:

Originally Posted by zendiver
You said to add a hook at 'user_complete'. Not sure where you mean to add it. Sorry for the stupidity.


I mistakenly thought this was a vB 3.5 hack. You don't have hooks in vB 3.0.x which this hack is for.

The instructions to fix this hack on vB 3.0.x are in the hack description at the top of this thread.

zendiver 12-07-2005 06:12 PM

So you can't use this in 3.5? Even if you go into and add a new hook?

zendiver 12-07-2005 06:36 PM

Well, I answered my own question. I went ahead and went to Add new plugin, chose 'usercp_complete', referenced with the text "Referral Amount", copied/pasted the php code, and it worked like a charm. Thanks noppid and thanks for the hack RB.

noppid 12-07-2005 06:39 PM

Quote:

Originally Posted by zendiver
Well, I answered my own question. I went ahead and went to Add new plugin, chose 'usercp_complete', referenced with the text "Referral Amount", copied/pasted the php code, and it worked like a charm. Thanks noppid and thanks for the hack RB.


Ok, Great, glad it worked out. I got confused, again. :surprised:

zendiver 12-07-2005 06:42 PM

So RB, now you can say that this actually works on vb 3.5.1 now, not just 3.0.7. :D

noppid 12-07-2005 06:55 PM

Quote:

Originally Posted by zendiver
So RB, now you can say that this actually works on vb 3.5.1 now, not just 3.0.7. :D

I have this packaged and ready to release as a vB 3.5 product when RB is ready. ;)

I have modified the phrase and USERCP Template add in code a bit as well. The box is still collaspable, but when collapsed, it still shows the referrer link for the member.

I also made the link just text. When the link was live, it was too easy to click and activate it while trying to copy and paste it.

zendiver 12-07-2005 06:59 PM

Same here...all packaged and ready, but I modified my results to not have all that text. Just what you see in the screen capture that I already posted.

Thanks for the work on this, both of you.

Boofo 12-07-2005 07:09 PM

Quote:

Originally Posted by noppid
I have this packaged and ready to release as a vB 3.5 product when RB is ready. ;)

I have modified the phrase and USERCP Template add in code a bit as well. The box is still collaspable, but when collapsed, it still shows the referrer link for the member.

I also made the link just text. When the link was live, it was too easy to click and activate it while trying to copy and paste it.

Could you please pm it to me, sir? ;)

ResaleBroker 12-07-2005 09:44 PM

Ok, I've updated the instructions to include both the 3.0.x and 3.5.x versions.

I'll work on getting this packaged for release as a vB 3.5 product.

JeffreySmith 12-08-2005 12:10 PM

HI,

I messed up big time. I wasnt paying to close attention and I modified the usercp.php even though I have 3.5.x, and published the changes, then I got an error message:

Parse error: parse error, unexpected '[' in /home/jeffsmit/public_html/forum/usercp.php(467) : eval()'d code on line 3

at the top of my usercp page on the forum.

I went back and looked over the directions and noticed I was only supposed to modify if I was using 3.0.x. So I erased the:

// REFERRALS
$refcount = $DB_site->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE referrerid = '".$bbuserinfo['userid']."'");
$referrals = vb_number_format($refcount['count']); [/CODE]

That I had previoulsy inserted. Then I republished, now I get the same error message at the top of my user cp.

This is lines: 461-474 as of right now:

// draw cp nav bar
construct_usercp_nav('usercp');

$frmjmpsel['usercp'] = 'class="fjsel" selected="selected"';
construct_forum_jump();

($hook = vBulletinHook::fetch_hook('usercp_complete')) ? eval($hook) : false;

eval('$HTML = "' . fetch_template('USERCP') . '";');

// build navbar
$navbits = construct_navbits(array('' => $vbphrase['user_control_panel']));
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('USERCP_SHELL') . '");');

Does anyone know what I can do to fix this, I dont really even know what I am doing but I am trying to learn as I go. I goofed this time... HELP!

Thank You,

Jeff Smith

ResaleBroker 12-08-2005 12:21 PM

Remove this line of code from the code you provided:
Code:

($hook = vBulletinHook::fetch_hook('usercp_complete')) ? eval($hook) : false;

JeffreySmith 12-08-2005 12:29 PM

Quote:

Originally Posted by ResaleBroker
Remove this line of code from the code you provided:
Code:

($hook = vBulletinHook::fetch_hook('usercp_complete')) ? eval($hook) : false;

I owe you my first born son. It worked!

ResaleBroker 12-08-2005 12:31 PM

Quote:

Originally Posted by JeffreySmith
I owe you my first born son. It worked!

I'm happy to hear your back up and running. :)

lazyseller 12-08-2005 03:34 PM

Thanks alot Resale... waiting for the release

i wish i found your forum before i quit working =) in the sales market..

I got a recommendation though

members from around the world.

maybe a enter forums link... right under that text on your index page...

I recommend some sorta forum link like enter forums or forums somewhere on your page i was a bit lost when i first entered the page because i didnt want to click one of the latest post and that didnt give me any other option other than adsense.

Snake 12-08-2005 04:29 PM

Whoa thanks for the update.

ResaleBroker 12-08-2005 07:20 PM

Quote:

Originally Posted by lazyseller
Thanks alot Resale... waiting for the release

i wish i found your forum before i quit working =) in the sales market..

I got a recommendation though

members from around the world.

maybe a enter forums link... right under that text on your index page...

I recommend some sorta forum link like enter forums or forums somewhere on your page i was a bit lost when i first entered the page because i didnt want to click one of the latest post and that didnt give me any other option other than adsense.

Thanks! :) I promised myself that if anyone brought that up I'd add a link to the forums so... link has been added. Thanks Again!

RaceJunkie 12-09-2005 02:09 PM

Clicks Install

Thank You very much for your time

Jorrit787 12-25-2005 03:01 AM

Works great, except that there seems to be an extra line break at the top of the box (see attached screenshot) - How do I get rid of it?

EDIT: Apparently it only shows the extra linebreak for admins...

RetroDreams 04-02-2006 12:41 PM

Someone needs to finally change this to a plug/product.

ResaleBroker 04-02-2006 02:51 PM

Quote:

Originally Posted by RetroDreams
Someone needs to finally change this to a plug/product.

Sorry, I forgot all about this. I think Noppid said he had this packaged. I'll send him a PM.

noppid 04-04-2006 08:32 PM

Quote:

Originally Posted by ResaleBroker
Sorry, I forgot all about this. I think Noppid said he had this packaged. I'll send him a PM.

I forgot all about this being as it was your idea and original post. I read a post that said I did it, so I'll go look.

lemonpiesaregoo 04-25-2006 05:48 PM

Hello,

I just installed this on http://www.make-money-online.tv/forum. And now that anytime anyone goes to the User CP this message shows up at the top of the window:

"Parse error: parse error, unexpected '[' in /home/makemo3/public_html/forum/usercp.php(471) : eval()'d code on line 3"

any ideas on how I can fix this?

Thanks

ResaleBroker 04-30-2006 01:04 AM

Lemonpiesaregoo, I sent you a PM. If you're still having troubles let me know.

ResaleBroker 04-30-2006 01:18 AM

The 3.5.x product is now available for download. :)

Boofo 04-30-2006 03:13 AM

Quote:

Originally Posted by noppid
I have this packaged and ready to release as a vB 3.5 product when RB is ready. ;)

I have modified the phrase and USERCP Template add in code a bit as well. The box is still collaspable, but when collapsed, it still shows the referrer link for the member.

I also made the link just text. When the link was live, it was too easy to click and activate it while trying to copy and paste it.

How did you have it show the referrer link when it was collasped? I'd like to learn that. ;)

paulfletcher 05-01-2006 11:32 PM

I have a quick question as well. I noticed in the "Downloads" section you have multiple downloads

refid usercp v1.2.zip
product usercp referrals.xml

I've downloaded the .zip and I've followed those instructions and everything appears to be working. But I wanted to check and see if I needed to install the .xml file as well.

Could you let me know if I need to install that as well, after making the needed code modifications.

Thanks,
Paul

ResaleBroker 05-02-2006 12:02 AM

Hello Paul,

The "zip" download is for boards running 3.0.x
The "xml" dowload is for boards running 3.5.x

Cheers,
Jeff


All times are GMT. The time now is 04:19 AM.

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.01406 seconds
  • Memory Usage 1,855KB
  • 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
  • (3)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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