PDA

View Full Version : Top XX Posters


tubedogg
22 Mar 2001, 20:48
LAST UPDATED: 3.26.01 2:10 AM Eastern

I put together a little thing to show the top XX posters on your board. It can be used on a non-vB page. The username is a link to the member's profile.

http://kevin.tubescan.com/i/topposters.jpg

Hack version: 0.0.4

Changes from version 0.0.1: Fixed a small bug with the path.
Changes from version 0.0.2: Added option to exclude admins from list of posters.
Changes from version 0.0.3: Fixed alternating colors so they are horizontal, not vertical. Changed $path to $url and $path2 to $path to make variables easier. Added a seperate header row color.

For version: 2.0.0 beta 3 (possibly also beta 1 and beta 2, but it is untested with those versions).

Files needed: topposters.php (see attached zip file below).

Files to edit: topposters.php (see instructions below).

Possible file locations: Anywhere, so long as the $path is set correctly.

Instructions

Unzip the file topposters.php from topposters004.zip to your hard drive.
Open topposters.php in an ASCII text editor, such as Notepad (Windows), SimpleText (Mac), EditPlus, UltraEdit, TextPad, etc. (DO NOT use WYSIWYG HTML editors such as FrontPage, HotDog, DreamWeaver, etc. They will in all likelyhood screw up the file! I will not be able to support you if you edit the file in one of these programs.)
Edit the variables at the top. These are:
---$maxposters > This is the number of posters you want to show.
---$hc > Set this to the color you want the header row to be.
---$bc1 and $bc2 > These are the first and second alternating colors. Look at the picture in the vbulletin.com thread and you'll see what I mean.
---$text and $link > Set the colors of the main text and the color of the links. Make sure this color is visible on both alternating colors, set in step 3b.
---$font > This is the font(s) to use for display. You can set specific fonts (e.g. Verdana, Arial, etc.) or general font-families (e.g. sans-serif, serif).
---$fontsize > Set a point size for your font. Size 8 is about equivelant to <font size=1>. Anything below about 6 will basically be undreadable, so be careful.
---$url > This is the path to your board files, such as index.php, members.php, etc. This is *not* the path to config.php (e.g. don't include the /admin part of the URL)!
---$path > This is the path to config.php - normally in the /admin directory. Do not add a trailing slash. It may need a leading slash.
---$admins > If you want admins included on the list of posters, set this to 1. If you do *not* want admins included, set this to 0.
Upload it to your website. You can include it as follows. To include it on a PHP-parsed page (.php, .php3, .phtml, etc.):
<? include("topposters.php"); ?>
To include it on a server-parsed page (.shtml, .shtm, .ssi, etc.):
<!--#include file="topposters.php"-->

Instructions are included in the zip file (topposters.txt) and brief instructions are also in the topposters.php file itself.

FEEDBACK WANTED! :) Likes/dislikes/modification requests, please. :D

23 Mar 2001, 00:51
thanks, looks good.

23 Mar 2001, 15:16
I can't call it in?!?
I have done this sort of thing befor, and this isnt working? Hummmm . . .

23 Mar 2001, 17:18
You mean you can't include it? Did you double-check the path set towards the top? (Remember, not to /admin, just to the main forums directory.)

23 Mar 2001, 18:55
kickass! :)

24 Mar 2001, 22:30
Okay I have this setup but how do I include it into an .html file?

25 Mar 2001, 00:20
You can't. You must either use an extension of .php or .shtml, as described in the instructions above.

25 Mar 2001, 00:39
no man, somthings wonky!
my server supports SSI
the file is SHTML
I donno whats wrong! I checked everything!
*pulls hairout*

snyx

25 Mar 2001, 00:41
Have you gotten the topposters.php to work separately? (e.g. upload it somewhere and go directly to it - myserver.com/topposters.php)

25 Mar 2001, 01:31
Im getting this:
Fatal error: Failed opening required '/forum/admin/config.php' (include_path='.:/usr/local/lib/php') in /home2/form-kaos/www/forum/topposters.php on line 12

tubey?

25 Mar 2001, 03:59
That is a bug due to my sloppy coding. :)

I apologize for the inconvenience. Please redownload the zip file from the first post in this thread and try again. :)

25 Mar 2001, 04:14
thanks, i thought i installed it wrong :P

25 Mar 2001, 04:17
Okay I got it to work (thanks for that) but you had a problem with path2, I had to change $path2/admin to forum/admin I donno why it didnt work?

Next, is there any way to leave the admins out of it? Cuz 2 of the 5 admins have top 10 posts, any ideas way yo leave admins out?

25 Mar 2001, 04:22
I'll work on leaving admins out.

Did you change $path2 = "board/admin" to $path2 = "forum/admin" ? That should've worked.

25 Mar 2001, 04:24
thats what im talking bout, I changed that, but it sisnt work

25 Mar 2001, 04:28
Are you putting the file in the forum directory or somewhere else?

25 Mar 2001, 04:45
I updated the first post with the latest version, which now gives an option to exclude admins from the list.

25 Mar 2001, 10:18
tubedogg, your a genious
thankz man!

01 Apr 2001, 18:00
Whaouuuu
You are making a lots of very nice hack guy!!!
Congrats!!

02 Apr 2001, 19:01
well a quick question where do i put the include....
cuz i want it to display on the main page?

03 Apr 2001, 03:10
Which main page? The vB's main page or your site's main page? It is designed to go on an external page (e.g. the main page of your site), not a page inside the vB.

03 Apr 2001, 04:57
i would love to see it on the index.php page of my vb site is it possible?
and if not then could u tell me how i can put in another button like the profile and search and faq....etc?

03 Apr 2001, 06:30
dito,

The include would go on the main index.html file for your site if you want it to show up on your home page. You can take a look at my site to get an idea.

03 Apr 2001, 06:47
dito: I'll see what I can do about a version to use on the index.php vB page.

dito
04 Apr 2001, 05:09
hehe:) that would be great tubedogg hope u work something out!!
thanx in advance :D:D:Dmaybe u would contact me when and if u found a way to get it on the index.php !
icq:71547154

jojo85
04 Apr 2001, 12:11
http://www.agnfr.com/portail/index.php

zoaner
14 Apr 2001, 09:06
I'm trying to put it on my phpwebsite portal and it doesn't let me include it on my mainpage, I don't know why but it doesn't insert it and my script is ok because I can see it using a shml file..... Any idea?

Also, the admins still in the list

Thanks, it will bee nice when I'll get it done:cool:

maverick1236
18 May 2001, 05:30
Warning: Failed opening 'upload/admin/config.php' for inclusion (include_path='') in h:\nusphere\apache\htdocs\upload\admin\topposters.php on line 59
this is what i see after installimg the topposters hack

tubedogg
18 May 2001, 09:09
You will need to move your topposters.php file up one directory, to h:\nusphere\apache\htdocs\upload\topposters.php and then adjust your $path to just "admin"

maverick1236
19 May 2001, 12:09
IT WORKED!

c-pr0mpt
22 May 2001, 05:54
I installed this hack and it works, but the problem is that the links to their member files goes into the admin directory. So instead of
forum/member.php

It goes
forum/admin/member.php

How can I fix this?

c-pr0mpt
22 May 2001, 06:12
Nevermind I fixed it. Was very simple. Should have looked harder before.

snyx
22 May 2001, 06:30
Can I please see a working update for vB 2.0 FINAL, PLEASE?!? :D

Rosevalley
23 May 2001, 09:30
Nice hack mate, I had it working in 3minutes in vbb 2.0 final.

I have only one question is het possible to have only the top poster of today and that it only counts if you make a new thread not a replay, so you will get a list with today guys who started a new post. Is this possible ?

AnnaFan
02 Jun 2001, 15:31
Hi,

where must I include the topposters.php? In which file? Thanx.

tubedogg
02 Jun 2001, 17:31
In whatever file you want it to appear.

AnnaFan
02 Jun 2001, 17:42
hi,

in every which is possible.

Brickhouse
08 Jun 2001, 10:34
I keep getting this error:

Fatal error: Failed opening required '/admin/config.php' (include_path='.:/usr/local/lib/php') in /home/onlinega/public_html/forum/topposters.php on line 59


Please help, thanks!

tubedogg
08 Jun 2001, 17:45
Remove the / before admin in the $path.

Brickhouse
10 Jun 2001, 02:18
I don't have a slash before the admin. Here I'll show you what my config looks like:

