PDA

View Full Version : Referrers On Forumhome v.1.3


tnguy3n
22 Nov 2005, 10:26
Top XX Referrers In FORUMHOME
Author: tnguy3n
Support Site: www.++++++.org

This plugin pulls out XX top referrers in your database and display it on your FORUMHOME. When you click on the referrer's name, it shows the list of users that the member referred in a popup window.
To change number of referrers to show, open the plugin, and change $num to your own value.

INSTALLTION: 2-3 mins
- plugin: 2
- template mod: 1
- new template: 1

CHANGES SINCE v.1.0
- show lists of users the member referred in a popup window

UPLOAD plugin-referrer.xml in your Plugin Manager, then apply template mod as in top_referrers_on_forumhome.txt file. For those who want to upgrade to version 1.2, follow instructions in upgrade.txt file.

Pls click on "INSTALL" buttons if you use it.

Loki12
22 Nov 2005, 10:32
Excellent! Clicks install.

Loki12
22 Nov 2005, 10:53
How about adding the username html markup to this? It looks odd when this is not shown on this hack, but it shows on the other stats, like members currently online and members online today...

trancetopia
22 Nov 2005, 12:46
What a great visible incentive for members to spread the word :) Thanks - installs!!

Snake
22 Nov 2005, 12:49
Installed. ;)

Living in music
22 Nov 2005, 14:01
Installed. :)

Vizionz
22 Nov 2005, 14:58
installed thanks for this hack :)

tnguy3n
22 Nov 2005, 15:36
How about adding the username html markup to this? It looks odd when this is not shown on this hack, but it shows on the other stats, like members currently online and members online today...

Updated!
This new version adds html tags for usergroups (if any).

To upgrade from old version, just simply delete the old plugin in AdminCP->Plugin Manager, then reupload the new one.

tnguy3n

Loki12
22 Nov 2005, 16:24
Updated!
This new version adds html tags for usergroups (if any).

To upgrade from old version, just simply delete the old plugin in AdminCP->Plugin Manager, then reupload the new one.

tnguy3n

Thanks :)

Qwest
22 Nov 2005, 18:07
Dude.... since 3.5 I absolutely CANNOT stop installing mods. It's just too easy!

*installs*

Ncturnal
22 Nov 2005, 21:47
Nice. Any chance of getting this for vBAdvanced CMPS? Nice hack.

G-Force 199
23 Nov 2005, 07:32
May I show it on my vBAdvanced CMPS homepage ?

Dollah
23 Nov 2005, 08:49
There seems to have been a problem with the OneWorldOneHood database.
Please try again by clicking the Refresh button in your web browser.

An E-Mail has been dispatched to our Technical Staff, whom you can also contact if the problem persists.

We apologise for any inconvenience.

dont know what i'm doing wrong pleas advise

tnguy3n
23 Nov 2005, 10:49
@ Dollah: what version of MySQL you run on your server?

tnguy3n
23 Nov 2005, 10:57
For those who want to shows it on CMPS, try this add-on. However, I don't guarantee it'll work properly as I didn't get to test it on a live site, and I just wrote it based on some existing mods at vbadvanced.com.

To install, just simply import the topreferrers.module file,
then create a new template named adv_portal_topreferrers with following content:
<tr>
<td class="$bgclass">
$showreferrers
</td>
</tr>

Vizionz
23 Nov 2005, 13:54
not valid module file to upload it

tnguy3n
23 Nov 2005, 18:43
Sorry, I don't run CMPS on my site nor have it installed on my PC, so I got no idea what format it is valid and what not. However, you can try this new approach.

NOTE: THIS INSTALLION IS FOR CMPS ONLY.

1. create a php file named topreferrers.php with the content:
<?php
// by tnguy3n @ ++++++.org

// number of top xx referrers to show
$num = 5;

$referrals = $db->query_read("SELECT COUNT(*) AS totalref, user.username, user.userid, user.usergroupid, usergroup.usergroupid, usergroup.opentag, usergroup.closetag FROM " . TABLE_PREFIX . "user AS users LEFT JOIN " . TABLE_PREFIX . "user AS user ON (users.referrerid = user.userid) LEFT JOIN " . TABLE_PREFIX . "usergroup ON (usergroup.usergroupid = user.usergroupid) WHERE users.referrerid != 0 GROUP BY users.referrerid ORDER BY totalref DESC LIMIT 0,$num");
$numref = $db->num_rows($referrals);
if($numref == '0')
{
$showreferrers = "No referrer found!";
}
while($referral = $db->fetch_array($referrals))
{
// display referrals on forumhome
$showreferrers .= "<a href=\"member.php?$session[sessionurl]u=$referral[userid]\" title=''>$referral[opentag]$referral[username]$referral[closetag]</a> ($referral[totalref])<br />;";
}

eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_topreferrers') . '";');

unset($referrals, $numref, $num);

?>

2. create a new template named adv_portal_topreferrers with content:
<tr>
<td class="$bgclass">
$showreferrers
</td>
</tr>

3. In your CMPS block manager, create a new module of PHP file that print results of topreferrers.php.

MThornback
23 Nov 2005, 19:17
I'd love to use this...but something is wrong with the plugin...atleast for me... its not registering the fact that it has " . TABLE_PREFIX . " in the query....and its giving me an SQL error on the forum home...any thoughts?

SnowBot
23 Nov 2005, 19:36
LOOKING GOOD AGAIN MATE :) iNSTALLING

Bounce
24 Nov 2005, 00:51
Great stuff..before I install is there a way it can EXCLUDE admins ??

tnguy3n
24 Nov 2005, 01:22
Great stuff..before I install is there a way it can EXCLUDE admins ??

You can add in the query:
AND user.usergroupid != 6

For multiple groups:
AND user.usergroupid NOT IN(6,7,8,9)

Deimos
24 Nov 2005, 13:15
Great hack, installed aok, but one small problem

On the bar which shows who's the top referrers, i've got this

Flutter (22) Queen Mum (12) Epona (6) Tukaram (6) (6)

As you can see, there's 2 (6)'s after "Tukaram", as if there's another user, but it isn't showing their name?

midaph
26 Nov 2005, 20:35
Installed.

Bounce
26 Nov 2005, 22:43
Great hack, installed aok, but one small problem

On the bar which shows who's the top referrers, i've got this



As you can see, there's 2 (6)'s after "Tukaram", as if there's another user, but it isn't showing their name?

maybe if you lengthen how many it pulls from the db

// number of top xx referrers to show :ninja:

in the plugin file

Bounce
26 Nov 2005, 22:50
You can add in the query:
AND user.usergroupid != 6

For multiple groups:
AND user.usergroupid NOT IN(6,7,8,9)

forgive my non knowledge,where does that go in the query :nervous: :disappointed: :rolleyes: :surprised: :surprised:

G-Force 199
27 Nov 2005, 13:28
I got this error :
Database error in vBulletin 3.5.0:

Invalid SQL:
SELECT COUNT(*) AS totalref, user.username, user.userid, user.usergroupid, usergroup.usergroupid, usergroup.opentag, usergroup.closetag FROM vbb_user AS users LEFT JOIN vbb_user AS user ON (users.referrerid = user.userid) LEFT JOIN vbb_usergroup ON (usergroup.usergroupid = user.usergroupid) WHERE users.referrerid != 0 GROUP BY users.referrerid ORDER BY totalref DESC LIMIT 0,5;

MySQL Error : Unknown column 'usergroup.usergroupid' in 'field list'
Error Number : 1054
Date : Sunday, November 27th 2005 @ 08:25:24 PM
Script : http://localhost/forum/
Referrer :
IP Address : 127.0.0.1
Username : 1st
Classname : vB_Database

tnguy3n
27 Nov 2005, 17:13
forgive my non knowledge,where does that go in the query :nervous: :disappointed: :rolleyes: :surprised: :surprised:


something like the following:
$referrals = $db->query_read("SELECT COUNT(*) AS totalref, user.username, user.userid, user.usergroupid, usergroup.usergroupid, usergroup.opentag, usergroup.closetag FROM " . TABLE_PREFIX . "user AS users LEFT JOIN " . TABLE_PREFIX . "user AS user ON (users.referrerid = user.userid) LEFT JOIN " . TABLE_PREFIX . "usergroup ON (usergroup.usergroupid = user.usergroupid) WHERE users.referrerid != 0 AND user.usergroupid != 6 GROUP BY users.referrerid ORDER BY totalref DESC LIMIT 0,$num");

tnguy3n
27 Nov 2005, 17:16
I got this error :
Database error in vBulletin 3.5.0:

Invalid SQL:
SELECT COUNT(*) AS totalref, user.username, user.userid, user.usergroupid, usergroup.usergroupid, usergroup.opentag, usergroup.closetag FROM vbb_user AS users LEFT JOIN vbb_user AS user ON (users.referrerid = user.userid) LEFT JOIN vbb_usergroup ON (usergroup.usergroupid = user.usergroupid) WHERE users.referrerid != 0 GROUP BY users.referrerid ORDER BY totalref DESC LIMIT 0,5;

