PDA

View Full Version : Miscellaneous Hacks - UserCP Referral ID and Count


Phaedrus
01-20-2009, 10:00 PM
While supporting my mini-mod (https://vborg.vbsupport.ru/showthread.php?t=201754) I came across a more in depth version of what I was trying to do. Once I saw it I had to add it to my site. Since I couldn't find it here, I created something of my own.

This hack will add a collapsible box in your UserCP with a message informing the user what the referral ID is, what it is for, and how to use it. The message can be, of course, rewritten in your phrases to fit your own site and users.

To install, simply install the product below in Manage Products, then of course you should click installed. :up:

Update: Sorry, re-uploaded the xml. I had set the wrong product dependency on the xml. I have removed it. It works again.

(first Code jitters I guess... :D)

Version 1.0.2:
Added a bit of code so that it will remember if you collapse it, or expand it and keep that formation so that you don't have to collapse it each time you go into the UserCP.

Version 1.0.3:
Corrected the query string so that it would not count users that had not been verified or passed through moderation. (user group 3 and 4 are not included in the referral counts now).

re-uploaded 1.0.3, minor change on version listed in the mod.

To upgrade install normally, set "Allow Overwrite" to 'yes'.

Rene Kriest
01-21-2009, 02:47 AM
Rocks! And even with a screenshot. ;)

This is way to go. Many ppl forget about the Why in their functions - why users should make use of it.

Edit: bring back the script! :)

Phaedrus
01-21-2009, 02:50 AM
Rocks! And even with a screenshot. ;)

This is way to go. Many ppl forget about the Why in their functions - why users should make use of it.

Edit: bring back the script! :)

Thanks. That was one quick reply!

Rene Kriest
01-21-2009, 02:54 AM
Thanks. That was one quick reply!
I already enjoyed you mini-mod. Thanks for this script. I really appreciate it. :)

lazydesis
01-21-2009, 04:48 AM
i got this error when trying to import the product


The following dependencies were not met:

1. The product 74201 must be installed before this product may be installed. (Compatible starting with 3.6.0)


i am running vb 3.8

Mukashi
01-21-2009, 05:01 AM
Got the same error sadly.

TandyServices
01-21-2009, 06:02 AM
I have it too

buileminh
01-21-2009, 06:32 AM
How can the user see who he has referred to the forums?

MandarS
01-21-2009, 07:39 AM
Installed :)

Edit - Not working ! :( Getting same error.. 3.6!

R-D
01-21-2009, 08:07 AM
Edit the xml and remove:

dependencytype="product" parentproductid="74201"


Then it works fine.

C138 Kaysone
01-21-2009, 08:09 AM
thats because you got the idea From me haha :D or did you... lol

Phaedrus
01-21-2009, 11:59 AM
Crap. I mistyped the compatibility...

LOL.

Phaedrus
01-21-2009, 11:59 AM
thats because you got the idea From me haha :D or did you... lol
Yeah, I saw it on your site and had to do it, but I couldn't find it anywhere so I wrote my own!

:D

Phaedrus
01-21-2009, 12:07 PM
How can the user see who he has referred to the forums?

I haven't added that one, it just counts it doesn't show who you referred. Hmm... An idea...

I'll see what I can do.

zorag
01-21-2009, 01:40 PM
Will this work with 3.7.x ?? Anyone tried yet..

Phaedrus
01-21-2009, 01:57 PM
Will this work with 3.7.x ?? Anyone tried yet..
It will. It should work as far back as 3.6.

buileminh
01-21-2009, 02:01 PM
I haven't added that one, it just counts it doesn't show who you referred. Hmm... An idea...

I'll see what I can do.
Thank you in advance!

If you can, please display users referred by him in this month, this year or give each user option to choose the time frame.

If you can do more, please add post count of each referred user because sometime, we want to ensure that they all are real referred person, not a faked referred members.

If you can do even more, please give user choose the minimum post counts of each referred in order for the referred user be displayed.

Hornstar
01-22-2009, 05:00 AM
Thanks, will update to this version soon.

digicom
01-22-2009, 06:40 AM
Thanks Installed :up:

C138 Kaysone
01-23-2009, 09:20 PM
Well imma put mine on disable and see what yours is like different from the one i have

Phaedrus
01-24-2009, 01:49 AM
Well imma put mine on disable and see what yours is like different from the one i have
Cool. :up:

paintballer.ie
01-24-2009, 06:48 PM
I haven't added that one, it just counts it doesn't show who you referred. Hmm... An idea...

I'll see what I can do.

Installed. Nice mod.

Allowing people to see who they have refferred indeed would be a great feature :)

