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)
-   -   Prune doesn't reduce user post count (https://vborg.vbsupport.ru/showthread.php?t=12420)

tubedogg 03-26-2001 10:00 PM

Someone mentioned this in the other forum (I think it was Castel). It's hardly a hack, as it consists of commenting out 3 lines, but here's how to do it:

In functions.php (in the /admin directory) find
Code:

// ###################### Start delete thread #######################
It should be around line 1450, somewhere in there. Now, a few lines below that, find
Code:

                        if ($countposts) {
                                $DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$post[userid]'");
                        }

and replace it with
Code:

//                        if ($countposts) {
//                                $DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$post[userid]'");
//                        }

Then, a few lines below that, find
Code:

// ###################### Start delete post #######################
A few lines below that, find
Code:

                if ($countposts) {
                        $DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
                }

and replace it with
Code:

//                if ($countposts) {
//                        $DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
//                }

Now when you prune (or a post is deleted) the users' post count won't decrease.

03-27-2001 05:40 AM

Whoa that's actually pretty good, I wonder if it's possible to do the same with the board's post count?

03-27-2001 07:36 AM

Oh btw I have another question, does the counter still work when you delete a thread? I mean if you delete a thread will it reduce that user's post count?

03-27-2001 07:40 AM

With this hack, any time a post is deleted (be it via Pruning or by the user himself or the moderator of the forum, and whether you are deleting an individual post or a whole thread), the user's post count is *not* affected. So this makes his count truly a full count of the total number of posts he has made since registering. The reason it works this way is all the different ways to delete a post - pruning, moderator deleting, user deleting, thread being deleted - rely on these two functions to work. Once you remove the reduce count functionality from these two places, no matter how a post is deleted, the user's count stays the same.

03-27-2001 07:58 AM

I see, the only drawback would be if a user spammed the board intentionaly to raise his or her post count, and then deleted his threads.

I guess if you don't allow users to delete their threads, but only to edit them you kinda solve this problem!
Nice hack indeed man!

03-29-2001 05:28 PM

I guess I'm the only person that likes it the way it is now. I like the fact that when a post is deleted, the post count goes down.

Messages are only deleted on my board for one main reason: The user accidentally double-posted. When I see a double post, I delete one. It makes things look nicer. And I don't think someone should get positive credit for a mistake, even if a genuine, simple mistake.

Now we have a very progressive moderating attitude on my board. We will allow a lot of stuff to go by, as long as people are not attacking each other, etc. But when situations do come up, I prefer to edit or censor, rather than deleting the message. By editing the message, and putting an explanation in the edited message, the person who posted the offending message will see right away that what he did was not acceptable, and will have an explanation. This is preferable, in my opinion, that the person coming back and seeing his message missing, and not knowing what is going on.

So deleting a post is not normally done on my board, and only as a very last resort. So if something is deleted, it was because it was very, very bad, and once again, I do not feel someone should continue to get positive credit, to keep credit for that post, if it was so bad that it had to be deleted.

Now I have things set so nobody can delete their own messages or threads, so we do not have a situation of innocent people getting their counts lowered because someone deleted the first post.

03-30-2001 07:38 AM

You might want to read what I wrote here at the bottom:

http://vbulletin.com/forum/showthrea...threadid=12189

This entire hack is redundent.

Instead of so many code lines, you can achieve exactly the same result by changing in functions.php:

Code:

function deletethread($threadid,$countposts=1)
to

Code:

function deletethread($threadid,$countposts=0)
(this will ensure that post count does not get decreased when a thread is deleted)

and if you want post count not to change when specific posts are deleted as well, then in function.php change:

Code:

function deletepost($postid,$countposts=1,$threadid=0)
to

Code:

function deletepost($postid,$countposts=0,$threadid=0)

Streicher 05-27-2001 07:00 AM

hmm, bira's version of the hack does not work in vB 2.0 final and tubedogg`s first replacement is not anywhere in the funcions.php of the final release.

Can you help me?


Edit: forgotten the word "not" :rolleyes:

JamesUS 05-27-2001 08:17 AM

Quote:

bira's version of the hack does work in vB 2.0 final
If bira's hack works what do you need help with? :)

Streicher 05-27-2001 08:44 AM

Quote:

Originally posted by JamesUS


If bira's hack works what do you need help with? :)

Ups :rolleyes:

I have forgotten the little word "not". Bira's version of the hack does not work, too.


All times are GMT. The time now is 01:45 PM.

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.01147 seconds
  • Memory Usage 1,746KB
  • 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
  • (10)bbcode_code_printable
  • (2)bbcode_quote_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