Home arrow Forums
  • English
  • Greek
Aperitto Software Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Go to bottom Post Reply Favoured: 0
TOPIC: Mobile Site
#21
nick_tg (Moderator)
Moderator
Posts: 205
graph
User Offline Click here to see the profile of this user
Mobile Site Posted at 2007/04/02 17:17 Karma: 6  
For now, when you access the aperitto.com from a mobile device, then a special design for these devices will be displayed.

For those who interested, below is a guide on how this can be done with php on Joomla Sites.

The idea is to have the Joomla to understand if the client is a mobile device or not.

Code:

$ua = $_SERVER['HTTP_USER_AGENT']; if (stristr($ua, "Windows CE"«») or stristr($ua, "AvantGo"«») or stristr($ua, "Mazingo"«») or stristr($ua, "Mobile"«») or stristr($ua, "T68"«») or stristr($ua, "Syncalot"«») or stristr($ua, "Blazer"«») or stristr($ua, "NetFront"«»)) { $DEVICE_TYPE="MOBILE"; } if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE"«») { // MOBILE SITE JOOMLA TEMPLATE HERE ... exit; } // DESKTOP SITE JOOMLA TEMPLATE HERE ...
In this code, the variable $ua holds the client's agent. From this variable we can understand if the user is on a mobile device, by looking if $ua contains "Windows CE" or "Mobile" or "Blazer" or whatever. Then if we are on mobile device, we give to the html output the mobile template, otherwise the desktop template, into the appropriated positions into the above code. For mobile template I use the xe_mobile template from Xe-Media Software Hope to be usefull, Nick Protopapas PS: Can someone give a feedback about the mobile site?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Login Form






Lost Password?
No account yet? Register

Your Cart

Your Cart is currently empty.