Any Mobile Theme Switcher - Version 1.6

Version Description

  • Added Remember forced layout till option.
Download this release

Release Info

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

Code changes from version 1.5 to 1.6

any-mobile-theme-switcher.php CHANGED
@@ -4,7 +4,7 @@ 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.5
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10
 
@@ -23,7 +23,12 @@ function amts_start(){
23
  global $amts_shown_theme;
24
  global $amts_force_param;
25
 
26
- $time = '0';
 
 
 
 
 
27
  $url_path = '/';
28
 
29
  $checkReturn = amts_checkMobile();
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.6
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10
 
23
  global $amts_shown_theme;
24
  global $amts_force_param;
25
 
26
+ $forcedLayoutExpireTime = get_option('forced_layout_expire_time');
27
+ if (empty($forcedLayoutExpireTime)){
28
+ $time = '0';
29
+ } else {
30
+ $time = $forcedLayoutExpireTime;
31
+ }
32
  $url_path = '/';
33
 
34
  $checkReturn = amts_checkMobile();
includes/amts-footer.php CHANGED
@@ -47,24 +47,7 @@
47
  </tr>
48
  </tbody>
49
  </table>
50
- <br/>
51
 
52
- <table class="wp-list-table widefat fixed bookmarks">
53
- <thead>
54
- <tr>
55
- <th>WP Pack Mobile Theme</th>
56
- </tr>
57
- </thead>
58
- <tbody>
59
- <tr>
60
- <td>
61
- <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>
62
- <h2 style="text-align:center;"><a href="http://goo.gl/eWXZp" target="_blank">Click For Details</a></h2>
63
-
64
- </td>
65
- </tr>
66
- </tbody>
67
- </table>
68
  <br/>
69
 
70
 
@@ -91,6 +74,19 @@
91
  </tbody>
92
  </table>
93
  <br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  </td>
95
  </tr>
96
  </table>
47
  </tr>
48
  </tbody>
49
  </table>
 
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  <br/>
52
 
53
 
74
  </tbody>
75
  </table>
76
  <br/>
77
+ <table class="wp-list-table widefat fixed bookmarks">
78
+ <thead>
79
+ <tr>
80
+ <th>Facebook</th>
81
+ </tr>
82
+ </thead>
83
+ <tbody>
84
+ <tr>
85
+ <td><iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FDnessCarKey%2F77553779916&amp;width=185&amp;height=180&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:180px;" allowTransparency="true"></iframe>
86
+ </td>
87
+ </tr>
88
+ </tbody>
89
+ </table>
90
  </td>
91
  </tr>
92
  </table>
includes/amts-force-switch.php CHANGED
@@ -1,7 +1,8 @@
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');
@@ -17,6 +18,12 @@ 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>
@@ -29,6 +36,21 @@ if (empty($desktopSwitchLink)){
29
  <td>
30
 
31
  <table class="form-table">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  <tr valign="top">
33
  <th scope="row">Switch Mobile Theme Link Text</th>
34
  <td>
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
+ $forcedLayoutExpireTime = get_option('forced_layout_expire_time');
6
 
7
  if (empty($mobileThemeText)){
8
  update_option('mobile_view_theme_link_text', 'Switch To Mobile Version');
18
  update_option('show_switch_link_for_desktop', 'no');
19
  $desktopSwitchLink = get_option('show_switch_link_for_desktop');
20
  }
21
+
22
+ if (empty($forcedLayoutExpireTime)){
23
+ update_option('forced_layout_expire_time', '0');
24
+ $forcedLayoutExpireTime = get_option('forced_layout_expire_time');
25
+ }
26
+
27
  ?>
28
  <table class="wp-list-table widefat fixed bookmarks">
29
  <thead>
36
  <td>
37
 
38
  <table class="form-table">
39
+ <tr valign="top">
40
+ <th scope="row">Remember forced layout till</th>
41
+ <td>
42
+ <select name="forced_layout_expire_time" style="width:300px">
43
+ <option value="0" <?php echo $forcedLayoutExpireTime == '0'?'selected="selected"':''; ?>>Browser is closed</option>
44
+ <option value="3600" <?php echo $forcedLayoutExpireTime == '3600'?'selected="selected"':''; ?>>1 hour</option>
45
+ <option value="21600" <?php echo $forcedLayoutExpireTime == '21600'?'selected="selected"':''; ?>>6 hours</option>
46
+ <option value="43200" <?php echo $forcedLayoutExpireTime == '43200'?'selected="selected"':''; ?>>12 hours</option>
47
+ <option value="86400" <?php echo $forcedLayoutExpireTime == '86400'?'selected="selected"':''; ?>>1 day</option>
48
+ <option value="604800" <?php echo $forcedLayoutExpireTime == '604800'?'selected="selected"':''; ?>>1 week</option>
49
+ <option value="2419200" <?php echo $forcedLayoutExpireTime == '2419200'?'selected="selected"':''; ?>>1 month</option>
50
+ </select>
51
+ </td>
52
+ </tr>
53
+
54
  <tr valign="top">
55
  <th scope="row">Switch Mobile Theme Link Text</th>
56
  <td>
plugin_interface.php CHANGED
@@ -33,6 +33,7 @@ function register_mysettings_theme() {
33
  register_setting('am-settings-group', 'mobile_view_theme_link_text');
34
  register_setting('am-settings-group', 'desktop_view_theme_link_text');
35
  register_setting('am-settings-group', 'show_switch_link_for_desktop');
 
36
  }
37
 
38
  function custom_get_themelist(){
33
  register_setting('am-settings-group', 'mobile_view_theme_link_text');
34
  register_setting('am-settings-group', 'desktop_view_theme_link_text');
35
  register_setting('am-settings-group', 'show_switch_link_for_desktop');
36
+ register_setting('am-settings-group', 'forced_layout_expire_time');
37
  }
38
 
39
  function custom_get_themelist(){
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, mobile detect, user agent detect, mobile user agent
4
  Requires at least: 3.0.
5
- Tested up to: 3.8.1
6
- Stable tag: 1.5
7
 
8
  This Plugin detects mobile browser and display the theme as the setting done from admin. Usefull for switch to Mobile Theme.
9
 
@@ -31,14 +31,12 @@ Any Mobile Theme Switcher Pro Features
31
  * Better Mobile Detection.
32
  * Click To Call to phone numbers.
33
 
34
- Click <a href="http://goo.gl/j1a2w" title="Any Mobile Theme Switcher Pro" target="_blank">here</a> for details about Any Mobile Theme Swticher
35
-
36
- Want Mobile Theme ? Get it from <a href="http://goo.gl/eWXZp">here</a>.
37
 
38
  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.
39
 
40
  <strong>Installation Video (Thanks to Scott Wiseman)</strong>
41
- [youtube http://www.youtube.com/embed/OqXhTW9FpRI]
42
 
43
  == Installation ==
44
 
@@ -50,7 +48,15 @@ Please visit our own <a href="http://dineshkarki.com.np/forums/forum/mobile-them
50
 
51
  = Does it detect all browsers ? =
52
 
53
- Yes it detect most of the mobile browsers and redirects it to its mobile theme set from admin settings.
 
 
 
 
 
 
 
 
54
 
55
  = Does it works with W3 Total Cache ? =
56
 
@@ -61,6 +67,8 @@ Yes, the pro version works with W3 Total Cache. Click <a href="http://goo.gl/j1a
61
  1. Admin Setting For Mobile Theme selection repective to their platform.
62
 
63
  == Changelog ==
 
 
64
 
65
  = 1.5 =
66
  * Removed depricated functions.
2
  Contributors: dnesscarkey
3
  Tags: mobile theme, mobile theme switcher, mobile browser detect, mobile detect, theme redirection based on mobile device, mobile detect, user agent detect, mobile user agent
4
  Requires at least: 3.0.
5
+ Tested up to: 3.9.1
6
+ Stable tag: 1.6
7
 
8
  This Plugin detects mobile browser and display the theme as the setting done from admin. Usefull for switch to Mobile Theme.
9
 
31
  * Better Mobile Detection.
32
  * Click To Call to phone numbers.
33
 
34
+ Click <a href="http://goo.gl/j1a2w" title="Any Mobile Theme Switcher Pro" target="_blank">here</a> for details about Any Mobile Theme Swticher Pro
 
 
35
 
36
  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.
37
 
38
  <strong>Installation Video (Thanks to Scott Wiseman)</strong>
39
+ [youtube http://www.youtube.com/watch?v=OqXhTW9FpRI]
40
 
41
  == Installation ==
42
 
48
 
49
  = Does it detect all browsers ? =
50
 
51
+ Yes it detects most of the mobile browsers and redirects it to its mobile theme set from admin settings.
52
+
53
+ = Can i place Switch to Desktop/Mobile link in my theme ? =
54
+
55
+ Yes, you can place the Switch to Desktop/Mobile theme from Shortcode or can make a menu item with the link as well. Please follow the instructions available in plugin's settings page.
56
+
57
+ = Do i get a pre build mobile theme with this plugin ? =
58
+
59
+ No, this is just a theme switcher plugin and we don't include any mobile theme like other plugin does.
60
 
61
  = Does it works with W3 Total Cache ? =
62
 
67
  1. Admin Setting For Mobile Theme selection repective to their platform.
68
 
69
  == Changelog ==
70
+ = 1.6 =
71
+ * Added Remember forced layout till option.
72
 
73
  = 1.5 =
74
  * Removed depricated functions.