vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Can anyone tell me... (https://vborg.vbsupport.ru/showthread.php?t=3028)

09-07-2000 11:24 PM

how I can post the total number of threads in a certain forum on a non-vb page??

09-08-2000 05:51 PM

Here is a start. I have no idea how to do the query. Can anyone help??

<?php

// Set this to the Forum ID to display
$forum = 20;
require("forum/admin/config.php3");
$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);

$forumtitle=htmlspecialchars($forum[title]);
$numberthreads=$forum[threadcount];
<A HREF="forumdisplay.php3?forumid=$forum">$forumtitl e</A> has $numberthreads Threads.

?>

09-08-2000 06:59 PM

90 Views and no one wants to help...

09-08-2000 07:00 PM

It's not that we don't WANT to help, many of us don't know HOW to help.

09-08-2000 07:26 PM

Quote:

Originally posted by Zothip
how I can post the total number of threads in a certain forum on a non-vb page??
read further down in this thread for the answer
http://www.vbulletin.com/forum/showt...?threadid=2658

09-08-2000 07:27 PM

here's what the thread had further down

Code:

<?php
require("/full/path/to/admin/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "select * from thread";
$resultlatest = mysql_query($query,$db);
$num = mysql_num_rows($resultlatest);
echo "<FONT FACE=\"Verdana, Arial, Helvetica, sans-serif\" SIZE=\"2\">There are currently <b>$num</b> threads on the forums.</font>";
?>

sorry didn't read your question properly... but i think you could work with this code for a per forum version - i don't know php so wouldn't have a clue :(

09-08-2000 07:55 PM

Code:

$query = "select * from thread";
This must be very resource intensive though.... you are reading all of your threads simply to find out how many there are. I think you would be better off with something like this:
Code:

SELECT COUNT(*) FROM thread
HTH.

-Chris

[Edited by Chris Schreiber on 09-08-2000 at 04:58 PM]

09-08-2000 08:20 PM

chris i tried SELECT COUNT(*) FROM thread

and it displayed my total thread count = 1 ?

09-08-2000 08:26 PM

Quote:

Originally posted by eva2000
and it displayed my total thread count = 1 ?
Well that sure isn't the correct count! :)

I can't check this now, but I will take a look at this later tonight.... this is valid SQL, I even checked here to make sure: http://www.mysql.com/documentation/m...=Counting_rows

-Chris

09-08-2000 08:56 PM

Is this what you want?

http://www.extremeforums.com/include..._count.inc.php

~Chris


All times are GMT. The time now is 07:12 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.01091 seconds
  • Memory Usage 1,731KB
  • 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
  • (3)bbcode_code_printable
  • (2)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
  • (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