web/wp-content/plugins/xilitheme-select/xilithemeselect.php
changeset 194 32102edaa81b
parent 170 8e3a5a6fc63e
--- a/web/wp-content/plugins/xilitheme-select/xilithemeselect.php	Thu Sep 16 15:45:36 2010 +0000
+++ b/web/wp-content/plugins/xilitheme-select/xilithemeselect.php	Mon Nov 19 18:26:13 2012 +0100
@@ -4,7 +4,7 @@
 Plugin URI: http://dev.xiligroup.com/xilitheme-select/
 Description: A plugin for WordPress that automatically redirects your blog's theme for optimized viewing on Apple's <a href="http://www.apple.com/iphone/">iPhone</a> and <a href="http://www.apple.com/ipodtouch/">iPod touch</a>.
 Author: MS xiligroup dev 
-Version: 1.0.1
+Version: 1.0.3
 Author URI: http://dev.xiligroup.com
 
 # inspired initially from iwphone from Robot Content - 2007 - (http://www.contentrobot.com)
@@ -33,7 +33,7 @@
 
 */
 
-define('XILITHEME_VER','1.0.1');
+define('XILITHEME_VER','1.0.3');
 
 class xilithemeselector{
 	
@@ -41,7 +41,7 @@
 	var $iphone = false;
 	var $currentthemefolder; /*the normal theme used by default*/
 	var $newfolder;
-	var $listofdevices = array("iPhone","iPod"); /* if present selector is activated - can be upgraded !*/
+	var $listofdevices = array("iPhone","iPod"); /* if present selector is activated - can be upgraded ! - iPad if you need !!*/
 	var $xitype; /*type of the selected device*/
 	var $xiversion; /*release of the selected device*/
 	/**/
@@ -118,7 +118,9 @@
 	
 	function detectiPhone($query){
 		/* prepare target theme folders according options and test them */
-		$this->currentthemefolder = str_replace(get_theme_root()."/","",get_template_directory());
+		
+		$this->currentthemefolder = str_replace(get_theme_root()."/","",get_stylesheet_directory());
+		
 		if($this->isfullname) :
 			/*test if theme with fullname exist*/
 			$curpath = get_theme_root()."/".$this->xilithemefullname;
@@ -333,7 +335,14 @@
 		<div class='wrap'>
 		<h2><?php _e("Xilitheme select settings","xilithemeselect"); ?></h2>
 		<p><cite><a href='http://www.xiliphone.mobi' target='_blank'>Xilitheme select</a></cite> <?php _e("provides an automatic selection of the theme for iphone's user when visiting your site.<br />Don't forget to upload a specific theme for ipod touch / iphone with a right folder's name in the wp-content/themes folder.<br /> If an error occur, the current theme is displayed in ipod touch / iphone browser.","xilithemeselect"); ?></p>
-		<p><?php _e("the current theme is","xilithemeselect"); echo ": <em>".$this->currentthemefolder ?>. </em><strong><br />
+		<p><?php
+		 
+		if (function_exists('is_child_theme') && is_child_theme() ) {
+				$theme_name = get_option("stylesheet").' '.__('child of','xili-language').' '.get_option("template");
+		} else {
+				$theme_name = get_option("template");
+		}
+		_e("the current theme is","xilithemeselect"); echo ": <em>".$theme_name ?>. </em><strong><br />
 		<?php _e("itouch theme's folder","xilithemeselect"); echo ": <em>".$this->currentthemefolder.$this->xilithemeextension."</em> "; 
 		$curpath = get_theme_root()."/".$this->currentthemefolder.$this->xilithemeextension;
 			if (file_exists($curpath)) :
@@ -387,7 +396,7 @@
 			</fieldset>
 			<p class="submit"><input type="submit" name="Submit" value="<?php _e('Save Changes'); ?> &raquo;" /></p>
 		</form>
-		<h4><a href="http://dev.xiligroup.com/xilitheme-select/" title="Plugin page and docs" target="_blank" style="text-decoration:none" ><img style="vertical-align:middle" src="<?php echo WP_PLUGIN_URL.'/'.dirname(plugin_basename(__FILE__)).'/xilitheme-logo-32.gif'; ?>" alt="xilitheme-select logo"/>  xilitheme-select</a> - © <a href="http://dev.xiligroup.com" target="_blank" title="<?php _e('Author'); ?>" >xiligroup.com</a>™ - msc 2007-9 - v. <?php echo XILITHEME_VER; ?></h4>
+		<h4><a href="http://dev.xiligroup.com/xilitheme-select/" title="Plugin page and docs" target="_blank" style="text-decoration:none" ><img style="vertical-align:middle" src="<?php echo plugins_url( 'xilitheme-logo-32.png', __FILE__ ) ;  ?>" alt="xilitheme-select logo"/>  xilitheme-select</a> - © <a href="http://dev.xiligroup.com" target="_blank" title="<?php _e('Author'); ?>" >dev.xiligroup.com</a>™ - msc 2007-2012 - v. <?php echo XILITHEME_VER; ?></h4>
 	</div>
 	<?php
 	}
@@ -399,7 +408,7 @@
 $wp_ismobile->cookienable = 1; /*0 to disable*/
 
 /**** tag insertable in the theme's footer or elsewhere ****/
-/* example 1 (in browser): if (function_exists('the_xilithemelink')) the_xilithemelink('mobbro=<img src="'.get_bloginfo("template_directory").'/images/mobilelink.gif" alt=""/>');
+/* example 1 (in browser): if (function_exists('the_xilithemelink')) the_xilithemelink('mobbro=<img src="'.get_bloginfo("stylesheet_directory").'/images/mobilelink.gif" alt=""/>');
 */
 /* example 2 (in mobilebrowser): if (function_exists('the_xilithemelink')) the_xilithemelink('bro=naviguer en mode normal');
 */