Post count

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
letmeinforgodsake
Registered User
Posts: 467
Joined: Thu Mar 21, 2002 12:01 am
Location: England

Post count

Post by letmeinforgodsake » Sun Sep 21, 2003 8:47 am

Can I stop this from going down when a post is deleted ?

boyinUK
Registered User
Posts: 320
Joined: Mon Aug 18, 2003 6:16 pm
Location: West Country, UK
Contact:

Post by boyinUK » Sun Sep 21, 2003 8:52 am

If you or one of your moderators deletes a post manually, the post count of the user will decrease. In order to change this and still retain similar functionality, you can create a new hidden moderator-viewable forum that is pruned daily, and move (without leaving shadows) posts to be deleted to that deletion forum. :)

User avatar
zeroK
Former Team Member
Posts: 20964
Joined: Sun Jan 20, 2002 7:36 pm
Location: Klagenfurt / Austria
Contact:

Post by zeroK » Sun Sep 21, 2003 8:56 am

I'm not 100% but try following:
Open the modcp.php and search for following section:

Code: Select all

			$sql = "SELECT poster_id, COUNT(post_id) AS posts 
				FROM " . POSTS_TABLE . " 
				WHERE topic_id IN ($topic_id_sql) 
				GROUP BY poster_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get poster id information', '', __LINE__, __FILE__, $sql);
			}

			$count_sql = array();
			while ( $row = $db->sql_fetchrow($result) )
			{
				$count_sql[] = "UPDATE " . USERS_TABLE . " 
					SET user_posts = user_posts - " . $row['posts'] . " 
					WHERE user_id = " . $row['poster_id'];
			}
			$db->sql_freeresult($result);

			if ( sizeof($count_sql) )
			{
				for($i = 0; $i < sizeof($count_sql); $i++)
				{
					if ( !$db->sql_query($count_sql[$i]) )
					{
						message_die(GENERAL_ERROR, 'Could not update user post count information', '', __LINE__, __FILE__, $sql);
					}
				}
			}
(Should be somewhere around line 248)

And comment it out

Code: Select all

/*
			$sql = "SELECT poster_id, COUNT(post_id) AS posts 
				FROM " . POSTS_TABLE . " 
				WHERE topic_id IN ($topic_id_sql) 
				GROUP BY poster_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get poster id information', '', __LINE__, __FILE__, $sql);
			}

			$count_sql = array();
			while ( $row = $db->sql_fetchrow($result) )
			{
				$count_sql[] = "UPDATE " . USERS_TABLE . " 
					SET user_posts = user_posts - " . $row['posts'] . " 
					WHERE user_id = " . $row['poster_id'];
			}
			$db->sql_freeresult($result);

			if ( sizeof($count_sql) )
			{
				for($i = 0; $i < sizeof($count_sql); $i++)
				{
					if ( !$db->sql_query($count_sql[$i]) )
					{
						message_die(GENERAL_ERROR, 'Could not update user post count information', '', __LINE__, __FILE__, $sql);
					}
				}
			}*/
Perhaps this works :-)
Image My weblog | gamerslog.com | No support via PM or ICQ or email - If you don't know a term or a program mentioned in a post -> Google is your friend

letmeinforgodsake
Registered User
Posts: 467
Joined: Thu Mar 21, 2002 12:01 am
Location: England

Post by letmeinforgodsake » Fri Sep 26, 2003 12:17 am

Thanks for the replies, cant move the posts to hidden, there would be millions of them in a short time.

Do I comment out all that code ?, will need to save and read this

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Post by A_Jelly_Doughnut » Fri Sep 26, 2003 12:21 am

I think what ZeroK says is right.

Yes, comment out the whole first block.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

letmeinforgodsake
Registered User
Posts: 467
Joined: Thu Mar 21, 2002 12:01 am
Location: England

Post by letmeinforgodsake » Sun Sep 28, 2003 8:37 am

Don't work ?