/////////////// CONFIG ///////////////
//
$maxposters = "3"; // change this to the number of posters you want to show. for a top 10 listing, set it to 10, etc.
$hc = "#999999"; // change to head row color.
$bc1 = "#696969"; // change to first alternating color.
$bc2 = "#5C5C5C"; // change to second alternating color.
$text = "#FFFFFF"; // change to text color.
$link = "#EEEEEE"; // change to link color.
$font = "Verdana,Helvetica,sans-serif"; // change to fonts you want. use serif or sans-serif for general, or use specific fonts names.
$fontsize = "8pt"; // change to font size you want. 8 is about the minimum; go up from there. 1 will not even show up.
$url = "http://216.10.11.101/forum/index.php"; // path to your board files. (e.g. index.php, member.php, etc.) may need a starting slash. *do not* put an ending slash on!
$path = "admin/config.php"; // path to your config.php file. may need a starting slash. *do not* put an ending slash on!
$admins = "0"; // change this to "0" to leave admins off the list of top posters.
//
///////////// END CONFIG /////////////

Please help?

tubedogg
10 Jun 2001, 06:44
Try
./admin/config.php

Brickhouse
10 Jun 2001, 07:12
Nope, that didn't work. I'll show you everything I have in my topposters.php file that is in my forum directory:

<?php

//..........Top X Posters v0.0.4..........\\
//......by Kevin (kevin@tubescan.com)......\\

// For vBulletin version 2, beta 3
// (c) 2001 Jelsoft Enterprises, Ltd.

// vBulletin.com thread: http://www.vbulletin.com/forum/showthread.php?threadid=12067

///////////// CHANGE LOG /////////////
//
// New in version 0.0.4
// -- Fixed alternating colors so they are horizontal, not vertical
// -- Changed $path to $url and $path2 to $path to make variables easier
// -- Added a seperate header row color
//
// New in version 0.0.3
// -- Added option to exclude admins from list of posters
//
// New in version 0.0.2
// -- Fixed a small bug with the path.
//
// New in version 0.0.1
// -- Released! :)
//
/////////// END CHANGE LOG ///////////

//////// CONFIG EXPLANATION //////////
//
// a] $maxposters > This is the number of posters you want to show.
// b] $hc > The head row color.
// c] $bc1 and $bc2 > These are the first and second alternating color.
// d] $text and $link > Set the colors of the main text and the color of the links. Make sure this color is visible on both alternating colors.
// e] $font > This is the font(s) to use for display. You can set specific fonts (e.g. Verdana, Arial, etc.) or general font-families (e.g. sans-serif, serif).
// f] $fontsize > Set a point size for your font. Size 8 is about equivelant to <font size=1>. Anything below about 6 will basically be undreadable, so be careful.
// g] $url > This is the URL to your board directory. This is not the path to config.php! Do not put a trailing slash, either.
// h] $path > This *is* the path to your config.php file. This should include the /admin part. NO TRAILING SLASH! (May need a leading slash)
// i] $admins > Set this to "1" to show admins on the list of top posters. Set this to "0" to NOT show admins on the list.
//
////// END CONFIG EXPLANATION ////////

/////////////// CONFIG ///////////////
//
$maxposters = "3"; // change this to the number of posters you want to show. for a top 10 listing, set it to 10, etc.
$hc = "#999999"; // change to head row color.
$bc1 = "#696969"; // change to first alternating color.
$bc2 = "#5C5C5C"; // change to second alternating color.
$text = "#FFFFFF"; // change to text color.
$link = "#EEEEEE"; // change to link color.
$font = "Verdana,Helvetica,sans-serif"; // change to fonts you want. use serif or sans-serif for general, or use specific fonts names.
$fontsize = "8pt"; // change to font size you want. 8 is about the minimum; go up from there. 1 will not even show up.
$url = "http://216.10.11.101/forum/index.php"; // path to your board files. (e.g. index.php, member.php, etc.) may need a starting slash. *do not* put an ending slash on!
$path = "./admin/config.php"; // path to your config.php file. may need a starting slash. *do not* put an ending slash on!
$admins = "0"; // change this to "0" to leave admins off the list of top posters.
//
///////////// END CONFIG /////////////

require("$path/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword) or die("Unable to connect to database");
mysql_select_db($dbname) or die("Unable to select database $dbname");

if ($admins == "1") {
$exq = mysql_query("SELECT usergroupid FROM usergroup WHERE cancontrolpanel='1'");
$exr = mysql_result($exq,0,0);
$exn = "WHERE usergroupid<>$exr";
}

echo("<table border=0 cellpadding=4 cellspacing=0><tr><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Username</i></b></td><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Posts</i></b></td></tr>");

$postsresult = mysql_query("SELECT username,posts,userid FROM user $exn ORDER BY posts desc LIMIT 0,$maxposters") or die("Unable to complete query");
while ($topposters = mysql_fetch_array($postsresult)):
if (($counter++ % 2) != 0) {
$bc=$bc1;
} else {
$bc=$bc2;
}
echo("<tr><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\"><a href=\"$path/member.php?&action=getinfo&userid=$topposters[userid]\" style=\"color: $link\">$topposters[username]</a></td><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\">$topposters[posts]</td></tr>");
endwhile;
echo("</table>");

?>

When I goto the 216.10.11.101/forum/topposters.php I get the same message:

"Fatal error: Failed opening required './admin/config.php/config.php' (include_path='.:/usr/local/lib/php') in /home/onlinega/public_html/forum/topposters.php on line 59"

I haven't included it in my main forum page yet but that's because I can't get this single topposters.php to work correctly. Have you ever encountered this error? Do you have any more ideas?

Please help? :confused:

tubedogg
10 Jun 2001, 08:01
doh sorry try just
./admin

Brickhouse
10 Jun 2001, 12:16
YES IT WORKED! I love you so much! ;)

You are the man, man!

But in all serious now, I really do appriciate the personal help you gave me there. It's working great and it's a beutiful peace of code!

Brickhouse
11 Jun 2001, 00:30
I only have one last problem now, I can't seem to get it to show up on the forum pages.

I add the code into the header section in the styles menu of the admin control pannel. I place it right below the control buttons where people can log into their user cp, register, calendar, member, etc...


Any ideas?

tubedogg
11 Jun 2001, 00:39
PHP isn't parsed in any of the templates, so it won't show up if you just put it in the header template. Really I wrote this for an external (to vB) page, but it could work inside it.

In your phpinclude template, put
$topposters = implode('',file('path/to/topposters.php'));
and then put $topposters where you want the list to appear.

floleb7
11 Jun 2001, 01:08
you don't need to use this inside vb there is also the feature
http://161.58.84.213/forum/memberlist.php?what=topposters&perpage=10

Neises
11 Jun 2001, 02:45
Has anyone set this up to run in a vBportal block? If so, would you be willing to share your method? :)

Chen
18 Jun 2001, 09:54
Ok, I got this error:
"Unable to select database"
So the problem is on:mysql_select_db($dbname) or die("Unable to select database $dbname");The forum works fine, so the config.php is ok.

What's the problem?!

Fixed. :)

Nocturnal
25 Jun 2001, 20:19
Okay I uploaded it and when I directly visit the page it gives me the following message -

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:



Thats all it gives :rolleyes:



EDIT - I am very dumb lol I uploaded it to the wrong folder. The site root rather than the forum folder. Really need to get a decent FTP client rather than a web based one :D Nice hack. Like other hacks this requires error_reporting(7); to be added to the scirpt to get rid of those nasty error messages.

learner
01 Jul 2001, 15:52
You're still the best Boss....;)

badmeetsevil
01 Jul 2001, 19:15
TUBEDOGG:

I'm getting two problems..

1.) When I click the name, it goes to bbs/admin instead of bbs/ for their profiles.. which makes a broken link..

...and

2.) I'm not getting Administrators to show up, even though I set it to 1.

learner
01 Jul 2001, 19:56
Tubey...

I have the second problem too....:(

badmeetsevil
02 Jul 2001, 00:24
*bump*

tubedogg
02 Jul 2001, 07:25
Originally posted by badmeetsevil
1.) When I click the name, it goes to bbs/admin instead of bbs/ for their profiles.. which makes a broken link..What do you have $url set to? It needs to be the path to your forums.2.) I'm not getting Administrators to show up, even though I set it to 1.Try replacing the line $exn = "WHERE usergroupid<>$exr";with $exn = "WHERE usergroupid<>$exr AND usergroupid!=6";

badmeetsevil
02 Jul 2001, 16:54
$url is http://www.soapedup.f2s.com/bbs ..

..and I changed around that coding, but still tries to get in my admin directory.

