vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   this should be very simple..... (https://vborg.vbsupport.ru/showthread.php?t=36968)

FWC 04-05-2002 04:30 PM

Quote:

Originally posted by TaP
same error..... cant you show a complete peice? im still a bit confused
This will give you the ten most replied to threads in forum 14:
Code:

SELECT postuserid,postusername,replycount FROM thread WHERE forumid=14 ORDER BY replycount DESC LIMIT 10
I am not sure what you are really looking for, though.

TaP 04-05-2002 07:27 PM

ok that worked i dont get error any more

but in the templates when i add

$top10thread

it doesnt show any thing

i also tried

$top10thread[posts]

FWC 04-05-2002 07:54 PM

OK, before we go any further. What exactly are you trying to do? What do you want a top ten list of?

mr e 04-05-2002 08:03 PM

Well until my forum is back up I'm kind of guessing here, but try this.

PHP Code:

// Top 10 Posters in a certain thread 
$top10 $DB_site->query('SELECT postuserid,forumid,postusername,posts FROM thread WHERE forumid = # ORDER BY posts DESC LIMIT 10'); 
while (
$top10thread mysql_fetch_array($top10)): 
++
$top10threadnbsp
$top10name .= "? <a href=member.php?s=$session[sessionhash]&action=getinfo&userid=$top10thread[userid]>$top10thread[username]</a><br>"
$top10post .= "$top10thread[posts]<br>"
endwhile; 
// End Top 10 Posters in a certain thread 

Then put $top10post and $top10name on your index.php

TaP 04-05-2002 10:24 PM

v

TaP 04-05-2002 10:24 PM

Database error in vBulletin 2.2.4:

Invalid SQL: SELECT postuserid,forumid,postusername,posts FROM thread WHERE forumid = # ORDER BY posts DESC LIMIT 10
mysql error: You have an error in your SQL syntax near '' at line 1

TaP 04-05-2002 10:28 PM

»
»

is what i get were i inserted the $top10post and $top10name

mr e 04-06-2002 02:08 AM

Well the "forumid = #" part you have to put in the number of the forum id you want it to use.

TaP 04-06-2002 03:38 AM

i did and i got the above..... is there any way you can just make the first hack on the back on the first page incorperate into the second hack?


All times are GMT. The time now is 03:08 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.01694 seconds
  • Memory Usage 1,732KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_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
  • (9)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