SVTCobraLTD
01-24-2009, 06:53 PM
Works on 3.6.11! Thank you.

Phaedrus
01-25-2009, 01:43 AM
Installed. Nice mod.

Allowing people to see who they have refferred indeed would be a great feature :)

Yeah, I've just got to get some time to really dig in and start adding to it. I'll work on it.

Phaedrus
01-25-2009, 01:44 AM
Works on 3.6.11! Thank you.
That's great! I'm glad there's somebody using it on that version.

veenuisthebest
01-27-2009, 03:50 PM
I remember Boofo's mod (in grave now) that does and look the same. It had a bug of showing 1 extra referral count.

This one's good. Thanks :)

veenuisthebest
01-28-2009, 06:11 PM
Your mod will show incorrect referral count as vbulletin also block usergroups 3 and 4 to not to be included. Change the query to this:-

$refcount = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE referrerid = '".$vbulletin->userinfo['userid']."' AND usergroupid NOT IN (3,4)");

Phaedrus
01-28-2009, 07:48 PM
Your mod will show incorrect referral count as vbulletin also block usergroups 3 and 4 to not to be included. Change the query to this:-


LOL. I didn't think of people who hadn't gone through verification.

Danke, and updated.

Julie
02-02-2009, 07:21 PM
Very nice, installed! :)

lasto
02-02-2009, 09:35 PM
Installed on 3.8 seems fine so far

Nadeemjp
02-02-2009, 11:34 PM
very nice hack. a very constructive one.
installed and clicked installed:)

TheInsaneManiac
02-03-2009, 01:58 AM
Those of you who have high server loads I've modified the product so that the template edits were manual:
Find:
$template_hook[usercp_main_pos2]

Add below:
<!-- REFERRALS IN USER CP -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat">
<a style="float:$stylevar[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="$vbcollapse[collapseobj_referral]">
<tr>
<td class="alt1" title="$bbuserinfo[username]'s $vbphrase[referrals]" width="100%" align="left">
<phrase 1="$vboptions[bbtitle]" 2="$vbphrase[referrals]" 3="member.php?$session[sessionurl]u=$bbuserinfo[userid]" 4="$vbphrase[profile]" 5="$bbuserinfo[username]" 6="$vboptions[bburl]/index.php?referrerid=$bbuserinfo[userid]" >$vbphrase[refid_usercp]</phrase>
</td>
</tr>
</tbody>
</table>
<br />
<!-- END REFERRALS IN USER CP -->

Phaedrus
02-03-2009, 02:11 AM
Cool.

