root/wp-ban/trunk/ban-preview.php

Revision 52944, 1.7 kB (checked in by GamerZ, 4 days ago)

Remove nested dirname() call

Line 
1 <?php
2 /*
3 +----------------------------------------------------------------+
4 |                                                                                            |
5 |    WordPress 2.5 Plugin: WP-Ban 1.31                                            |
6 |    Copyright (c) 2008 Lester "GaMerZ" Chan                                    |
7 |                                                                                            |
8 |    File Written By:                                                                    |
9 |    - Lester "GaMerZ" Chan                                                            |
10 |    - http://lesterchan.net                                                            |
11 |                                                                                            |
12 |    File Information:                                                                    |
13 |    - Banned Message Preview                                                        |
14 |    - wp-content/plugins/wp-ban/ban-preview.php                            |
15 |                                                                                            |
16 +----------------------------------------------------------------+
17 */
18
19
20 ### Require wp-config.php
21 $wp_root = '../../..';
22 if (file_exists($wp_root.'/wp-load.php')) {
23     require_once($wp_root.'/wp-load.php');
24 } else {
25     require_once($wp_root.'/wp-config.php');
26 }
27
28
29 ### Display Banned Message
30 $banned_stats = get_option('banned_stats');
31 $banned_stats['count'] = number_format_i18n(intval($banned_stats['count']));
32 $banned_stats['users'][get_IP()] = number_format_i18n(intval($banned_stats['users'][get_IP()]));
33 $banned_message = stripslashes(get_option('banned_message'));
34 $banned_message = str_replace("%SITE_NAME%", get_option('blogname'), $banned_message);
35 $banned_message = str_replace("%SITE_URL%"get_option('siteurl'), $banned_message);
36 $banned_message = str_replace("%USER_ATTEMPTS_COUNT%"$banned_stats['users'][get_IP()], $banned_message);
37 $banned_message = str_replace("%USER_IP%", get_IP(), $banned_message);
38 $banned_message = str_replace("%USER_HOSTNAME%",  @gethostbyaddr(get_IP()), $banned_message);
39 $banned_message = str_replace("%TOTAL_ATTEMPTS_COUNT%"$banned_stats['count'], $banned_message);               
40 echo $banned_message;
41 exit();
42 ?>
Note: See TracBrowser for help on using the browser.