Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Stop people mass deleting / editing their posts Details »»
Stop people mass deleting / editing their posts
Version: 1.02, by bairy bairy is offline
Developer Last Online: Jul 2023 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 03-19-2006 Last Update: 03-20-2006 Installs: 2
Code Changes Is in Beta Stage  
No support by the author.

Recently I have had a couple of my members disagree with me. They've then decided they want to throw a fit and managed to edit or delete several dozen of their posts before I've spotted them and being able to stop it.

Therefore I've written this hack.

What it does:
Every time someone* edits or soft deletes a post of theirs, the time of that event is logged. The edit post script reads the last 5 times that user edited or deleted a (different) post and if they've done 5 edits/deletes in 10 mins it automatically puts them into a "can not edit" list.
The user of your choice (probably you) then gets a PM telling you they've triggered this auto and you can investigate it.
The list is in the admin control panel so you can remove (or if you like, manually add) people to it.

*Usergroups 5,6,7 (supermods, admin, mods) are excluded from the check.


Changes:
1 vB option (optional)
1 phrase addition
4 file edits (1 is optional but recommended)
4 SQLs to run


Downsides:
= You have to disable the ajax in-line editing, or the error message gets really messy for people who are on the "can't edit or delete" list.
OR There is one extra query per showthread.

= There is one more query on every initial edit post request, and 3 more if that post is saved.


Note that people in the list who can't edit do still see the edit button. This was deliberate as when clicked it will supply them with a message. I thought this better than confusion over where it is.


I'm not a great coder and my knowledge of vB is what I can pick up as I go. I have successfully got this hack working on my board and I think I've covered all the angles and so far as I can tell, it will work on any board. However, make sure you have a backup of your database, and backups of the files you're editing, just in case, and at this time I still consider the hack as beta.

I'll try to give support where I can but I'm not "officially" supporting it.


UPDATES

1.01: Minor update
1. Added TABLE_PREFIX to my queries.
2. In editpost.php,
PHP Code:
$pmdm->set_recipients('bairy'); 
became
PHP Code:
$pmdm->set_recipients('bairy'$movealongnothingtoseehere); 
(where bairy is the name you chose).
Previously php moaned there was no 2nd parameter for the set_recipients function, now there is and the fact it's blank doesn't matter in this hack.

1.02: Fixed the AJAX problem.
Using one query per showthread, vb will determine if the user is on the can't edit list. If they are, it will disable the ajax inline editor meaning if they click edit, they'll be shown the error message as it's supposed to look.
It won't execute if the inline editor is switched off.
Fix (which is in the updated txt attachment):

Open includes/class_postbit.php
Find (line ~913):
PHP Code:
        // can edit or delete this post, so show the link
            
$this->post['editlink'] = 'editpost.php?' $this->registry->session->vars['sessionurl'] . 'do=editpost&p=' $this->post['postid']; 
Add Below:
PHP Code:
            // Bairy's "too fast too much editors" hack
            
if (!is_member_of($vbulletin->userinfo567) AND !$this->registry->options['cannoteditupdated'] AND $this->registry->options['quickedit'])
            {    
// If the list isn't updated and ajax inline editing is on, update the list. If ajax i-l-e is off, there's no need to.
                
$cannoteditlist $this->registry->db->query_first("SELECT value FROM ".TABLE_PREFIX."setting WHERE varname = 'cannotedit'"); // Refresh the list in realtime (not cached)
                
$this->registry->options['cannoteditupdated'] = true// as options is already globalised it seems a good idea to use it instead of making another entire variable
                
$this->registry->options['cannotedit'] = explode("|"$cannoteditlist['value']);
                if (
in_array($this->registry->userinfo['userid'], $this->registry->options['cannotedit'])) { $this->registry->options['quickedit'] = false; }
            }
            
// Bairy's "too fast too much editors" hack 

Show Your Support

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

Comments
  #2  
Old 03-20-2006, 09:34 PM
Stangsta's Avatar
Stangsta Stangsta is offline
 
Join Date: Aug 2004
Location: Virginia
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good Job! But I cant use it. Im not going to disable AJAX nor do file edits

However, ill keep checking back for a plugin.
Reply With Quote
  #3  
Old 03-20-2006, 09:48 PM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You don't have to disable the whole of AJAX, just the in-thread editing (when you click edit, it's the text box that comes up).
You don't even have to disable that if you don't want to, it's just that anyone who happens to trigger the limiter will have the warning phrase appear, header n all within the thread, which looks really horrible.
If anyone knows a way to force a page refresh and then show the error message when you click "save" on the in-line editor, I'll stick it in.

At the moment I don't know how I could disable AJAX for those members.

As for vB plugins, you're outta luck. The places I've edited don't have hooks anywhere near them.
Reply With Quote
  #4  
Old 03-20-2006, 11:02 PM
LincolnForums LincolnForums is offline
 
Join Date: Oct 2005
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not just disable the feature where users can delete their own posts, and have it so they cant edit them after a certain amount of time?
Reply With Quote
  #5  
Old 03-20-2006, 11:08 PM
Tralala's Avatar
Tralala Tralala is offline
 
Join Date: Jan 2006
Posts: 1,207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LincolnForums
Why not just disable the feature where users can delete their own posts, and have it so they cant edit them after a certain amount of time?
Because that throws the baby out with the bathwater. It may be okay to delete or edit a post from time to time, but NOT OKAY to edit or delete them all in a anger-ridden frenzy...
Reply With Quote
  #6  
Old 03-20-2006, 11:14 PM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did think about not allowing editing after a certain amount of time, but then I looked at the timestamps on the edit logs and found that a lot of people were editing days and even weeks after the original posts, usually to add a new photo of themselves or something.

It was an option but not ideal enough. This solution, although fiddly and not without drawbacks, was much more ideal (for me, at least)

With the deleting I personally feel users should be able to delete their own threads if they like.
Reply With Quote
  #7  
Old 03-21-2006, 12:46 AM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a GREAT modificatioN! I hope you get some help over the AJAX problem so this wil become a better hack without those downsides.

Good luck! Ill install just to keep track of updates.
Reply With Quote
  #8  
Old 03-21-2006, 10:24 AM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice work man!
Reply With Quote
Reply


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 08:38 PM.


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.04290 seconds
  • Memory Usage 2,292KB
  • 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
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete