vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Top Posters Hack? (https://vborg.vbsupport.ru/showthread.php?t=7940)

snyx 02-07-2001 10:55 PM

Im looking for a hack that shows the top posters on your baords on the main page, so I can make it show up on my home page, anyone ever seen one?

02-07-2001 11:08 PM

Code:

SELECT user.posts, user.username FROM user ORDER BY user.posts DESC, user.username DESC LIMIT 0, 10

02-07-2001 11:26 PM

Wow thanks, but how do I, and what can I do with one line of code? What do i do to incorp it into a php file in another DIR

02-08-2001 12:24 AM

Sorry, I wasn't thinking...

PHP Code:

<?php
require("path/to/global.php");

print(
"<table><tr><td colspan=\"2\">Top Posters</td></tr>
<tr><td><b>Username</b></td><td><b>Posts</b></td></tr>"
);

$db_link = @mysql_pconnect("$dbservername""$dbusername""$dbpassword");
mysql_select_db ("$dbname"$db_link);

$query mysql_query("SELECT posts, username FROM user ORDER BY user.posts DESC, user.username DESC LIMIT 0, 10");

while(
$row mysql_fetch_array($query))
          {
          
$username $row["username"];
          
$posts $row["posts"];

          print(
"<tr><td>$username</td><td>$posts</td></tr>");
          }

print(
"</table>");

?>

Put this in any page you want to. Just change the path to global.php and the LIMIT statement to reflect how many people you want to display. It's set at 10.

HTH

-jim

02-08-2001 11:55 AM

THANKS MAN! Wow, this wasnt hard like it thought, sweet!

02-18-2001 01:03 PM

I did that and I get this error

Warning: Supplied argument is not a valid MySQL-Link resource in /web/sites/3/leokiller/www.flyaway.f2s.com/board/main.php on line 15

and on line 15 the only thing on is is this symbol -> {

02-19-2001 01:58 PM

help ... :(

02-21-2001 12:05 PM

help help help plzzzzzzz

02-21-2001 05:54 PM

try changing the lines to this:
PHP Code:

$db_link = @mysql_pconnect("$dbservername""$dbusername""$dbpassword");
mysql_select_db ("$dbname"$db_link)
  or die(
"Error connecting to DB");

$query mysql_query("SELECT posts, username FROM user ORDER BY user.posts DESC, user.username DESC LIMIT 0, 10")
  or die(
"Query Error:$query"); 

This should tell you where your error is...
Good Luck,

02-21-2001 06:03 PM

is sais error connecting to DB ,how is that possible ? It uses my global.php yes ? Well since my vbulletin shows no problems and connects without errors ,how can this script make an error connecting ? Please help , I really want this script to work


All times are GMT. The time now is 08:57 PM.

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.01110 seconds
  • Memory Usage 1,733KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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