Mobile Theme Switching to Outside Website

Permalink
Sorry if this has been talked about already; I searched but didn't find anything.

What I have a concrete5.5 site and a 'non-concrete5 html & php mobile theme'... so, all the mobile theme switchers here only switch to a concrete5 theme..

I don't have a problem setting up the mobile site outside my concrete5 site, so is there something, or how would someone go about a mobile switcher redirecting to an alternate site?

thanx in advance

 
Mainio replied on at Permalink Reply
Mainio
You could setup custom code to detect whether the user comes in with a mobile browser and then redirect them to correct location.

The only difference in the mobile switcher add-ons (I think) is that they just setup the theme for the view.

There are free open source scripts available with which you can do the detection. For example this one:
https://github.com/garetjax/phpbrowscap...

And here's a quick start guide on using that:
https://github.com/GaretJax/phpbrowscap/wiki/QuickStart...

You don't actually have to load it through the Composer package manager although the guide tells you so. It works just fine without the package manager as well.

Best,
Antti / Mainio
mkly replied on at Permalink Reply
mkly
The mobile theme switcher currently uses a script from detectmobileborwsers.com

@Manio We should probably replace that one with this one. When I added detectmobilebrowsers it was when there were only like 4 strings regex'd. This seems a lot more flexible/robust.

That addon is friendly to pull requests. You might want to add that, or I will.
Mainio replied on at Permalink Reply
Mainio
@mkly Sure if it can wait for a while (week or so).

However, I think it would be appropriate to contact the maintainers of the database. Here's a short quote from their TOS:
If you intend to make use of the files in conjunction with a commercial product or service that contains a client-based auto-update feature you must contact us first to obtain permission. Said permission is usually perfunctory. Mostly we're concerned with things like what the added load on our servers might be. [...]


I think with C5 it would not become an issue because there is only few requests per site to download the database in general. They consider it abuse if there are more than 100 requests in 24 hours from one IP.

After all it would at least be polite to inform them if this is included in some project...
mkly replied on at Permalink Reply
mkly
Oh well. lol.
ajvobara replied on at Permalink Reply 1 Attachment
Hmm... custom code.. ok, I'm not really that technical. however, I did find a simple php snippet and placed it in the 'Header Extra Content' attribute on the home page.. it redirects great, but the code if visible at the top of the page of the normal page. whyz' that? **photo attached for example

here's the php I'm using
<?php 
@include("Mobile_Detect.php");
$detect = new Mobile_Detect();
if ($detect->isMobile() && isset($_COOKIE['mobile'])){
$detect = "false";
}
elseif ($detect->isMobile())
{
header("Location:http://mysite.xxx");
}
?>
AccountDisabled replied on at Permalink Reply
Warning: Shameless plug!

Mobile Home can help you redirect mobile or mobile and tablet devices to a separate domain. More info on the concrete5 Marketplacehttp://www.concrete5.org/marketplace/addons/mobile-home/...

Cheers!