The Top Posters Include is on my front page as well.

badmeetsevil
03 Jul 2001, 01:10
Bah, I found the glitch. I had to change $path to my Forums directory.. you should really fix that tubedogg.

Or atleast change the $path/member.php?blahblah to $url/member.php?blahblah.

DEMOLiTiON
06 Jul 2001, 00:36
c00l hack! can you please make a Top XX Threads started?
Thnx!

FireandicE
15 Jul 2001, 13:26
Great hack Thanx alot, works like a charm

($admins = "0"; // change this to "0" to leave admins off the list of top posters. does so indeed, only the other way arround, so "1" to leave em off;))

Devels
20 Jul 2001, 11:08
See plz this sample (http://www.vbulletin.com/forum/showthread.php?s=&postid=141547) --> include all needed functions in one file, not required conf file, all in one page, transparent include vb style on non vb pages....

tubedogg
20 Jul 2001, 20:44
While I appreciate your initiative, could you not use my thread? Thanks.

Devels
20 Jul 2001, 21:29
Indeed all much simply.
Can send ready file (worker version) good working at one of the sites(beside 60 non vb pages)

Pie'oh'pah
24 Jul 2001, 13:07
First, nice hack dude.

though, i have a prob:

when i include


$topposters = implode('',file('path/to/topposters.php'));


into the phpinclude-template

and $topposters into the forumhome-template, the content of the php-file is being diplayed and spammes my page...

any hints?

btw: calling the topposters.php directly is workin fine....

Pie'oh'pah
24 Jul 2001, 16:23
I worked around, you may find this interesting if you want to integrate it to your vbulletin pages, so i post it here.

What I did was pasting the code from topposters.php to my index.php

then changed the following:

Step 1 find:


echo("<table border=0 cellpadding=4 cellspacing=0><tr><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Username</i></b></td><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Posts</i></b></td></tr>");


Change to read:


$mytops="<table border=0 cellpadding=4 cellspacing=0><tr><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Username</i></b></td><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Posts</i></b></td></tr>";


Step 2 find:


echo("<tr><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\"><a href=\"$path/member.php3?&action=getinfo&userid=$topposters[userid]\" style=\"color: $link\">$topposters[username]</a></td><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\">$topposters[posts]</td></tr>");


Change to read:


$mytops .="<tr><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\"><a href=\"./member.php3?&action=getinfo&userid=$topposters[userid]\" style=\"color: $link\">$topposters[username]</a></td><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\">$topposters[posts]</td></tr>";


Step 3 find:


echo("</table>");


Change to read:


$mytops .="</table>";


Step 4:
Place the $mytops anywhere you want the stats to be displayed.

Hope this helps

-Pie

webhost
24 Jul 2001, 20:13
Tubedogg

I loaded your hack and it works but I have one probelm with it. I have a user that goes by AhoyM8 . He should be based on his post counts in the top 5, but with your hack he doesn't even showup in the top 10. In the member list top10 he shows up number 3.

Any ideas?


Can someone help with this I have updated counters in cp

FIXED I HAD TO UPPATE HIS usergroupid from 3 to 2 IN THE DATABASE

GREAT HACK!!!!!!!!!

Click on Forums in my signature to see Top Posters. It is located at the bottom of the page lower left.

Jaffa
26 Jul 2001, 13:24
Warning: Unable to access upload/admin/config.php in /usr/home/d/e/deadlycncu/public_html/upload/topposters.php on line 59

Fatal error: Failed opening required 'upload/admin/config.php' (include_path='') in /usr/home/d/e/deadlycncu/public_html/upload/topposters.php on line 59

thats wat i get i tried all sorts redownloaded and tried again ahhhhhhhhhh:mad:

tubedogg
26 Jul 2001, 22:27
Change $path to admin/config.php

Jaffa
27 Jul 2001, 11:27
np i had to change path to admin thats it ive done it now anyway thx... oh dam now im having problams including file in my index.shtml page i tried

<!--#include file="cncu.deadlyfear.com/upload/topposters.php" -->
<!--#include file="/upload/topposters.php" -->
<!--#include file="upload/topposters.php" -->
<!--#include file="topposters.php" -->
and loads y dont it work ??
:(

webhost
31 Jul 2001, 01:55
Trying not to have admins show up on list. I followed instructions in zip file but they still show up.

Any Ideas anyone?

Jaffa
31 Jul 2001, 14:11
ye u set it to 0 instead of 1 tubedog got it mudled up now someone help me!

acid
05 Aug 2001, 12:26
I installed the hack and I have tried everything, but I can't get past this error. I can't find the problem anywhere.
Parse error: parse error in /home/teamacid/public_html/topposters.php3 on line 45

This is my topposters.php, all my files are .PHP3 so I changed this to .PHP3- Could this be the problem?

<?php3

//..........Top X Posters v0.0.4..........\\
//......by Kevin (kevin@tubescan.com)......\\

// For vBulletin version 2, beta 3
// (c) 2001 Jelsoft Enterprises, Ltd.

// vBulletin.com thread: http://www.vbulletin.com/forum/showthread.php?threadid=12067

///////////// CHANGE LOG /////////////
//
// New in version 0.0.4
// -- Fixed alternating colors so they are horizontal, not vertical
// -- Changed $path to $url and $path2 to $path to make variables easier
// -- Added a seperate header row color
//
// New in version 0.0.3
// -- Added option to exclude admins from list of posters
//
// New in version 0.0.2
// -- Fixed a small bug with the path.
//
// New in version 0.0.1
// -- Released! :)
//
/////////// END CHANGE LOG ///////////

//////// CONFIG EXPLANATION //////////
//
// a] $maxposters > This is the number of posters you want to show.
// b] $hc > The head row color.
// c] $bc1 and $bc2 > These are the first and second alternating color.
// d] $text and $link > Set the colors of the main text and the color of the links. Make sure this color is visible on both alternating colors.
// e] $font > This is the font(s) to use for display. You can set specific fonts (e.g. Verdana, Arial, etc.) or general font-families (e.g. sans-serif, serif).
// f] $fontsize > Set a point size for your font. Size 8 is about equivelant to <font size=1>. Anything below about 6 will basically be undreadable, so be careful.
// g] $url > This is the URL to your board directory. This is not the path to config.php! Do not put a trailing slash, either.
// h] $path > This *is* the path to your config.php file. This should include the /admin part. NO TRAILING SLASH! (May need a leading slash)
// i] $admins > Set this to "1" to show admins on the list of top posters. Set this to "0" to NOT show admins on the list.
//
////// END CONFIG EXPLANATION ////////

/////////////// CONFIG ///////////////
//
$maxposters = "5"; // change this to the number of posters you want to show. for a top 10 listing, set it to 10, etc.
$hc = "#999999"; // change to head row color.
$bc1 = "#696969"; // change to first alternating color.
$bc2 = "#5C5C5C"; // change to second alternating color.
$text = "#FFFFFF"; // change to text color.
$link = "#EEEEEE"; // change to link color.
$font = "Verdana,Helvetica,sans-serif"; // change to fonts you want. use serif or sans-serif for general, or use specific fonts names.
$fontsize = "8pt"; // change to font size you want. 8 is about the minimum; go up from there. 1 will not even show up.
$url = "http://www.teamacid.org/forum/index.php3"; // path to your board files. (e.g. index.php, member.php, etc.) may need a starting slash. *do not* put an ending slash on!
$path = "./admin"; // path to your config.php file. may need a starting slash. *do not* put an ending slash on!
$admins = "1"; // change this to "0" to leave admins off the list of top posters.
//
///////////// END CONFIG /////////////

require("$path/config.php3");
$db=mysql_connect($servername,$dbusername,$dbpassword) or die("Unable to connect to database");
mysql_select_db($dbname) or die("Unable to select database $dbname");

if ($admins == "1") {
$exq = mysql_query("SELECT usergroupid FROM usergroup WHERE cancontrolpanel='1'");
$exr = mysql_result($exq,0,0);
$exn = "WHERE usergroupid<>$exr";
}

echo("<table border=0 cellpadding=4 cellspacing=0><tr><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Username</i></b></td><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Posts</i></b></td></tr>");

$postsresult = mysql_query("SELECT username,posts,userid FROM user $exn ORDER BY posts desc LIMIT 0,$maxposters") or die("Unable to complete query");
while ($topposters = mysql_fetch_array($postsresult)):
if (($counter++ % 2) != 0) {
$bc=$bc1;
} else {
$bc=$bc2;
}
echo("<tr><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\"><a href=\"$path/member.php3?&action=getinfo&userid=$topposters[userid]\" style=\"color: $link\">$topposters[username]</a></td><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\">$topposters[posts]</td></tr>");
endwhile;
echo("</table>");

?>

GameGalaxy
10 Sep 2001, 02:15
Well before you post it might help to findout what is line 45?

It looks like you don't have // around words so it is screwed up near the beginning.

the <? <?php <?php3
I believe they all do the same thing, supposedly <?php3 was to let a programmer know that it was written in php3 code.

dkilburn
10 Sep 2001, 23:18
I've tried every combination I could think of to get the name link to work. Here's what I have in that section:

$url = "http://www.collegeteacher.org/forums";
$path = "./admin";

And it makes the name link to http://www.collegeteacher.org/admin/member.php?&action=getinfo&userid=24 . I have tried using "./forums/admin", but then I get:

Fatal error: Failed opening required './forums/admin/config.php' (include_path='.:/usr/local/lib/php') in /home/kilburn/public_html/forums/topposters.php on line 59

Any ideas:

Debby Kilburn
http://www.collegeteacher.org/

GameGalaxy
10 Sep 2001, 23:33
Do what I did

make a new variable called

url2 = "http://www.yourdomain.com/forumdirectory";

then look in the url part below for $url and add the 2 after it and it will work fine.

shadowbreed
13 Sep 2001, 23:04
Pie'oh'pah's solution works great check out http://www.snakepages.com/forum

also for people getting a link to admin/member.php?blablabla

find the line:


$path/member.php?&action=getinfo&userid=$topposters[userid]\"

and change to:

$url/member.php?&action=getinfo&userid=$topposters[userid]\"

Sarge
30 Sep 2001, 00:56
Originally posted by Pie'oh'pah
I worked around, you may find this interesting if you want to integrate it to your vbulletin pages, so i post it here.

What I did was pasting the code from topposters.php to my index.php

then changed the following:

Step 1 find:
-Pie

I am confused

Did you place the entire contents of tubedoggs hack into your index,php?

What parts did you put in?
Thanks
Sarge

Alien
03 Oct 2001, 16:31
Any way to get this modified so it wouldn't display MODS either, just like it doesn't for admins? I'd really appreciate it. :D

soceris
08 Oct 2001, 18:54
Could somebody PLEASE upload the topposters.php file as a text file so that I can use it please. For some reason when i try to open a php file my pc associates it with a programmes photo parade.
Tis doing my nut in but I can get round it if somebody could just post the code as a normal text file

Thanks in advance

amykhar
08 Oct 2001, 19:04
soceris,
rename the php file to .txt on your machine.

Amy

soceris
08 Oct 2001, 20:11
sorry to be a pain but i've tries every method under the sun to do that already.
Its doing my nut as i really want this hack installed.

help!!!!!

Pie'oh'pah
09 Oct 2001, 17:56
Sorry dudes,

have been away for some time. Anyone care to bring me back on track?

-Pie

Lil'B
12 Oct 2001, 18:17
I want to Include it on the index.php ... HOOOOOOOW ?

Help me plz :(

webhost
12 Oct 2001, 21:22
top of index.php make look like this

<?php
error_reporting(7);
require('./global.php');
require("./topposters.php");

Try that make sure topposters.php is in your forums root directory

add $topposters in forumhome you will need to build a table for it.

Lil'B
14 Oct 2001, 17:01
I need More help with the Table ...

Freegaia
14 Oct 2001, 17:07
Verry cool, but how to exclude admins AND moderators ?

ColdFusion
14 Oct 2001, 22:03
is there any way to include it on my forums home page
the first page where you see all forum?
like in http://mysite.com/forums

Neo
14 Oct 2001, 22:09
Originally posted by ColdFusion
is there any way to include it on my forums home page
the first page where you see all forum?
like in http://mysite.com/forums i dont get what you want. could you tell me what it is in a little more detail.. i have been coding for 2weeks straight not all here right now

ColdFusion
14 Oct 2001, 22:18
I have a swf intro on my forum home page and i want to place the topposters below that but above the list of forums the forums. right in the index.php page.

Neo
14 Oct 2001, 22:47
like this.... http://www.animegathering.com/
look in the stats bar.

Freegaia
14 Oct 2001, 23:59
sorry for my bad english, but how to exclude admins AND moderators ?

thank

webhost
15 Oct 2001, 00:04
find in topposters.php make sure you have 1's and not zero's see below this works for admins, but does not for moderators.


$admins = "1"; // change this to "1" to leave admins off the list of top posters.



if ($admins == "1") {
$exq = mysql_query("SELECT usergroupid FROM usergroup WHERE cancontrolpanel='1'");
$exr = mysql_result($exq,0,0);
$exn = "WHERE usergroupid<>$exr";

Freegaia
15 Oct 2001, 22:49
I can exclude administrators, but i want to exlude to all moderators.

How can i do ? Please ;)

Sloat
11 Nov 2001, 16:38
Originally posted by webhost
top of index.php make look like this

<?php
error_reporting(7);
require('./global.php');
require("./topposters.php");

Try that make sure topposters.php is in your forums root directory

add $topposters in forumhome you will need to build a table for it.

If I add the "require" line, the output of topposters.php appears at the top of the index.php instead of the table where I have $topposters

Logtenberg
24 Nov 2001, 01:09
Originally posted by webhost
top of index.php make look like this

<?php
error_reporting(7);
require('./global.php');
require("./topposters.php");

Try that make sure topposters.php is in your forums root directory

add $topposters in forumhome you will need to build a table for it.

I made the above modifications to my index.php - I basically just added the line: require("./topposters.php");

I uploaded topposters.php to the /forum folder and I added $topposters into my forumhome template.

When I go to load the page, the page is completely blank.

Any idea what's going on?

Thanks

Logtenberg
25 Nov 2001, 04:07
Never mind. I fixed it.

Logtenberg
28 Nov 2001, 01:20
Originally posted by Pie'oh'pah
I worked around, you may find this interesting if you want to integrate it to your vbulletin pages, so i post it here.

What I did was pasting the code from topposters.php to my index.php

then changed the following:

Step 1 find:


echo("<table border=0 cellpadding=4 cellspacing=0><tr><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Username</i></b></td><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Posts</i></b></td></tr>");


Change to read:


$mytops="<table border=0 cellpadding=4 cellspacing=0><tr><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Username</i></b></td><td align=\"center\" bgcolor=\"$hc\"><b style=\"color: $text; font-family: $font; font-size: $fontsize\"><i>Posts</i></b></td></tr>";


Step 2 find:


echo("<tr><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\"><a href=\"$path/member.php3?&action=getinfo&userid=$topposters[userid]\" style=\"color: $link\">$topposters[username]</a></td><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\">$topposters[posts]</td></tr>");


Change to read:


$mytops .="<tr><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\"><a href=\"./member.php3?&action=getinfo&userid=$topposters[userid]\" style=\"color: $link\">$topposters[username]</a></td><td align=\"center\" bgcolor=\"$bc\" style=\"color: $text; font-family: $font; font-size: $fontsize\">$topposters[posts]</td></tr>";


Step 3 find:


echo("</table>");


Change to read:


$mytops .="</table>";


Step 4:
Place the $mytops anywhere you want the stats to be displayed.

Hope this helps

-Pie


I did this and it works for me too. the problem I have though is that the administrator is not listed in the top posters even though I have $admins = "1";

Do you have this problem too? Is anyone having this problem where admins don't appear in top posters on index.php?

Sinecure
28 Nov 2001, 01:42
One of the usefull hacks, I luv it!

SirSteve
26 Dec 2001, 16:41
Does this work on 2.2.1?

nitro
19 Feb 2002, 16:33
gr8 hack works fine in vbb 222 got it displaying in a sideblock on my portal

also id like to see a conversion of this hack instead of showing top overall posters cud sum1 tell me how to get this to query top thread starters in specific forum ids then u cud display say your top 5 news submitters

ForKmaN
10 Aug 2002, 15:44
Fatal error: Failed opening required '/admin/config.php' (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site44/fst/var/www/html/topposters.php on line 59

eep :s

I seen this error for a few other people but I did every thing that was said, and I still get it! :(

350Chevy
23 Nov 2002, 06:33
Nice hack, one problem though. My Super Moderators do no show up!?? I do not wish anyone to be excluded from this list including Admin. I didn't actually notice it, one of my super mods did. :)

350Chevy
24 Nov 2002, 03:55
found the problem in your code and fixed it..