Quantcast
Channel: WJunction - Webmaster Forum - QuickRDP.com- Upto 60% on rdp plans for ...
Viewing all articles
Browse latest Browse all 15793

Disable Member Posting Until Message has been read (ACP Profile)

$
0
0
I quickly made a mod so staff can disable members posting until they read a message and accept it, there isn't currently a mod to do this so I made one.

This is good when autoposters ignore PM's and warnings, It gives another option rather than banning.


I might as well share it here then I cant loose it :))


SQL
PHP Code:

ALTER TABLE phpbb_users ADD user_accept_rules SMALLINTNOT NULL DEFAULT '0'

Open: includes/functions.php

Find
PHP Code:

    header('Pragma: no-cache'); 

Add After
PHP Code:

    if ($user->data['user_accept_rules'] == && $user->data['is_registered'] && !$user->data['is_bot'] && (request_var('mode''') != 'terms'))
    {
        if (
confirm_box(true))
        {
            
$sql 'UPDATE ' USERS_TABLE '
                SET user_accept_rules = 0
                WHERE user_id = ' 
$user->data['user_id'];
            
$db->sql_query($sql);
        }
        else
        {
            
confirm_box(falsesprintf($user->lang['NEW_RULES'], '<a href="' append_sid("{$phpbb_root_path}ucp.$phpEx"'mode=terms') . '">''</a>'));
            
header("Location: " append_sid("{$phpbb_root_path}ucp.$phpEx?mode=logout&sid=" $user->session_id));
        }
    } 

Open: language/en/common.php

Find
PHP Code:

    'NEW_POSTS'                    => 'New posts'

Add After
PHP Code:

    'NEW_RULES'                    => 'Your account has been temporary disabled by staff due to ignoring warnings or private messages.<br/><br/>Please check for any private messages or warnings issued, if you ignore this polite warning a ban will likely be issued.<br/><br/><br/>After you confirm (Yes), your account will be restored.<br/>',
    
'UPDATE_TERMS'                => 'Accept Terms'

Open: adm/style/acp_users_overview.html

Find
PHP Code:

<dl>
    <
dt><label for="user_founder">{L_FOUNDER}:</label><br /><span>{L_FOUNDER_EXPLAIN}</span></dt>
    <
dd><label><input type="radio" class="radio" name="user_founder" value="1"<!-- IF S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> /> {L_YES}</label>
        <
label><input type="radio" class="radio" name="user_founder" value="0"<!-- IF not S_USER_FOUNDER --> id="user_founder" checked="checked"<!-- ENDIF --><!-- IF not S_FOUNDER --> disabled="disabled"<!-- ENDIF --> /> {L_NO}</label></dd>
</
dl

Add After
PHP Code:

<dl>
    <
dt><label for="user_force">Disable Posting:</label><br /><span>Force Member to read a warning message before being able to post again.</span></dt>
    <
dd><label><input type="radio" class="radio" name="user_force" value="1"<!-- IF S_USER_FORCE --> id="user_force" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
        <
label><input type="radio" class="radio" name="user_force" value="0"<!-- IF not S_USER_FORCE --> id="user_force" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</
dl

Open: includes/acp/acp_users.php

Find
PHP Code:

                        'user_founder'        => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 0), 

Add After
PHP Code:

                        'user_force'        => request_var('user_force', ($user_row['user_accept_rules '] == 0) ? 0), 

Find
PHP Code:

// Which updates do we need to do? 

Add After
PHP Code:

                    $update_user_force = ($user_row['user_accept_rules '] != $data['user_force']) ? $data['user_force'] : false

Find
PHP Code:

    trigger_error($user->lang['AT_LEAST_ONE_FOUNDER'] . adm_back_link($this->u_action '&amp;u=' $user_id), E_USER_WARNING);
                                    }
                                }
                            }
                        } 

Add After
PHP Code:

                        if ($update_user_force !== false)
                        {
                            if (
$data['user_force']==1)
                                {
                                
$sql_ary['user_accept_rules'] = 1;
                                }
                            else
                                {
                                
$sql_ary['user_accept_rules'] = 0;
                                }
                                
add_log('user'$user_id$user_row['username'].'- Forced to read warning page'$user_row['username'], $update_user_force);
                        } 

Find
PHP Code:

                    'S_USER_IP'            => ($user_row['user_ip']) ? true false

Add After
PHP Code:

                    'S_USER_FORCE'      => ($user_row['user_accept_rules'] == 1) ? true false



ACP User Management Disable Posting.




Disabled Profile.

Viewing all articles
Browse latest Browse all 15793

Trending Articles