vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - UserCP Referral ID and Count (https://vborg.vbsupport.ru/showthread.php?t=202533)

Phaedrus 01-20-2009 10:00 PM

UserCP Referral ID and Count
 
1 Attachment(s)
While supporting my mini-mod 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

Quote:

Originally Posted by Rene Kriest (Post 1719687)
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

Quote:

Originally Posted by Phaedrus (Post 1719690)
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

Code:

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:

Code:

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

Quote:

Originally Posted by C138 Kaysone (Post 1719875)
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

Quote:

Originally Posted by buileminh (Post 1719817)
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

Quote:

Originally Posted by zorag (Post 1720116)
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

Quote:

Originally Posted by Phaedrus (Post 1720046)
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

Quote:

Originally Posted by C138 Kaysone (Post 1722749)
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

Quote:

Originally Posted by Phaedrus (Post 1720046)
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

Quote:

Originally Posted by paintballer.ie (Post 1723565)
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

Quote:

Originally Posted by SVTCobraLTD (Post 1723572)
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:-

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

Phaedrus 01-28-2009 07:48 PM

Quote:

Originally Posted by veenuisthebest (Post 1727439)
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

1 Attachment(s)
Those of you who have high server loads I've modified the product so that the template edits were manual:
Find:
Code:

$template_hook[usercp_main_pos2]
Add below:
Code:

<!--  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

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

Quote:

Originally Posted by Saviour (Post 1737762)
This mod conflicts with the following mod: Icons for UserCP Navbar

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

Quote:

Originally Posted by Phaedrus (Post 1738106)
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

Quote:

Originally Posted by ndut (Post 1754662)
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

Quote:

Originally Posted by fattony69 (Post 1755415)
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.


All times are GMT. The time now is 06:21 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.03072 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
  • (4)bbcode_code_printable
  • (15)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