PDA

View Full Version : Top XX Posters


tubedogg
03-21-2001, 10:00 PM
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

03-22-2001, 10:51 PM
thanks, looks good.

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

03-23-2001, 03:18 PM
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.)

03-23-2001, 04:55 PM
kickass! :)

03-24-2001, 08:30 PM
Okay I have this setup but how do I include it into an .html file?

03-24-2001, 10:20 PM
You can't. You must either use an extension of .php or .shtml, as described in the instructions above.

03-24-2001, 10:39 PM
no man, somthings wonky!
my server supports SSI
the file is SHTML
I donno whats wrong! I checked everything!
*pulls hairout*

snyx

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

03-24-2001, 11:31 PM
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?

03-25-2001, 01:14 AM
thanks, i thought i installed it wrong :P

03-25-2001, 01:17 AM
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?

03-25-2001, 01:22 AM
I'll work on leaving admins out.

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

03-25-2001, 01:24 AM
thats what im talking bout, I changed that, but it sisnt work

03-25-2001, 01:28 AM
Are you putting the file in the forum directory or somewhere else?

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

03-25-2001, 01:59 AM
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. :)

03-25-2001, 08:18 AM
tubedogg, your a genious
thankz man!

04-01-2001, 04:00 PM
Whaouuuu
You are making a lots of very nice hack guy!!!
Congrats!!

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

04-03-2001, 01:10 AM
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.

04-03-2001, 02:57 AM
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?

04-03-2001, 04:30 AM
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.

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

dito
04-04-2001, 03:09 AM
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-04-2001, 10:11 AM
<a href="http://www.agnfr.com/portail/index.php" target="_blank">http://www.agnfr.com/portail/index.php</a>

zoaner
04-14-2001, 07:06 AM
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
05-18-2001, 03:30 AM
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
05-18-2001, 07:09 AM
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
05-19-2001, 10:09 AM
IT WORKED!

c-pr0mpt
05-22-2001, 03:54 AM
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
05-22-2001, 04:12 AM
Nevermind I fixed it. Was very simple. Should have looked harder before.

snyx
05-22-2001, 04:30 AM
Can I please see a working update for vB 2.0 FINAL, PLEASE?!? :D

Rosevalley
05-23-2001, 07:30 AM
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
06-02-2001, 01:31 PM
Hi,

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

tubedogg
06-02-2001, 03:31 PM
In whatever file you want it to appear.

AnnaFan
06-02-2001, 03:42 PM
hi,

in every which is possible.

Brickhouse
06-08-2001, 08:34 AM
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
06-08-2001, 03:45 PM
Remove the / before admin in the $path.

Brickhouse
06-10-2001, 12:18 AM
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
06-10-2001, 04:44 AM
Try
./admin/config.php

Brickhouse
06-10-2001, 05:12 AM
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,$dbpassw ord) 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
06-10-2001, 06:01 AM
doh sorry try just
./admin

Brickhouse
06-10-2001, 10:16 AM
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
06-10-2001, 10:30 PM
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
06-10-2001, 10:39 PM
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
06-10-2001, 11:08 PM
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
06-11-2001, 12:45 AM
Has anyone set this up to run in a vBportal block? If so, would you be willing to share your method? :)

Admin
06-18-2001, 07:54 AM
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
06-25-2001, 06:19 PM
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
07-01-2001, 01:52 PM
You're still the best Boss....;)

badmeetsevil
07-01-2001, 05:15 PM
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
07-01-2001, 05:56 PM
Tubey...

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

badmeetsevil
07-01-2001, 10:24 PM
*bump*

tubedogg
07-02-2001, 05:25 AM
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
07-02-2001, 02:54 PM
$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
07-02-2001, 11:10 PM
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
07-05-2001, 10:36 PM
c00l hack! can you please make a Top XX Threads started?
Thnx!

FireandicE
07-15-2001, 11:26 AM
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
07-20-2001, 09:08 AM
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
07-20-2001, 06:44 PM
While I appreciate your initiative, could you not use my thread? Thanks.

Devels
07-20-2001, 07:29 PM
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
07-24-2001, 11:07 AM
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
07-24-2001, 02:23 PM
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
07-24-2001, 06:13 PM
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
07-26-2001, 11:24 AM
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
07-26-2001, 08:27 PM
Change $path to admin/config.php

Jaffa
07-27-2001, 09:27 AM
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
07-30-2001, 11:55 PM
Trying not to have admins show up on list. I followed instructions in zip file but they still show up.

Any Ideas anyone?

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

acid
08-05-2001, 10:26 AM
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,$dbpassw ord) 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
09-10-2001, 12:15 AM
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
09-10-2001, 09:18 PM
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
09-10-2001, 09:33 PM
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
09-13-2001, 09:04 PM
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
09-29-2001, 10:56 PM
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
10-03-2001, 02:31 PM
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
10-08-2001, 04:54 PM
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
10-08-2001, 05:04 PM
soceris,
rename the php file to .txt on your machine.

Amy

soceris
10-08-2001, 06:11 PM
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
10-09-2001, 03:56 PM
Sorry dudes,

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

-Pie

Lil'B
10-12-2001, 04:17 PM
I want to Include it on the index.php ... HOOOOOOOW ?

Help me plz :(

webhost
10-12-2001, 07:22 PM
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
10-14-2001, 03:01 PM
I need More help with the Table ...

Freegaia
10-14-2001, 03:07 PM
Verry cool, but how to exclude admins AND moderators ?

ColdFusion
10-14-2001, 08:03 PM
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
10-14-2001, 08:09 PM
[QUOTE]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

ColdFusion
10-14-2001, 08:18 PM
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
10-14-2001, 08:47 PM
like this.... http://www.animegathering.com/
look in the stats bar.

Freegaia
10-14-2001, 09:59 PM
sorry for my bad english, but how to exclude admins AND moderators ?

thank

webhost
10-14-2001, 10:04 PM
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
10-15-2001, 08:49 PM
I can exclude administrators, but i want to exlude to all moderators.

How can i do ? Please ;)

Sloat
11-11-2001, 02:38 PM
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
11-23-2001, 11:09 PM
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
11-25-2001, 02:07 AM
Never mind. I fixed it.

Logtenberg
11-27-2001, 11:20 PM
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
11-27-2001, 11:42 PM
One of the usefull hacks, I luv it!

SirSteve
12-26-2001, 02:41 PM
Does this work on 2.2.1?

nitro
02-19-2002, 02:33 PM
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
08-10-2002, 01:44 PM
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
11-23-2002, 04:33 AM
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
11-24-2002, 01:55 AM
found the problem in your code and fixed it..