Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: , by tubedogg tubedogg is offline
Developer Last Online: Dec 2016 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-26-2001 Last Update: Never Installs: 45
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-27-2001, 05:40 AM
Guest
 
Posts: n/a
Default

Whoa that's actually pretty good, I wonder if it's possible to do the same with the board's post count?
Reply With Quote
  #3  
Old 03-27-2001, 07:36 AM
Guest
 
Posts: n/a
Default

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?
Reply With Quote
  #4  
Old 03-27-2001, 07:40 AM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #5  
Old 03-27-2001, 07:58 AM
Guest
 
Posts: n/a
Default

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!
Reply With Quote
  #6  
Old 03-29-2001, 05:28 PM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #7  
Old 03-30-2001, 07:38 AM
Guest
 
Posts: n/a
Default

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)
Reply With Quote
  #8  
Old 05-27-2001, 07:00 AM
Streicher Streicher is offline
 
Join Date: Oct 2001
Location: Reinbek, Germany
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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"
Reply With Quote
  #9  
Old 05-27-2001, 08:17 AM
JamesUS's Avatar
JamesUS JamesUS is offline
 
Join Date: Oct 2001
Posts: 347
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #10  
Old 05-27-2001, 08:44 AM
Streicher Streicher is offline
 
Join Date: Oct 2001
Location: Reinbek, Germany
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JamesUS


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

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:56 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04308 seconds
  • Memory Usage 2,278KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (10)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (4)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete