View Full Version : Referrers On Forumhome v.1.3
tnguy3n
11-21-2005, 10:00 PM
Top XX Referrers In FORUMHOME
Author: tnguy3n
Support Site: www.vbviet.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
11-22-2005, 08:32 AM
Excellent! Clicks install.
Loki12
11-22-2005, 08:53 AM
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
11-22-2005, 10:46 AM
What a great visible incentive for members to spread the word :) Thanks - installs!!
Snake
11-22-2005, 10:49 AM
Installed. ;)
Living in music
11-22-2005, 12:01 PM
Installed. :)
Vizionz
11-22-2005, 12:58 PM
installed thanks for this hack :)
tnguy3n
11-22-2005, 01:36 PM
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
11-22-2005, 02:24 PM
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
11-22-2005, 04:07 PM
Dude.... since 3.5 I absolutely CANNOT stop installing mods. It's just too easy!
*installs*
Ncturnal
11-22-2005, 07:47 PM
Nice. Any chance of getting this for vBAdvanced CMPS? Nice hack.
G-Force 199
11-23-2005, 05:32 AM
May I show it on my vBAdvanced CMPS homepage ?
Dollah
11-23-2005, 06:49 AM
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
11-23-2005, 08:49 AM
@ Dollah: what version of MySQL you run on your server?
tnguy3n
11-23-2005, 08:57 AM
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
11-23-2005, 11:54 AM
not valid module file to upload it
tnguy3n
11-23-2005, 04:43 PM
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 @ vbviet.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
11-23-2005, 05:17 PM
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
11-23-2005, 05:36 PM
LOOKING GOOD AGAIN MATE :) iNSTALLING
Bounce
11-23-2005, 10:51 PM
Great stuff..before I install is there a way it can EXCLUDE admins ??
tnguy3n
11-23-2005, 11:22 PM
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
11-24-2005, 11:15 AM
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
11-26-2005, 06:35 PM
Installed.
Bounce
11-26-2005, 08:43 PM
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
11-26-2005, 08:50 PM
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
11-27-2005, 11:28 AM
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
11-27-2005, 03:13 PM
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
11-27-2005, 03:16 PM
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
11-27-2005, 07:40 PM
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
* Bounce installed and working 100% :rolleyes:
Boofo
11-27-2005, 08:28 PM
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
11-27-2005, 09:00 PM
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
11-27-2005, 09:06 PM
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
11-28-2005, 12:03 PM
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
11-29-2005, 11:18 AM
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
11-29-2005, 11:59 AM
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
12-02-2005, 03:08 AM
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
12-02-2005, 03:10 AM
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
12-02-2005, 03:52 AM
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
12-03-2005, 08:17 PM
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
12-03-2005, 08:24 PM
pls read first post for the alternative.
kurtbarker
12-03-2005, 09:21 PM
maybe i'm missing it aye, but that 'edit' looks like it's for a different error?
cbr929rrerion
12-04-2005, 02:18 AM
It shows the wrong date for "Date Joined". It has the same date for everyone..
Can this be fixed?
tnguy3n
12-04-2005, 02:43 AM
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");
* tnguy3n updated hack.
cbr929rrerion
12-04-2005, 03:02 AM
Done.. Awesome.. fixed.. Thanks
smokering
12-04-2005, 04:12 AM
excellent hack thank you
Developer
12-06-2005, 06:39 AM
v.nice hack
NoCo7
12-18-2005, 02:06 PM
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
12-19-2005, 11:04 PM
thanks for pointing that out, NoCo7.
update the hack!
neutek
01-06-2006, 07:48 PM
thanks :)
+install
cbr929rrerion
01-13-2006, 06:38 PM
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
01-13-2006, 07:11 PM
It's supposed to popup in new window. Check if you have all the template modded correctly.
cbr929rrerion
01-13-2006, 07:21 PM
I will have to check because it dont do a new window..
cbr929rrerion
01-18-2006, 08:04 PM
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
02-03-2006, 04:32 AM
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
02-03-2006, 05:25 AM
I think you mistaked in editing of FORUMHOME style.
Celtkin
02-03-2006, 02:47 PM
Thank you. Clicked install
cbr929rrerion
02-03-2006, 02:56 PM
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
02-12-2006, 05:26 AM
Nice little add-on, I like it.
/me clicks install
GamerJunk.net
02-14-2006, 02:13 AM
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
02-14-2006, 02:14 AM
<a href="http://www.gsnforce.com/forum/referrals.php" target="_blank">http://www.gsnforce.com/forum/referrals.php</a>
See how its showing from my own forum?
tnguy3n
02-14-2006, 02:39 AM
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
02-14-2006, 10:35 PM
I even blocked the gsnforce from showing up yet it still does.
guamdude
02-15-2006, 07:25 PM
works just fine.
ubblite
02-19-2006, 04:54 AM
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
02-21-2006, 03:00 PM
The popup window does not work for me either. I checked and the code changes are done correctly.
SlowRoasted
02-22-2006, 03:51 AM
How can i get this to display in another template? It wont let me just put $showreferrers in another template.
SlowRoasted
02-23-2006, 01:54 AM
*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
02-23-2006, 02:14 AM
I think if you change the hook to global_start, it would show anywhere on vBulletin powered page.
Drache
03-02-2006, 08:37 PM
Does this work with 3.5.4?
budswope
03-02-2006, 11:48 PM
I get the message "No Referrer Found" even after new signups?
I love this idea!
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
03-09-2006, 03:00 PM
Thank you! This works perfectly! was just inquiring about one of these!
Treak
03-10-2006, 03:59 AM
amazing hack thanks again.. very useful for a contest i am running!!
GuaRRand
03-10-2006, 10:26 AM
completely screwed up my forum :(
cant even load the main page anymore...
www.glcoti.com
Pls help!!!!!
MorrisMcD
03-10-2006, 12:32 PM
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
03-29-2006, 03:50 AM
installed and works great!!
http://www.myetalk.com/forums/index.php
* The Chief clicks install
hypnoticpimp
05-31-2006, 02:25 AM
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
06-15-2006, 01:41 PM
I am looking to install this in 3.5.4 as well. Does this work on 3.5.4?
sunnycher
02-10-2007, 10:59 PM
I'd love to have this for 3.6.4, anyone install it yet?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.