WP-Ban - Version 1.10

Version Description

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-Ban
Version 1.10
Comparing to
See all releases

Code changes from version 1.00 to 1.10

Files changed (5) hide show
  1. ban.php +0 -241
  2. ban/ban.php +365 -0
  3. ban/wp-ban.pot +142 -0
  4. readme.html +124 -23
  5. readme.txt +31 -0
ban.php DELETED
@@ -1,241 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: WP-Ban
4
- Plugin URI: http://www.lesterchan.net/portfolio/programming.php
5
- Description: Ban Users By IP Or Host Name From Visiting Your WordPress Site
6
- Version: 1.00
7
- Author: GaMerZ
8
- Author URI: http://www.lesterchan.net
9
- */
10
-
11
-
12
- /* Copyright 2006 Lester Chan (email : gamerz84@hotmail.com)
13
-
14
- This program is free software; you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation; either version 2 of the License, or
17
- (at your option) any later version.
18
-
19
- This program is distributed in the hope that it will be useful,
20
- but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- GNU General Public License for more details.
23
-
24
- You should have received a copy of the GNU General Public License
25
- along with this program; if not, write to the Free Software
26
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
- */
28
-
29
-
30
- ### Function: Ban Menu
31
- add_action('admin_menu', 'ban_menu');
32
- function ban_menu() {
33
- if (function_exists('add_options_page')) {
34
- add_options_page(__('Ban'), __('Ban'), 'manage_options', 'ban.php', 'ban_options');
35
- }
36
- }
37
-
38
-
39
- ### Function: Get IP Address
40
- if(!function_exists('get_IP')) {
41
- function get_IP() {
42
- if(empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
43
- $ip_address = $_SERVER["REMOTE_ADDR"];
44
- } else {
45
- $ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"];
46
- }
47
- if(strpos($ip_address, ',') !== false) {
48
- $ip_address = explode(',', $ip_address);
49
- $ip_address = $ip_address[0];
50
- }
51
- return $ip_address;
52
- }
53
- }
54
-
55
-
56
-
57
- ### Function: Process Banning
58
- function process_ban($banarray, $against) {
59
- if(!empty($banarray)) {
60
- foreach($banarray as $cban) {
61
- $regexp = str_replace ('.', '\\.', $cban);
62
- $regexp = str_replace ('*', '.+', $regexp);
63
- if(ereg("^$regexp$", $against)) {
64
- $banned_message = stripslashes(get_settings('banned_message'));
65
- $banned_message = str_replace("%SITE_NAME%", get_settings('blogname'), $banned_message);
66
- $banned_message = str_replace("%SITE_URL%", get_settings('siteurl'), $banned_message);
67
- echo $banned_message;
68
- exit();
69
- }
70
- }
71
- }
72
- return;
73
- }
74
-
75
-
76
- ### Function: Banned
77
- add_action('init', 'banned');
78
- function banned() {
79
- $banned_ips = get_settings('banned_ips');
80
- $banned_hosts = get_settings('banned_hosts');
81
- process_ban($banned_ips, get_IP());
82
- process_ban($banned_hosts, gethostbyaddr(get_IP()));
83
- }
84
-
85
-
86
- ### Function: Ban Options
87
- function ban_options() {
88
- global $wpdb;
89
- if($_POST['Submit']) {
90
- $update_ban_queries = array();
91
- $update_ban_text = array();
92
- $banned_ips_post = explode("\n", trim($_POST['banned_ips']));
93
- $banned_hosts_post = explode("\n", trim($_POST['banned_hosts']));
94
- $banned_message = trim($_POST['banned_template_message']);
95
- if(!empty($banned_ips_post)) {
96
- $banned_ips = array();
97
- foreach($banned_ips_post as $banned_ip) {
98
- if($banned_ip != get_IP()) {
99
- $banned_ips[] = trim($banned_ip);
100
- }
101
- }
102
- }
103
- if(!empty($banned_hosts_post)) {
104
- $banned_hosts = array();
105
- foreach($banned_hosts_post as $banned_host) {
106
- if($banned_host != gethostbyaddr(get_IP())) {
107
- $banned_hosts[] = trim($banned_host);
108
- }
109
- }
110
- }
111
- $update_ban_queries[] = update_option('banned_ips', $banned_ips);
112
- $update_ban_queries[] = update_option('banned_hosts', $banned_hosts);
113
- $update_ban_queries[] = update_option('banned_message', $banned_message);
114
- $update_ban_text[] = __('Banned IPs');
115
- $update_ban_text[] = __('Banned Host Names');
116
- $update_ban_text[] = __('Banned Message');
117
- $i=0;
118
- $text = '';
119
- foreach($update_ban_queries as $update_ban_query) {
120
- if($update_ban_query) {
121
- $text .= '<font color="green">'.$update_ban_text[$i].' '.__('Updated').'</font><br />';
122
- }
123
- $i++;
124
- }
125
- if(empty($text)) {
126
- $text = '<font color="red">'.__('No Ban Option Updated').'</font>';
127
- }
128
- }
129
- ### Get Useronline Bots
130
- $banned_ips = get_settings('banned_ips');
131
- $banned_hosts = get_settings('banned_hosts');
132
- $banned_ips_display = '';
133
- $banned_hosts_display = '';
134
- if(!empty($banned_ips)) {
135
- foreach($banned_ips as $banned_ip) {
136
- $banned_ips_display .= $banned_ip."\n";
137
- }
138
- }
139
- if(!empty($banned_hosts)) {
140
- foreach($banned_hosts as $banned_host) {
141
- $banned_hosts_display .= $banned_host."\n";
142
- }
143
- }
144
- $banned_ips_display = trim($banned_ips_display);
145
- $banned_hosts_display = trim($banned_hosts_display);
146
- ?>
147
- <script type="text/javascript">
148
- /* <![CDATA[*/
149
- function banned_default_templates(template) {
150
- var default_template;
151
- switch(template) {
152
- case "message":
153
- default_template = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=<?php echo get_settings('blog_charset'); ?>\" />\n<title>%SITE_NAME% - %SITE_URL%</title>\n</head>\n<body>\n<p style=\"text-align: center; font-weight: bold;\">You Are Banned.</p>\n</body>\n</html>";
154
- break;
155
- }
156
- document.getElementById("banned_template_" + template).value = default_template;
157
- }
158
- /* ]]> */
159
- </script>
160
- <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
161
- <!-- Ban Options -->
162
- <div class="wrap">
163
- <h2>Ban Options</h2>
164
- <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
165
- <table width="100%" cellspacing="3" cellpadding="3" border="0">
166
- <tr>
167
- <td valign="top" colspan="2" align="center">
168
- Your IP is: <strong><?php echo get_IP(); ?></strong><br />Your Host Name is: <strong><?php echo gethostbyaddr(get_IP()); ?></strong><br />
169
- Please <strong>DO NOT</strong> ban yourself.
170
- </td>
171
- </tr>
172
- <tr>
173
- <td valign="top">
174
- <strong><?php _e('Banned IPs'); ?>:</strong><br />
175
- Use <strong>*</strong> for wildcards.<br />
176
- Start each entry on a new line.<br /><br />
177
- Examples:<br />
178
- <strong>&raquo;</strong> 192.168.1.100<br />
179
- <strong>&raquo;</strong> 192.168.1.*<br />
180
- <strong>&raquo;</strong> 192.168.*.*<br />
181
- </td>
182
- <td>
183
- <textarea cols="40" rows="10" name="banned_ips"><?php echo $banned_ips_display; ?></textarea>
184
- </td>
185
- </tr>
186
- <tr>
187
- <td valign="top">
188
- <strong><?php _e('Banned Host Names'); ?>:</strong><br />
189
- Use <strong>*</strong> for wildcards.<br />
190
- Start each entry on a new line.<br /><br />
191
- Examples:<br />
192
- <strong>&raquo;</strong> *.sg<br />
193
- <strong>&raquo;</strong> *.cn<br />
194
- <strong>&raquo;</strong> *.th<br />
195
- </td>
196
- <td>
197
- <textarea cols="40" rows="10" name="banned_hosts"><?php echo $banned_hosts_display; ?></textarea>
198
- </td>
199
- </tr>
200
- <tr>
201
- <td valign="top">
202
- <strong><?php _e('Banned Message'); ?>:</strong><br /><br /><br />
203
- <?php _e('Allowed Variables:'); ?><br />
204
- - %SITE_NAME%<br />
205
- - %SITE_URL%<br /><br />
206
- <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template'); ?>" onclick="javascript: banned_default_templates('message');" class="button" />
207
- </td>
208
- <td>
209
- <textarea cols="60" rows="20" id="banned_template_message" name="banned_template_message"><?php echo stripslashes(get_settings('banned_message')); ?></textarea>
210
- </td>
211
- </tr>
212
- <tr>
213
- <td width="100%" colspan="2" align="center"><input type="submit" name="Submit" class="button" value="<?php _e('Update Options'); ?>" />&nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" class="button" onclick="javascript:history.go(-1)" /></td>
214
- </tr>
215
- </table>
216
- </form>
217
- </div>
218
- <?php
219
- }
220
-
221
-
222
- ### Function: Create Ban Options
223
- add_action('activate_ban.php', 'ban_init');
224
- function ban_init() {
225
- global $wpdb;
226
- $banned_ips = array();
227
- $banned_hosts = array();
228
- add_option('banned_ips', $banned_ips, 'Banned IPs');
229
- add_option('banned_hosts', $banned_hosts, 'Banned Hosts');
230
- add_option('banned_message', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n".
231
- '<html xmlns="http://www.w3.org/1999/xhtml">'."\n".
232
- '<head>'."\n".
233
- '<meta http-equiv="Content-Type" content="text/html; charset='.get_settings('blog_charset').'" />'."\n".
234
- '<title>%SITE_NAME% - %SITE_URL%</title>'."\n".
235
- '</head>'."\n".
236
- '<body>'."\n".
237
- '<p style="text-align: center; font-weight: bold;">You Are Banned.</p>'."\n".
238
- '</body>'."\n".
239
- '</html>', 'Banned Hosts');
240
- }
241
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ban/ban.php ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WP-Ban
4
+ Plugin URI: http://www.lesterchan.net/portfolio/programming.php
5
+ Description: Ban users by IP or host name from visiting your WordPress's blog. It will display a custom ban message when the banned IP/host name trys to visit you blog. There will be statistics recordered on how many times they attemp to visit your blog. It allows wildcard matching too.
6
+ Version: 1.10
7
+ Author: GaMerZ
8
+ Author URI: http://www.lesterchan.net
9
+ */
10
+
11
+
12
+ /*
13
+ Copyright 2007 Lester Chan (email : gamerz84@hotmail.com)
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License as published by
17
+ the Free Software Foundation; either version 2 of the License, or
18
+ (at your option) any later version.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program; if not, write to the Free Software
27
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
+ */
29
+
30
+
31
+ ### Create Text Domain For Translation
32
+ load_plugin_textdomain('wp-ban', 'wp-content/plugins/ban');
33
+
34
+
35
+ ### Function: Ban Menu
36
+ add_action('admin_menu', 'ban_menu');
37
+ function ban_menu() {
38
+ if (function_exists('add_management_page')) {
39
+ add_management_page(__('Ban', 'wp-ban'), __('Ban', 'wp-ban'), 'manage_options', 'ban.php', 'ban_options');
40
+ }
41
+ }
42
+
43
+
44
+ ### Function: Get IP Address
45
+ if(!function_exists('get_IP')) {
46
+ function get_IP() {
47
+ if(empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
48
+ $ip_address = $_SERVER["REMOTE_ADDR"];
49
+ } else {
50
+ $ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"];
51
+ }
52
+ if(strpos($ip_address, ',') !== false) {
53
+ $ip_address = explode(',', $ip_address);
54
+ $ip_address = $ip_address[0];
55
+ }
56
+ return $ip_address;
57
+ }
58
+ }
59
+
60
+
61
+ ### Function: Process Banning
62
+ function process_ban($banarray, $against) {
63
+ if(!empty($banarray)) {
64
+ foreach($banarray as $cban) {
65
+ $regexp = str_replace ('.', '\\.', $cban);
66
+ $regexp = str_replace ('*', '.+', $regexp);
67
+ if(ereg("^$regexp$", $against)) {
68
+ $banned_message = stripslashes(get_option('banned_message'));
69
+ $banned_message = str_replace("%SITE_NAME%", get_option('blogname'), $banned_message);
70
+ $banned_message = str_replace("%SITE_URL%", get_option('siteurl'), $banned_message);
71
+ $banned_message = str_replace("%USER_IP%", get_IP(), $banned_message);
72
+ $banned_message = str_replace("%USER_HOSTNAME%", gethostbyaddr(get_IP()), $banned_message);
73
+ echo $banned_message;
74
+ // Credits To Joe (Ttech) - http://blog.fileville.net/
75
+ $banned_stats = get_option('banned_stats');
76
+ $banned_stats['count'] = (intval($banned_stats['count'])+1);
77
+ $banned_stats['users'][get_IP()] = intval($banned_stats['users'][get_IP()]+1);
78
+ update_option('banned_stats', $banned_stats);
79
+ exit();
80
+ }
81
+ }
82
+ }
83
+ return;
84
+ }
85
+
86
+
87
+ ### Function: Banned
88
+ add_action('init', 'banned');
89
+ function banned() {
90
+ $banned_ips = get_option('banned_ips');
91
+ $banned_hosts = get_option('banned_hosts');
92
+ process_ban($banned_ips, get_IP());
93
+ process_ban($banned_hosts, gethostbyaddr(get_IP()));
94
+ }
95
+
96
+
97
+ ### Function: Ban Options
98
+ function ban_options() {
99
+ global $wpdb, $current_user;
100
+ $admin_login = trim($current_user->user_login);
101
+ // Form Processing
102
+ if(!empty($_POST['do'])) {
103
+ switch($_POST['do']) {
104
+ // Credits To Joe (Ttech) - http://blog.fileville.net/
105
+ case __('Reset Ban Stats', 'wp-ban'):
106
+ if($_POST['reset_ban_stats'] == 'yes') {
107
+ $banned_stats = array('users' => array(), 'count' => 0);
108
+ update_option('banned_stats', $banned_stats);
109
+ $text = '<font color="green">'.__('All IP Ban Stats And Total Ban Stat Reseted', 'wp-ban').'</font>';
110
+ } else {
111
+ $banned_stats = get_option('banned_stats');
112
+ $delete_ips = $_POST['delete_ips'];
113
+ foreach($delete_ips as $delete_ip) {
114
+ unset($banned_stats['users'][$delete_ip]);
115
+ }
116
+ update_option('banned_stats', $banned_stats);
117
+ $text = '<font color="green">'.__('Selected IP Ban Stats Reseted', 'wp-ban').'</font>';
118
+ }
119
+ break;
120
+ }
121
+ }
122
+ if($_POST['Submit']) {
123
+ $text = '';
124
+ $update_ban_queries = array();
125
+ $update_ban_text = array();
126
+ $banned_ips_post = explode("\n", trim($_POST['banned_ips']));
127
+ $banned_hosts_post = explode("\n", trim($_POST['banned_hosts']));
128
+ $banned_message = trim($_POST['banned_template_message']);
129
+ if(!empty($banned_ips_post)) {
130
+ $banned_ips = array();
131
+ foreach($banned_ips_post as $banned_ip) {
132
+ if($admin_login == 'admin' && ($banned_ip == get_IP() || is_admin_ip($banned_ip))) {
133
+ $text .= '<font color="blue">'.sprintf(__('This IP \'%s\' Belongs To The Admin And Will Not Be Added To Ban List', 'wp-ban'),$banned_ip).'</font><br />';
134
+ } else {
135
+ $banned_ips[] = trim($banned_ip);
136
+ }
137
+ }
138
+ }
139
+ if(!empty($banned_hosts_post)) {
140
+ $banned_hosts = array();
141
+ foreach($banned_hosts_post as $banned_host) {
142
+ if($admin_login == 'admin' && ($banned_host == gethostbyaddr(get_IP()) || is_admin_hostname($banned_host))) {
143
+ $text .= '<font color="blue">'.sprintf(__('This Hostname \'%s\' Belongs To The Admin Will Not Be Added To Ban List', 'wp-ban'), $banned_host).'</font><br />';
144
+ } else {
145
+ $banned_hosts[] = trim($banned_host);
146
+ }
147
+ }
148
+ }
149
+ $update_ban_queries[] = update_option('banned_ips', $banned_ips);
150
+ $update_ban_queries[] = update_option('banned_hosts', $banned_hosts);
151
+ $update_ban_queries[] = update_option('banned_message', $banned_message);
152
+ $update_ban_text[] = __('Banned IPs', 'wp-ban');
153
+ $update_ban_text[] = __('Banned Host Names', 'wp-ban');
154
+ $update_ban_text[] = __('Banned Message', 'wp-ban');
155
+ $i=0;
156
+ foreach($update_ban_queries as $update_ban_query) {
157
+ if($update_ban_query) {
158
+ $text .= '<font color="green">'.$update_ban_text[$i].' '.__('Updated', 'wp-ban').'</font><br />';
159
+ }
160
+ $i++;
161
+ }
162
+ if(empty($text)) {
163
+ $text = '<font color="red">'.__('No Ban Option Updated', 'wp-ban').'</font>';
164
+ }
165
+ }
166
+ // Get Banned IPs/Hosts
167
+ $banned_ips = get_option('banned_ips');
168
+ $banned_hosts = get_option('banned_hosts');
169
+ $banned_ips_display = '';
170
+ $banned_hosts_display = '';
171
+ if(!empty($banned_ips)) {
172
+ foreach($banned_ips as $banned_ip) {
173
+ $banned_ips_display .= $banned_ip."\n";
174
+ }
175
+ }
176
+ if(!empty($banned_hosts)) {
177
+ foreach($banned_hosts as $banned_host) {
178
+ $banned_hosts_display .= $banned_host."\n";
179
+ }
180
+ }
181
+ $banned_ips_display = trim($banned_ips_display);
182
+ $banned_hosts_display = trim($banned_hosts_display);
183
+ // Get Banned Stats
184
+ $banned_stats = get_option('banned_stats');
185
+ ?>
186
+ <script type="text/javascript">
187
+ /* <![CDATA[*/
188
+ var checked = 0;
189
+ function banned_default_templates(template) {
190
+ var default_template;
191
+ switch(template) {
192
+ case "message":
193
+ default_template = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=<?php echo get_option('blog_charset'); ?>\" />\n<title>%SITE_NAME% - %SITE_URL%</title>\n</head>\n<body>\n<p style=\"text-align: center; font-weight: bold;\"><?php _e('You Are Banned.', 'wp-ban'); ?></p>\n</body>\n</html>";
194
+ break;
195
+ }
196
+ document.getElementById("banned_template_" + template).value = default_template;
197
+ }
198
+ function toggle_checkbox() {
199
+ checkboxes = document.getElementsByName('delete_ips[]');
200
+ total = checkboxes.length;
201
+ if(checked == 0) {
202
+ for (var i = 0; i < total; i++) {
203
+ checkboxes[i].checked = true;
204
+ }
205
+ checked++;
206
+ } else if(checked == 1) {
207
+ for (var i = 0; i < total; i++) {
208
+ checkboxes[i].checked = false;
209
+ }
210
+ checked--;
211
+ }
212
+ }
213
+ /* ]]> */
214
+ </script>
215
+ <?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?>
216
+ <!-- Ban Options -->
217
+ <div class="wrap">
218
+ <h2><?php _e('Ban Options', 'wp-ban'); ?></h2>
219
+ <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
220
+ <table width="100%" cellspacing="3" cellpadding="3" border="0">
221
+ <tr>
222
+ <td valign="top" colspan="2" align="center">
223
+ <?php printf(__('Your IP is: <strong>%s</strong><br />Your Host Name is: <strong>%s</strong>', 'wp-ban'), get_IP(), gethostbyaddr(get_IP())); ?><br />
224
+ <?php _e('Please <strong>DO NOT</strong> ban yourself.', 'wp-ban'); ?>
225
+ </td>
226
+ </tr>
227
+ <tr>
228
+ <td valign="top">
229
+ <strong><?php _e('Banned IPs', 'wp-ban'); ?>:</strong><br />
230
+ <?php _e('Use <strong>*</strong> for wildcards.', 'wp-ban'); ?><br />
231
+ <?php _e('Start each entry on a new line.', 'wp-ban'); ?><br /><br />
232
+ <?php _e('Examples:', 'wp-ban'); ?><br />
233
+ <strong>&raquo;</strong> 192.168.1.100<br />
234
+ <strong>&raquo;</strong> 192.168.1.*<br />
235
+ <strong>&raquo;</strong> 192.168.*.*<br />
236
+ </td>
237
+ <td>
238
+ <textarea cols="40" rows="10" name="banned_ips"><?php echo $banned_ips_display; ?></textarea>
239
+ </td>
240
+ </tr>
241
+ <tr>
242
+ <td valign="top">
243
+ <strong><?php _e('Banned Host Names', 'wp-ban'); ?>:</strong><br />
244
+ <?php _e('Use <strong>*</strong> for wildcards', 'wp-ban'); ?>.<br />
245
+ <?php _e('Start each entry on a new line.', 'wp-ban'); ?><br /><br />
246
+ <?php _e('Examples:', 'wp-ban'); ?><br />
247
+ <strong>&raquo;</strong> *.sg<br />
248
+ <strong>&raquo;</strong> *.cn<br />
249
+ <strong>&raquo;</strong> *.th<br />
250
+ </td>
251
+ <td>
252
+ <textarea cols="40" rows="10" name="banned_hosts"><?php echo $banned_hosts_display; ?></textarea>
253
+ </td>
254
+ </tr>
255
+ <tr>
256
+ <td valign="top">
257
+ <strong><?php _e('Banned Message', 'wp-ban'); ?>:</strong><br /><br /><br />
258
+ <?php _e('Allowed Variables:', 'wp-ban'); ?><br />
259
+ - %SITE_NAME%<br />
260
+ - %SITE_URL%<br />
261
+ - %USER_IP%<br />
262
+ - %USER_HOSTNAME%<br /><br />
263
+ <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-ban'); ?>" onclick="javascript: banned_default_templates('message');" class="button" />
264
+ </td>
265
+ <td>
266
+ <textarea cols="60" rows="20" id="banned_template_message" name="banned_template_message"><?php echo stripslashes(get_option('banned_message')); ?></textarea>
267
+ </td>
268
+ </tr>
269
+ <tr>
270
+ <td width="100%" colspan="2" align="center"><input type="submit" name="Submit" class="button" value="<?php _e('Update Options', 'wp-ban'); ?>" />&nbsp;&nbsp;<input type="button" name="cancel" value="<?php _e('Cancel', 'wp-ban'); ?>" class="button" onclick="javascript:history.go(-1)" /></td>
271
+ </tr>
272
+ </table>
273
+ </form>
274
+ </div>
275
+ <div class="wrap">
276
+ <h2><?php _e('Ban Stats', 'wp-ban'); ?></h2>
277
+ <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
278
+ <table width="100%" cellspacing="3" cellpadding="3" border="0">
279
+ <tr class="thead">
280
+ <th width="40%">IPs</th>
281
+ <th width="30%">Attempts</th>
282
+ <th width="30%"><input type="checkbox" name="toogle_checkbox" value="1" onclick="toggle_checkbox();" />&nbsp; Action</th>
283
+ </tr>
284
+ <?php
285
+ // Credits To Joe (Ttech) - http://blog.fileville.net/
286
+ if(!empty($banned_stats['users'])) {
287
+ $i = 0;
288
+ foreach($banned_stats['users'] as $key => $value) {
289
+ if($i%2 == 0) {
290
+ $style = 'style=\'background-color: #eee\'';
291
+ } else {
292
+ $style = 'style=\'background-color: none\'';
293
+ }
294
+ echo "<tr $style>\n";
295
+ echo "<td style=\"text-align: center;\">$key</td>\n";
296
+ echo "<td style=\"text-align: center;\">$value</td>\n";
297
+ echo "<td><input type=\"checkbox\" name=\"delete_ips[]\" value=\"$key\" />&nbsp;Reset this IP ban stat?</td>\n";
298
+ echo '</tr>'."\n";
299
+ $i++;
300
+ }
301
+ } else {
302
+ echo "<tr>\n";
303
+ echo '<td colspan="3" align="center">'.__('No Attempts', 'wp-ban').'</td>'."\n";
304
+ echo '</tr>'."\n";
305
+ }
306
+ ?>
307
+ <tr class="thead">
308
+ <td style="text-align: center;"><strong><?php _e('Total Attempts:', 'wp-ban'); ?></strong></td>
309
+ <td style="text-align: center;"><strong><?php echo intval($banned_stats['count']); ?></strong></td>
310
+ <td><input type="checkbox" name="reset_ban_stats" value="yes" /> &nbsp;<?php _e('Reset all IP ban stats and total ban stat?', 'wp-ban'); ?>&nbsp;</td>
311
+ </tr>
312
+ </table>
313
+ <p style="text-align: center;"><input type="submit" name="do" value="<?php _e('Reset Ban Stats', 'wp-ban'); ?>" class="button" onclick="return confirm('<?php _e('You Are About To Reset Ban Stats.', 'wp-ban'); ?>\n\n<?php _e('This Action Is Not Reversible. Are you sure?', 'wp-ban'); ?>')" /></p>
314
+ </form>
315
+ </div>
316
+ <?php
317
+ }
318
+
319
+
320
+ ### Function: Check Whether Or Not The IP Address Belongs To Admin
321
+ function is_admin_ip($check) {
322
+ $admin_ip = get_IP();
323
+ $regexp = str_replace ('.', '\\.', $check);
324
+ $regexp = str_replace ('*', '.+', $regexp);
325
+ if(ereg("^$regexp$", $admin_ip)) {
326
+ return true;
327
+ }
328
+ return false;
329
+ }
330
+
331
+
332
+ ### Function: Check Whether Or Not The Hostname Belongs To Admin
333
+ function is_admin_hostname($check) {
334
+ $admin_hostname = gethostbyaddr(get_IP());
335
+ $regexp = str_replace ('.', '\\.', $check);
336
+ $regexp = str_replace ('*', '.+', $regexp);
337
+ if(ereg("^$regexp$", $admin_hostname)) {
338
+ return true;
339
+ }
340
+ return false;
341
+ }
342
+
343
+
344
+ ### Function: Create Ban Options
345
+ add_action('activate_ban/ban.php', 'ban_init');
346
+ function ban_init() {
347
+ global $wpdb;
348
+ $banned_ips = array();
349
+ $banned_hosts = array();
350
+ $banned_stats = array('users' => array(), 'count' => 0);
351
+ add_option('banned_ips', $banned_ips, 'Banned IPs');
352
+ add_option('banned_hosts', $banned_hosts, 'Banned Hosts');
353
+ add_option('banned_stats', $banned_stats, 'WP-Ban Stats');
354
+ add_option('banned_message', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n".
355
+ '<html xmlns="http://www.w3.org/1999/xhtml">'."\n".
356
+ '<head>'."\n".
357
+ '<meta http-equiv="Content-Type" content="text/html; charset='.get_option('blog_charset').'" />'."\n".
358
+ '<title>%SITE_NAME% - %SITE_URL%</title>'."\n".
359
+ '</head>'."\n".
360
+ '<body>'."\n".
361
+ '<p style="text-align: center; font-weight: bold;">'.__('You Are Banned.', 'wp-ban').'</p>'."\n".
362
+ '</body>'."\n".
363
+ '</html>', 'Banned Message');
364
+ }
365
+ ?>
ban/wp-ban.pot ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP-Ban 1.10\n"
4
+ "POT-Creation-Date: \n"
5
+ "PO-Revision-Date: 2007-01-27 14:55+0800\n"
6
+ "Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n"
7
+ "Language-Team: Lester Chan <gamerz84@hotmail.com>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-Language: English\n"
12
+ "X-Poedit-Country: SINGAPORE\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SearchPath-0: .\n"
16
+
17
+ #: ban.php:39
18
+ msgid "Ban"
19
+ msgstr ""
20
+
21
+ #: ban.php:105
22
+ #: ban.php:313
23
+ msgid "Reset Ban Stats"
24
+ msgstr ""
25
+
26
+ #: ban.php:109
27
+ msgid "All IP Ban Stats And Total Ban Stat Reseted"
28
+ msgstr ""
29
+
30
+ #: ban.php:117
31
+ msgid "Selected IP Ban Stats Reseted"
32
+ msgstr ""
33
+
34
+ #: ban.php:133
35
+ #, php-format
36
+ msgid "This IP '%s' Belongs To The Admin And Will Not Be Added To Ban List"
37
+ msgstr ""
38
+
39
+ #: ban.php:143
40
+ #, php-format
41
+ msgid "This Hostname '%s' Belongs To The Admin Will Not Be Added To Ban List"
42
+ msgstr ""
43
+
44
+ #: ban.php:152
45
+ #: ban.php:229
46
+ msgid "Banned IPs"
47
+ msgstr ""
48
+
49
+ #: ban.php:153
50
+ #: ban.php:243
51
+ msgid "Banned Host Names"
52
+ msgstr ""
53
+
54
+ #: ban.php:154
55
+ #: ban.php:257
56
+ msgid "Banned Message"
57
+ msgstr ""
58
+
59
+ #: ban.php:158
60
+ msgid "Updated"
61
+ msgstr ""
62
+
63
+ #: ban.php:163
64
+ msgid "No Ban Option Updated"
65
+ msgstr ""
66
+
67
+ #: ban.php:193
68
+ #: ban.php:361
69
+ msgid "You Are Banned."
70
+ msgstr ""
71
+
72
+ #: ban.php:218
73
+ msgid "Ban Options"
74
+ msgstr ""
75
+
76
+ #: ban.php:223
77
+ #, php-format
78
+ msgid "Your IP is: <strong>%s</strong><br />Your Host Name is: <strong>%s</strong>"
79
+ msgstr ""
80
+
81
+ #: ban.php:224
82
+ msgid "Please <strong>DO NOT</strong> ban yourself."
83
+ msgstr ""
84
+
85
+ #: ban.php:230
86
+ msgid "Use <strong>*</strong> for wildcards."
87
+ msgstr ""
88
+
89
+ #: ban.php:231
90
+ #: ban.php:245
91
+ msgid "Start each entry on a new line."
92
+ msgstr ""
93
+
94
+ #: ban.php:232
95
+ #: ban.php:246
96
+ msgid "Examples:"
97
+ msgstr ""
98
+
99
+ #: ban.php:244
100
+ msgid "Use <strong>*</strong> for wildcards"
101
+ msgstr ""
102
+
103
+ #: ban.php:258
104
+ msgid "Allowed Variables:"
105
+ msgstr ""
106
+
107
+ #: ban.php:263
108
+ msgid "Restore Default Template"
109
+ msgstr ""
110
+
111
+ #: ban.php:270
112
+ msgid "Update Options"
113
+ msgstr ""
114
+
115
+ #: ban.php:270
116
+ msgid "Cancel"
117
+ msgstr ""
118
+
119
+ #: ban.php:276
120
+ msgid "Ban Stats"
121
+ msgstr ""
122
+
123
+ #: ban.php:303
124
+ msgid "No Attempts"
125
+ msgstr ""
126
+
127
+ #: ban.php:308
128
+ msgid "Total Attempts:"
129
+ msgstr ""
130
+
131
+ #: ban.php:310
132
+ msgid "Reset all IP ban stats and total ban stat?"
133
+ msgstr ""
134
+
135
+ #: ban.php:313
136
+ msgid "You Are About To Reset Ban Stats."
137
+ msgstr ""
138
+
139
+ #: ban.php:313
140
+ msgid "This Action Is Not Reversible. Are you sure?"
141
+ msgstr ""
142
+
readme.html CHANGED
@@ -2,7 +2,7 @@
2
  <html>
3
  <head>
4
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
- <title>WP-Ban 1.00 Readme</title>
6
  <style type="text/css" media="screen">
7
  /* Default Style */
8
  BODY {
@@ -121,16 +121,33 @@
121
  }
122
  </style>
123
  <script type="text/javascript">
 
124
  // Index Page
125
  function index() {
126
  // Tab
127
  document.getElementById('IndexTab').className = 'SelectedTab';
 
128
  document.getElementById('InstallTab').className = 'Tab';
129
  document.getElementById('UpgradeTab').className = 'Tab';
130
  document.getElementById('UsageTab').className = 'Tab';
131
  // Page
132
  document.getElementById('Index').style.display= 'block';
133
- document.getElementById('IndexTab').className = 'SelectedTab';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  document.getElementById('Install').style.display = 'none';
135
  document.getElementById('Upgrade').style.display = 'none';
136
  document.getElementById('Usage').style.display = 'none';
@@ -139,11 +156,13 @@
139
  function install() {
140
  // Tab
141
  document.getElementById('IndexTab').className = 'Tab';
 
142
  document.getElementById('InstallTab').className = 'SelectedTab';
143
  document.getElementById('UpgradeTab').className = 'Tab';
144
  document.getElementById('UsageTab').className = 'Tab';
145
  // Page
146
  document.getElementById('Index').style.display= 'none';
 
147
  document.getElementById('Install').style.display = 'block';
148
  document.getElementById('Upgrade').style.display = 'none';
149
  document.getElementById('Usage').style.display = 'none';
@@ -152,12 +171,13 @@
152
  function upgrade() {
153
  // Tab
154
  document.getElementById('IndexTab').className = 'Tab';
 
155
  document.getElementById('InstallTab').className = 'Tab';
156
  document.getElementById('UpgradeTab').className = 'SelectedTab';
157
- document.getElementById('UpgradeTab').href = 'Tab';
158
  document.getElementById('UsageTab').className = 'Tab';
159
  // Page
160
  document.getElementById('Index').style.display= 'none';
 
161
  document.getElementById('Install').style.display = 'none';
162
  document.getElementById('Upgrade').style.display = 'block';
163
  document.getElementById('Usage').style.display = 'none';
@@ -166,27 +186,31 @@
166
  function usage() {
167
  // Tab
168
  document.getElementById('IndexTab').className = 'Tab';
 
169
  document.getElementById('InstallTab').className = 'Tab';
170
  document.getElementById('UpgradeTab').className = 'Tab';
171
  document.getElementById('UsageTab').className = 'SelectedTab';
172
  // Page
173
- document.getElementById('Index').style.display= 'none';
 
174
  document.getElementById('Install').style.display = 'none';
175
  document.getElementById('Upgrade').style.display = 'none';
176
  document.getElementById('Usage').style.display = 'block';
177
  }
178
- </script>
 
179
  </head>
180
  <body>
181
  <div id="Container">
182
  <!-- Title -->
183
- <div id="Title">WP-Ban 1.00&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div>
184
 
185
  <!-- Tabs -->
186
  <ul id="Tabs">
187
  <li id="UsageTab" class="Tab"><a href="#Usage" onclick="usage(); return false;" title="Usage Instructions">Usage</a></li>
188
  <li id="UpgradeTab" class="Tab"><a href="#Upgrade" onclick="upgrade(); return false;" title="Upgrade Instructions">Upgrade</a></li>
189
  <li id="InstallTab" class="Tab"><a href="#Installation" onclick="install(); return false;" title="Installation Instructions">Installation</a></li>
 
190
  <li id="IndexTab" class="SelectedTab"><a href="#Index" onclick="index(); return false;" title="Index Instructions">Index</a></li>
191
  </ul>
192
 
@@ -196,26 +220,90 @@
196
  <div id="Index">
197
  <div class="SubTitle">&raquo; Index</div>
198
  <div class="SubSubTitle">Plugin Information</div>
199
- <p><b>Author</b><br /><b>&raquo;</b> Lester 'GaMerZ' Chan</p>
200
  <p>
201
- <b>EMail:</b><br /><b>&raquo;</b>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  <script type="text/javascript">
203
  /* <![CDATA[*/
204
- document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-Ban%201.00%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
205
  /* ]]> */
206
  </script>
207
  </p>
208
- <p><b>Website:</b><br /><b>&raquo;</b> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a></p>
209
- <!--
210
- <p><b>Documentation:</b><br /><b>&raquo;</b> <a href="http://dev.wp-plugins.org/wiki/wp-ban" title="http://dev.wp-plugins.org/wiki/wp-ban">http://dev.wp-plugins.org/wiki/wp-ban</a></p>
211
- <p><b>Development:</b><br /><b>&raquo;</b> <a href="http://dev.wp-plugins.org/browser/wp-ban/" title="http://dev.wp-plugins.org/browser/wp-ban/">http://dev.wp-plugins.org/browser/wp-ban/</a></p>
212
- -->
213
- <p><b>Support Forums:</b><br /><b>&raquo;</b> <a href="http://forums.lesterchan.net/index.php?board=10.0" title="http://forums.lesterchan.net/index.php?board=10.0">http://forums.lesterchan.net/index.php?board=10.0</a></p>
214
- <p><b>Updated:</b><br /><b>&raquo;</b> 2nd January 2007</p>
215
- <div class="SubSubTitle">Changelog</div>
216
  <ul>
 
 
 
 
 
 
 
 
 
 
 
 
217
  <li>
218
- <b>Version 1.00 (02-11-2007)</b>
219
  <ul>
220
  <li>NEW: Initial Release</li>
221
  </ul>
@@ -232,7 +320,7 @@
232
  </li>
233
  <li>
234
  Put:
235
- <blockquote>File: ban.php</blockquote>
236
  </li>
237
  <li>
238
  <b>Activate</b> WP-Ban Plugin
@@ -246,15 +334,28 @@
246
  <!-- Upgrade Instructions -->
247
  <div id="Upgrade" style="display: none;">
248
  <div class="SubTitle">&raquo; Upgrade Instructions</div>
249
- <div class="SubSubTitle">From v1.0x To v1.00</div>
250
  <ol>
 
 
 
251
  <li>
252
  Open <b>wp-content/plugins</b> Folder
253
  </li>
254
  <li>
255
- Overwrite:
 
 
 
 
256
  <blockquote>File: ban.php</blockquote>
257
  </li>
 
 
 
 
 
 
258
  </ol>
259
  </div>
260
 
@@ -264,7 +365,7 @@
264
  <div class="SubSubTitle">General Usage</div>
265
  <ol>
266
  <li>
267
- Go to '<b>WP-Admin -> Options -> Ban</b>'
268
  </li>
269
  <li>
270
  Configure your ban options
@@ -273,6 +374,6 @@
273
  </div>
274
  </div>
275
  </div>
276
- <p id="Copyright">WP-Ban 1.00<br />Copyright &copy; 2006 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
277
  </body>
278
  </html>
2
  <html>
3
  <head>
4
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
+ <title>WP-Ban 1.10 Readme</title>
6
  <style type="text/css" media="screen">
7
  /* Default Style */
8
  BODY {
121
  }
122
  </style>
123
  <script type="text/javascript">
124
+ /* <![CDATA[*/
125
  // Index Page
126
  function index() {
127
  // Tab
128
  document.getElementById('IndexTab').className = 'SelectedTab';
129
+ document.getElementById('ChangelogTab').className = 'Tab';
130
  document.getElementById('InstallTab').className = 'Tab';
131
  document.getElementById('UpgradeTab').className = 'Tab';
132
  document.getElementById('UsageTab').className = 'Tab';
133
  // Page
134
  document.getElementById('Index').style.display= 'block';
135
+ document.getElementById('Changelog').style.display = 'none';
136
+ document.getElementById('Install').style.display = 'none';
137
+ document.getElementById('Upgrade').style.display = 'none';
138
+ document.getElementById('Usage').style.display = 'none';
139
+ }
140
+ // Changelog Page
141
+ function changelog() {
142
+ // Tab
143
+ document.getElementById('IndexTab').className = 'Tab';
144
+ document.getElementById('ChangelogTab').className = 'SelectedTab';
145
+ document.getElementById('InstallTab').className = 'Tab';
146
+ document.getElementById('UpgradeTab').className = 'Tab';
147
+ document.getElementById('UsageTab').className = 'Tab';
148
+ // Page
149
+ document.getElementById('Index').style.display = 'none';
150
+ document.getElementById('Changelog').style.display = 'block';
151
  document.getElementById('Install').style.display = 'none';
152
  document.getElementById('Upgrade').style.display = 'none';
153
  document.getElementById('Usage').style.display = 'none';
156
  function install() {
157
  // Tab
158
  document.getElementById('IndexTab').className = 'Tab';
159
+ document.getElementById('ChangelogTab').className = 'Tab';
160
  document.getElementById('InstallTab').className = 'SelectedTab';
161
  document.getElementById('UpgradeTab').className = 'Tab';
162
  document.getElementById('UsageTab').className = 'Tab';
163
  // Page
164
  document.getElementById('Index').style.display= 'none';
165
+ document.getElementById('Changelog').style.display = 'none';
166
  document.getElementById('Install').style.display = 'block';
167
  document.getElementById('Upgrade').style.display = 'none';
168
  document.getElementById('Usage').style.display = 'none';
171
  function upgrade() {
172
  // Tab
173
  document.getElementById('IndexTab').className = 'Tab';
174
+ document.getElementById('ChangelogTab').className = 'Tab';
175
  document.getElementById('InstallTab').className = 'Tab';
176
  document.getElementById('UpgradeTab').className = 'SelectedTab';
 
177
  document.getElementById('UsageTab').className = 'Tab';
178
  // Page
179
  document.getElementById('Index').style.display= 'none';
180
+ document.getElementById('Changelog').style.display = 'none';
181
  document.getElementById('Install').style.display = 'none';
182
  document.getElementById('Upgrade').style.display = 'block';
183
  document.getElementById('Usage').style.display = 'none';
186
  function usage() {
187
  // Tab
188
  document.getElementById('IndexTab').className = 'Tab';
189
+ document.getElementById('ChangelogTab').className = 'Tab';
190
  document.getElementById('InstallTab').className = 'Tab';
191
  document.getElementById('UpgradeTab').className = 'Tab';
192
  document.getElementById('UsageTab').className = 'SelectedTab';
193
  // Page
194
+ document.getElementById('Index').style.display= 'none';
195
+ document.getElementById('Changelog').style.display = 'none';
196
  document.getElementById('Install').style.display = 'none';
197
  document.getElementById('Upgrade').style.display = 'none';
198
  document.getElementById('Usage').style.display = 'block';
199
  }
200
+ /* ]]> */
201
+ </script>
202
  </head>
203
  <body>
204
  <div id="Container">
205
  <!-- Title -->
206
+ <div id="Title">WP-Ban 1.10&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div>
207
 
208
  <!-- Tabs -->
209
  <ul id="Tabs">
210
  <li id="UsageTab" class="Tab"><a href="#Usage" onclick="usage(); return false;" title="Usage Instructions">Usage</a></li>
211
  <li id="UpgradeTab" class="Tab"><a href="#Upgrade" onclick="upgrade(); return false;" title="Upgrade Instructions">Upgrade</a></li>
212
  <li id="InstallTab" class="Tab"><a href="#Installation" onclick="install(); return false;" title="Installation Instructions">Installation</a></li>
213
+ <li id="ChangelogTab" class="Tab"><a href="#Changelog" onclick="changelog(); return false;" title="Changelog">Changelog</a></li>
214
  <li id="IndexTab" class="SelectedTab"><a href="#Index" onclick="index(); return false;" title="Index Instructions">Index</a></li>
215
  </ul>
216
 
220
  <div id="Index">
221
  <div class="SubTitle">&raquo; Index</div>
222
  <div class="SubSubTitle">Plugin Information</div>
 
223
  <p>
224
+ <b>Author:</b><br />
225
+ <b>&raquo;</b> Lester 'GaMerZ' Chan
226
+ </p>
227
+ <p>
228
+ <b>EMail:</b><br />
229
+ <b>&raquo;</b>
230
+ <script type="text/javascript">
231
+ /* <![CDATA[*/
232
+ document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-Ban%201.10%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>');
233
+ /* ]]> */
234
+ </script>
235
+ </p>
236
+ <p>
237
+ <b>Website:</b><br />
238
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/" title="http://www.lesterchan.net/">http://www.lesterchan.net/</a>
239
+ </p>
240
+ <p>
241
+ <b>Features:</b><br />
242
+ <b>&raquo;</b> Ban users by IP or host name from visiting your WordPress's blog. It will display a custom ban message when the banned IP/host name trys to visit you blog. There will be statistics recordered on how many times they attemp to visit your blog. It allows wildcard matching too.
243
+ </p>
244
+ <p>
245
+ <b>Download:</b><br />
246
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/others/downloads.php?id=26" title="http://www.lesterchan.net/others/downloads.php?id=26">WP-Ban 1.10 For WordPress 2.1.x</a><br />
247
+ <b>&raquo;</b> <a href="http://www.lesterchan.net/others/downloads/wp-ban100.zip" title="http://www.lesterchan.net/others/downloads/wp-ban100.zip">WP-Ban 1.00 For WordPress 2.0.x</a><br />
248
+ </p>
249
+ <p>
250
+ <b>Demo:</b><br />
251
+ <b>&raquo;</b> N/A</a>
252
+ </p>
253
+ <p>
254
+ <b>Development:</b><br />
255
+ <b>&raquo;</b> <a href="http://dev.wp-plugins.org/browser/wp-ban/" title="http://dev.wp-plugins.org/browser/wp-ban/">http://dev.wp-plugins.org/browser/wp-ban/</a>
256
+ </p>
257
+ <p>
258
+ <b>Translations:</b><br />
259
+ <b>&raquo;</b> <a href="http://dev.wp-plugins.org/browser/wp-ban/i18n/" title="http://dev.wp-plugins.org/browser/wp-ban/i18n/">http://dev.wp-plugins.org/browser/wp-ban/i18n/</a>
260
+ </p>
261
+ <p>
262
+ <b>Support Forums:</b><br />
263
+ <b>&raquo;</b> <a href="http://forums.lesterchan.net/index.php?board=10.0" title="http://forums.lesterchan.net/index.php?board=10.0">http://forums.lesterchan.net/index.php?board=10.0</a>
264
+ </p>
265
+ <p>
266
+ <b>Credits:</b><br />
267
+ <b>&raquo;</b> Ban Stats By <a href="http://blog.fileville.net/">Joe (Ttech)</a>
268
+ </p>
269
+ <p>
270
+ <b>Updated:</b><br />
271
+ <b>&raquo;</b> 1st February 2007
272
+ </p>
273
+ <p>
274
+ <b>Note:</b><br />
275
+ <b>&raquo;</b> The <b>Changelog</b>, <b>Installation</b>, <b>Upgrade</b>, <b>Usage</b> Tab at the top of the page.<br />
276
+ <b>&raquo;</b> The ban tab has been moved to 'WP-Admin -> Manage'
277
+ </p>
278
+ <p>
279
+ <b>Donations:</b><br />
280
+ <b>&raquo;</b> I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks as my school allowance, I will really appericiate it. If not feel free to use it without any obligations. Thank You. My Paypal account is
281
  <script type="text/javascript">
282
  /* <![CDATA[*/
283
+ document.write(' <b>gamerz84@hotmail.com</b>.');
284
  /* ]]> */
285
  </script>
286
  </p>
287
+ </div>
288
+
289
+ <!-- Changelog -->
290
+ <div id="Changelog" style="display: none;">
291
+ <div class="SubTitle">&raquo; Changelog</div>
 
 
 
292
  <ul>
293
+ <li>
294
+ <b>Version 1.10 (01-02-2007)</b>
295
+ <ul>
296
+ <li>NEW: Works For WordPress 2.1 Only</li>
297
+ <li>NEW: Move ban.php To ban Folder</li>
298
+ <li>NEW: Localize WP-Ban</li>
299
+ <li>NEW: Added Ban Attempts Statistics In 'WP-Admin -> Manage -> Ban'</li>
300
+ <li>NEW: Move Ban Tab To 'WP-Admin -> Manage'</li>
301
+ <li>NEW: Added Toggle All Checkboxes</li>
302
+ <li>FIXED: Main Administrator Of The Site Cannot Be Banned</li>
303
+ </ul>
304
+ </li>
305
  <li>
306
+ <b>Version 1.00 (02-01-2007)</b>
307
  <ul>
308
  <li>NEW: Initial Release</li>
309
  </ul>
320
  </li>
321
  <li>
322
  Put:
323
+ <blockquote>Folder: ban</blockquote>
324
  </li>
325
  <li>
326
  <b>Activate</b> WP-Ban Plugin
334
  <!-- Upgrade Instructions -->
335
  <div id="Upgrade" style="display: none;">
336
  <div class="SubTitle">&raquo; Upgrade Instructions</div>
337
+ <div class="SubSubTitle">From v1.0x To v1.10</div>
338
  <ol>
339
+ <li>
340
+ <b>Deactivate</b> WP-Ban Plugin
341
+ </li>
342
  <li>
343
  Open <b>wp-content/plugins</b> Folder
344
  </li>
345
  <li>
346
+ Put/Overwrite:
347
+ <blockquote>Folder: ban</blockquote>
348
+ </li>
349
+ <li>
350
+ Delete:
351
  <blockquote>File: ban.php</blockquote>
352
  </li>
353
+ <li>
354
+ <b>Activate</b> WP-Ban Plugin
355
+ </li>
356
+ <li>
357
+ Refer To <b>Usage</b> For Further Instructions
358
+ </li>
359
  </ol>
360
  </div>
361
 
365
  <div class="SubSubTitle">General Usage</div>
366
  <ol>
367
  <li>
368
+ Go to '<b>WP-Admin -> Manage -> Ban</b>'
369
  </li>
370
  <li>
371
  Configure your ban options
374
  </div>
375
  </div>
376
  </div>
377
+ <p id="Copyright">WP-Ban 1.10<br />Copyright &copy; 2007 Lester 'GaMerZ' Chan. All Rights Reserved.</p>
378
  </body>
379
  </html>
readme.txt ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP-Ban ===
2
+ Contributors: GamerZ
3
+ Donate link: http://www.lesterchan.net/wordpress
4
+ Tags: ban, deny, denied, permission, ip, hostname, host, spam, bots, bot
5
+ Requires at least: 2.1.0
6
+ Stable tag: 1.10
7
+
8
+ Ban users by IP or host name from visiting your WordPress's blog.
9
+
10
+ == Description ==
11
+
12
+ It will display a custom ban message when the banned IP/host name trys to visit you blog. There will be statistics recordered on how many times they attemp to visit your blog. It allows wildcard matching too.
13
+
14
+ All the information (general, changelog, installation, upgrade, usage) you need about this plugin can be found here: [WP-Ban Readme](http://www.lesterchan.net/wordpress/readme/wp-ban.html "WP-Ban Readme").
15
+ It is the exact same readme.html is included in the zip package.
16
+
17
+ == Development Blog ==
18
+
19
+ [GaMerZ WordPress Plugins Development Blog](http://www.lesterchan.net/wordpress/ "GaMerZ WordPress Plugins Development Blog")
20
+
21
+ == Installation ==
22
+
23
+ [WP-Ban Readme](http://www.lesterchan.net/wordpress/readme/wp-ban.html "WP-Ban Readme") (Installation Tab)
24
+
25
+ == Screenshots ==
26
+
27
+ [GaMerZ WordPress Plugins Screenshots](http://www.lesterchan.net/wordpress/screenshots/ "GaMerZ WordPress Plugins Screenshots")
28
+
29
+ == Frequently Asked Questions ==
30
+
31
+ You will need [GaMerZ WordPress Plugins Support Forums](http://forums.lesterchan.net/ "GaMerZ WordPress Plugins Support Forums")