Any Mobile Theme Switcher - Version 1.3

Version Description

  • Use of Cookie inplace of session.
Download this release

Release Info

Developer dnesscarkey
Plugin Icon 128x128 Any Mobile Theme Switcher
Version 1.3
Comparing to
See all releases

Code changes from version 1.2 to 1.3

any-mobile-theme-switcher.php CHANGED
@@ -4,128 +4,80 @@ Plugin Name: Any Mobile Theme Switcher
4
  Plugin URI: http://dineshkarki.com.np/any-mobile-theme-switcher
5
  Description: This plugin allow you to detect all mobile platform and switch the theme. Supports most of the mobile platform including iphone, ipad, ipod, windows mobile, parm os, blackberry, android, andriod tab.
6
  Author: Dinesh Karki
7
- Version: 1.2
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10
 
11
  /* Copyright 2012 Dinesh Karki (email : dnesskarki@gmail.com)*/
12
 
13
- add_action('init', 'startAMTSsession', 1);
14
- function startAMTSsession(){
15
- if (!session_id()){
16
- session_start();
17
- }
18
- }
19
-
20
- $mobile_browser = '';
21
- $mobileredirect = '';
22
- $status = '';
23
- $user_agent = $_SERVER['HTTP_USER_AGENT']; // get the user agent value - this should be cleaned to ensure no nefarious input gets executed
24
- $accept = $_SERVER['HTTP_ACCEPT']; // get the content accept value - this should be cleaned to ensure no nefarious input gets executed
25
-
26
- switch(true){ // using a switch against the following statements which could return true is more efficient than the previous method of using if statements
27
-
28
- case (preg_match('/ipad/i',$user_agent)); // we find the word ipad in the user agent
29
- $mobile_browser = get_option('ipad_theme'); // mobile browser is either true or false depending on the setting of ipad when calling the function
30
- $status = 'Apple iPad';
31
- break; // break out and skip the rest if we've had a match on the ipad // this goes before the iphone to catch it else it would return on the iphone instead
32
-
33
- case (preg_match('/ipod/i',$user_agent)||preg_match('/iphone/i',$user_agent)); // we find the words iphone or ipod in the user agent
34
- $mobile_browser = get_option('iphone_theme'); // mobile browser is either true or false depending on the setting of iphone when calling the function
35
- $status = 'Apple';
36
- break; // break out and skip the rest if we've had a match on the iphone or ipod
37
-
38
- case (preg_match('/android/i',$user_agent)); // we find android in the user agent
39
- if (preg_match('/mobile/i',$user_agent)):
40
- $mobile_browser = get_option('android_theme'); // mobile browser is either true or false depending on the setting of android when calling the function
41
- $status = 'Android';
42
- else :
43
- $mobile_browser = get_option('android_tab_theme'); // mobile browser is either true or false depending on the setting of android when calling the function
44
- $status = 'Android Tab';
45
- endif;
46
-
47
- break; // break out and skip the rest if we've had a match on android
48
-
49
- case (preg_match('/opera mini/i',$user_agent)); // we find opera mini in the user agent
50
- $mobile_browser = get_option('opera_theme'); // mobile browser is either true or false depending on the setting of opera when calling the function
51
- $status = 'Opera';
52
- break; // break out and skip the rest if we've had a match on opera
53
-
54
- case (preg_match('/blackberry/i',$user_agent)); // we find blackberry in the user agent
55
- $mobile_browser = get_option('blackberry_theme'); // mobile browser is either true or false depending on the setting of blackberry when calling the function
56
- $status = 'Blackberry';
57
- break; // break out and skip the rest if we've had a match on blackberry
58
-
59
- case (preg_match('/(pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)/i',$user_agent)); // we find palm os in the user agent - the i at the end makes it case insensitive
60
- $mobile_browser = get_option('parm_os_theme'); // mobile browser is either true or false depending on the setting of palm when calling the function
61
- $status = 'Palm';
62
- break; // break out and skip the rest if we've had a match on palm os
63
-
64
- case (preg_match('/(iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i',$user_agent)); // we find windows mobile in the user agent - the i at the end makes it case insensitive
65
- $mobile_browser = get_option('windows_theme'); // mobile browser is either true or false depending on the setting of windows when calling the function
66
- $status = 'Windows Smartphone';
67
- break; // break out and skip the rest if we've had a match on windows
68
 
69
- case (preg_match('/(mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370|sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888|nx250|n120|mtk |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|_mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_touch|355x|m50|km100|d736|p-9521|telco|sl74|ktouch|m4u\/|me702|8325rc|kddi|phone|lg |sonyericsson|samsung|240x|x320|vx10|nokia|sony cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo)/i',$user_agent)); // check if any of the values listed create a match on the user agent - these are some of the most common terms used in agents to identify them as being mobile devices - the i at the end makes it case insensitive
70
- $mobile_browser = get_option('other_theme'); // set mobile browser to true
71
- $status = 'Mobile matched on piped preg_match';
72
- break; // break out and skip the rest if we've preg_match on the user agent returned true
73
-
74
- case ((strpos($accept,'text/vnd.wap.wml')>0)||(strpos($accept,'application/vnd.wap.xhtml+xml')>0)); // is the device showing signs of support for text/vnd.wap.wml or application/vnd.wap.xhtml+xml
75
- $mobile_browser = get_option('other_theme'); // set mobile browser to true
76
- $status = 'Mobile matched on content accept header';
77
- break; // break out and skip the rest if we've had a match on the content accept headers
78
-
79
- case (isset($_SERVER['HTTP_X_WAP_PROFILE'])||isset($_SERVER['HTTP_PROFILE'])); // is the device giving us a HTTP_X_WAP_PROFILE or HTTP_PROFILE header - only mobile devices would do this
80
- $mobile_browser = get_option('other_theme'); // set mobile browser to true
81
- $status = 'Mobile matched on profile headers being set';
82
- break; // break out and skip the final step if we've had a return true on the mobile specfic headers
83
-
84
- case (in_array(strtolower(substr($user_agent,0,4)),array('1207'=>'1207','3gso'=>'3gso','4thp'=>'4thp','501i'=>'501i','502i'=>'502i','503i'=>'503i','504i'=>'504i','505i'=>'505i','506i'=>'506i','6310'=>'6310','6590'=>'6590','770s'=>'770s','802s'=>'802s','a wa'=>'a wa','acer'=>'acer','acs-'=>'acs-','airn'=>'airn','alav'=>'alav','asus'=>'asus','attw'=>'attw','au-m'=>'au-m','aur '=>'aur ','aus '=>'aus ','abac'=>'abac','acoo'=>'acoo','aiko'=>'aiko','alco'=>'alco','alca'=>'alca','amoi'=>'amoi','anex'=>'anex','anny'=>'anny','anyw'=>'anyw','aptu'=>'aptu','arch'=>'arch','argo'=>'argo','bell'=>'bell','bird'=>'bird','bw-n'=>'bw-n','bw-u'=>'bw-u','beck'=>'beck','benq'=>'benq','bilb'=>'bilb','blac'=>'blac','c55/'=>'c55/','cdm-'=>'cdm-','chtm'=>'chtm','capi'=>'capi','cond'=>'cond','craw'=>'craw','dall'=>'dall','dbte'=>'dbte','dc-s'=>'dc-s','dica'=>'dica','ds-d'=>'ds-d','ds12'=>'ds12','dait'=>'dait','devi'=>'devi','dmob'=>'dmob','doco'=>'doco','dopo'=>'dopo','el49'=>'el49','erk0'=>'erk0','esl8'=>'esl8','ez40'=>'ez40','ez60'=>'ez60','ez70'=>'ez70','ezos'=>'ezos','ezze'=>'ezze','elai'=>'elai','emul'=>'emul','eric'=>'eric','ezwa'=>'ezwa','fake'=>'fake','fly-'=>'fly-','fly_'=>'fly_','g-mo'=>'g-mo','g1 u'=>'g1 u','g560'=>'g560','gf-5'=>'gf-5','grun'=>'grun','gene'=>'gene','go.w'=>'go.w','good'=>'good','grad'=>'grad','hcit'=>'hcit','hd-m'=>'hd-m','hd-p'=>'hd-p','hd-t'=>'hd-t','hei-'=>'hei-','hp i'=>'hp i','hpip'=>'hpip','hs-c'=>'hs-c','htc '=>'htc ','htc-'=>'htc-','htca'=>'htca','htcg'=>'htcg','htcp'=>'htcp','htcs'=>'htcs','htct'=>'htct','htc_'=>'htc_','haie'=>'haie','hita'=>'hita','huaw'=>'huaw','hutc'=>'hutc','i-20'=>'i-20','i-go'=>'i-go','i-ma'=>'i-ma','i230'=>'i230','iac'=>'iac','iac-'=>'iac-','iac/'=>'iac/','ig01'=>'ig01','im1k'=>'im1k','inno'=>'inno','iris'=>'iris','jata'=>'jata','java'=>'java','kddi'=>'kddi','kgt'=>'kgt','kgt/'=>'kgt/','kpt '=>'kpt ','kwc-'=>'kwc-','klon'=>'klon','lexi'=>'lexi','lg g'=>'lg g','lg-a'=>'lg-a','lg-b'=>'lg-b','lg-c'=>'lg-c','lg-d'=>'lg-d','lg-f'=>'lg-f','lg-g'=>'lg-g','lg-k'=>'lg-k','lg-l'=>'lg-l','lg-m'=>'lg-m','lg-o'=>'lg-o','lg-p'=>'lg-p','lg-s'=>'lg-s','lg-t'=>'lg-t','lg-u'=>'lg-u','lg-w'=>'lg-w','lg/k'=>'lg/k','lg/l'=>'lg/l','lg/u'=>'lg/u','lg50'=>'lg50','lg54'=>'lg54','lge-'=>'lge-','lge/'=>'lge/','lynx'=>'lynx','leno'=>'leno','m1-w'=>'m1-w','m3ga'=>'m3ga','m50/'=>'m50/','maui'=>'maui','mc01'=>'mc01','mc21'=>'mc21','mcca'=>'mcca','medi'=>'medi','meri'=>'meri','mio8'=>'mio8','mioa'=>'mioa','mo01'=>'mo01','mo02'=>'mo02','mode'=>'mode','modo'=>'modo','mot '=>'mot ','mot-'=>'mot-','mt50'=>'mt50','mtp1'=>'mtp1','mtv '=>'mtv ','mate'=>'mate','maxo'=>'maxo','merc'=>'merc','mits'=>'mits','mobi'=>'mobi','motv'=>'motv','mozz'=>'mozz','n100'=>'n100','n101'=>'n101','n102'=>'n102','n202'=>'n202','n203'=>'n203','n300'=>'n300','n302'=>'n302','n500'=>'n500','n502'=>'n502','n505'=>'n505','n700'=>'n700','n701'=>'n701','n710'=>'n710','nec-'=>'nec-','nem-'=>'nem-','newg'=>'newg','neon'=>'neon','netf'=>'netf','noki'=>'noki','nzph'=>'nzph','o2 x'=>'o2 x','o2-x'=>'o2-x','opwv'=>'opwv','owg1'=>'owg1','opti'=>'opti','oran'=>'oran','p800'=>'p800','pand'=>'pand','pg-1'=>'pg-1','pg-2'=>'pg-2','pg-3'=>'pg-3','pg-6'=>'pg-6','pg-8'=>'pg-8','pg-c'=>'pg-c','pg13'=>'pg13','phil'=>'phil','pn-2'=>'pn-2','pt-g'=>'pt-g','palm'=>'palm','pana'=>'pana','pire'=>'pire','pock'=>'pock','pose'=>'pose','psio'=>'psio','qa-a'=>'qa-a','qc-2'=>'qc-2','qc-3'=>'qc-3','qc-5'=>'qc-5','qc-7'=>'qc-7','qc07'=>'qc07','qc12'=>'qc12','qc21'=>'qc21','qc32'=>'qc32','qc60'=>'qc60','qci-'=>'qci-','qwap'=>'qwap','qtek'=>'qtek','r380'=>'r380','r600'=>'r600','raks'=>'raks','rim9'=>'rim9','rove'=>'rove','s55/'=>'s55/','sage'=>'sage','sams'=>'sams','sc01'=>'sc01','sch-'=>'sch-','scp-'=>'scp-','sdk/'=>'sdk/','se47'=>'se47','sec-'=>'sec-','sec0'=>'sec0','sec1'=>'sec1','semc'=>'semc','sgh-'=>'sgh-','shar'=>'shar','sie-'=>'sie-','sk-0'=>'sk-0','sl45'=>'sl45','slid'=>'slid','smb3'=>'smb3','smt5'=>'smt5','sp01'=>'sp01','sph-'=>'sph-','spv '=>'spv ','spv-'=>'spv-','sy01'=>'sy01','samm'=>'samm','sany'=>'sany','sava'=>'sava','scoo'=>'scoo','send'=>'send','siem'=>'siem','smar'=>'smar','smit'=>'smit','soft'=>'soft','sony'=>'sony','t-mo'=>'t-mo','t218'=>'t218','t250'=>'t250','t600'=>'t600','t610'=>'t610','t618'=>'t618','tcl-'=>'tcl-','tdg-'=>'tdg-','telm'=>'telm','tim-'=>'tim-','ts70'=>'ts70','tsm-'=>'tsm-','tsm3'=>'tsm3','tsm5'=>'tsm5','tx-9'=>'tx-9','tagt'=>'tagt','talk'=>'talk','teli'=>'teli','topl'=>'topl','hiba'=>'hiba','up.b'=>'up.b','upg1'=>'upg1','utst'=>'utst','v400'=>'v400','v750'=>'v750','veri'=>'veri','vk-v'=>'vk-v','vk40'=>'vk40','vk50'=>'vk50','vk52'=>'vk52','vk53'=>'vk53','vm40'=>'vm40','vx98'=>'vx98','virg'=>'virg','vite'=>'vite','voda'=>'voda','vulc'=>'vulc','w3c '=>'w3c ','w3c-'=>'w3c-','wapj'=>'wapj','wapp'=>'wapp','wapu'=>'wapu','wapm'=>'wapm','wig '=>'wig ','wapi'=>'wapi','wapr'=>'wapr','wapv'=>'wapv','wapy'=>'wapy','wapa'=>'wapa','waps'=>'waps','wapt'=>'wapt','winc'=>'winc','winw'=>'winw','wonu'=>'wonu','x700'=>'x700','xda2'=>'xda2','xdag'=>'xdag','yas-'=>'yas-','your'=>'your','zte-'=>'zte-','zeto'=>'zeto','acs-'=>'acs-','alav'=>'alav','alca'=>'alca','amoi'=>'amoi','aste'=>'aste','audi'=>'audi','avan'=>'avan','benq'=>'benq','bird'=>'bird','blac'=>'blac','blaz'=>'blaz','brew'=>'brew','brvw'=>'brvw','bumb'=>'bumb','ccwa'=>'ccwa','cell'=>'cell','cldc'=>'cldc','cmd-'=>'cmd-','dang'=>'dang','doco'=>'doco','eml2'=>'eml2','eric'=>'eric','fetc'=>'fetc','hipt'=>'hipt','http'=>'http','ibro'=>'ibro','idea'=>'idea','ikom'=>'ikom','inno'=>'inno','ipaq'=>'ipaq','jbro'=>'jbro','jemu'=>'jemu','java'=>'java','jigs'=>'jigs','kddi'=>'kddi','keji'=>'keji','kyoc'=>'kyoc','kyok'=>'kyok','leno'=>'leno','lg-c'=>'lg-c','lg-d'=>'lg-d','lg-g'=>'lg-g','lge-'=>'lge-','libw'=>'libw','m-cr'=>'m-cr','maui'=>'maui','maxo'=>'maxo','midp'=>'midp','mits'=>'mits','mmef'=>'mmef','mobi'=>'mobi','mot-'=>'mot-','moto'=>'moto','mwbp'=>'mwbp','mywa'=>'mywa','nec-'=>'nec-','newt'=>'newt','nok6'=>'nok6','noki'=>'noki','o2im'=>'o2im','opwv'=>'opwv','palm'=>'palm','pana'=>'pana','pant'=>'pant','pdxg'=>'pdxg','phil'=>'phil','play'=>'play','pluc'=>'pluc','port'=>'port','prox'=>'prox','qtek'=>'qtek','qwap'=>'qwap','rozo'=>'rozo','sage'=>'sage','sama'=>'sama','sams'=>'sams','sany'=>'sany','sch-'=>'sch-','sec-'=>'sec-','send'=>'send','seri'=>'seri','sgh-'=>'sgh-','shar'=>'shar','sie-'=>'sie-','siem'=>'siem','smal'=>'smal','smar'=>'smar','sony'=>'sony','sph-'=>'sph-','symb'=>'symb','t-mo'=>'t-mo','teli'=>'teli','tim-'=>'tim-','tosh'=>'tosh','treo'=>'treo','tsm-'=>'tsm-','upg1'=>'upg1','upsi'=>'upsi','vk-v'=>'vk-v','voda'=>'voda','vx52'=>'vx52','vx53'=>'vx53','vx60'=>'vx60','vx61'=>'vx61','vx70'=>'vx70','vx80'=>'vx80','vx81'=>'vx81','vx83'=>'vx83','vx85'=>'vx85','wap-'=>'wap-','wapa'=>'wapa','wapi'=>'wapi','wapp'=>'wapp','wapr'=>'wapr','webc'=>'webc','whit'=>'whit','winw'=>'winw','wmlb'=>'wmlb','xda-'=>'xda-',))); // check against a list of trimmed user agents to see if we find a match
85
- $mobile_browser = get_option('other_theme'); // set mobile browser to true
86
- $status = 'Mobile matched on in_array';
87
- break; // break even though it's the last statement in the switch so there's nothing to break away from but it seems better to include it than exclude it
88
 
89
- } // ends the switch
90
-
91
- //Force Theme Display request from visitor.
92
- if (@$_GET['am_force_theme_layout']){
93
- $_SESSION['am_force_theme_layout'] = $_GET['am_force_theme_layout'];
94
- }
95
-
96
- if (isset($_SESSION['am_force_theme_layout'])){ //IF USER FORCE FOR THE THEME
97
- if ($_SESSION['am_force_theme_layout'] == 'mobile'){ // IF FORCED THEME IS MOBILE
98
- $mobile_browser = get_option('iphone_theme');
99
- add_filter('stylesheet', 'loadMobileStyle');
100
- add_filter('template', 'loadMobileTheme');
101
- $shown_theme = 'mobile';
102
- }
103
- } else { // NORMAL THEME [PLUGIN DEFAULT]
104
- if (!empty($mobile_browser)){
105
- add_filter('stylesheet', 'loadMobileStyle');
106
- add_filter('template', 'loadMobileTheme');
107
- $shown_theme = 'mobile';
108
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  }
110
 
111
  function loadMobileStyle(){
112
- global $mobile_browser;
113
- $mobileTheme = $mobile_browser;
114
  $themeList = get_themes();
115
  foreach ($themeList as $theme) {
116
  if ($theme['Name'] == $mobileTheme) {
117
- return $theme['Stylesheet'];
118
  }
119
  }
120
  }
121
 
122
  function loadMobileTheme(){
123
- global $mobile_browser;
124
- $mobileTheme = $mobile_browser;
125
  $themeList = get_themes();
126
  foreach ($themeList as $theme) {
127
  if ($theme['Name'] == $mobileTheme) {
128
- return $theme['Template'];
129
  }
130
  }
131
  }
@@ -133,13 +85,13 @@ function loadMobileTheme(){
133
  // Embed Switch Links in Theme Via Shortcode
134
  // [show_theme_switch_link]
135
  function show_theme_switch_link_func( $atts ){
136
- $desktopSwitchLink = get_option('show_switch_link_for_desktop');
137
- global $shown_theme;
138
- global $status;
139
- if ($shown_theme){
140
  $return = '<a rel="external" data-ajax="false" href="'.get_bloginfo('url').'?am_force_theme_layout=desktop" class="am-switch-btn godesktop">'.get_option('desktop_view_theme_link_text').'</a>';
141
  } else {
142
- if ((!empty($status)) || ($desktopSwitchLink == 'yes')){
143
  $return = '<a href="'.get_bloginfo('url').'?am_force_theme_layout=mobile" class="am-switch-btn gomobile">'.get_option('mobile_view_theme_link_text').'</a>';
144
  }
145
  }
@@ -147,4 +99,82 @@ function show_theme_switch_link_func( $atts ){
147
  }
148
  add_shortcode('show_theme_switch_link', 'show_theme_switch_link_func');
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  include('plugin_interface.php');
4
  Plugin URI: http://dineshkarki.com.np/any-mobile-theme-switcher
5
  Description: This plugin allow you to detect all mobile platform and switch the theme. Supports most of the mobile platform including iphone, ipad, ipod, windows mobile, parm os, blackberry, android, andriod tab.
6
  Author: Dinesh Karki
7
+ Version: 1.3
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10
 
11
  /* Copyright 2012 Dinesh Karki (email : dnesskarki@gmail.com)*/
12
 
13
+ $amts_mobile_browser = '';
14
+ $amts_status = '';
15
+ $amts_shown_theme = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ add_action('plugins_loaded', 'amts_start', 1);
18
+ function amts_start(){
19
+ global $amts_mobile_browser;
20
+ global $amts_status;
21
+ global $amts_shown_theme;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
+ $time = '0';
24
+ $url_path = '/';
25
+
26
+ $checkReturn = amts_checkMobile();
27
+ $amts_mobile_browser = $checkReturn['amts_mobile_browser'];
28
+ $amts_status = $checkReturn['amts_status'];
29
+
30
+ $forceLayout = '';
31
+
32
+ //Force Theme Display request from visitor.
33
+ if (isset($_COOKIE['am_force_theme_layout'])){
34
+ $forceLayout = $_COOKIE['am_force_theme_layout'];
 
 
 
 
 
 
 
35
  }
36
+
37
+ if (isset($_GET['am_force_theme_layout'])){
38
+ if ($_GET['am_force_theme_layout'] == 'mobile'){
39
+ $forceLayout = 'mobile';
40
+ setcookie('am_force_theme_layout', $_GET['am_force_theme_layout'], $time, $url_path);
41
+ } else {
42
+ $forceLayout = 'desktop';
43
+ setcookie('am_force_theme_layout', $_GET['am_force_theme_layout'], $time, $url_path);
44
+ }
45
+ }
46
+
47
+ if (!empty($forceLayout)){ //IF USER FORCE FOR THE THEME
48
+ if ($forceLayout == 'mobile'){ // IF FORCED THEME IS MOBILE
49
+ $amts_mobile_browser = get_option('iphone_theme');
50
+ add_filter('stylesheet', 'loadMobileStyle');
51
+ add_filter('template', 'loadMobileTheme');
52
+ $amts_shown_theme = 'mobile';
53
+ }
54
+ } else { // NORMAL THEME [PLUGIN DEFAULT]
55
+ if (!empty($amts_mobile_browser)){
56
+ add_filter('stylesheet', 'loadMobileStyle');
57
+ add_filter('template', 'loadMobileTheme');
58
+ $amts_shown_theme = 'mobile';
59
+ }
60
+ }
61
  }
62
 
63
  function loadMobileStyle(){
64
+ global $amts_mobile_browser;
65
+ $mobileTheme = $amts_mobile_browser;
66
  $themeList = get_themes();
67
  foreach ($themeList as $theme) {
68
  if ($theme['Name'] == $mobileTheme) {
69
+ return $theme['Stylesheet'];
70
  }
71
  }
72
  }
73
 
74
  function loadMobileTheme(){
75
+ global $amts_mobile_browser;
76
+ $mobileTheme = $amts_mobile_browser;
77
  $themeList = get_themes();
78
  foreach ($themeList as $theme) {
79
  if ($theme['Name'] == $mobileTheme) {
80
+ return $theme['Template'];
81
  }
82
  }
83
  }
85
  // Embed Switch Links in Theme Via Shortcode
86
  // [show_theme_switch_link]
87
  function show_theme_switch_link_func( $atts ){
88
+ global $amts_shown_theme;
89
+ global $amts_status;
90
+ $desktopSwitchLink = get_option('show_switch_link_for_desktop');
91
+ if ($amts_shown_theme){
92
  $return = '<a rel="external" data-ajax="false" href="'.get_bloginfo('url').'?am_force_theme_layout=desktop" class="am-switch-btn godesktop">'.get_option('desktop_view_theme_link_text').'</a>';
93
  } else {
94
+ if ((!empty($amts_status)) || ($desktopSwitchLink == 'yes')){
95
  $return = '<a href="'.get_bloginfo('url').'?am_force_theme_layout=mobile" class="am-switch-btn gomobile">'.get_option('mobile_view_theme_link_text').'</a>';
96
  }
97
  }
99
  }
100
  add_shortcode('show_theme_switch_link', 'show_theme_switch_link_func');
101
 
102
+ // DETECT MOBILE BROWSER
103
+ function amts_checkMobile(){
104
+ $amts_mobile_browser = '';
105
+ $mobileredirect = '';
106
+ $amts_status = '';
107
+ $user_agent = $_SERVER['HTTP_USER_AGENT']; // get the user agent value - this should be cleaned to ensure no nefarious input gets executed
108
+ $accept = $_SERVER['HTTP_ACCEPT']; // get the content accept value - this should be cleaned to ensure no nefarious input gets executed
109
+
110
+ switch(true){ // using a switch against the following statements which could return true is more efficient than the previous method of using if statements
111
+
112
+ case (preg_match('/ipad/i',$user_agent)); // we find the word ipad in the user agent
113
+ $amts_mobile_browser = get_option('ipad_theme'); // mobile browser is either true or false depending on the setting of ipad when calling the function
114
+ $amts_status = 'Apple iPad';
115
+ break; // break out and skip the rest if we've had a match on the ipad // this goes before the iphone to catch it else it would return on the iphone instead
116
+
117
+ case (preg_match('/ipod/i',$user_agent)||preg_match('/iphone/i',$user_agent)); // we find the words iphone or ipod in the user agent
118
+ $amts_mobile_browser = get_option('iphone_theme'); // mobile browser is either true or false depending on the setting of iphone when calling the function
119
+ $amts_status = 'Apple';
120
+ break; // break out and skip the rest if we've had a match on the iphone or ipod
121
+
122
+ case (preg_match('/android/i',$user_agent)); // we find android in the user agent
123
+ if (preg_match('/mobile/i',$user_agent)):
124
+ $amts_mobile_browser = get_option('android_theme'); // mobile browser is either true or false depending on the setting of android when calling the function
125
+ $amts_status = 'Android';
126
+ else :
127
+ $amts_mobile_browser = get_option('android_tab_theme'); // mobile browser is either true or false depending on the setting of android when calling the function
128
+ $amts_status = 'Android Tab';
129
+ endif;
130
+
131
+ break; // break out and skip the rest if we've had a match on android
132
+
133
+ case (preg_match('/opera mini/i',$user_agent)); // we find opera mini in the user agent
134
+ $amts_mobile_browser = get_option('opera_theme'); // mobile browser is either true or false depending on the setting of opera when calling the function
135
+ $amts_status = 'Opera';
136
+ break; // break out and skip the rest if we've had a match on opera
137
+
138
+ case (preg_match('/blackberry/i',$user_agent)); // we find blackberry in the user agent
139
+ $amts_mobile_browser = get_option('blackberry_theme'); // mobile browser is either true or false depending on the setting of blackberry when calling the function
140
+ $amts_status = 'Blackberry';
141
+ break; // break out and skip the rest if we've had a match on blackberry
142
+
143
+ case (preg_match('/(pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)/i',$user_agent)); // we find palm os in the user agent - the i at the end makes it case insensitive
144
+ $amts_mobile_browser = get_option('parm_os_theme'); // mobile browser is either true or false depending on the setting of palm when calling the function
145
+ $amts_status = 'Palm';
146
+ break; // break out and skip the rest if we've had a match on palm os
147
+
148
+ case (preg_match('/(iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i',$user_agent)); // we find windows mobile in the user agent - the i at the end makes it case insensitive
149
+ $amts_mobile_browser = get_option('windows_theme'); // mobile browser is either true or false depending on the setting of windows when calling the function
150
+ $amts_status = 'Windows Smartphone';
151
+ break; // break out and skip the rest if we've had a match on windows
152
+
153
+ case (preg_match('/(mini 9.5|vx1000|lge |m800|e860|u940|ux840|compal|wireless| mobi|ahong|lg380|lgku|lgu900|lg210|lg47|lg920|lg840|lg370|sam-r|mg50|s55|g83|t66|vx400|mk99|d615|d763|el370|sl900|mp500|samu3|samu4|vx10|xda_|samu5|samu6|samu7|samu9|a615|b832|m881|s920|n210|s700|c-810|_h797|mob-x|sk16d|848b|mowser|s580|r800|471x|v120|rim8|c500foma:|160x|x160|480x|x640|t503|w839|i250|sprint|w398samr810|m5252|c7100|mt126|x225|s5330|s820|htil-g1|fly v71|s302|-x113|novarra|k610i|-three|8325rc|8352rc|sanyo|vx54|c888|nx250|n120|mtk |c5588|s710|t880|c5005|i;458x|p404i|s210|c5100|teleca|s940|c500|s590|foma|samsu|vx8|vx9|a1000|_mms|myx|a700|gu1100|bc831|e300|ems100|me701|me702m-three|sd588|s800|8325rc|ac831|mw200|brew |d88|htc\/|htc_touch|355x|m50|km100|d736|p-9521|telco|sl74|ktouch|m4u\/|me702|8325rc|kddi|phone|lg |sonyericsson|samsung|240x|x320|vx10|nokia|sony cmd|motorola|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo)/i',$user_agent)); // check if any of the values listed create a match on the user agent - these are some of the most common terms used in agents to identify them as being mobile devices - the i at the end makes it case insensitive
154
+ $amts_mobile_browser = get_option('other_theme'); // set mobile browser to true
155
+ $amts_status = 'Mobile matched on piped preg_match';
156
+ break; // break out and skip the rest if we've preg_match on the user agent returned true
157
+
158
+ case ((strpos($accept,'text/vnd.wap.wml')>0)||(strpos($accept,'application/vnd.wap.xhtml+xml')>0)); // is the device showing signs of support for text/vnd.wap.wml or application/vnd.wap.xhtml+xml
159
+ $amts_mobile_browser = get_option('other_theme'); // set mobile browser to true
160
+ $amts_status = 'Mobile matched on content accept header';
161
+ break; // break out and skip the rest if we've had a match on the content accept headers
162
+
163
+ case (isset($_SERVER['HTTP_X_WAP_PROFILE'])||isset($_SERVER['HTTP_PROFILE'])); // is the device giving us a HTTP_X_WAP_PROFILE or HTTP_PROFILE header - only mobile devices would do this
164
+ $amts_mobile_browser = get_option('other_theme'); // set mobile browser to true
165
+ $amts_status = 'Mobile matched on profile headers being set';
166
+ break; // break out and skip the final step if we've had a return true on the mobile specfic headers
167
+
168
+ case (in_array(strtolower(substr($user_agent,0,4)),array('1207'=>'1207','3gso'=>'3gso','4thp'=>'4thp','501i'=>'501i','502i'=>'502i','503i'=>'503i','504i'=>'504i','505i'=>'505i','506i'=>'506i','6310'=>'6310','6590'=>'6590','770s'=>'770s','802s'=>'802s','a wa'=>'a wa','acer'=>'acer','acs-'=>'acs-','airn'=>'airn','alav'=>'alav','asus'=>'asus','attw'=>'attw','au-m'=>'au-m','aur '=>'aur ','aus '=>'aus ','abac'=>'abac','acoo'=>'acoo','aiko'=>'aiko','alco'=>'alco','alca'=>'alca','amoi'=>'amoi','anex'=>'anex','anny'=>'anny','anyw'=>'anyw','aptu'=>'aptu','arch'=>'arch','argo'=>'argo','bell'=>'bell','bird'=>'bird','bw-n'=>'bw-n','bw-u'=>'bw-u','beck'=>'beck','benq'=>'benq','bilb'=>'bilb','blac'=>'blac','c55/'=>'c55/','cdm-'=>'cdm-','chtm'=>'chtm','capi'=>'capi','cond'=>'cond','craw'=>'craw','dall'=>'dall','dbte'=>'dbte','dc-s'=>'dc-s','dica'=>'dica','ds-d'=>'ds-d','ds12'=>'ds12','dait'=>'dait','devi'=>'devi','dmob'=>'dmob','doco'=>'doco','dopo'=>'dopo','el49'=>'el49','erk0'=>'erk0','esl8'=>'esl8','ez40'=>'ez40','ez60'=>'ez60','ez70'=>'ez70','ezos'=>'ezos','ezze'=>'ezze','elai'=>'elai','emul'=>'emul','eric'=>'eric','ezwa'=>'ezwa','fake'=>'fake','fly-'=>'fly-','fly_'=>'fly_','g-mo'=>'g-mo','g1 u'=>'g1 u','g560'=>'g560','gf-5'=>'gf-5','grun'=>'grun','gene'=>'gene','go.w'=>'go.w','good'=>'good','grad'=>'grad','hcit'=>'hcit','hd-m'=>'hd-m','hd-p'=>'hd-p','hd-t'=>'hd-t','hei-'=>'hei-','hp i'=>'hp i','hpip'=>'hpip','hs-c'=>'hs-c','htc '=>'htc ','htc-'=>'htc-','htca'=>'htca','htcg'=>'htcg','htcp'=>'htcp','htcs'=>'htcs','htct'=>'htct','htc_'=>'htc_','haie'=>'haie','hita'=>'hita','huaw'=>'huaw','hutc'=>'hutc','i-20'=>'i-20','i-go'=>'i-go','i-ma'=>'i-ma','i230'=>'i230','iac'=>'iac','iac-'=>'iac-','iac/'=>'iac/','ig01'=>'ig01','im1k'=>'im1k','inno'=>'inno','iris'=>'iris','jata'=>'jata','java'=>'java','kddi'=>'kddi','kgt'=>'kgt','kgt/'=>'kgt/','kpt '=>'kpt ','kwc-'=>'kwc-','klon'=>'klon','lexi'=>'lexi','lg g'=>'lg g','lg-a'=>'lg-a','lg-b'=>'lg-b','lg-c'=>'lg-c','lg-d'=>'lg-d','lg-f'=>'lg-f','lg-g'=>'lg-g','lg-k'=>'lg-k','lg-l'=>'lg-l','lg-m'=>'lg-m','lg-o'=>'lg-o','lg-p'=>'lg-p','lg-s'=>'lg-s','lg-t'=>'lg-t','lg-u'=>'lg-u','lg-w'=>'lg-w','lg/k'=>'lg/k','lg/l'=>'lg/l','lg/u'=>'lg/u','lg50'=>'lg50','lg54'=>'lg54','lge-'=>'lge-','lge/'=>'lge/','lynx'=>'lynx','leno'=>'leno','m1-w'=>'m1-w','m3ga'=>'m3ga','m50/'=>'m50/','maui'=>'maui','mc01'=>'mc01','mc21'=>'mc21','mcca'=>'mcca','medi'=>'medi','meri'=>'meri','mio8'=>'mio8','mioa'=>'mioa','mo01'=>'mo01','mo02'=>'mo02','mode'=>'mode','modo'=>'modo','mot '=>'mot ','mot-'=>'mot-','mt50'=>'mt50','mtp1'=>'mtp1','mtv '=>'mtv ','mate'=>'mate','maxo'=>'maxo','merc'=>'merc','mits'=>'mits','mobi'=>'mobi','motv'=>'motv','mozz'=>'mozz','n100'=>'n100','n101'=>'n101','n102'=>'n102','n202'=>'n202','n203'=>'n203','n300'=>'n300','n302'=>'n302','n500'=>'n500','n502'=>'n502','n505'=>'n505','n700'=>'n700','n701'=>'n701','n710'=>'n710','nec-'=>'nec-','nem-'=>'nem-','newg'=>'newg','neon'=>'neon','netf'=>'netf','noki'=>'noki','nzph'=>'nzph','o2 x'=>'o2 x','o2-x'=>'o2-x','opwv'=>'opwv','owg1'=>'owg1','opti'=>'opti','oran'=>'oran','p800'=>'p800','pand'=>'pand','pg-1'=>'pg-1','pg-2'=>'pg-2','pg-3'=>'pg-3','pg-6'=>'pg-6','pg-8'=>'pg-8','pg-c'=>'pg-c','pg13'=>'pg13','phil'=>'phil','pn-2'=>'pn-2','pt-g'=>'pt-g','palm'=>'palm','pana'=>'pana','pire'=>'pire','pock'=>'pock','pose'=>'pose','psio'=>'psio','qa-a'=>'qa-a','qc-2'=>'qc-2','qc-3'=>'qc-3','qc-5'=>'qc-5','qc-7'=>'qc-7','qc07'=>'qc07','qc12'=>'qc12','qc21'=>'qc21','qc32'=>'qc32','qc60'=>'qc60','qci-'=>'qci-','qwap'=>'qwap','qtek'=>'qtek','r380'=>'r380','r600'=>'r600','raks'=>'raks','rim9'=>'rim9','rove'=>'rove','s55/'=>'s55/','sage'=>'sage','sams'=>'sams','sc01'=>'sc01','sch-'=>'sch-','scp-'=>'scp-','sdk/'=>'sdk/','se47'=>'se47','sec-'=>'sec-','sec0'=>'sec0','sec1'=>'sec1','semc'=>'semc','sgh-'=>'sgh-','shar'=>'shar','sie-'=>'sie-','sk-0'=>'sk-0','sl45'=>'sl45','slid'=>'slid','smb3'=>'smb3','smt5'=>'smt5','sp01'=>'sp01','sph-'=>'sph-','spv '=>'spv ','spv-'=>'spv-','sy01'=>'sy01','samm'=>'samm','sany'=>'sany','sava'=>'sava','scoo'=>'scoo','send'=>'send','siem'=>'siem','smar'=>'smar','smit'=>'smit','soft'=>'soft','sony'=>'sony','t-mo'=>'t-mo','t218'=>'t218','t250'=>'t250','t600'=>'t600','t610'=>'t610','t618'=>'t618','tcl-'=>'tcl-','tdg-'=>'tdg-','telm'=>'telm','tim-'=>'tim-','ts70'=>'ts70','tsm-'=>'tsm-','tsm3'=>'tsm3','tsm5'=>'tsm5','tx-9'=>'tx-9','tagt'=>'tagt','talk'=>'talk','teli'=>'teli','topl'=>'topl','hiba'=>'hiba','up.b'=>'up.b','upg1'=>'upg1','utst'=>'utst','v400'=>'v400','v750'=>'v750','veri'=>'veri','vk-v'=>'vk-v','vk40'=>'vk40','vk50'=>'vk50','vk52'=>'vk52','vk53'=>'vk53','vm40'=>'vm40','vx98'=>'vx98','virg'=>'virg','vite'=>'vite','voda'=>'voda','vulc'=>'vulc','w3c '=>'w3c ','w3c-'=>'w3c-','wapj'=>'wapj','wapp'=>'wapp','wapu'=>'wapu','wapm'=>'wapm','wig '=>'wig ','wapi'=>'wapi','wapr'=>'wapr','wapv'=>'wapv','wapy'=>'wapy','wapa'=>'wapa','waps'=>'waps','wapt'=>'wapt','winc'=>'winc','winw'=>'winw','wonu'=>'wonu','x700'=>'x700','xda2'=>'xda2','xdag'=>'xdag','yas-'=>'yas-','your'=>'your','zte-'=>'zte-','zeto'=>'zeto','acs-'=>'acs-','alav'=>'alav','alca'=>'alca','amoi'=>'amoi','aste'=>'aste','audi'=>'audi','avan'=>'avan','benq'=>'benq','bird'=>'bird','blac'=>'blac','blaz'=>'blaz','brew'=>'brew','brvw'=>'brvw','bumb'=>'bumb','ccwa'=>'ccwa','cell'=>'cell','cldc'=>'cldc','cmd-'=>'cmd-','dang'=>'dang','doco'=>'doco','eml2'=>'eml2','eric'=>'eric','fetc'=>'fetc','hipt'=>'hipt','http'=>'http','ibro'=>'ibro','idea'=>'idea','ikom'=>'ikom','inno'=>'inno','ipaq'=>'ipaq','jbro'=>'jbro','jemu'=>'jemu','java'=>'java','jigs'=>'jigs','kddi'=>'kddi','keji'=>'keji','kyoc'=>'kyoc','kyok'=>'kyok','leno'=>'leno','lg-c'=>'lg-c','lg-d'=>'lg-d','lg-g'=>'lg-g','lge-'=>'lge-','libw'=>'libw','m-cr'=>'m-cr','maui'=>'maui','maxo'=>'maxo','midp'=>'midp','mits'=>'mits','mmef'=>'mmef','mobi'=>'mobi','mot-'=>'mot-','moto'=>'moto','mwbp'=>'mwbp','mywa'=>'mywa','nec-'=>'nec-','newt'=>'newt','nok6'=>'nok6','noki'=>'noki','o2im'=>'o2im','opwv'=>'opwv','palm'=>'palm','pana'=>'pana','pant'=>'pant','pdxg'=>'pdxg','phil'=>'phil','play'=>'play','pluc'=>'pluc','port'=>'port','prox'=>'prox','qtek'=>'qtek','qwap'=>'qwap','rozo'=>'rozo','sage'=>'sage','sama'=>'sama','sams'=>'sams','sany'=>'sany','sch-'=>'sch-','sec-'=>'sec-','send'=>'send','seri'=>'seri','sgh-'=>'sgh-','shar'=>'shar','sie-'=>'sie-','siem'=>'siem','smal'=>'smal','smar'=>'smar','sony'=>'sony','sph-'=>'sph-','symb'=>'symb','t-mo'=>'t-mo','teli'=>'teli','tim-'=>'tim-','tosh'=>'tosh','treo'=>'treo','tsm-'=>'tsm-','upg1'=>'upg1','upsi'=>'upsi','vk-v'=>'vk-v','voda'=>'voda','vx52'=>'vx52','vx53'=>'vx53','vx60'=>'vx60','vx61'=>'vx61','vx70'=>'vx70','vx80'=>'vx80','vx81'=>'vx81','vx83'=>'vx83','vx85'=>'vx85','wap-'=>'wap-','wapa'=>'wapa','wapi'=>'wapi','wapp'=>'wapp','wapr'=>'wapr','webc'=>'webc','whit'=>'whit','winw'=>'winw','wmlb'=>'wmlb','xda-'=>'xda-',))); // check against a list of trimmed user agents to see if we find a match
169
+ $amts_mobile_browser = get_option('other_theme'); // set mobile browser to true
170
+ $amts_status = 'Mobile matched on in_array';
171
+ break; // break even though it's the last statement in the switch so there's nothing to break away from but it seems better to include it than exclude it
172
+
173
+ } // ends the switch
174
+
175
+ $return['amts_mobile_browser'] = $amts_mobile_browser;
176
+ $return['amts_status'] = $amts_status;
177
+ return $return;
178
+ } // END OF MOBILE CHECK FUNCTION
179
+
180
  include('plugin_interface.php');
img/amtsp.png ADDED
Binary file
includes/amts-footer.php CHANGED
@@ -1,19 +1,30 @@
1
  </td>
2
  <td width="15">&nbsp;</td>
3
  <td width="250" valign="top">
4
-
5
- <table class="wp-list-table widefat fixed bookmarks">
6
  <thead>
7
  <tr>
8
- <th>WP Pack Mobile Theme</th>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  </tr>
10
  </thead>
11
  <tbody>
12
  <tr>
13
  <td>
14
- <a href="http://goo.gl/eWXZp" target="_blank"><img src="<?php echo plugins_url('any-mobile-theme-switcher/img/wppacktheme.png') ?>" alt="WP Pack Theme" /></a>
15
- <h2 style="text-align:center;"><a href="http://goo.gl/eWXZp" target="_blank">Click For Details</a></h2>
16
-
17
  </td>
18
  </tr>
19
  </tbody>
@@ -23,16 +34,22 @@
23
  <table class="wp-list-table widefat fixed bookmarks">
24
  <thead>
25
  <tr>
26
- <th>Support</th>
27
  </tr>
28
  </thead>
29
  <tbody>
30
  <tr>
31
- <td>If you have any issues, click <a href="http://dineshkarki.com.np/forums/forum/mobile-theme-switcher" target="_blank">here</a> to visit our support forum</td>
 
 
 
 
32
  </tr>
33
  </tbody>
34
  </table>
35
  <br/>
 
 
36
  <table class="wp-list-table widefat fixed bookmarks">
37
  <thead>
38
  <tr>
@@ -44,8 +61,7 @@
44
  <td>
45
  <ol>
46
  <li><a href="http://wordpress.org/extend/plugins/use-any-font/" target="_blank">Use Any Font</a></li>
47
- <li><a href="http://wordpress.org/extend/plugins/sms/" target="_blank">SMS</a></li>
48
- <li><a href="http://dineshkarki.com.np/jquery-validation-for-contact-form-7" target="_blank">Jquery Validation For Contact Form 7</a></li>
49
  <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
50
  <li><a href="http://wordpress.org/extend/plugins/block-specific-plugin-updates/" target="_blank">Block Specific Plugin Updates</a></li>
51
  <li><a href="http://wordpress.org/extend/plugins/featured-image-in-rss-feed/" target="_blank">Featured Image In RSS Feed</a></li>
@@ -57,20 +73,6 @@
57
  </tbody>
58
  </table>
59
  <br/>
60
- <table class="wp-list-table widefat fixed bookmarks">
61
- <thead>
62
- <tr>
63
- <th>Facebook</th>
64
- </tr>
65
- </thead>
66
- <tbody>
67
- <tr>
68
- <td><iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FDnessCarKey%2F77553779916&amp;width=185&amp;height=200&amp;show_faces=true&amp;colorscheme=light&amp;stream=false&amp;border_color=%23f9f9f9&amp;header=false&amp;appId=215419415167468" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:240px; height:200px;" allowTransparency="true"></iframe>
69
- </td>
70
- </tr>
71
- </tbody>
72
- </table>
73
- <br/>
74
  </td>
75
  </tr>
76
  </table>
1
  </td>
2
  <td width="15">&nbsp;</td>
3
  <td width="250" valign="top">
4
+ <table class="wp-list-table widefat fixed bookmarks">
 
5
  <thead>
6
  <tr>
7
+ <th>Support</th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <tr>
12
+ <td>If you have any issues, click <a href="http://dineshkarki.com.np/forums/forum/mobile-theme-switcher" target="_blank">here</a> to visit our support forum</td>
13
+ </tr>
14
+ </tbody>
15
+ </table>
16
+ <br/>
17
+
18
+ <table class="wp-list-table widefat fixed bookmarks">
19
+ <thead>
20
+ <tr>
21
+ <th>Any Mobile Theme Switcher Pro</th>
22
  </tr>
23
  </thead>
24
  <tbody>
25
  <tr>
26
  <td>
27
+ <a href="http://goo.gl/j1a2w" title="Any Mobile Theme Switcher Pro" target="_blank"><img src="<?php echo plugins_url('any-mobile-theme-switcher/img/amtsp.png') ?>" alt="Any Mobile Theme Switcher Pro" /></a>
 
 
28
  </td>
29
  </tr>
30
  </tbody>
34
  <table class="wp-list-table widefat fixed bookmarks">
35
  <thead>
36
  <tr>
37
+ <th>WP Pack Mobile Theme</th>
38
  </tr>
39
  </thead>
40
  <tbody>
41
  <tr>
42
+ <td>
43
+ <a href="http://goo.gl/eWXZp" target="_blank"><img src="<?php echo plugins_url('any-mobile-theme-switcher/img/wppacktheme.png') ?>" alt="WP Pack Theme" /></a>
44
+ <h2 style="text-align:center;"><a href="http://goo.gl/eWXZp" target="_blank">Click For Details</a></h2>
45
+
46
+ </td>
47
  </tr>
48
  </tbody>
49
  </table>
50
  <br/>
51
+
52
+
53
  <table class="wp-list-table widefat fixed bookmarks">
54
  <thead>
55
  <tr>
61
  <td>
62
  <ol>
63
  <li><a href="http://wordpress.org/extend/plugins/use-any-font/" target="_blank">Use Any Font</a></li>
64
+ <li><a href="http://dineshkarki.com.np/jquery-validation-for-contact-form-7" target="_blank">Jquery Validation For Contact Form 7</a></li>
 
65
  <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
66
  <li><a href="http://wordpress.org/extend/plugins/block-specific-plugin-updates/" target="_blank">Block Specific Plugin Updates</a></li>
67
  <li><a href="http://wordpress.org/extend/plugins/featured-image-in-rss-feed/" target="_blank">Featured Image In RSS Feed</a></li>
73
  </tbody>
74
  </table>
75
  <br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  </td>
77
  </tr>
78
  </table>
includes/amts-theme-select.php CHANGED
@@ -147,7 +147,7 @@ natcasesort($themeNames);
147
  </tr>
148
 
149
  <tr valign="top">
150
- <th scope="row">Parm Os Theme</th>
151
  <td>
152
  <select name="parm_os_theme">
153
  <?php
147
  </tr>
148
 
149
  <tr valign="top">
150
+ <th scope="row">Palm Os Theme</th>
151
  <td>
152
  <select name="parm_os_theme">
153
  <?php
plugin_interface.php CHANGED
@@ -1,5 +1,19 @@
1
  <?php
2
  add_action('admin_menu', 'any_mobile_create_menu');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  function any_mobile_create_menu() {
5
  add_options_page('Any Mobile Theme', 'Any Mobile Theme', 'administrator', __FILE__, 'am_settings_page');
1
  <?php
2
  add_action('admin_menu', 'any_mobile_create_menu');
3
+ add_action('admin_notices', 'amts_pro_notification');
4
+
5
+
6
+ if ($_GET['hidemsg'] == 1){
7
+ update_option('amts_hide_pro_notice','yes');
8
+ }
9
+
10
+ function amts_pro_notification(){
11
+ if (get_option('amts_hide_pro_notice') != 'yes'){
12
+ echo '<div class="updated">
13
+ <p><b>Any Mobile Theme Swticher Pro</b> now works with <b>W3 Total Cache</b>. Click <a href="http://dnesscarkey.com/any-mobile-theme-switcher-pro/" target="_blank">here</a> for details.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="options-general.php?pageany-mobile-theme-switcher-pro/plugin_interface.php&hidemsg=1">Hide This Message</a></p>
14
+ </div>';
15
+ }
16
+ }
17
 
18
  function any_mobile_create_menu() {
19
  add_options_page('Any Mobile Theme', 'Any Mobile Theme', 'administrator', __FILE__, 'am_settings_page');
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: dnesscarkey
3
  Tags: mobile theme, mobile theme switcher, mobile browser detect, mobile detect, theme redirection based on mobile device
4
  Requires at least: 3.0.
5
  Tested up to: 3.5.1
6
- Stable tag: 1.2
7
 
8
  This Plugin detects mobile browser and display the theme as the setting done from admin. Usefull for switch to Mobile Theme.
9
 
@@ -13,7 +13,7 @@ Detects all the Mobile Browsers and loads the mobile theme as per your settings
13
 
14
  * Iphone / Ipod
15
  * Ipad
16
- * Parm Os
17
  * Android
18
  * Android Tab
19
  * Windows Mobile
@@ -23,6 +23,8 @@ Detects all the Mobile Browsers and loads the mobile theme as per your settings
23
 
24
  You can select a different mobile theme for each mobile browser. You can select different mobile themes for each of the options above.
25
 
 
 
26
  Want Mobile Theme ? Get it from <a href="http://goo.gl/eWXZp">here</a>.
27
 
28
  Please visit our own <a href="http://dineshkarki.com.np/forums/forum/mobile-theme-switcher" target="_blank">support forum</a> for any issues. We don't respond support ticket created here.
@@ -40,12 +42,19 @@ Please visit our own <a href="http://dineshkarki.com.np/forums/forum/mobile-them
40
 
41
  Yes it detect most of the mobile browsers and redirects it to its mobile theme set from admin settings.
42
 
 
 
 
 
43
  == Screenshots ==
44
 
45
  1. Admin Setting For Mobile Theme selection repective to their platform.
46
 
47
  == Changelog ==
48
 
 
 
 
49
  = 1.2 =
50
  * Session Issue Fixed
51
 
3
  Tags: mobile theme, mobile theme switcher, mobile browser detect, mobile detect, theme redirection based on mobile device
4
  Requires at least: 3.0.
5
  Tested up to: 3.5.1
6
+ Stable tag: 1.3
7
 
8
  This Plugin detects mobile browser and display the theme as the setting done from admin. Usefull for switch to Mobile Theme.
9
 
13
 
14
  * Iphone / Ipod
15
  * Ipad
16
+ * Palm Os
17
  * Android
18
  * Android Tab
19
  * Windows Mobile
23
 
24
  You can select a different mobile theme for each mobile browser. You can select different mobile themes for each of the options above.
25
 
26
+ Any Mobile Theme Switcher Pro now works with W3 Total Cache. Click <a href="http://goo.gl/j1a2w" title="Any Mobile Theme Switcher Pro" target="_blank">here</a> for details.
27
+
28
  Want Mobile Theme ? Get it from <a href="http://goo.gl/eWXZp">here</a>.
29
 
30
  Please visit our own <a href="http://dineshkarki.com.np/forums/forum/mobile-theme-switcher" target="_blank">support forum</a> for any issues. We don't respond support ticket created here.
42
 
43
  Yes it detect most of the mobile browsers and redirects it to its mobile theme set from admin settings.
44
 
45
+ = Does it works with W3 Total Cache ? =
46
+
47
+ Yes, the pro version works with W3 Total Cache. Click <a href="http://goo.gl/j1a2w" title="Any Mobile Theme Switcher Pro" target="_blank">here</a> for details.
48
+
49
  == Screenshots ==
50
 
51
  1. Admin Setting For Mobile Theme selection repective to their platform.
52
 
53
  == Changelog ==
54
 
55
+ = 1.3 =
56
+ * Use of Cookie inplace of session.
57
+
58
  = 1.2 =
59
  * Session Issue Fixed
60