Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-31-2001, 04:37 PM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #2  
Old 08-31-2001, 04:46 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand...
Where and what do you want to show?
Reply With Quote
  #3  
Old 08-31-2001, 04:51 PM
Bane's Avatar
Bane Bane is offline
 
Join Date: Oct 2001
Posts: 411
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The total number of posts for all 7 sub-forums on the main forum? Or on the main page?
Reply With Quote
  #4  
Old 08-31-2001, 05:03 PM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 09-01-2001, 06:09 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 09-01-2001, 07:15 AM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Reply With Quote
  #7  
Old 09-01-2001, 07:18 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, forgot the AS part.
Updated my post, the variables are a bit diff as well.
Reply With Quote
  #8  
Old 09-01-2001, 07:25 AM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Reply With Quote
  #9  
Old 09-01-2001, 07:48 AM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #10  
Old 09-01-2001, 09:22 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

NO, don't do that.

I'll try this myself and get back to you. This should work damnit.
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 09:53 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.04171 seconds
  • Memory Usage 2,267KB
  • 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
  • (3)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
  • (2)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
  • (10)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