PDA

View Full Version : Post Counts


hello
11-29-2004, 05:58 PM
I want to know how to make it so that post counts are not lowered when posts are deleted without making a seperate forum which only admins and smods can see, so like editing a php file or something, but for 3.0.3

hello
11-30-2004, 05:36 AM
please can someone help me i need it urgently

SaN-DeeP
11-30-2004, 06:47 AM
I want to know how to make it so that post counts are not lowered when posts are deleted without making a seperate forum which only admins and smods can see, so like editing a php file or something, but for 3.0.3
I dont think if this is possible anyway, by default post counts will get reduced if you physically delete posts from forms, and again when you update your counters some day.

For what you want, you may need to create another field and store the values someway there, A SQL Pro can help ya here.

hello
11-30-2004, 10:08 AM
so is there a sql pro lol

hello
12-12-2004, 05:18 PM
please can someone help me

grrr
12-13-2004, 08:52 PM
i am not much of a programmer, but i suggest a new DB table so that new post is copied to both, and when they delete they only delete from ain, and u keep showing the other?

hello
12-14-2004, 05:56 AM
so how do i do that lol

Colin F
12-14-2004, 06:30 AM
Why are you deleting posts?

If you don't need to save space or so, you can just soft delete them, which will not reduce the postcount.

hello
12-14-2004, 07:45 AM
i don't want to soft delete them i want them gone lol, so how do i do it without making the post counts go down

Colin F
12-14-2004, 09:36 AM
You'd have to look for the function that hard deletes posts.

There should be a query there along the lines of $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET postcount = postcount-1 WHERE userid = $userid");

Delete that query.

hello
12-14-2004, 03:36 PM
i can't find it :(

Kagen
12-14-2004, 05:42 PM
LOL noob :p o well were all newbies it should be in the /includes in one of the post funtions or somewere else related to posting

hello
12-24-2004, 12:10 PM
please can someone tell me what file

dcarr
12-24-2004, 04:07 PM
If you Prune posts...rather than deleting them..the post counts will remain the same
On my forum, I move all posts that need to be pruned..to a separate forum, just because it's easier. But you can prune selectively as well

hello
12-24-2004, 04:08 PM
i don't want to put it in a different forum i want it so that when i physicly remove a post, their post count doesn't go down

Zachery
12-24-2004, 04:22 PM
i don't want to put it in a different forum i want it so that when i physicly remove a post, their post count doesn't go down
Why do you want to remove the posts though?

Paul M
12-24-2004, 04:52 PM
What he said - Why ?

dcarr
12-26-2004, 12:47 AM
Then you can prune the posts selectively..I only mentioned that I put them in a separate forum, because we sometimes prune quite a few. But you can do them one by one. Pruning does not affect post count...Deleting does

hello
12-26-2004, 06:36 AM
ok so how do i prune posts selectivly

Bison
12-26-2004, 07:47 PM
I see everyone giving this guy a hard time, but this could be done in vB2 where after deleting posts, the user's post count decreases. Someone created a hack which prevented this forum happening ... For you's who asked "Why Delete??" ... there's a few good reason, but one that really comes to mind is some of us run huge forums and there's no reason to keep dead or resolved posts around because the forum a very active and keeping them around is NOT a good forum performance maneuver.

dcarr
12-27-2004, 01:39 AM
Ok, in your admin or mod cp in Threads and posts section is a drop down for prune. There are many options to isolate the threads. Often I just choose the appropriate forum, and then click prune threads...this brings up a separate window where you can view each and decide what to prune and what to keep

Michael Morris
12-27-2004, 01:57 AM
The counters are maintained in the ./includes/functions_databuild.php library. That's the file where you'll find the query (or one similar to it) Colin mentioned.

snake-boy
12-30-2004, 06:08 PM
I'd have to second this request for this hack. In fact I can't believe nobody has addressed this before. If I had a clue about php I'd do it myself.

I have the exact same problem in that I have to move all threads to a separate forum that users cannot see. The key issue here is SPACE. The thousands of posts that have accumulated there occupy more space then all my other forums combined! I want to be able to flush out that forum (ie HARD delete all those posts), but NOT impact on users post counts.

Once a post has been made, the act of posting has been acomplished, thus +1 to the post count. The physical removal of the 'evidence' of the posting should not have anything to do with the post count.

What amazes me is some feel so strongly that post counts should be -1 when a post is hard deleted, yet they feel that soft-delete is fine. It's no different from the users point of view, he has still committed the 'act of posting' weather his post is later hard deleted OR soft deleted, so why should his post count be effected be either?

I'd really appreciate it if someone would take a look at a hack that could acomplish this. I would really appreciate it. It will put this descision in the hands of the admin, where it belongs.

Many thanks

-snake

dcarr
12-30-2004, 07:15 PM
Well if you do move them to a separate forum, then you can prune that entire forum and no post counts will be affected.

KOKS@LN
01-04-2006, 02:33 AM
I'm using vB 3.5.2 but i tried to find a solution for you...
I think your problem can be solved if you remove the underlying code from includes/functions_databuild.php
It works, but i'm not sure whether it affects other things or not, because i also don't know php...

if (!empty($userbyuserid) AND $threadinfo['visible'] == 1)
{ // if the thread is moderated the posts have already been reduced
$userbypostcount = array();
foreach ($userbyuserid AS $postuserid => $postcount)
{
$alluserids .= ",$postuserid";
$userbypostcount["$postcount"] .= ",$postuserid";
}
foreach($userbypostcount AS $postcount => $userids)
{
$casesql .= " WHEN userid IN (0$userids) AND posts > $postcount THEN

posts - $postcount\n";
}

// postcounts are already negative, so we don't want to do -(-1)
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX ."user SET
posts = CASE $casesql ELSE 0 END
WHERE userid IN (0$alluserids)
");
}