Changeset 772574
- Timestamp:
- 09/15/2013 07:40:53 AM (12 years ago)
- Location:
- theme-to-browser-t2b-control/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
t2b.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
theme-to-browser-t2b-control/trunk/readme.txt
r424603 r772574 5 5 Requires at least: 2.0.2 6 6 Tested up to: 3.2.1 7 Stable tag: 0. 37 Stable tag: 0.4 8 8 9 9 Displays different themes based on the browser used. … … 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, iPad/iPhone/iPod, Safari, Playstation 3, 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, Chrome, Opera, iPad/iPhone/iPod, Safari, Playstation 3, 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 18 19 19 Thanks to Drazen Mokic, Nicholas McQuillin and Paul Gregory for their help and suggestions. -
theme-to-browser-t2b-control/trunk/t2b.php
r417226 r772574 4 4 Plugin URI: http://www.federicojacobi.com/wp/work/t2b-control/ 5 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, BlackBerries, Playstation 3 6 Version: 0. 36 Version: 0.4 7 7 Author: Federico Jacobi 8 8 Author URI: http://www.federicojacobi.com … … 10 10 11 11 $supported_browsers = array ( 12 '|MSIE ([0-9] .[0-9]{1,2})|' => array('ie','Internet Explorer'),12 '|MSIE ([0-9]?.[0-9]{1,2})|' => array('ie','Internet Explorer'), 13 13 '|Firefox/([0-9\.]+)|' => array('firefox','FireFox'), 14 '|Opera/([0-9].[0-9]{1,2})|' => array('opera','Opera'), 14 '/Opera|OPR\/(.[0-9]){1,5}/' => array('opera','Opera'), 15 16 '|Chrome/[0-9]{1,3}(.[0-9]{1,3}){1,5}|' => array('chrome','Chrome'), 17 15 18 '/\(iPhone|iPod/' => array('iphone','iPhone, iPod'), 16 19 '/\(iPad/' => array('ipad','iPad'), 17 '|Safari/([0-9\.]+)|' => array('safari','Safari'), 20 '|Safari|' => array('safari','Safari'), 21 18 22 '/BlackBerry8310/' => array('blackberry8310','BlackBerry 8310'), 19 23 '/BlackBerry/' => array('blackberry','All BlackBerry'), 20 24 '/PLAYSTATION 3|PS3/' => array('ps3','Playstation 3') 21 25 ); 22 $lzt_version = '0. 3';26 $lzt_version = '0.4'; 23 27 $useragent = $_SERVER['HTTP_USER_AGENT']; 24 28 $browser_version = 0; … … 34 38 35 39 $lzt_theme = get_option('lzt_'.$lzt_browser); 36 37 if ($lzt_theme != "t2b_default") { 38 // Check for a valid theme directory, and set the template and stylesheet directory 39 if($lzt_theme && file_exists(get_theme_root() . "/$lzt_theme")) { 40 41 $theme_data = get_theme_data(get_theme_root()."/$lzt_theme/style.css"); 42 if ($theme_data['Template'] == '') { 43 $theme_parent = $lzt_theme; 44 } else { 45 $theme_parent = $theme_data['Template']; 40 if (! is_admin() ) { 41 if ($lzt_theme != "t2b_default") { 42 // Check for a valid theme directory, and set the template and stylesheet directory 43 if($lzt_theme && file_exists(get_theme_root() . "/$lzt_theme")) { 44 45 $theme_data = get_theme_data(get_theme_root()."/$lzt_theme/style.css"); 46 if ($theme_data['Template'] == '') { 47 $theme_parent = $lzt_theme; 48 } else { 49 $theme_parent = $theme_data['Template']; 50 } 51 add_filter('template','lzt_set_theme'); 52 add_filter('stylesheet','lzt_set_css'); 46 53 } 47 add_filter('template','lzt_set_theme');48 add_filter('stylesheet','lzt_set_css');49 // add_action('wp_footer','echoresult'); // Triggers debug at the footer50 54 } 55 //add_action('wp_footer','echoresult'); // Triggers debug at the footer 51 56 } 52 53 57 // Debug function ... just to make sure the right stuff is loaded 54 58 function echoresult() { 55 59 global $theme_parent, $lzt_theme; 56 60 global $theme_data; 61 global $useragent; 62 echo "<div>"; 63 get_template(); 64 echo '|'; 57 65 echo "ThemeParent:".$theme_parent."<br>"; 58 echo "ThemeCss:".$lzt_theme; 66 echo "ThemeCss:".$lzt_theme."<br>"; 67 echo "Useragent:". $useragent."<br>"; 68 print_r($theme_data); 69 echo "</div>"; 59 70 } 60 71 … … 73 84 ?> 74 85 <div class="wrap"> 75 < h2>Theme to Browser Control a.k.a. T2B (v.<?php echo $lzt_version ?>)</h2>86 <div id="icon-options-general" class="icon32"></div> <h2>Theme to Browser Control a.k.a. T2B (v.<?php echo $lzt_version ?>)</h2> 76 87 <?php 77 88 if ($_REQUEST['submit']) { … … 112 123 foreach ($supported_browsers as $browser_regex => $browser_name) { 113 124 ?> 114 <div class="postbox" style="width:200px; float:left; display: inline-block; margin:5px;">115 <h3 class="hndle"><span><?php echo $browser_name[1] ?></span></h3>125 <div style="width:200px; float:left; display: inline-block; margin: 5px; background-color:#F1F1F1; border:1px solid #E3E3E3; padding:5px;"> 126 <h3><?php echo $browser_name[1] ?></h4> 116 127 <div class="inside"><p><ul> 117 128 <?php
Note: See TracChangeset
for help on using the changeset viewer.