Changeset 7111
- Timestamp:
- 12/19/06 23:26:22 (2 years ago)
- Files:
-
- wordpress-mobile-edition/trunk/wp-mobile.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wordpress-mobile-edition/trunk/wp-mobile.php
r6890 r7111 19 19 Plugin Name: WordPress Mobile Edition 20 20 Plugin URI: http://alexking.org/projects/wordpress 21 Description: Show a mobile view of the post/page if the visitor is on a known mobile device. 21 Description: Show a mobile view of the post/page if the visitor is on a known mobile device. Questions on configuration, etc.? Make sure to read the README. 22 22 Author: Alex King 23 23 Author URI: http://alexking.org … … 29 29 function akm_check_mobile() { 30 30 if (!isset($_SERVER["HTTP_USER_AGENT"]) || (isset($_COOKIE['akm_mobile']) && $_COOKIE['akm_mobile'] == 'false')) { 31 return false; 32 } 33 if (akm_mobile_exclude()) { 31 34 return false; 32 35 } … … 82 85 } 83 86 84 function akm_mobile_ redirect() {85 $ redirect = true;87 function akm_mobile_exclude() { 88 $exclude = false; 86 89 $pages_to_exclude = array( 87 90 'wp-admin' 88 ,'wp-mobile.php'89 91 ,'wp-comments-post.php' 90 92 ,'wp-mail.php' … … 93 95 foreach ($pages_to_exclude as $exclude) { 94 96 if (strstr(strtolower($_SERVER['REQUEST_URI']), $exclude)) { 95 $ redirect = false;96 } 97 } 98 return $ redirect;97 $exclude = true; 98 } 99 } 100 return $exclude; 99 101 } 100 102 … … 194 196 } 195 197 196 if (akm_ mobile_redirect() && akm_check_mobile()) {198 if (akm_check_mobile()) { 197 199 add_action('template', 'akm_template'); 198 200 add_action('option_template', 'akm_template');
