bp_registration_options_banned

Render our banned members management page.

Description

bp_registration_options_banned(); 

Usage

  1. if ( !function_exists( 'bp_registration_options_banned' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-registration-options/includes/admin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_registration_options_banned(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/admin.php  
  1. function bp_registration_options_banned() { 
  2. // NEEDS DONE. 
  3. ?> 
  4. <div class="wrap"> 
  5. <?php 
  6.  
  7.  
  8. $blockedIPs = get_option( 'bprwg_blocked_ips' ); 
  9. $blockedemails = get_option( 'bprwg_blocked_emails' ); 
  10.  
  11. if ( ! empty( $blockedIPs ) || ! empty( $blockedemails ) ) { ?> 
  12.  
  13. <h3><?php esc_html_e( 'The following IP addresses are currently banned.', 'bp-registration-options' ); ?></h3> 
  14. <table class="widefat"> 
  15. <thead> 
  16. <tr> 
  17. <th id="cb" class="manage-column column-cb check-column" scope="col"> 
  18. <label><input type="checkbox" id="bp_checkall_top_blocked" name="checkall" /></label> 
  19. </th> 
  20. <th><?php esc_html_e( 'IP Address', 'bp-registration-options' ); ?></th> 
  21. </tr> 
  22. </thead> 
  23. <?php 
  24.  
  25. $odd = true; 
  26.  
  27. foreach ( $blockedIPs as $IP ) { 
  28. if ( $odd ) { 
  29. $attributes = ' class="alternate"'; 
  30. $odd = false; 
  31. } else { 
  32. $attributes = ''; 
  33. $odd = true; 
  34. ?> 
  35. <tr<?php echo $attributes; ?>> 
  36. <th class="check-column" scope="row"><label><input type="checkbox" class="bpro_checkbox" id="bp_blocked_check_<?php echo $IP; ?>" name="bp_blockedip_check[]" value="<?php echo esc_attr( $IP ); ?>" /></label></th> 
  37. <td><?php echo esc_html( $IP ); ?></a></td> 
  38. </tr> 
  39. <?php } ?> 
  40. <tfoot> 
  41. <tr> 
  42. <th id="cb" class="manage-column column-cb check-column" scope="col"> 
  43. <label><input type="checkbox" id="bp_checkall_top_blocked" name="checkall" /></label> 
  44. </th> 
  45. <th><?php esc_html_e( 'IP Address', 'bp-registration-options' ); ?></th> 
  46. </tr> 
  47. </tfoot> 
  48. </table> 
  49.  
  50. <h3><?php esc_html_e( 'The following Email addresses are currently banned.', 'bp-registration-options' ); ?></h3> 
  51.  
  52. <table class="widefat"> 
  53. <thead> 
  54. <tr> 
  55. <th id="cb" class="manage-column column-cb check-column" scope="col"> 
  56. <label><input type="checkbox" id="bp_checkall_top_blocked" name="checkall" /></label> 
  57. </th> 
  58. <th><?php esc_html_e( 'Email Address', 'bp-registration-options' ); ?></th> 
  59. </tr> 
  60. </thead> 
  61. <?php 
  62.  
  63. $odd = true; 
  64.  
  65. foreach ( $blockedemails as $email ) { 
  66. if ( $odd ) { ?> 
  67. <tr class="alternate"> 
  68. <?php 
  69. $odd = false; 
  70. } else { ?> 
  71. <tr> 
  72. <?php 
  73. $odd = true; 
  74. ?> 
  75. <th class="check-column" scope="row"><label><input type="checkbox" class="bpro_checkbox" id="bp_member_check_<?php echo $user_id; ?>" name="bp_blockedemail_check[]" value="" /></label></th> 
  76. <td><?php echo $email; ?></a></td> 
  77. </tr> 
  78. <?php } ?> 
  79. <tfoot> 
  80. <tr> 
  81. <th id="cb" class="manage-column column-cb check-column" scope="col"> 
  82. <label><input type="checkbox" id="bp_checkall_top_blocked" name="checkall" /></label> 
  83. </th> 
  84. <th><?php esc_html_e( 'Email Address', 'bp-registration-options' ); ?></th> 
  85. </tr> 
  86. </tfoot> 
  87. </table> 
  88. <?php } else { 
  89. echo '<p><strong>' . esc_html__( 'You have no blocked IP Addresses or Email Addresses at the moment', 'bp-registration-options' ) . '</strong></p>';