[Solved]Mobile Detect plugin won't work
Posted: Fri May 17, 2013 2:56 pm
Hi there! I'm currently trying to implement a mobile detect php script, so that mobile user will get a light version of a slideshow.
PHP Mobile Detect Script: http://mobiledetect.net/
1. I placed the PHP script in the folder: /mdetect/MobileDetect.php
2. Created a plugin (see below) /plugin/function.mobile_detect.php
3. when I call {mobile_detect} my website only is displaying the html till the placed tag. No stylesheets are generated.
My steps to solve the problem:
1. Smarty 3 include php guide: http://www.smarty.net/best_practices
2. Smarty debug = true (isn't generating any output)
3. Posting a forumpost
pls help
PHP Mobile Detect Script: http://mobiledetect.net/
1. I placed the PHP script in the folder: /mdetect/MobileDetect.php
2. Created a plugin (see below) /plugin/function.mobile_detect.php
3. when I call {mobile_detect} my website only is displaying the html till the placed tag. No stylesheets are generated.
Code: Select all
<?php
function smarty_function_mobile_detect($params, $smarty)
{
include_once('/mdetect/Mobile_Detect.php');
$detect = new Mobile_Detect;
$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
$smarty->assign('deviceType', $deviceType);
}
?>
1. Smarty 3 include php guide: http://www.smarty.net/best_practices
2. Smarty debug = true (isn't generating any output)

3. Posting a forumpost
