viewtopic.php?f=7&t=66545
I created my UDT "mobile_detect".
then added {mobile_detect} to my template and trying to get conditional with {$deviceType} to work.
but no response, not sure where to put my mobile_detect.php class
Code: Select all
function smarty_function_mobile_detect($params, $smarty)
{
include_once('/mobile_detect.php');
$detect = new Mobile_Detect;
$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
$smarty->assign('deviceType', $deviceType);
}
server has 7.1 php