vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Top XX Posters (https://vborg.vbsupport.ru/showthread.php?t=12067)

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/memberlis...ers&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:
PHP Code:

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

Quote:

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.
Quote:

2.) I'm not getting Administrators to show up, even though I set it to 1.
Try replacing the line
Code:

        $exn = "WHERE usergroupid<>$exr";
with
Code:

        $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 --> 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

PHP Code:

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

PHP Code:

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:

PHP Code:

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

PHP Code:

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:

PHP Code:

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

PHP Code:

echo("</table>"); 

Change to read:

PHP Code:

$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/showt...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/...info&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:


Quote:

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

Quote:

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

Sarge 09-29-2001 10:56 PM

Quote:

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!!!!!


All times are GMT. The time now is 01:02 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.01538 seconds
  • Memory Usage 1,875KB
  • 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
  • (2)bbcode_code_printable
  • (8)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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