MySQL Error : Unknown column 'usergroup.usergroupid' in 'field list'
Error Number : 1054
Date : Sunday, November 27th 2005 @ 08:25:24 PM
Script : http://localhost/forum/
Referrer :
IP Address : 127.0.0.1
Username : 1st
Classname : vB_Database

G-Force 199,
usergroupid is the first field in usergroup table, existing in both vb 3.0.x and vb 3.5.x. Unless you drop the field by accident or conflict with other hacks.

Bounce
27 Nov 2005, 21:40
something like the following:
$referrals = $db->query_read("SELECT COUNT(*) AS totalref, user.username, user.userid, user.usergroupid, usergroup.usergroupid, usergroup.opentag, usergroup.closetag FROM " . TABLE_PREFIX . "user AS users LEFT JOIN " . TABLE_PREFIX . "user AS user ON (users.referrerid = user.userid) LEFT JOIN " . TABLE_PREFIX . "usergroup ON (usergroup.usergroupid = user.usergroupid) WHERE users.referrerid != 0 AND user.usergroupid != 6 GROUP BY users.referrerid ORDER BY totalref DESC LIMIT 0,$num");


thank you sir

/me installed and working 100% :rolleyes:

Boofo
27 Nov 2005, 22:28
Hey, college boy. How's it going? ;)

Any way to have the number of referrals after each name be clickable with a window and a list of the names? Or maybe take you to another page that has a referral listing of some kind for the site? ;)

tnguy3n
27 Nov 2005, 23:00
Hey, college boy. How's it going? ;)

Any way to have the number of referrals after each name be clickable with a window and a list of the names? Or maybe take you to another page that has a referral listing of some kind for the site? ;)

Hey boofy, how is it down there in Des Moines? School is getting more tensed now as it's getting closer to finals.

A popup that lists all of the names is cool, but maybe I'll add another query to get the list since the other one is way too big aleady.

Boofo
27 Nov 2005, 23:06
Hey boofy, how is it down there in Des Moines? School is getting more tensed now as it's getting closer to finals.

A popup that lists all of the names is cool, but maybe I'll add another query to get the list since the other one is way too big aleady.

A new page with how many and the names, too? ;)

Make sure you let me know when you get some free time and we'll hook up since you are this close. ;)

MThornback
28 Nov 2005, 14:03
Database error in vBulletin 3.5.1:

Invalid SQL:
SELECT COUNT(*) AS totalref, user.username, user.userid, user.usergroupid, usergroup.usergroupid, usergroup.opentag, usergroup.closetag FROM vb3_user AS users LEFT JOIN vb3_user AS user ON (users.referrerid = user.userid) LEFT JOIN vb3_usergroup ON (usergroup.usergroupid = user.usergroupid) WHERE users.referrerid != 0 GROUP BY users.referrerid ORDER BY totalref DESC LIMIT 0,5;

MySQL Error : Unknown table 'usergroup' in field list
Error Number : 1109
Date : Monday, November 28th 2005 @ 02:01:26 PM
Script : http://www.webcadets.com/forum/index.php
Referrer : http://www.webcadets.com/forum/arcade.php?&act=Arcade
IP Address :
Username : MThornback
Classname : vb_database


Help, Please?

Dead End Society
29 Nov 2005, 13:18
Yeah I get the same error when I install the plugin....when I uninstall it I can access my forums again. So this means it's conflicting with another hack right?

MThornback
29 Nov 2005, 13:59
Yeah I get the same error when I install the plugin....when I uninstall it I can access my forums again. So this means it's conflicting with another hack right?

I'm thinking it means that we have another hack that dropped that row for some reason, or replaced it with something else...but I wanted to ask to be sure..

tnguy3n
02 Dec 2005, 05:08
A new page with how many and the names, too? ;)

Done as requested. Just download and install new release of the hack. ;)

Make sure you let me know when you get some free time and we'll hook up since you are this close. ;)
We definitely should. My semester will end on the 22nd of December, then I'll have 4 weeks off. If you have chance going to down to IC, give me me a call.

tnguy3n
02 Dec 2005, 05:10
I'm thinking it means that we have another hack that dropped that row for some reason, or replaced it with something else...but I wanted to ask to be sure..

Frankly, I got no idea what caused that bug, but there's a work-around (posted in first post) to fix this bug.

