Icy Phoenix

     
 

Moderator Messages / Message Locking ?

Moderator Messages / Message Locking ?

Article
Reply with quote    Download Post  
Post Moderator Messages / Message Locking ? 
 
Hey everybody,

I've seen something really interesting while browsing phpBB3 mods :
"Moderator messages"

Basically, this allows a moderator to add a "red box" containing a message that the user won't be able to edit. This is used to make notices etc, because I've had a lot of users removing what moderators put up in their messages, etc (they used to come back after a week or two, even ).

Another idea would be message locking. Let's say, if a moderator edits a message, then it's considered "locked" and can't be edited by the user again. That'd fix the problem from the first idea : an user could still delete his message's content, so that the message left by the moderator would not make any sense.
I really like that idea. I actually think phpBB3 has something like this, but even 6 years later, I still can't find willpower to install it   . (I've installed it once, actually, but that was because it was a premodded board).

/discuss

PS : what about we remove that "clean name" field ? This just confuses the hell out of people.



 
Informpro - View user's profile Send private message  
Informpro [ Fri 16 Aug, 2013 15:53 ]
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us


Moderator Messages / Message Locking ?

Comments
Reply with quote    Download Post  
Post Re: Moderator Messages / Message Locking ? 
 
Clean name was implemented to replace/integrate URL Rewrite... it's like WordPress works... I never finished integrating the feature, but it's something that could be easily done.

I can hide that field... or I can finish coding it... maybe the time required will be the same, so I'd better finish it.

Regarding other features, try to suggest some code and I will analyze it.



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Sun 18 Aug, 2013 09:17 ]
Reply with quote    Download Post  
Post Re: Moderator Messages / Message Locking ? 
 
Okay, meddled around with "post locking" :

I added "post_locked" tinyint(1) to ip_posts

viewtopic.php line 1765 ($edit_switch stuff)
Inline Add "&& !$postrow[$i]['post_locked']" after "$is_auth['auth_edit']"

posting.php ~line 452 (after limit post edit time)
Add
Code: [Download] [Hide]
  1. if ($mode == 'editpost') 
  2.   if ($is_auth['auth_mod']) 
  3.   { 
  4.     $template->assign_block_vars('switch_lock_post', array()); 
  5.     $lock_post = request_boolean_var('post_locked', false); 
  6.     $template->assign_var('S_LOCK_POST', $lock_post ? ' checked="checked"' : ''); 
  7.   } 
  8.   else if ($post_info['post_locked']) 
  9.   { 
  10.     message_die(GENERAL_MESSAGE, 'Message_locked'); 
  11.   } 
  12.   else 
  13.   { 
  14.     $lock_post = $post_info['post_locked']; 


And finally in posting_body, after "END switch_topic_unlock"
Add
Code: [Download] [Hide]
  1. <!-- BEGIN switch_lock_post --> 
  2.   <label><input type="checkbox" name="post_locked" {S_POST_LOCK} />&nbsp;{L_LOCK_POST}</label><br /> 
  3. <!-- END switch_lock_post --> 


functions_post.php in submit_post
You just need to pass $lock_post and add it to the query.
Maybe there's a better way to do it, but that seems like the most minimalist solution to me :).
Sorry for the typos I might've made, I posted this from my phone.



 
Informpro - View user's profile Send private message  
Informpro [ Sun 18 Aug, 2013 11:54 ]
Reply with quote    Download Post  
Post Re: Moderator Messages / Message Locking ? 
 
I'll have a look at this suggestion and let you know.

Usually I regret adding fields to posts and topics tables... but I'll consider adding a couple of new fields to add new moderation features.



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Wed 21 Aug, 2013 12:29 ]
Reply with quote    Download Post  
Post Re: Moderator Messages / Message Locking ? 
 
I had some extra thoughts about this... and if it has to be implemented, it needs to be switchable, because there could be cases where the Admins or Mods may just want to edit something without disallowing the user from further edits. So we need to add a new checkbox to lock/unlock single posts from further edits...



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Wed 21 Aug, 2013 18:38 ]
Reply with quote    Download Post  
Post Re: Moderator Messages / Message Locking ? 
 
The switch is here :

Quote:
And finally in posting_body, after "END switch_topic_unlock"
Add ...




 
Informpro - View user's profile Send private message  
Informpro [ Thu 22 Aug, 2013 11:11 ]
Reply with quote    Download Post  
Post Re: Moderator Messages / Message Locking ? 
 
Sorry, I missed it.

I think I will integrate this.

Can you please test it?



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Sun 25 Aug, 2013 19:16 ]
Reply with quote    Download Post  
Post Re: Moderator Messages / Message Locking ? 
 
Well, the code I posted is from my local installation and working great :).



 
Informpro - View user's profile Send private message  
Informpro [ Mon 26 Aug, 2013 18:10 ]
Reply with quote    Download Post  
Post Re: Moderator Messages / Message Locking ? 
 
I don't think it works only with the code listed here...

Anyway I have added the missed code and integrated it.

On next PUSH you will see the code on GIT.



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Wed 28 Aug, 2013 10:53 ]
Display posts from previous:    

HideWas this topic useful?

Post new topic  Reply to topic  Page 1 of 1