Log in

View Full Version : Disallow Editing on a Closed Thread


SpawnedX
07-23-2011, 06:37 PM
I am having a hard time searching for any possible mod that does this (maybe my search terms are too broad). Does anyone know a mod that allows you to stipulate a particular post is not allowed to be edited if that thread has been closed.

Basically, say you have a competition, and you want people to not be able to edit their application after the deadline and don't want your judges to have to spend time checking everyone's edit history. Just a little option to select upon closing the thread that says do not allow posting edits for this thread.

BirdOPrey5
07-26-2011, 10:55 AM
That would be a tough one to add an option to every thread, it would require modifying the database and templates and custom plugins.

If however it's something you will seldom use you could make a new plugin-

Admin CP -> Plugin Manager -> Add New Plugin

Product: vbulletin
hook: postbit_display_complete
title: disable edit in thread
execution order: 5

PHP Code:


if ($thread['threadid'] == 1000)
$post['editlink'] = "";


Set Active to YES and SAVE.

Change 1000 to be the threadid of whatever thread you want to disable edits on.

That will disable edits for everyone.

If you want to allow mods and admins to edit:


if ($thread['threadid'] == 1000 AND !is_member_of($vbulletin->userinfo, 5, 6, 7))
$post['editlink'] = "";


Where 5, 6, and 7 are mod and admin usergroups.