Edit Reason Can not be blank

A perfect place for code snippets to small to be a MOD or a library.
Or for examples on how to use our libraries.
Post Reply
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6242
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Edit Reason Can not be blank

Post by RMcGirr83 »

This post was originally posted by Kenny at 6 String MODs, I have made some minor adjustments and we in the team will try to fix any bugs in the included codes.

Requested by TheMarauder in [url=http://www.phpbb.com/community/viewtopic.php?f=72&t=1514055]this topic[/url], the snippet forces moderators to enter an edit reason when editing a post. The post will not be submitted until their is at least 1 character in the edit reason box.

OPEN: posting.php
FIND:

Code: Select all

         $error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]);
      }
   }   &nbsp

AFTER ADD:

Code: Select all

       if (empty($post_data['post_edit_reason']) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id))
       {
          $error[] = $user->lang['EDIT_REASON_EMPTY'];       
       
}   &nbsp


OPEN: language/en/posting.php
FIND:

Code: Select all

   'EDIT_REASON'            => 'Reason for editing this post',

AFTER ADD:

Code: Select all

   'EDIT_REASON_EMPTY'         => 'You are required to enter an edit reason before submitting',


Or what ever you like:

Code: Select all

'EDIT_REASON_EMPTY'         => 'The edit reason can not be empty',
Neo
New member
New member
Posts: 3
Joined: 26 Feb 2011, 18:45

Re: Edit Reason Can not be blank

Post by Neo »

thanks Rich ;)
Mr Gloeilamp
Nub
Nub
Posts: 4
Joined: 12 Apr 2011, 06:54

Re: Edit Reason Can not be blank

Post by Mr Gloeilamp »

Thanks, I will translate to NL if I have time.
Post Reply