vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Add current post counter to each post! (https://vborg.vbsupport.ru/showthread.php?t=33052)

FWC 12-18-2001 04:38 PM

[QUOTE]Originally posted by Sadie Frost
I'm asking cause when I was installing and went to update my post counters, I got this database error:

Database error in vBulletin Control Panel 2.2.1:

Invalid SQL: SELECT postcount FROM post LIMIT 1
mysql error: Unknown column 'postcount' in 'field list'

Tommy Boy 12-18-2001 05:13 PM

I'm sorry for that. It's my fault, since I took a code from another hack, without testing it first... Anyway, the attachment was updated (v2.1), and if you already installed v2.0, just make this small modification:

Open admin/misc.php, and look for:
PHP Code:

  // Add post counter column to post table, if needed 
$DB_site->query ("SELECT postcount FROM post LIMIT 1"); 
  if (
$DB_site->errno
    
$DB_site->query ("ALTER TABLE post ADD postcount int unsigned not null AFTER userid"); 

Change it to:
PHP Code:

  // Add post counter column to post table, if needed 
$col_exists $DB_site->query_first ("SHOW columns FROM post LIKE 'postcount'"); 
  if (!
$col_exists
    
$DB_site->query ("ALTER TABLE post ADD postcount int unsigned not null AFTER userid"); 

As for your question, update-post-counters.php is no longer needed, as long as the above change is applied.

Sadie Frost 12-18-2001 06:05 PM

Thanks for helping me with that :)

No to be a pain but I'm still getting a parse error when I try to go to update counters - think that's an unrelated problem?

Tommy Boy 12-18-2001 06:10 PM

I think so too. Send me your misc.php file, and I'll tell you what's wrong with it. I sent you an email, so you will know mine.

Sadie Frost 12-18-2001 11:08 PM

It's working great now! :) I always thought posts should say the order in which they were posted - it's terrific. Thanks! :)

kidney 03-17-2002 10:57 PM

Ok, got a question,

Why does my total post counter increase, but not the other.
Here is what I mean, I get 1/16 or 1/17.
When ever I post the last two digit increase, but I alway get 1/?? anywhere No mather which post I look I get 1/##, it always remains at 1/##, any clue!!

kidney 03-17-2002 11:02 PM

Ok, it only increments whitin the same thread, Isn't suppose to work accross the forum?

Tommy Boy 03-18-2002 10:32 AM

Yes it is. It might be conflicting with another hack you have installed. Try reapplying it, but use another name instead of "postcount".

kidney 03-18-2002 12:15 PM

Yup it's conflicting with Biras' "Post Counter & Direct Link"

I know that you can fix it, but I figured that I have already done it, so I will pm the new file...

julius 05-18-2003 07:29 AM

Mysql error when you delete a thread. (vb 2.3.0.)


All times are GMT. The time now is 01:46 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.01015 seconds
  • Memory Usage 1,736KB
  • 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
  • (2)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