Any Mobile Theme Switcher - Version 1.0

Version Description

  • Added option for Andriod Tab
  • User Agents Update
  • Tested With 3.5
Download this release

Release Info

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

Code changes from version 0.7 to 1.0

any-mobile-theme-switcher.php CHANGED
@@ -2,9 +2,9 @@
2
  /*
3
  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.
6
  Author: Dinesh Karki
7
- Version: 0.7
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10
 
@@ -33,8 +33,14 @@ $accept = $_SERVER['HTTP_ACCEPT']; // get the content accept value - t
33
  break; // break out and skip the rest if we've had a match on the iphone or ipod
34
 
35
  case (preg_match('/android/i',$user_agent)); // we find android in the user agent
36
- $mobile_browser = get_option('android_theme'); // mobile browser is either true or false depending on the setting of android when calling the function
37
- $status = 'Android';
 
 
 
 
 
 
38
  break; // break out and skip the rest if we've had a match on android
39
 
40
  case (preg_match('/opera mini/i',$user_agent)); // we find opera mini in the user agent
@@ -99,7 +105,6 @@ if (isset($_SESSION['am_force_theme_layout'])){ //IF USER FORCE FOR THE THEME
99
  }
100
  }
101
 
102
-
103
  function loadMobileStyle(){
104
  global $mobile_browser;
105
  $mobileTheme = $mobile_browser;
2
  /*
3
  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.0
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10
 
33
  break; // break out and skip the rest if we've had a match on the iphone or ipod
34
 
35
  case (preg_match('/android/i',$user_agent)); // we find android in the user agent
36
+ if (preg_match('/mobile/i',$user_agent)):
37
+ $mobile_browser = get_option('android_theme'); // mobile browser is either true or false depending on the setting of android when calling the function
38
+ $status = 'Android';
39
+ else :
40
+ $mobile_browser = get_option('android_tab_theme'); // mobile browser is either true or false depending on the setting of android when calling the function
41
+ $status = 'Android Tab';
42
+ endif;
43
+
44
  break; // break out and skip the rest if we've had a match on android
45
 
46
  case (preg_match('/opera mini/i',$user_agent)); // we find opera mini in the user agent
105
  }
106
  }
107
 
 
108
  function loadMobileStyle(){
109
  global $mobile_browser;
110
  $mobileTheme = $mobile_browser;
img/wppacktheme.png ADDED
Binary file
includes/amts-footer.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>
20
+ </table>
21
+ <br/>
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>
39
+ <th>Plugins You May Like</th>
40
+ </tr>
41
+ </thead>
42
+ <tbody>
43
+ <tr>
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>
52
+ <li><a href="http://wordpress.org/extend/plugins/remove-admin-bar-for-client/" target="_blank">Remove Admin Bar</a></li>
53
+ <li><a href="http://wordpress.org/extend/plugins/html-in-category-and-pages/" target="_blank">.html in category and page url</a></li>
54
+ </ol>
55
+ </td>
56
+ </tr>
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>
77
+
78
+
79
+ </div>
includes/amts-force-switch.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $mobileThemeText = get_option('mobile_view_theme_link_text');
3
+ $desktopThemeText = get_option('desktop_view_theme_link_text');
4
+ $desktopSwitchLink = get_option('show_switch_link_for_desktop');
5
+
6
+ if (empty($mobileThemeText)){
7
+ update_option('mobile_view_theme_link_text', 'Switch To Mobile Version');
8
+ $mobileThemeText = get_option('mobile_view_theme_link_text');
9
+ }
10
+
11
+ if (empty($desktopThemeText)){
12
+ update_option('desktop_view_theme_link_text', 'Switch To Desktop Version');
13
+ $desktopThemeText = get_option('desktop_view_theme_link_text');
14
+ }
15
+
16
+ if (empty($desktopSwitchLink)){
17
+ update_option('show_switch_link_for_desktop', 'no');
18
+ $desktopSwitchLink = get_option('show_switch_link_for_desktop');
19
+ }
20
+ ?>
21
+ <table class="wp-list-table widefat fixed bookmarks">
22
+ <thead>
23
+ <tr>
24
+ <th>Other Settings (Optional)</th>
25
+ </tr>
26
+ </thead>
27
+ <tbody>
28
+ <tr>
29
+ <td>
30
+
31
+ <table class="form-table">
32
+ <tr valign="top">
33
+ <th scope="row">Switch Mobile Theme Link Text</th>
34
+ <td>
35
+ <input name="mobile_view_theme_link_text" style="width:300px;" value="<?php echo $mobileThemeText; ?>" type="text" />
36
+ </td>
37
+ </tr>
38
+
39
+ <tr valign="top">
40
+ <th scope="row">Switch Desktop Theme Link Text</th>
41
+ <td>
42
+ <input name="desktop_view_theme_link_text" style="width:300px;" value="<?php echo $desktopThemeText; ?>" type="text" />
43
+ </td>
44
+ </tr>
45
+
46
+ <tr valign="top">
47
+ <th scope="row">Do you want to show Switch Mobile Theme link even the vistor is viewing from desktop ?</th>
48
+ <td>
49
+ <input name="show_switch_link_for_desktop" type="radio" value="yes" <?php echo $desktopSwitchLink == 'yes'?'checked="checked"':''; ?> /> Yes &nbsp;&nbsp;&nbsp;
50
+ <input name="show_switch_link_for_desktop" type="radio" value="no" <?php echo $desktopSwitchLink == 'no'?'checked="checked"':''; ?> /> No <br/><span class="description">Normally, it is <b>NO</b>. It is usually useless to force the visitor to switch to mobile theme when s/he is in desktop.</span>
51
+ </td>
52
+ </tr>
53
+
54
+ <tr valign="top">
55
+ <th scope="row">&nbsp;</th>
56
+ <td>
57
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
58
+ </td>
59
+ </tr>
60
+
61
+ </table>
62
+
63
+ <br/>
64
+
65
+ </td></tr></tbody></table>
66
+
67
+ <br/>
includes/amts-header.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <style>.amts .form-table th, .amts .form-table td{border:none !important;}</style>
2
+ <div class="wrap amts">
3
+ <h2>Any Mobile Theme Switcher</h2>
4
+ <table width="100%">
5
+ <tr>
6
+ <td valign="top">
7
+ <form method="post" action="options.php">
8
+ <?php settings_fields( 'am-settings-group' ); ?>
includes/amts-readme.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ </form>
2
+ <table class="wp-list-table widefat fixed bookmarks">
3
+ <thead>
4
+ <tr>
5
+ <th>Read Me Please</th>
6
+ </tr>
7
+ </thead>
8
+ <tbody>
9
+ <tr>
10
+ <td>
11
+ <p>
12
+ Use the following shortcode <strong>[show_theme_switch_link]</strong> in templates to show the theme switch link.
13
+ <br/>Example: <strong>&lt;?php echo do_shortcode('[show_theme_switch_link]'); ?&gt;</strong>
14
+ <br/><br/>
15
+ You can also add Switch Mobile Theme link to your Menus from Custom Links section under Appearance > Menus.<br />
16
+ Example:<br />
17
+ Url : <strong><?php bloginfo('url'); ?>/?am_force_theme_layout=desktop</strong> (For Mobile Theme)<br/>
18
+ Url : <strong><?php bloginfo('url'); ?>/?am_force_theme_layout=mobile</strong> (For Desktop Theme)<br/>
19
+ Label : As you wish :)
20
+ </p>
21
+ </td></tr></tbody></table>
includes/amts-theme-select.php ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $iphoneTheme = get_option('iphone_theme');
3
+ $ipadTheme = get_option('ipad_theme');
4
+ $androidTheme = get_option('android_theme');
5
+ $androidTabTheme = get_option('android_tab_theme');
6
+ $blackberryTheme = get_option('blackberry_theme');
7
+ $windowsTheme = get_option('windows_theme');
8
+ $operaTheme = get_option('opera_theme');
9
+ $palmTheme = get_option('parm_os_theme');
10
+ $otherTheme = get_option('other_theme');
11
+
12
+ $themeList = get_themes();
13
+ $themeNames = array_keys($themeList);
14
+ $defaultTheme = get_current_theme();
15
+ natcasesort($themeNames);
16
+ ?>
17
+
18
+ <table class="wp-list-table widefat fixed bookmarks">
19
+ <thead>
20
+ <tr>
21
+ <th>Select Theme For Devices</th>
22
+ </tr>
23
+ </thead>
24
+ <tbody>
25
+ <tr>
26
+ <td>
27
+
28
+ <table class="form-table">
29
+ <tr valign="top">
30
+ <th scope="row">iPhone/iPod Touch Theme:</th>
31
+ <td>
32
+ <select name="iphone_theme">
33
+ <?php
34
+ foreach ($themeNames as $themeName) {
35
+ if (($iphoneTheme == $themeName) || (($iphoneTheme == '') && ($themeName == $defaultTheme))) {
36
+ echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
37
+ } else {
38
+ echo '<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
39
+ }
40
+ }
41
+ ?>
42
+ </select>
43
+ </td>
44
+ </tr>
45
+
46
+ <tr valign="top">
47
+ <th scope="row">iPad Theme</th>
48
+ <td>
49
+ <select name="ipad_theme">
50
+ <?php
51
+ foreach ($themeNames as $themeName) {
52
+ if (($ipadTheme == $themeName) || (($ipadTheme == '') && ($themeName == $defaultTheme))) {
53
+ echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
54
+ } else {
55
+ echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
56
+ }
57
+ }
58
+ ?>
59
+ </select>
60
+ </td>
61
+ </tr>
62
+
63
+ <tr valign="top">
64
+ <th scope="row">Android Theme</th>
65
+ <td>
66
+ <select name="android_theme">
67
+ <?php
68
+ foreach ($themeNames as $themeName) {
69
+ if (($androidTheme == $themeName) || (($androidTheme == '') && ($themeName == $defaultTheme))) {
70
+ echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
71
+ } else {
72
+ echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
73
+ }
74
+ }
75
+ ?>
76
+ </select>
77
+ </td>
78
+ </tr>
79
+
80
+ <tr valign="top">
81
+ <th scope="row">Android Tab Theme</th>
82
+ <td>
83
+ <select name="android_tab_theme">
84
+ <?php
85
+ foreach ($themeNames as $themeName) {
86
+ if (($androidTabTheme == $themeName) || (($androidTabTheme == '') && ($themeName == $defaultTheme))) {
87
+ echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
88
+ } else {
89
+ echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
90
+ }
91
+ }
92
+ ?>
93
+ </select>
94
+ </td>
95
+ </tr>
96
+
97
+ <tr valign="top">
98
+ <th scope="row">Blackberry Theme</th>
99
+ <td>
100
+ <select name="blackberry_theme">
101
+ <?php
102
+ foreach ($themeNames as $themeName) {
103
+ if (($blackberryTheme == $themeName) || (($blackberryTheme == '') && ($themeName == $defaultTheme))) {
104
+ echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
105
+ } else {
106
+ echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
107
+ }
108
+ }
109
+ ?>
110
+ </select>
111
+ </td>
112
+ </tr>
113
+
114
+
115
+ <tr valign="top">
116
+ <th scope="row">Windows Mobile Theme</th>
117
+ <td>
118
+ <select name="windows_theme">
119
+ <?php
120
+ foreach ($themeNames as $themeName) {
121
+ if (($windowsTheme == $themeName) || (($windowsTheme == '') && ($themeName == $defaultTheme))) {
122
+ echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
123
+ } else {
124
+ echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
125
+ }
126
+ }
127
+ ?>
128
+ </select>
129
+ </td>
130
+ </tr>
131
+
132
+ <tr valign="top">
133
+ <th scope="row">Opera Mini Theme</th>
134
+ <td>
135
+ <select name="opera_theme">
136
+ <?php
137
+ foreach ($themeNames as $themeName) {
138
+ if (($operaTheme == $themeName) || (($operaTheme == '') && ($themeName == $defaultTheme))) {
139
+ echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
140
+ } else {
141
+ echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
142
+ }
143
+ }
144
+ ?>
145
+ </select>
146
+ </td>
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
154
+ foreach ($themeNames as $themeName) {
155
+ if (($palmTheme == $themeName) || (($palmTheme == '') && ($themeName == $defaultTheme))) {
156
+ echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
157
+ } else {
158
+ echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
159
+ }
160
+ }
161
+ ?>
162
+ </select>
163
+ </td>
164
+ </tr>
165
+
166
+ <tr valign="top">
167
+ <th scope="row">Other Mobile Device Theme</th>
168
+ <td>
169
+ <select name="other_theme">
170
+ <?php
171
+ foreach ($themeNames as $themeName) {
172
+ if (($otherTheme == $themeName) || (($otherTheme == '') && ($themeName == $defaultTheme))) {
173
+ echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
174
+ } else {
175
+ echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
176
+ }
177
+ }
178
+ ?>
179
+ </select>
180
+ </td>
181
+ </tr>
182
+ <tr valign="top">
183
+ <th scope="row">&nbsp;</th>
184
+ <td>
185
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
186
+ </td>
187
+ </tr>
188
+ </table>
189
+ <br/>
190
+ </td></tr></tbody></table>
191
+ <br/>
plugin_interface.php CHANGED
@@ -6,11 +6,11 @@ function any_mobile_create_menu() {
6
  add_action('admin_init', 'register_mysettings_theme');
7
  }
8
 
9
-
10
  function register_mysettings_theme() {
11
  register_setting('am-settings-group', 'iphone_theme');
12
  register_setting('am-settings-group', 'ipad_theme');
13
  register_setting('am-settings-group', 'android_theme');
 
14
  register_setting('am-settings-group', 'blackberry_theme');
15
  register_setting('am-settings-group', 'windows_theme');
16
  register_setting('am-settings-group', 'opera_theme');
@@ -21,348 +21,10 @@ function register_mysettings_theme() {
21
  register_setting('am-settings-group', 'show_switch_link_for_desktop');
22
  }
23
 
24
- function am_settings_page() {
25
-
26
- $iphoneTheme = get_option('iphone_theme');
27
- $ipadTheme = get_option('ipad_theme');
28
- $androidTheme = get_option('android_theme');
29
- $blackberryTheme = get_option('blackberry_theme');
30
- $windowsTheme = get_option('windows_theme');
31
- $operaTheme = get_option('opera_theme');
32
- $palmTheme = get_option('parm_os_theme');
33
- $otherTheme = get_option('other_theme');
34
- $mobileThemeText = get_option('mobile_view_theme_link_text');
35
- $desktopThemeText = get_option('desktop_view_theme_link_text');
36
- $desktopSwitchLink = get_option('show_switch_link_for_desktop');
37
-
38
-
39
- if (empty($mobileThemeText)){
40
- update_option('mobile_view_theme_link_text', 'Switch To Mobile Version');
41
- $mobileThemeText = get_option('mobile_view_theme_link_text');
42
- }
43
-
44
- if (empty($desktopThemeText)){
45
- update_option('desktop_view_theme_link_text', 'Switch To Desktop Version');
46
- $desktopThemeText = get_option('desktop_view_theme_link_text');
47
- }
48
-
49
- if (empty($desktopSwitchLink)){
50
- update_option('show_switch_link_for_desktop', 'no');
51
- $desktopSwitchLink = get_option('show_switch_link_for_desktop');
52
- }
53
-
54
- $themeList = get_themes();
55
- $themeNames = array_keys($themeList);
56
- $defaultTheme = get_current_theme();
57
- natcasesort($themeNames);
58
- ?>
59
-
60
- <div class="wrap amts">
61
- <h2>Any Mobile Theme Switcher</h2>
62
- <style>
63
- .amts .form-table th, .amts .form-table td{border:none !important;}
64
- </style>
65
- <table width="100%">
66
- <tr>
67
- <td valign="top">
68
- <form method="post" action="options.php">
69
- <?php settings_fields( 'am-settings-group' ); ?>
70
-
71
-
72
- <table class="wp-list-table widefat fixed bookmarks">
73
- <thead>
74
- <tr>
75
- <th>Select Theme For Devices</th>
76
- </tr>
77
- </thead>
78
- <tbody>
79
- <tr>
80
- <td>
81
-
82
- <table class="form-table">
83
- <tr valign="top">
84
- <th scope="row">iPhone/iPod Touch Theme:</th>
85
- <td>
86
- <select name="iphone_theme">
87
- <?php
88
- foreach ($themeNames as $themeName) {
89
- if (($iphoneTheme == $themeName) || (($iphoneTheme == '') && ($themeName == $defaultTheme))) {
90
- echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
91
- } else {
92
- echo '<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
93
- }
94
- }
95
- ?>
96
- </select>
97
- </td>
98
- </tr>
99
-
100
- <tr valign="top">
101
- <th scope="row">iPad Theme</th>
102
- <td>
103
- <select name="ipad_theme">
104
- <?php
105
- foreach ($themeNames as $themeName) {
106
- if (($ipadTheme == $themeName) || (($ipadTheme == '') && ($themeName == $defaultTheme))) {
107
- echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
108
- } else {
109
- echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
110
- }
111
- }
112
- ?>
113
- </select>
114
- </td>
115
- </tr>
116
-
117
- <tr valign="top">
118
- <th scope="row">Android Theme</th>
119
- <td>
120
- <select name="android_theme">
121
- <?php
122
- foreach ($themeNames as $themeName) {
123
- if (($androidTheme == $themeName) || (($androidTheme == '') && ($themeName == $defaultTheme))) {
124
- echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
125
- } else {
126
- echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
127
- }
128
- }
129
- ?>
130
- </select>
131
- </td>
132
- </tr>
133
-
134
-
135
- <tr valign="top">
136
- <th scope="row">Blackberry Theme</th>
137
- <td>
138
- <select name="blackberry_theme">
139
- <?php
140
- foreach ($themeNames as $themeName) {
141
- if (($blackberryTheme == $themeName) || (($blackberryTheme == '') && ($themeName == $defaultTheme))) {
142
- echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
143
- } else {
144
- echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
145
- }
146
- }
147
- ?>
148
- </select>
149
- </td>
150
- </tr>
151
-
152
-
153
- <tr valign="top">
154
- <th scope="row">Windows Mobile Theme</th>
155
- <td>
156
- <select name="windows_theme">
157
- <?php
158
- foreach ($themeNames as $themeName) {
159
- if (($windowsTheme == $themeName) || (($windowsTheme == '') && ($themeName == $defaultTheme))) {
160
- echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
161
- } else {
162
- echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
163
- }
164
- }
165
- ?>
166
- </select>
167
- </td>
168
- </tr>
169
-
170
- <tr valign="top">
171
- <th scope="row">Opera Mini Theme</th>
172
- <td>
173
- <select name="opera_theme">
174
- <?php
175
- foreach ($themeNames as $themeName) {
176
- if (($operaTheme == $themeName) || (($operaTheme == '') && ($themeName == $defaultTheme))) {
177
- echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
178
- } else {
179
- echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
180
- }
181
- }
182
- ?>
183
- </select>
184
- </td>
185
- </tr>
186
-
187
- <tr valign="top">
188
- <th scope="row">Parm Os Theme</th>
189
- <td>
190
- <select name="parm_os_theme">
191
- <?php
192
- foreach ($themeNames as $themeName) {
193
- if (($palmTheme == $themeName) || (($palmTheme == '') && ($themeName == $defaultTheme))) {
194
- echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
195
- } else {
196
- echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
197
- }
198
- }
199
- ?>
200
- </select>
201
- </td>
202
- </tr>
203
-
204
- <tr valign="top">
205
- <th scope="row">Other Mobile Device Theme</th>
206
- <td>
207
- <select name="other_theme">
208
- <?php
209
- foreach ($themeNames as $themeName) {
210
- if (($otherTheme == $themeName) || (($otherTheme == '') && ($themeName == $defaultTheme))) {
211
- echo '<option value="' . $themeName . '" selected="selected">' . htmlspecialchars($themeName) . '</option>';
212
- } else {
213
- echo'<option value="' . $themeName . '">' . htmlspecialchars($themeName) . '</option>';
214
- }
215
- }
216
- ?>
217
- </select>
218
- </td>
219
- </tr>
220
- <tr valign="top">
221
- <th scope="row">&nbsp;</th>
222
- <td>
223
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
224
- </td>
225
- </tr>
226
- </table>
227
- <br/>
228
-
229
- </td></tr></tbody></table>
230
-
231
- <br/>
232
-
233
-
234
- <table class="wp-list-table widefat fixed bookmarks">
235
- <thead>
236
- <tr>
237
- <th>Other Settings (Optional)</th>
238
- </tr>
239
- </thead>
240
- <tbody>
241
- <tr>
242
- <td>
243
-
244
- <table class="form-table">
245
- <tr valign="top">
246
- <th scope="row">Switch Mobile Theme Link Text</th>
247
- <td>
248
- <input name="mobile_view_theme_link_text" style="width:300px;" value="<?php echo $mobileThemeText; ?>" type="text" />
249
- </td>
250
- </tr>
251
-
252
- <tr valign="top">
253
- <th scope="row">Switch Desktop Theme Link Text</th>
254
- <td>
255
- <input name="desktop_view_theme_link_text" style="width:300px;" value="<?php echo $desktopThemeText; ?>" type="text" />
256
- </td>
257
- </tr>
258
-
259
- <tr valign="top">
260
- <th scope="row">Do you want to show Switch Mobile Theme link even the vistor is viewing from desktop ?</th>
261
- <td>
262
- <input name="show_switch_link_for_desktop" type="radio" value="yes" <?php echo $desktopSwitchLink == 'yes'?'checked="checked"':''; ?> /> Yes &nbsp;&nbsp;&nbsp;
263
- <input name="show_switch_link_for_desktop" type="radio" value="no" <?php echo $desktopSwitchLink == 'no'?'checked="checked"':''; ?> /> No <br/><span class="description">Normally, it is <b>NO</b>. It is usually useless to force the visitor to switch to mobile theme when s/he is in desktop.</span>
264
- </td>
265
- </tr>
266
-
267
- <tr valign="top">
268
- <th scope="row">&nbsp;</th>
269
- <td>
270
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
271
- </td>
272
- </tr>
273
-
274
- </table>
275
-
276
- <br/>
277
-
278
- </td></tr></tbody></table>
279
-
280
- <br/>
281
-
282
- <table class="wp-list-table widefat fixed bookmarks">
283
- <thead>
284
- <tr>
285
- <th>Read Me Please</th>
286
- </tr>
287
- </thead>
288
- <tbody>
289
- <tr>
290
- <td>
291
- <p>
292
- Use the following shortcode <strong>[show_theme_switch_link]</strong> in templates to show the theme switch link.
293
- <br/>Example: <strong>&lt;?php echo do_shortcode('[show_theme_switch_link]'); ?&gt;</strong>
294
- <br/><br/>
295
- You can also add Switch Mobile Theme link to your Menus from Custom Links section under Appearance > Menus.<br />
296
- Example:<br />
297
- Url : <strong>http://yoursitename.com/?am_force_theme_layout=desktop</strong> (For Mobile Theme)<br/>
298
- Url : <strong>http://yoursitename.com/?am_force_theme_layout=mobile</strong> (For Desktop Theme)<br/>
299
- Label : As you wish :)
300
- </p>
301
- </td></tr></tbody></table>
302
-
303
- </td>
304
- <td width="15">&nbsp;</td>
305
- <td width="250" valign="top">
306
- <table class="wp-list-table widefat fixed bookmarks">
307
- <thead>
308
- <tr>
309
- <th>Support</th>
310
- </tr>
311
- </thead>
312
- <tbody>
313
- <tr>
314
- <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>
315
- </tr>
316
- </tbody>
317
- </table>
318
- <br/>
319
- <table class="wp-list-table widefat fixed bookmarks">
320
- <thead>
321
- <tr>
322
- <th>Plugins You May Like</th>
323
- </tr>
324
- </thead>
325
- <tbody>
326
- <tr>
327
- <td>
328
- <ol>
329
- <li><a href="http://wordpress.org/extend/plugins/use-any-font/" target="_blank">Use Any Font</a></li>
330
- <li><a href="http://wordpress.org/extend/plugins/sms/" target="_blank">SMS</a></li>
331
- <li><a href="http://dineshkarki.com.np/jquery-validation-for-contact-form-7" target="_blank">Jquery Validation For Contact Form 7</a></li>
332
- <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
333
- <li><a href="http://wordpress.org/extend/plugins/block-specific-plugin-updates/" target="_blank">Block Specific Plugin Updates</a></li>
334
- <li><a href="http://wordpress.org/extend/plugins/featured-image-in-rss-feed/" target="_blank">Featured Image In RSS Feed</a></li>
335
- <li><a href="http://wordpress.org/extend/plugins/remove-admin-bar-for-client/" target="_blank">Remove Admin Bar</a></li>
336
- <li><a href="http://wordpress.org/extend/plugins/html-in-category-and-pages/" target="_blank">.html in category and page url</a></li>
337
- </ol>
338
- </td>
339
- </tr>
340
- </tbody>
341
- </table>
342
- <br/>
343
- <table class="wp-list-table widefat fixed bookmarks">
344
- <thead>
345
- <tr>
346
- <th>Facebook</th>
347
- </tr>
348
- </thead>
349
- <tbody>
350
- <tr>
351
- <td><iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FDnessCarKey%2F77553779916&amp;width=185&amp;height=258&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:258px;" allowTransparency="true"></iframe>
352
- </td>
353
- </tr>
354
- </tbody>
355
- </table>
356
- <br/>
357
-
358
-
359
-
360
-
361
- </td>
362
- </tr>
363
- </table>
364
-
365
-
366
- </form>
367
- </div>
368
- <?php } ?>
6
  add_action('admin_init', 'register_mysettings_theme');
7
  }
8
 
 
9
  function register_mysettings_theme() {
10
  register_setting('am-settings-group', 'iphone_theme');
11
  register_setting('am-settings-group', 'ipad_theme');
12
  register_setting('am-settings-group', 'android_theme');
13
+ register_setting('am-settings-group', 'android_tab_theme');
14
  register_setting('am-settings-group', 'blackberry_theme');
15
  register_setting('am-settings-group', 'windows_theme');
16
  register_setting('am-settings-group', 'opera_theme');
21
  register_setting('am-settings-group', 'show_switch_link_for_desktop');
22
  }
23
 
24
+ function am_settings_page() {
25
+ include('includes/amts-header.php');
26
+ include('includes/amts-theme-select.php');
27
+ include('includes/amts-force-switch.php');
28
+ include('includes/amts-readme.php');
29
+ include('includes/amts-footer.php');
30
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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.4.2
6
- Stable tag: 0.7
7
 
8
  This Plugin detects mobile browser and display the theme as the setting done from admin. Usefull for switch to Mobile Theme.
9
 
@@ -15,6 +15,7 @@ Detects all the Mobile Browsers and loads the mobile theme as per your settings
15
  * Ipad
16
  * Parm Os
17
  * Android
 
18
  * Windows Mobile
19
  * Blackberry
20
  * Opera Mini
@@ -22,7 +23,7 @@ Detects all the Mobile Browsers and loads the mobile theme as per your settings
22
 
23
  You can select a different mobile theme for each mobile browser. You can select different mobile themes for each of the options above.
24
 
25
- Want Mobile Theme ? Get it from <a href="http://dineshkarki.com.np/wppack-theme">here</a>.
26
 
27
  Please visit our <a href="http://dineshkarki.com.np/forums/forum/mobile-theme-switcher" target="_blank">support forum</a> for any issues.
28
 
@@ -45,6 +46,11 @@ Yes it detect most of the mobile browsers and redirects it to its mobile theme s
45
 
46
  == Changelog ==
47
 
 
 
 
 
 
48
  = 0.7 =
49
  * New Interface
50
  * User Agents Update
2
  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.0
7
 
8
  This Plugin detects mobile browser and display the theme as the setting done from admin. Usefull for switch to Mobile Theme.
9
 
15
  * Ipad
16
  * Parm Os
17
  * Android
18
+ * Android Tab
19
  * Windows Mobile
20
  * Blackberry
21
  * Opera Mini
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 <a href="http://dineshkarki.com.np/forums/forum/mobile-theme-switcher" target="_blank">support forum</a> for any issues.
29
 
46
 
47
  == Changelog ==
48
 
49
+ = 1.0 =
50
+ * Added option for Andriod Tab
51
+ * User Agents Update
52
+ * Tested With 3.5
53
+
54
  = 0.7 =
55
  * New Interface
56
  * User Agents Update