Changeset 370910
- Timestamp:
- 04/09/2011 02:22:30 PM (15 years ago)
- Location:
- theme-to-browser-t2b-control/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (5 diffs)
-
t2b.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
theme-to-browser-t2b-control/trunk/readme.txt
r365390 r370910 4 4 Tags: themes, browser, design, control, browser control, mobile, blackberry 5 5 Requires at least: 2.0.2 6 Tested up to: 3.1 6 Tested up to: 3.1.1 7 7 Stable tag: trunk 8 8 … … 15 15 PLEASE vote and/or rate if it works for you or let me know if there's a fix needed at web[at]federicojacobi.com. 16 16 17 Supported browsers for now: Internet Explorer, FireFox, Opera, iPhone/iPod, Safari, BlackBerry8310 specifically, and other BlackBerry models (non-specific). All of them modern versions, however, version specific detection will come in future upgrades of the plugin. 17 Supported browsers for now: Internet Explorer, FireFox, Opera, iPad/iPhone/iPod, Safari, BlackBerry8310 specifically, and other BlackBerry models (non-specific). All of them modern versions, however, version specific detection will come in future upgrades of the plugin. 18 19 Thanks to Nicholas McQuillin and Paul Gregory for their help. 18 20 19 21 == Installation == … … 25 27 == Frequently Asked Questions == 26 28 What browsers are detected? 27 Internet Explorer, FireFox, Opera, iP hone/iPod, Safari, BlackBerry8310, BlackBerry29 Internet Explorer, FireFox, Opera, iPad/iPhone/iPod, Safari, BlackBerry8310, BlackBerry 28 30 29 31 What about browser versions (ie5, ie6, operamini) ? … … 46 48 47 49 == Changelog == 50 = 0.21 = 51 Child themes now supported. Important fix. iPad added to browser list. 52 48 53 = 0.2 = 49 54 BlackBerry8310 and All BlackBerry models added. … … 53 58 54 59 == Upgrade Notice == 60 = 0.21 = 61 The plugin wasn't working with child themes, now it is! Important fix. iPad added to browser list. 62 55 63 = 0.2 = 56 64 Non critical update. It adds support for BlackBerry phones. -
theme-to-browser-t2b-control/trunk/t2b.php
r365387 r370910 3 3 Plugin Name: Theme to Browser (T2B) Control 4 4 Plugin URI: http://www.federicojacobi.com/wp/work/t2b-control/ 5 Description: Display a different theme depending on the users browser. It is perfect for a quick way out of CSS annoyances and also for customization on mobile devices. Supports: Internet Explorer, FireFox, Opera, iPhone/iPod, Safari. Now supporting BlackBerry 8310, and all BlackBerries.6 Version: 0.2 5 Description: Display a different theme depending on the users browser. It is perfect for a quick way out of CSS annoyances and also for customization on mobile devices. Supports: Internet Explorer, FireFox, Opera, iPhone/iPod, iPad, Safari. Now supporting BlackBerry 8310, and all BlackBerries. 6 Version: 0.21 7 7 Author: Federico Jacobi 8 8 Author URI: http://www.federicojacobi.com … … 14 14 '|Opera/([0-9].[0-9]{1,2})|' => array('opera','Opera'), 15 15 '/\(iPhone|iPod/' => array('iphone','iPhone, iPod'), 16 '/\(iPad/' => array('ipad','iPad'), 16 17 '|Safari/([0-9\.]+)|' => array('safari','Safari'), 17 18 '/BlackBerry8310/' => array('blackberry8310','BlackBerry 8310'), 18 19 '/BlackBerry/' => array('blackberry','All BlackBerry') 19 20 ); 20 $lzt_version = '0. 1';21 $lzt_version = '0.21'; 21 22 $useragent = $_SERVER['HTTP_USER_AGENT']; 22 23 $browser_version = 0; … … 34 35 // Check for a valid theme directory, and set the template and stylesheet directory 35 36 if($lzt_theme && file_exists(get_theme_root() . "/$lzt_theme")) { 37 38 $theme_data = get_theme_data(get_theme_root()."/$lzt_theme/style.css"); 39 if ($theme_data['Template'] == '') { 40 $theme_parent = $lzt_theme; 41 } else { 42 $theme_parent = $theme_data['Template']; 43 } 36 44 add_filter('template','lzt_set_theme'); 37 add_filter('stylesheet','lzt_set_theme'); 45 add_filter('stylesheet','lzt_set_css'); 46 // add_action('wp_footer','echoresult'); // Triggers debug at the footer 47 } 48 49 // Debug function ... just to make sure the right stuff is loaded 50 function echoresult() { 51 global $theme_parent, $lzt_theme; 52 global $theme_data; 53 echo "ThemeParent:".$theme_parent."<br>"; 54 echo "ThemeCss:".$lzt_theme; 55 } 56 57 58 function lzt_set_theme() { 59 global $theme_parent; 60 return $theme_parent; 61 } 62 function lzt_set_css() { 63 global $lzt_theme; 64 return $lzt_theme; 38 65 } 39 66 … … 88 115 foreach($themes as $theme) { 89 116 ?> 90 <input type="radio" name="<?php echo $browser_name[0]?>" value="<?php echo $theme[' Template']; ?>" <?php117 <input type="radio" name="<?php echo $browser_name[0]?>" value="<?php echo $theme['Stylesheet']; ?>" <?php 91 118 // IF este es el seleccionado THEN echo SELECTED 92 if ((get_option('lzt_'.$browser_name[0]) == $theme[' Template']) || ($first)) {119 if ((get_option('lzt_'.$browser_name[0]) == $theme['Stylesheet']) || ($first)) { 93 120 echo 'checked="checked"'; 94 121 $first = false; … … 134 161 } 135 162 136 function lzt_set_theme($themename) {137 global $lzt_theme;138 return $lzt_theme;139 }140 141 163 142 164 add_action('admin_menu','lzt_modify_menu');
Note: See TracChangeset
for help on using the changeset viewer.