New param required to display Image for Mobile/Tablet.

More
11 years 4 months ago #38695 by brandonking
Sorry Rooney, I misunderstood. :)

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #38696 by ggppdk
Hello,
as i said above i would rather use a 3rd party maintained library, rather than maintain our own detection

but the experimental built-in method of FLEXIcontent also has code to detect screen size (not window that is screen size) and thus set the isMobile FLAG based on screen resolution AND/OR browser reported type

any thoughts ?

e.g.
use this popular mobile Detection library
but also keep our screen resolution detection code ???


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #38698 by brandonking
Sorry, I thought you were asking to Rooney.. :D
Well, I think only one will be enough to have mobile detect but I guess the one I suggested will have more options coz we can even get device name and so on. Also they will keep update for new device as well.
Having two will just make heavier... A little though. :D

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #38699 by ggppdk
Yes,
just screen resolution code is not present in mobile detector and is independent of client it is JS-based and will work without need of maintenance,

the benefit is that you want to know if user is mobile client aka using finger , etc

but also the screen resolution maybe useful for deciding layout , even when having a responsive layout


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #38700 by Rooney
I have to ask my web designer Angie Radtke which mobile_detect.php she is using, but the contents below.
Code:
<?php /** * Mobile Detect * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ class Mobile_Detect { protected $accept; protected $userAgent; protected $isMobile = false; protected $isAndroid = null; protected $isAndroidtablet = null; protected $isIphone = null; protected $isIpad = null; protected $isBlackberry = null; protected $isBlackberrytablet = null; protected $isOpera = null; protected $isPalm = null; protected $isWindows = null; protected $isWindowsphone = null; protected $isGeneric = null; protected $devices = array( "android" => "android.*mobile", "androidtablet" => "android(?!.*mobile)", "blackberry" => "blackberry", "blackberrytablet" => "rim tablet os", "iphone" => "(iphone|ipod)", "ipad" => "(ipad)", "palm" => "(avantgo|blazer|elaine|hiptop|palm|plucker|xiino)", "windows" => "windows ce; (iemobile|ppc|smartphone)", "windowsphone" => "windows phone os", "generic" => "(kindle|mobile|mmp|midp|pocket|psp|symbian|smartphone|treo|up.browser|up.link|vodafone|wap|opera mini)" ); public function __construct() { $this->userAgent = $_SERVER['HTTP_USER_AGENT']; $this->accept = $_SERVER['HTTP_ACCEPT']; if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])) { $this->isMobile = true; } elseif (strpos($this->accept, 'text/vnd.wap.wml') > 0 || strpos($this->accept, 'application/vnd.wap.xhtml+xml') > 0) { $this->isMobile = true; } else { foreach ($this->devices as $device => $regexp) { if ($this->isDevice($device)) { $this->isMobile = true; } } } } /** * Overloads isAndroid() | isAndroidtablet() | isIphone() | isIpad() | isBlackberry() | isBlackberrytablet() | isPalm() | isWindowsphone() | isWindows() | isGeneric() through isDevice() * * @param string $name * @param array $arguments * @return bool */ public function __call($name, $arguments) { $device = substr($name, 2); if ($name == "is" . ucfirst($device) && array_key_exists(strtolower($device), $this->devices)) { return $this->isDevice($device); } else { trigger_error("Method $name not defined", E_USER_WARNING); } } /** * Returns true if any type of mobile device detected, including special ones * @return bool */ public function isMobile() { return $this->isMobile; } protected function isDevice($device) { $var = "is" . ucfirst($device); $return = $this->$var === null ? (bool) preg_match("/" . $this->devices[strtolower($device)] . "/i", $this->userAgent) : $this->$var; if ($device != 'generic' && $return == true) { $this->isGeneric = false; } return $return; } }

Rooney

Joomla! 3.9.24 and FC 3.3.9

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #38701 by brandonking
I have found that mobile detect you use created by same developer.

Your version is r8 by serbanghita on Mar 13, 2012
code.google.com/p/php-mobile-detect/sour...obile_Detect.php?r=8

Or, you can get Latest one from below.
mobiledetect.net/

And The one that I am suggesting Mobile detect plugin for joomla is created by yagendoo Media based on above one.

They mentioned as below.

Credits

The plug-in is based on the (MIT) code library of Serban Ghita, which is also available free of charge and forms the core of the plug-in. Thank you for your great work, Serban!


You can check it below link..
www.yagendoo.com/en/blog/free-mobile-det...ugin-for-joomla.html

Hope we are in the same boat!! :D

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.410 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline