1 Post Limit

Stop users from making more than 1 post (admins & mods are exempt)

Requested by twisterz in this topic, this little snippet stops users from making any more than 1 post - anyone with administrator or moderator privileges is exempt from this limit.

#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
// Permission to do the action asked?
$is_authed = false; 
#
#-----[ BEFORE, ADD ]------------------------------------------
#
    // Users can only post once
    if ($user->data['user_posts'] >= 1 && !$auth->acl_get('a_', 'm_')) 
    {
        trigger_error("You are only allowed to post once on this forum");
    }

Or this if you would like a link added to go back to the index page

    if ($user->data['user_posts'] >= 1 && !$auth->acl_get('a_', 'm_')) 
    {
            $message = 'You are only allowed to post once on this forum

' . sprintf($user->lang['RETURN_INDEX'], '', ''); trigger_error($message); }

You could also set this up in just 1 or certain forums using a similar set up to the way I did static topics.

    $one_post_limit = array("1", "2", "3"); // replace 1, 2, 3 with your forum ID's. Add/remove as necessary

    if (in_array($forum_id, $one_post_limit ))
    { 
    // Code from above
    }