As addition to deleting of 'zca_responsive_functions.php' file (containing code, which is non-functional anyway), here is my suggestion for code in 'init_zca_layout.php' file:
This handle $_SESSION['layoutType'] in correct way and correct place and makes any further mobile detection within (any) template unnecessaryCode:if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } include_once DIR_WS_CLASSES . 'Mobile_Detect.php'; if (isset($_GET['layoutType'])) $layoutType = preg_replace('/[^a-z0-9_-]/i', '', $_GET['layoutType']); elseif (!empty($_SESSION['layoutType'])) $layoutType = $_SESSION['layoutType']; elseif (!class_exists('Mobile_Detect')) $layoutType = 'default'; else { $detect = new Mobile_Detect; $layoutType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'mobile') : 'default'); } if (!in_array($layoutType, array('mobile', 'tablet', 'full'))) $layoutType = 'default'; $_SESSION['layoutType'] = $layoutType;


Reply With Quote