Saviour
02-08-2009, 02:02 PM
This mod conflicts with the following mod: Icons for UserCP Navbar (https://vborg.vbsupport.ru/showthread.php?t=202000)

The screenshot you supplied shows a link to Your Referral Link in the Your Profile section of the UserCP menu.

I have installed this mod and it does not show this link...otherwise, it works fine.

You may want to take this into consideration and modify your code to allow for this.

Phaedrus
02-08-2009, 10:21 PM
This mod conflicts with the following mod: Icons for UserCP Navbar (https://vborg.vbsupport.ru/showthread.php?t=202000)

The screenshot you supplied shows a link to Your Referral Link in the Your Profile section of the UserCP menu.

I have installed this mod and it does not show this link...otherwise, it works fine.

You may want to take this into consideration and modify your code to allow for this.
Actually that's from a different mod. This mod doesn't add that link. That was my mini-mod in the Template Mods area.

Can you link me to the mod it conflicts with? I need to find out what they are hooking on and choose something different so they won't conflict.

Saviour
02-08-2009, 10:54 PM
Actually that's from a different mod. This mod doesn't add that link. That was my mini-mod in the Template Mods area.

Can you link me to the mod it conflicts with? I need to find out what they are hooking on and choose something different so they won't conflict.

That being the case...then I'd replace the screenshot with one that's actually for this particular mod.

Other than that...like I said...the mod works fine.

ndut
02-25-2009, 09:18 PM
already installed. thanks
but when i click : your refferal for xxx (userid member)
the link, direct me to forum home..

is it true or still have errors?
thank you

Phaedrus
02-26-2009, 01:58 AM
already installed. thanks
but when i click : your refferal for xxx (userid member)
the link, direct me to forum home..

is it true or still have errors?
thank you
You don't want to click the link, you want to use that link at other places to direct them to your site. The link carries your user ID, those people that follow it then register at your site will automatically be credited as referred by you.

fattony69
02-26-2009, 05:54 PM
Will this work for vbseo where it wont modify the url?

Phaedrus
03-01-2009, 01:09 PM
Will this work for vbseo where it wont modify the url?

I don't believe that this would have any problem with vbseo which would translate the url into "vbseo-style" as the user entered, if it was one that would be changed to begin with.

thea1masta
03-02-2009, 04:34 PM
I am having a problem where my referral ID takes my users to a 404 not found error page. Any suggestions?

dklassen
03-04-2009, 12:25 AM
Installed in 3.8 but I have no link in user cp.

rob01
03-04-2009, 12:31 AM
maybe you should add a point system support

like for vbcredits or vbexperience

i mean for each referral that person will get some point/credits

Phaedrus
03-04-2009, 01:09 AM
I am having a problem where my referral ID takes my users to a 404 not found error page. Any suggestions?
Can you post your link from your UserCP? And have you tested this?

Phaedrus
03-04-2009, 01:10 AM
Installed in 3.8 but I have no link in user cp.
Do you have the box? If not you may have made updates to your UserCP that have changed the rewrites I used on this Mod.

What types of other UserCP mods do you use?

Phaedrus
03-04-2009, 01:12 AM
maybe you should add a point system support

like for vbcredits or vbexperience

i mean for each referral that person will get some point/credits
This is also an interesting concept. The next time I get some time I will look into adding some of the suggestions that people have put in here. Unfortunately during the first six months of the year I am busy filling out taxes for non-profits and don't get too much free time to have fun trying to figure this kind of stuff out.

fattony69
03-04-2009, 03:35 AM
maybe you should add a point system support

like for vbcredits or vbexperience

i mean for each referral that person will get some point/credits

If you ever used vbcredits, you would know you can already set up getting points for referrals.

Aclikyano
03-22-2009, 05:37 AM
downloaded it and it says 1.02 not 1.03

Phaedrus
03-28-2009, 02:50 PM
downloaded it and it says 1.02 not 1.03

Hmm... I downloaded it, it is version 1.0.3 and yet it said 1.0.2. I've fixed that and re-uploaded it.

GCSkye
03-29-2009, 08:54 PM
Could you add a vboption that allows people to easily change the text that is displayed in usercp.

820Media
04-15-2009, 10:44 PM
Great Mod!

Installed!

S7rik3R
05-04-2009, 08:40 AM
Fast & Furious ... *Installed in 5sec*

Thanks ~

WIHEE
05-20-2009, 06:32 PM
Installed:
Nice, clean and smooth.

Thank you

DobieGillis?
05-20-2009, 06:46 PM
installed in 5 seconds, excellent work.

Parafal
05-25-2009, 09:16 PM
Installed! ;-)

A question: is there a way to see which member has more referrals? It would be cool to have this possibility for the admin. TOP 10 members with more referrals points. ;-)

But is there a way to see this right now?

trotskid
05-31-2009, 05:47 PM
Hi. I have several objects on UCP page like Tabbed Personal Statistics, group suscriptions.. and UserCP Referral. I wondering if it?s possible move this object down the others, like the fourth position.

Other question. There is no link in "Your Profile" like the screenshot shown (Your Referral Link) on my forum. Why doesn?t appear?

Thank you :)

Bro_Joey_Gowdy
06-10-2009, 06:27 PM
Will this interfere with ragtek's Referrer Tab mod:

https://vborg.vbsupport.ru/showthread.php?t=212505

:confused:

WIHEE
06-11-2009, 05:07 PM
Installed! ;-)

A question: is there a way to see which member has more referrals? It would be cool to have this possibility for the admin. TOP 10 members with more referrals points. ;-)

But is there a way to see this right now?

I have found this Mod for that:
https://vborg.vbsupport.ru/showthread.php?t=101000

and here you can see it how it looks after installed:
http://forums.wihee.net/referrers.php

Good luck!
~Mike

Jamieinnh
06-18-2009, 03:00 AM
This is a great Mod, but for some reason, in the Referral link in the UserCP it has my user name at the end of the url instead of the referral number.

What would be causing this?

ITDarasgah
06-20-2009, 11:38 PM
Install....thanks

Eryeal
07-01-2009, 06:32 PM
Great mod - works fine for me - exactly what I was looking for!

On a side note - I'm shocked that Vbulletin itself doesn't implement something at least similar. Right now it's buried in the FAQ. This should definitely be a customizable option on the standard Vbulletin.

