vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Referrers On Forumhome v.1.3 (https://vborg.vbsupport.ru/showthread.php?t=101324)

tnguy3n 11-21-2005 10:00 PM

Referrers On Forumhome v.1.3
 
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

Quote:

Originally Posted by Loki12
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

Quote:

Originally Posted by tnguy3n
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:
HTML Code:

<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 Code:

<?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:
HTML Code:

<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

Quote:

Originally Posted by hIBEES
Great stuff..before I install is there a way it can EXCLUDE admins ??

You can add in the query:
PHP Code:

AND user.usergroupid != 

For multiple groups:
PHP Code:

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

Quote:

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

Quote:

Originally Posted by Deimos
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

Quote:

Originally Posted by tnguy3n
You can add in the query:
PHP Code:

AND user.usergroupid != 

For multiple groups:
PHP Code:

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:

Code:

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

Quote:

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


something like the following:
PHP Code:

$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

Quote:

Originally Posted by G-Force 199
I got this error :
Database error in vBulletin 3.5.0:

Code:

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

Quote:

Originally Posted by tnguy3n
something like the following:
PHP Code:

$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

[high]* Bounce installed and working 100% :rolleyes:[/high]

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

Quote:

Originally Posted by Boofo
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

Quote:

Originally Posted by tnguy3n
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

Quote:

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

Quote:

Originally Posted by Dead End Society
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

Quote:

Originally Posted by Boofo
A new page with how many and the names, too? ;)

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

Quote:

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

Quote:

Originally Posted by MThornback
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

Quote:

Originally Posted by tnguy3n
Done as requested. Just download and install new release of the hack. ;)

Thank you, sir. ;)

Quote:

Originally Posted by tnguy3n
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:
Code:

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.


All times are GMT. The time now is 01:45 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.01821 seconds
  • Memory Usage 1,865KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (7)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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