vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Forum-Subforum Post Count (https://vborg.vbsupport.ru/showthread.php?t=26988)

webhost 08-31-2001 04:37 PM

I have a forum with say 7 sub-forums. Is it possible to show the total posts of these just by their selves on the opening page? Like forumid "Name" Total Posts = 37 FOR EXAMPLE

Admin 08-31-2001 04:46 PM

I don't understand... :confused:
Where and what do you want to show?

Bane 08-31-2001 04:51 PM

The total number of posts for all 7 sub-forums on the main forum? Or on the main page?

webhost 08-31-2001 05:03 PM

I have a forum with 7 subforums. I have made them invisible because I could not get the color scheme right to match the board because of getting the last thread hack to work with subforums. I didn't want to show all of these sub-forums on the opening page. So like I said I made them invisible. Then in the forumhome template I placed a table to place the link for the hidden sub forums. That way it only takes up one space on the board. This table has the same look as the rest of the board. Same heading color same forum look, and I have a link in it called Latest News Here. When you click it, the 7 subforums open up which shows total threads and total posts in each column for each sub-forum. What I want to do is add all of those subforum posts counts up and display that number on the opening page in the table I have created with the link called Latest News Here, right beside it.
Go to my forums in my signature and look for this at the bottom.

Look under here for all information pretaining to WNG listed here. Includes News Releases, Court Proceedings, Raytheon and other.

Information Here:Latest News Items

Joey

Admin 09-01-2001 06:09 AM

Umm, I think that if you put this in your index.php:
PHP Code:

$invpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE forumid=29");
$invthread=$DB_site->query_first("SELECT count(*) AS threads FROM thread WHERE forumid=29"); 

and use $invpost[posts] and $invthread[threads] will do what you need.

EDIT:
Place it somewhere here:
PHP Code:

// get total posts
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=$countposts['posts'];
if (
$totalposts=='') {
  
$totalposts=0;
}
$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=$countthreads['threads'];
if (
$totalthreads=='') {
  
$totalthreads=0;
}

// get number of posts today
$datecut=time()-(86400);
$getpoststoday=$DB_site->query_first("SELECT count(*) AS count FROM post WHERE dateline>='$datecut'");
$poststoday=$getpoststoday[count];

// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid']; 

I think that shouldn't cause any problems.

webhost 09-01-2001 07:15 AM

Small problem, I installed your script in index.php and when tried to open forum I got the error below. I then went and put 2 new fields in forum table in database called invpost and invthread but still got error.

There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

Database error in vBulletin: Invalid SQL: SELECT count(*) FROM post WHERE forumid=29
mysql error:
mysql error number:
Date: Saturday 01st of September 2001 02:15:35 AM
Script: /
Referer:

Admin 09-01-2001 07:18 AM

Sorry, forgot the AS part.
Updated my post, the variables are a bit diff as well.

webhost 09-01-2001 07:25 AM

Problem still here I placed this index.php

PHP Code:

$invpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE forumid=29");
$invthread=$DB_site->query_first("SELECT count(*) AS threads FROM thread WHERE forumid=29"); 

There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.


Database error in vBulletin: Invalid SQL: SELECT count(*) AS posts FROM post WHERE forumid=29
mysql error:
mysql error number:
Date: Saturday 01st of September 2001 02:24:14 AM
Script: /
Referer:

webhost 09-01-2001 07:48 AM

I added like I said above to the forum table, do you think we need to add fields to the post and thread tables in the database?

Admin 09-01-2001 09:22 AM

NO, don't do that.

I'll try this myself and get back to you. This should work damnit.


All times are GMT. The time now is 12:35 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.01720 seconds
  • Memory Usage 1,744KB
  • 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_php_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