View Single Post
  #3  
Old 03-10-2003, 01:57 PM
gopherhockey's Avatar
gopherhockey gopherhockey is offline
 
Join Date: Jul 2002
Posts: 202
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Close, but adding that to a posts query always gives me a SQL error...

One of the displays I run is actually a hack (welcome message on non-vb page) - however, the index.php for vb has the following:

Code:
// get total posts
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);
This one isn't as critical because people don't really seem to watch it closely, but for the purposes of this hack I'd like to have the stats not show here either.

I've tried doing something similar to your threads solution with your code (for a hack) or something like this (for index.php):

Code:
 $totalposts=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE forumid!=X");
But then I get a SQL error:

Invalid SQL: SELECT count(*) AS posts FROM post WHERE forumid!=50
mysql error: Unknown column 'forumid' in 'where clause'


Actually I wonder if I'm taking the wrong road with this whole thing and should be hitting this from the other side of things.. what I mean is, instead of allowing vb to continue to count posts from this forum and masking them in displays - wouldn't there be a way to just not count them at the time some counter is increased?

I'd be happy either way I guess.. I just always get a SQL error when adding the term forumid!=XX to the post count line(s) regardless of it being a hack or being index.php...
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01657 seconds
  • Memory Usage 1,763KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete