Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2001, 10:55 PM
snyx's Avatar
snyx snyx is offline
 
Join Date: Oct 2001
Location: Vancouver (whistler.2010)
Posts: 556
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #2  
Old 02-07-2001, 11:08 PM
Guest
 
Posts: n/a
Default

Code:
SELECT user.posts, user.username FROM user ORDER BY user.posts DESC, user.username DESC LIMIT 0, 10
Reply With Quote
  #3  
Old 02-07-2001, 11:26 PM
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #4  
Old 02-08-2001, 12:24 AM
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #5  
Old 02-08-2001, 11:55 AM
Guest
 
Posts: n/a
Default

THANKS MAN! Wow, this wasnt hard like it thought, sweet!
Reply With Quote
  #6  
Old 02-18-2001, 01:03 PM
Guest
 
Posts: n/a
Default

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 -> {
Reply With Quote
  #7  
Old 02-19-2001, 01:58 PM
Guest
 
Posts: n/a
Default

help ...
Reply With Quote
  #8  
Old 02-21-2001, 12:05 PM
Guest
 
Posts: n/a
Default

help help help plzzzzzzz
Reply With Quote
  #9  
Old 02-21-2001, 05:54 PM
Guest
 
Posts: n/a
Default

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,
Reply With Quote
  #10  
Old 02-21-2001, 06:03 PM
Guest
 
Posts: n/a
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04044 seconds
  • Memory Usage 2,236KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete