Page 1 of 1
display the Mobile interface only
Posted: 18 Oct 2013, 14:28
by Rodolfo Ugarte
Does anyone have an idea on what can i do to "hide" the Desktop version of imagevue? i mean.... what i want is that evetytime that somebody opens my gallery, i want the mobile version works even if the user open the website in a desktop computer.
Or.... if someone opens my URL on a mobile device.... the mobile version of imagevuex works, but if they open my URL on a desktop Computer another landing site opens.
Any idea on what can i do?
Thanks a lot!
Re: display the Mobile interface only
Posted: 18 Oct 2013, 20:00
by oneANT
Do you mean....
http://name.com/?mobile=1
then
http://name.com/?mobile=0 to return to desktop.
Hope I understood.
Re: display the Mobile interface only
Posted: 18 Oct 2013, 23:30
by Rodolfo Ugarte
What i want is the mobile version to be displayed in all devices, smartphones tablets and computers as well, but the mobile version not the desktop one.
I donĀ“t want the desktop version to be displayed even in PCs
Re: display the Mobile interface only
Posted: 20 Oct 2013, 08:50
by Nick
You can change the following code in iv-includes/common.inc.php (lines 40-47):
// Is mobile phone?
if (isset($_GET['mobile'])) {
if ($mobile=$_GET['mobile']) {
setcookie('IS_MOBILE', true); define('IS_MOBILE', true);
} else {
setcookie('IS_MOBILE', null, -1); define('IS_MOBILE', false);
}
}
To:
define('IS_MOBILE', true);
Re: display the Mobile interface only
Posted: 20 Oct 2013, 15:54
by Rodolfo Ugarte
It worked!!!
Thanks a lot Nick
Im wondering... what if i want it to open another "landing site" i made when a desktop computer opens the gallery?
I mean:
on mobile Phone ----> mygallery.com (mobile version)
on desktop Computer----->mygallery.com/landing (a landing site i made in HTML)
Can u help me with that code?
Thanks a lot for your patience and help (my english is awfull)
Re: display the Mobile interface only
Posted: 23 Oct 2013, 02:41
by Nick
In that case you might want to use the snippet from README/mobile-detect.html:
<script>
var url = "/mobile/"; // Link to the mobile page
if (navigator.userAgent.match(/iPhone|iPad|iPod|android|bada|blackberry|phone|mobile/i)) window.location = url;
</script>
or the reversed version:
<script>
var url = "/desktop/"; // Link to the desktop page
if (!navigator.userAgent.match(/iPhone|iPad|iPod|android|bada|blackberry|phone|mobile/i)) window.location = url;
</script>