Boofo
02 Dec 2005, 05:52
Done as requested. Just download and install new release of the hack. ;)

Thank you, sir. ;)

We definitely should. My semester will end on the 22nd of December, then I'll have 4 weeks off. If you have chance going to down to IC, give me me a call.

Sounds like a plan. ;)

How long do you have left then?

kurtbarker
03 Dec 2005, 22:17
hey mate, i'm getting:
Database error in vBulletin 3.5.1:

Invalid SQL:
SELECT COUNT(*) AS totalref, user.username, user.userid, user.usergroupid, usergroup.usergroupid, usergroup.opentag, usergroup.closetag FROM vb_user AS users LEFT JOIN vb_user AS user ON (users.referrerid = user.userid) LEFT JOIN vb_usergroup ON (usergroup.usergroupid = user.usergroupid) WHERE users.referrerid != 0 GROUP BY users.referrerid ORDER BY totalref DESC LIMIT 0,5;

MySQL Error : Unknown table 'usergroup' in field list
Error Number : 1109
Date : Saturday, December 3rd 2005 @ 04:16:21 PM
Script : http://commodorelife.com/forums/
Referrer :
IP Address : 220.101.20.174
Username : kurtbarker
Classname : vb_database

any suggestions?

tnguy3n
03 Dec 2005, 22:24
pls read first post for the alternative.

kurtbarker
03 Dec 2005, 23:21
maybe i'm missing it aye, but that 'edit' looks like it's for a different error?

cbr929rrerion
04 Dec 2005, 04:18
It shows the wrong date for "Date Joined". It has the same date for everyone..

Can this be fixed?

tnguy3n
04 Dec 2005, 04:43
It shows the wrong date for "Date Joined". It has the same date for everyone..

Can this be fixed?

I think I missed out the joindate field in my query.

In the plugin,

FIND:

$referrers = $db->query_read("SELECT user.userid, user.username, user.referrerid, users.username AS refname FROM " . TABLE_PREFIX . "user AS users LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.referrerid = users.userid) WHERE user.referrerid = '" . intval($vbulletin->GPC['referrerid']) . "' ORDER BY user.username DESC LIMIT 0, $count");

REPLACE WITH:
$referrers = $db->query_read("SELECT user.userid, user.username, user.referrerid, users.username AS refname, user.joindate FROM " . TABLE_PREFIX . "user AS users LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.referrerid = users.userid) WHERE user.referrerid = '" . intval($vbulletin->GPC['referrerid']) . "' ORDER BY user.username DESC LIMIT 0, $count");

/me updated hack.

cbr929rrerion
04 Dec 2005, 05:02
Done.. Awesome.. fixed.. Thanks

smokering
04 Dec 2005, 06:12
excellent hack thank you

Developer
06 Dec 2005, 08:39
v.nice hack

NoCo7
18 Dec 2005, 16:06
An alternative fix I found for the mysql 'usergroup' table related errors is to adding 'AS usergroup' on the second LEFT JOIN in the initial $referrals query resolves the problem and allows the group markup to work.

$referrals = $db->query_read("SELECT COUNT(*) AS totalref, user.username, user.userid, user.usergroupid, usergroup.usergroupid, usergroup.opentag, usergroup.closetag
FROM " . TABLE_PREFIX . "user AS users
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (users.referrerid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)
WHERE users.referrerid != 0
GROUP BY users.referrerid
ORDER BY totalref
DESC LIMIT 0,$num");

tnguy3n
20 Dec 2005, 01:04
thanks for pointing that out, NoCo7.

update the hack!

neutek
06 Jan 2006, 21:48
thanks :)
+install

cbr929rrerion
13 Jan 2006, 20:38
when I click on the members name it takes me to a page but it dont list them, you can see where they should be but they are not there..

www.crotchrocketracing.com

Its at the bottom.. any idea?

tnguy3n
13 Jan 2006, 21:11
It's supposed to popup in new window. Check if you have all the template modded correctly.

cbr929rrerion
13 Jan 2006, 21:21
I will have to check because it dont do a new window..

cbr929rrerion
18 Jan 2006, 22:04
well i completely reinstalled and it does not work, any idea what I am missing..

Take a look at www.crotchrocketracing.com

Thanks for the help..

