| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if( ! defined( 'ABSPATH' ) ) exit; |
| 4 |
if( ! current_user_can( 'administrator' ) ) exit; |
| 5 |
|
| 6 |
if( ! isset( $_GET['action'] ) ): ?> |
| 7 |
<form action="" method="POST" class="validate"> |
| 8 |
<?php wp_nonce_field( 'wpforo-tools-cleanup' ) ?> |
| 9 |
<input type="hidden" name="wpfaction" value="cleanup_options_save"> |
| 10 |
<div class="wpf-tool-box" style="width:50%;"> |
| 11 |
<h3><?php _e( 'Delete Inactive Users', 'wpforo' ); ?> |
| 12 |
<p class="wpf-info"><?php _e( 'Inactive users are the account owners who have no topics, posts, comments and subscriptions for new content. In 99% cases this kind of accounts are being registered by Spammers. This tool allows you to only keep active and known inactive users.', 'wpforo' ); ?></p> |
| 13 |
</h3> |
| 14 |
<div style="margin-top:10px; clear:both;"> |
| 15 |
<table style="width:100%;"> |
| 16 |
<tbody> |
| 17 |
<tr> |
| 18 |
<th><label><?php _e( 'Inactive users who have been registered more than', 'wpforo' ); ?></label></th> |
| 19 |
<td><input type="number" min="0" max="100" name="wpforo_tools_cleanup[user_reg_days_ago]" value="<?php wpfo( WPF()->tools_cleanup['user_reg_days_ago'] ) ?>" class="wpf-field" style="width:70px;"> <span style="white-space:nowrap;"><?php _e( 'days ago', 'wpforo' ); ?></span></td> |
| 20 |
</tr> |
| 21 |
<?php $ugroups = WPF()->usergroup->usergroup_list_data(); ?> |
| 22 |
<tr> |
| 23 |
<td colspan="2"> |
| 24 |
<label style="display:inline-block; border-bottom:1px solid #ccc; padding:0px 50px 5px 10px; margin-bottom:5px;"> <?php _e( 'Filter by Usergroups', 'wpforo' ); ?></label><br> |
| 25 |
<?php |
| 26 |
foreach( $ugroups as $ugroup ) { |
| 27 |
if( $ugroup['groupid'] == 4 ) { |
| 28 |
continue; |
| 29 |
} |
| 30 |
$value = ( isset( WPF()->tools_cleanup['usergroup'][ $ugroup['groupid'] ] ) ) ? WPF()->tools_cleanup['usergroup'][ $ugroup['groupid'] ] : 0; |
| 31 |
echo '<label style="display:inline-block; width:23%; text-align:center;"><input name="wpforo_tools_cleanup[usergroup][' . intval( $ugroup['groupid'] ) . ']" value="1" type="checkbox" ' . wpfo_check( 1, $value, 'checked', false ) . ' style="font-size: 12px; height: 24px; width: 100%;"> ' . esc_html( $ugroup['name'] ) . '</label>'; |
| 32 |
} |
| 33 |
?> |
| 34 |
</td> |
| 35 |
</tr> |
| 36 |
<tr> |
| 37 |
<th><label><?php _e( 'Enable Auto-cleanup of inactive users', 'wpforo' ); ?></label></th> |
| 38 |
<td> |
| 39 |
<div class="wpf-switch-field"> |
| 40 |
<input id="auto_cleanup_users_yes" type="radio" name="wpforo_tools_cleanup[auto_cleanup_users]" value="1" <?php wpfo_check( WPF()->tools_cleanup['auto_cleanup_users'], 1 ); ?>/><label for="auto_cleanup_users_yes"><?php _e( 'Yes', 'wpforo' ); ?></label> |
| 41 |
<input id="auto_cleanup_users_no" type="radio" name="wpforo_tools_cleanup[auto_cleanup_users]" value="0" <?php wpfo_check( WPF()->tools_cleanup['auto_cleanup_users'], 0 ); ?>/><label for="auto_cleanup_users_no"><?php _e( 'No', 'wpforo' ); ?></label> |
| 42 |
</div> |
| 43 |
</td> |
| 44 |
</tr> |
| 45 |
</tbody> |
| 46 |
</table> |
| 47 |
</div> |
| 48 |
</div> |
| 49 |
<div class="wpforo_settings_foot" style="clear:both; margin-top:20px;"> |
| 50 |
|
| 51 |
<input type="submit" class="button button-primary" value="<?php _e( 'Update Options', 'wpforo' ); ?>"/> |
| 52 |
</div> |
| 53 |
</form> |
| 54 |
<?php |
| 55 |
endif; |
| 56 |
|