Let's see your index.php file:<?php function detectmobile() { //returns true if the visitor is a mobile phone or false}if (detectmobile() === true) { include('mobile.php');} else { include('standard.php');}?>
<?php /*** Some comments* Elxis CMS is a Free Software*/defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );?>
(datahell types much more quickly than me )I don't think that this is the correct the way, the one that you discussing above.. unless you want a completely different layout for mobile which i do not recommend at all.so you haven't to change a tpl or index file...or the domain to subdomain... remember that 2 files means you have to follow up whit any changes in future twice.. not very practical.
Thanks datahell, I try that using an Iphone user-agent, and it dont work :S also I try with a Blackberry and the result is the same.
if (mobile_device_detect() === true) { include('mobile.php');} else { include('standard.php');}
Thanks datahell, I try that using an Iphone user-agent, and it dont work :S also I try with a Blackberry and the result is the same.........
It would be nice if we created a sample template with this functionality or write some documentation on Elxis wiki when we finally find the best solution for this implementation.
At the other hand it would be very useful not only for mobile devices but in many other cases, to have a function that will detect browsers.If this can implement completely with php would be nice... is this possible?
i have already thought of this.. the only problem is that i missing an iphone to test results,As for the sample template.. my first thought was that this way must be(next-elxis-version) builded elxis default tpl that will be not only compatible with mobile devices but will have all latest elxis characteristics.. xml parameters, collapsible columns etc..
Ps I will start testing this :<link rel="stylesheet" href="handheldstyle.css" type="text/css" media="handheld" />then javascript to force loading different css .. but i will prefer php to do all the work, if this is possible.(?)