Code: Select all
if ($submit)
{
// Lock/Unlock Topic
$change_topic_status = $post_data['topic_status'];
$perm_lock_unlock = ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED)) ? true : false;
Code: Select all
/*** 2011-07-18 BEGIN AmigoJack
Lock a topic by submitting a keyword in a post while being able to lock topics ***/
define( 'MOD_LOCK_WORD', 'locked' ); // The word to be used in the post text
if( $perm_lock_unlock ) { // Does it make sense AND are we able to lock the topic?
if( preg_match( '#\\b'. MOD_LOCK_WORD. '\\b#i', $message_parser-> message ) ) $topic_lock= TRUE;
}
/*** 2011-07-18 END ***/
locked
to the keyword you want to use. Uses word boundaries, so you won't lock a topic with words like blocked
or lockedit
. Works case insensitive. Tested.Code: Select all
<!-- IF S_CODE_UNTIDY and S_MESS_ON_INDEX Good If_Not_TIDY_Then_SUBMIT -->
$auth->acl_get('m_lock', $forum_id)
or $auth->acl_get('f_user_lock', $forum_id)