I have checked several times, uploaded deleted original did a refresh of everything, but post count is still going down, is there any other script that changes it ?

Few mods
Quick reply
Album
Member Number

Don't see anything there that could bypass, is the "/* */" effective ?

Made a few posts, deleted them, post count still goes down

BFUK
Registered User
Posts: 17
Joined: Fri May 23, 2003 11:44 pm
Contact:

Post by BFUK » Sun Sep 28, 2003 9:51 pm

After searching through the topics to see if anyone else had the same problem I found this topic and set up a hidden deletion forum.

It works a treat. Thanks :D

letmeinforgodsake
Registered User
Posts: 467
Joined: Thu Mar 21, 2002 12:01 am
Location: England

Post by letmeinforgodsake » Mon Sep 29, 2003 9:22 am

hidden deletion forum.

Until you have a million posts in there ?

BFUK
Registered User
Posts: 17
Joined: Fri May 23, 2003 11:44 pm
Contact:

Post by BFUK » Mon Sep 29, 2003 11:05 pm

Nope, I've set that particular forum to auto prune all the topics every day.

That way they don't build up and forum members don't lose posts.

letmeinforgodsake
Registered User
Posts: 467
Joined: Thu Mar 21, 2002 12:01 am
Location: England

Post by letmeinforgodsake » Tue Sep 30, 2003 8:39 am

auto prune


this will make the post count go down, what is the point of auto prune on moved posts :) might as well auto prune the original posts.
members don't lose posts

they will, just like auto prune on the original topic.


Does antbody know how to stop the post count gowing down ?

BFUK
Registered User
Posts: 17
Joined: Fri May 23, 2003 11:44 pm
Contact:

Post by BFUK » Tue Sep 30, 2003 9:04 pm

Ah. Now the thing is the auto prune doesn't lower the post count on our board - the only time members lose posts is if myself or one of the moderators manually delete a post or thread.

letmeinforgodsake
Registered User
Posts: 467
Joined: Thu Mar 21, 2002 12:01 am
Location: England

Post by letmeinforgodsake » Sun Oct 05, 2003 9:44 am

is that so? never new that, will go try it :)

Ah, well that's one way to stop the count going down, still don't know why you want to move yours first, auto prune on the other topics would do the same thing.

Thanks for the tip, now I can get rid of a lot of old posts without the count going down

BFUK
Registered User
Posts: 17
Joined: Fri May 23, 2003 11:44 pm
Contact:

Post by BFUK » Wed Oct 08, 2003 12:02 am

It's hard to explain if you're not a board member, but there's some old threads that have stuff on them we want to keep for reference. On the other hand there's loads of threads that go way off topic and chatty threads that can go bye-bye after a while.

I'd invite you over but we're having major hassles with our site hosts and I'm currently in the middle of moving everything to a new company :evil:

Nautilus_Xtrem!!
Registered User
Posts: 15
Joined: Tue Mar 02, 2004 4:27 am

Post by Nautilus_Xtrem!! » Thu Mar 04, 2004 5:58 am

Ok people again for the one millionith time this only works with TOPICS if I want to delete individual posts this does me squat. Does ANYONE have the knowledge or skill to make it possible to delete INDIVIDUAL posts and have the post count stay the same???? I've been on and posted on other forums (not phpbb) that accompish this. So please any real help would be greatly appreciated!!

User avatar
AdamR
Former Team Member
Posts: 9731
Joined: Tue Mar 02, 2004 5:40 pm
Location: Tampa, Florida
Name: Adam Reyher
Contact:

Post by AdamR » Thu Mar 04, 2004 6:07 am

In addition to the first edit, (commenting out), there is a second one:

http://morpheus.2037.biz/viewtopic.php?p=983#983
phpBB Support: Welcome | Userguide | Knowledge Base | Search
Honored supporter of the phpBB Group!
"If I have seen a little further it is by standing on the shoulders of Giants." - Isaac Newton

Locked

Return to “2.0.x Support Forum”