MorrisMcD
03 Feb 2006, 06:32
I started getting this error shortly after having this hack installed.. It was fine, but I registered as a new user to test and put the only other user in the database as the referral.. After that I continued to get this error until I disabled the plugins for this hack, and ultimately deleted :(

Fatal error: Cannot use object of type vB_Session as array in /home/html/index.php(485) : eval()'d code on line 172

Any idea why? I like the idea of this mod

payamix1
03 Feb 2006, 07:25
I think you mistaked in editing of FORUMHOME style.

Celtkin
03 Feb 2006, 16:47
Thank you. Clicked install

cbr929rrerion
03 Feb 2006, 16:56
well i completely reinstalled and it does not work, any idea what I am missing..

Take a look at www.crotchrocketracing.com

Thanks for the help..

I will be UN_INSTALLING THIS since no one can assist in pointing out why this is not working correctly for me.

If I can get someone to take a look at it and see what its doing then I would appreciate it, if not I will have to un-install it...

:devious:

o0Hubba0o
12 Feb 2006, 07:26
Nice little add-on, I like it.
/me clicks install

GamerJunk.net
14 Feb 2006, 04:13
Its listing referral links from my forums...if someone views someone's profile and clicks the link to go back it is counting it

GamerJunk.net
14 Feb 2006, 04:14
http://www.gsnforce.com/forum/referrals.php

See how its showing from my own forum?

tnguy3n
14 Feb 2006, 04:39
I will be UN_INSTALLING THIS since no one can assist in pointing out why this is not working correctly for me.

If I can get someone to take a look at it and see what its doing then I would appreciate it, if not I will have to un-install it...

:devious:

check your FORUMHOME template if you have this javascript:
<SCRIPT TYPE="text/javascript">
<!--
function popup(url, referrers)
{
if (! window.focus)return true;
var href;
if (typeof(url) == 'string')
href=url;
else
href=url.href;
window.open(href, referrers, 'width=300,height=250,scrollbars=yes');
return false;
}
//-->
</SCRIPT>

GamerJunk.net
15 Feb 2006, 00:35
I even blocked the gsnforce from showing up yet it still does.

guamdude
15 Feb 2006, 21:25
works just fine.

ubblite
19 Feb 2006, 06:54
It's been a while since the earlier posts, so I was wondering if anyone has been able to get this Mod working with vbAdvanced CMPS?

nonet
21 Feb 2006, 17:00
The popup window does not work for me either. I checked and the code changes are done correctly.

SlowRoasted
22 Feb 2006, 05:51
How can i get this to display in another template? It wont let me just put $showreferrers in another template.

SlowRoasted
23 Feb 2006, 03:54
*bump* anyone know how to get this in another template? I want to put it in my sidebar template but it won't work if I just put $showreferrers in it.

tnguy3n
23 Feb 2006, 04:14
I think if you change the hook to global_start, it would show anywhere on vBulletin powered page.

Drache
02 Mar 2006, 22:37
Does this work with 3.5.4?

budswope
03 Mar 2006, 01:48
I get the message "No Referrer Found" even after new signups?

I love this idea!

kira
05 Mar 2006, 21:56
Does this work with 3.5.4?

It's working in mine so far, although it's only a test board (i.e. not 'live' yet).

Many thanks for this nifty little plugin. I think it'll add a nice incentive to refer more people to a community!

sunnycher
09 Mar 2006, 17:00
Thank you! This works perfectly! was just inquiring about one of these!

Treak
10 Mar 2006, 05:59
amazing hack thanks again.. very useful for a contest i am running!!

GuaRRand
10 Mar 2006, 12:26
completely screwed up my forum :(

cant even load the main page anymore...

www.glcoti.com

Pls help!!!!!

MorrisMcD
10 Mar 2006, 14:32
completely screwed up my forum :(

cant even load the main page anymore...

www.glcoti.com

Pls help!!!!!

Same thing happened to me.. could never get this working for some reason

go to http://yoursite/admincp

It should allow you there.. Then you can go into the product manager and disable this hack or uninstall it (I would suggest disabling in case you do it to the wrong plugin)

The Chief
29 Mar 2006, 05:50
installed and works great!!

http://www.myetalk.com/forums/index.php

/me clicks install

hypnoticpimp
31 May 2006, 04:25
Hey does this work for 3.5.4 cause i tried it and got an error this error
Fatal error: Cannot use object of type vB_Session as array in /home/wshh/public_html/forums/index.php(485) : eval()'d code on line 195

Let me know how i can fix this error

BryceW
15 Jun 2006, 15:41
I am looking to install this in 3.5.4 as well. Does this work on 3.5.4?

sunnycher
11 Feb 2007, 00:59
I'd love to have this for 3.6.4, anyone install it yet?