Have 'Replies' column start at 1 instead of 0

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Get Involved
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
Keno2113
Registered User
Posts: 21
Joined: Tue Nov 14, 2006 2:13 pm

Have 'Replies' column start at 1 instead of 0

Post by Keno2113 »

I know this may be an odd request but, believe me, I do have a reason for asking. When viewing a forum you have the following columns: Topics - Poster - Replies - Views - Last Post. When a new topic is created the 'Replies' column count (correctly) reflects '0' until a reply is made to the topic and then increments to '1, 2, 3, etc...'.
I need (for a special purpose) the 'Replies' column to start its count at '1' when the topic is created and increment from there on each reply to the topic.

How can I accomplish this?

Thanks in advance.
Last edited by JimA on Thu Oct 08, 2009 6:05 pm, edited 1 time in total.
Reason: Topic icon changed
I don't suffer from insanity, I enjoy every minute of it!

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51348
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Have 'Replies' column start at 1 instead of 0

Post by stevemaury »

This SQL will start the post count at 1 for every newly created forum.

Code: Select all

 ALTER TABLE `phpbb_forums` CHANGE `forum_posts` `forum_posts` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '1' ;
For existing forums, run this before running the above:

Code: Select all

UPDATE phpbb_forums SET `forum_posts` = `forum_posts` + 1 WHERE `forum_id` > 0; 
That will add 1 to ALL forum's post counts. If you just want it for certain existing forums:

Code: Select all

UPDATE phpbb_forums SET `forum_posts` = `forum_posts` + 1 WHERE `forum_id` = N; 
Change N to the forum_id and repeat as necessary.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
Keno2113
Registered User
Posts: 21
Joined: Tue Nov 14, 2006 2:13 pm

Re: Have 'Replies' column start at 1 instead of 0

Post by Keno2113 »

Steve,
Thanks for your reply. I have made the change you suggested and it is now working.
I don't suffer from insanity, I enjoy every minute of it!

Locked

Return to “[3.0.x] Support Forum”