realdx
09-05-2009, 11:29 PM
Simply great! Clean, effective, and very usefull!! Thank you so much!!

TheInsaneManiac
09-27-2009, 04:52 PM
Sweet thanks. I have a feature request, maybe the possibility to see my referrals?

Delifed
09-27-2009, 06:38 PM
Very nice i am gonna use for my forums :)

maXmood
10-21-2009, 04:37 PM
installed and working fine, but how can i edit the message???

thnx

kjsmith84
10-21-2009, 05:05 PM
i have vbadvanced and it is linking to my forums page- is there a way to link it to my homepage?

kjsmith84
10-22-2009, 07:46 PM
i have vbadvanced and it is linking to my forums page- is there a way to link it to my homepage?

bump??

wildCOUNTRY
10-23-2009, 12:54 AM
This gets edited in the USERCP_SHELL template, right?

maXmood
10-26-2009, 02:07 PM
installed and working fine, but how can i edit the message???

thnx

Bump!

anyone ????

dd365media
11-02-2009, 05:48 PM
<font color="Black">I get this message, when trying to install is.

XML Error: syntax error at Line 1
</font>

realdx
11-05-2009, 02:02 PM
will this work with vbadvanced? the original vb index.php has been replaced by the vbavanced one and renamed to indexb.php.. thanks!

Phaedrus
11-08-2009, 09:17 PM
will this work with vbadvanced? the original vb index.php has been replaced by the vbavanced one and renamed to indexb.php.. thanks!

I actually don't know if it would work because the link is the one generated by bvulletin... I can't see why it wouldn't.


I think it would depend on what the url for your home page is. It uses the link generated by vbulletin that points them to index.php...

In you user_cp templates it creates a new template, in that template you would need to find the line below...


6="$vboptions[bburl]/index.php?referrerid=$bbuserinfo[userid]" >$vbphrase[refid_usercp]


And change the "index.php" portion to refer to your index.

Phaedrus
11-08-2009, 09:17 PM
Bump!

anyone ????

You would edit it in phrases.

Edit this phrase: refid_usercp

Phaedrus
11-08-2009, 09:18 PM
I get this message, when trying to install is.

XML Error: syntax error at Line 1


What version are you trying to install it on?

Phaedrus
11-08-2009, 09:20 PM
i have vbadvanced and it is linking to my forums page- is there a way to link it to my homepage?

I think it would depend on what the url for your home page is. It uses the link generated by vbulletin that points them to index.php...

In you user_cp templates it creates a new template, in that template you would need to find the line below...


6="$vboptions[bburl]/index.php?referrerid=$bbuserinfo[userid]" >$vbphrase[refid_usercp]


And change the "index.php" portion to refer to your index.

realdx
11-09-2009, 09:36 AM
I actually don't know if it would work because the link is the one generated by bvulletin... I can't see why it wouldn't.


I think it would depend on what the url for your home page is. It uses the link generated by vbulletin that points them to index.php...

In you user_cp templates it creates a new template, in that template you would need to find the line below...


6="$vboptions[bburl]/index.php?referrerid=$bbuserinfo[userid]" >$vbphrase[refid_usercp]


And change the "index.php" portion to refer to your index.

done! and thanks for the hint! now the referal system is pointing to indexb.htm, that is the original vbulletin index file, thus jumping all the vbadvanced portal, but who cares, is just for the registration... thanks!

P?ŋĭsЋ?я
11-09-2009, 10:54 AM
Thank you very nice :)

Alirezatr
11-23-2009, 08:07 PM
This plugin is awesome.. thanks for your work..:)

Bouncer222
12-24-2009, 08:59 PM
Would this work for vb4? if not, is this going to be upgraded anytime soon please?

Bouncer222
01-16-2010, 09:24 PM
Is anyone going to upgrade this????

I NEED it for vb4 please!

Phaedrus
01-24-2010, 10:46 PM
Is anyone going to upgrade this????

I NEED it for vb4 please!

I haven't upgraded yet... I'll figure out how to upgrade it once I get there. But I am waiting for some other mods that I'll need... Maybe I'll set it up on my 'puter at home and figure it out early as this is one of the mods I'm going to need when I upgrade anyway. I'll see what I can do.

Bouncer222
01-24-2010, 11:58 PM
k please upgrade as soon as possible, many of our users are asking what happened to it in vb4.0.1

enemy@fps
02-07-2010, 10:30 AM
I translated it to German for my need.

If someone is needing it here it is

JWL
03-13-2010, 09:37 PM
This thing totally hosed my forum styles and buttons :down::mad:

I have lost all of my admincp Images, So there is no drop down buttons or arrows. I have to expand all.

This was not until I installed this mod. After I uninstalled it it did not change/

I have tried updating all of the image paths to no avail

Help would be appreciated

*************************
WELL FREAKING BIZARRE - WEIRD -SPOOKY OR WHAT?

For some off reason, Firefox 3.6, just decided to block all images from my site only
How that happened I have no clue at all. Glad to report it WAS NOT THIS MAD

I found the probelme after I logged into Admin CP in IE (EEEuuuuuuu Yukkie DOO DOO)

I then went back to Firefox, put the URL of a Smiley as well as an AdminCP collaps icon and noticed a little line in the Menu box that said

BLOCK ALL IMAGES FROM NorCalCanyonCarvers

So I unblocked it and all is very well indeedy Do

BTW NICE HACK

David Copeland
03-22-2010, 11:09 PM
This thing totally hosed my forum styles and buttons :down::mad:

I have lost all of my admincp Images, So there is no drop down buttons or arrows. I have to expand all.

This was not until I installed this mod. After I uninstalled it it did not change/

I have tried updating all of the image paths to no avail

Help would be appreciated

*************************
WELL FREAKING BIZARRE - WEIRD -SPOOKY OR WHAT?

For some off reason, Firefox 3.6, just decided to block all images from my site only
How that happened I have no clue at all. Glad to report it WAS NOT THIS MAD

I found the probelme after I logged into Admin CP in IE (EEEuuuuuuu Yukkie DOO DOO)

I then went back to Firefox, put the URL of a Smiley as well as an AdminCP collaps icon and noticed a little line in the Menu box that said

BLOCK ALL IMAGES FROM NorCalCanyonCarvers

So I unblocked it and all is very well indeedy Do

BTW NICE HACK

So after all that, what is your verdict on this Add-on?

David Copeland
03-22-2010, 11:10 PM
k please upgrade as soon as possible, many of our users are asking what happened to it in vb4.0.1

Me too!

Should I be using this on my VB 4 forums?

David Copeland
03-23-2010, 01:53 AM
Also, please see this:

http://www.vbulletin.com/forum/showthread.php?346527-How-to-I-get-the-Referral-url-links-working-for-my-Members&p=1950516#post1950516

Phaedrus
04-02-2010, 12:55 AM
I translated it to German for my need.

If someone is needing it here it is

Thanks.

MagicThemeParks
04-02-2010, 12:07 PM
I actually don't know if it would work because the link is the one generated by bvulletin... I can't see why it wouldn't.


I think it would depend on what the url for your home page is. It uses the link generated by vbulletin that points them to index.php...

In you user_cp templates it creates a new template, in that template you would need to find the line below...


6="$vboptions[bburl]/index.php?referrerid=$bbuserinfo[userid]" >$vbphrase[refid_usercp]


And change the "index.php" portion to refer to your index.

So, if I'm using the vBadvanced as my index/homepage , then I need to do this?

When someone clicks on the referral link, should they be taken to the registration page or will the referral ID 'follow' them when they find the register page?

EDITED: Just tested it and it does 'follow' you without having to do the edit. So, the referrer is already added in the appropriate field when registering. :up:

Also, edited the text by going to Languages & Phrases >> Search in Phrases >> type refid_usercp in the Search for Text field >> Click radio button for Phrase Text and Phrase Variable Name >> Find

Thanks for the easy and great mod!

Works with both 3.7x and 3.8x :up:

siliconfinance
04-02-2010, 06:37 PM
Is it possible to directly link to this in the USER CP like you can for privage messages or thread subscriptions?

Winter Sonata
07-20-2010, 04:22 AM
wonderful,

installed

Winter Sonata
07-23-2010, 06:35 PM
will that work for VB4

valcha
07-31-2010, 04:17 AM
Does it work with Version 4.0.3?

Boofo
07-31-2010, 09:12 AM
Does it work with Version 4.0.3?

No, but this does:

https://vborg.vbsupport.ru/showthread.php?t=243455

Phaedrus
09-26-2010, 06:50 AM
No, but this does:

https://vborg.vbsupport.ru/showthread.php?t=243455

True that. Thanks.

Scyther
06-28-2011, 05:46 PM
Cool mod.
Marked installed.

mapleleaffans
08-27-2011, 11:26 PM
Nice mod! Thank you! :)

Spectre_Aidan
09-29-2011, 11:36 AM
mod works perfectly on my forum :D thanks for this great piece of work :D