• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Trying to make mobile detect plugin
PostPosted: Thu Jul 12, 2018 7:30 pm 
Offline
New Member
New Member

Joined: Wed Jul 11, 2018 6:24 pm
Posts: 6
I found this old thread on mobile detect. I want to implement it.
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:
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);
}


cmsms 2.2.7
server has 7.1 php


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Trying to make mobile detect plugin
PostPosted: Thu Jul 12, 2018 8:33 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7561
Location: The Netherlands
The CGExtensions module already has a mobile detect plug-in included. Check the help text.

Grtz Rolf

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return! [ Click here ]



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Trying to make mobile detect plugin
PostPosted: Thu Jul 12, 2018 9:43 pm 
Offline
New Member
New Member

Joined: Wed Jul 11, 2018 6:24 pm
Posts: 6
Rolf wrote:
The CGExtensions module already has a mobile detect plug-in included. Check the help text.

Grtz Rolf


But it doesn't work for all mobile devices for example it doesn't recognize a lot of samsung models


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Trying to make mobile detect plugin  Topic is solved
PostPosted: Thu Jul 12, 2018 10:16 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7561
Location: The Netherlands
Maybe this one helps you a bit
https://cmscanbesimple.org/blog/smartphone-call-me-link

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return! [ Click here ]



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting