Mobile Site
-
Can I use this script when I use .html files?
Yes, that’s possible. Rename your index.html to index.php and then follow the documentation file to install the script in your index.php file.
-
For people like me who dont have an iphone or blackberry , how to check whether this works or not for thier site?
You can add ?mobile=iphone to the url to force the mobile layout to show in a regular browser. But keep in mind that Mozilla and IE renders the HTML and CSS differently than for example the iPhone browser.
-
The script doesn’t work?
Make sure you used the right type of quotes in the php include (“). I noticed when you copy and paste from the PDF documentation the quotes are wrong.
<?php include ("Mobile/Mobile.php"); ?> -
How to justify the page text?
To do this you add the following css to your Mobile/css/default.css:
.page .content{ text-align: justify; } -
Can i use php files instead of tpl files?
You can use regular PHP code in the tpl files so there is not need to change the extension.
-
I’m getting the following:
Warning: Cannot modify header information – headers already sent by (output started at …...) in ….. on line …
The mobile.php include must be the first line of code you do in your website index.php file. Or you can add
ob_start();
in your index.php file. -
Does this support iPod Touch?
Yes
-
Is this just for wordpress (or can it be used for anything)?
You can use it for all your PHP websites.
-
The RSS feeds don’t work?
Probably your server only allows to read remote files with curl. To fix this in the script you open the Mobile/RssParser.php script and replace line 15 with this::
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $_GET['url']); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0'); $content = curl_exec($ch); curl_close($ch); $Xml = simplexml_load_string($content );
-
I get the following error: “Warning: Division by zero in /home/luckyhut/public_html/index.php on line 1”. How can I solve this?
Make sure you used the right type of quotes in the php include (“). I noticed when you copy and paste from the PDF documentation the quotes are wrong.
<?php include ("Mobile/Mobile.php"); ?> -
Mobile phone emulators to do some testing:
-
How to disable iPad redirection?
Replace Line 24 in Mobile.php with
if(($Detect->IsMobile() && !strstr($_SERVER["HTTP_USER_AGENT"], "iPad")) || isset($_GET["mobile"])){ -
How can i show áñí characters correctly?
Wrap you text with special characters in:
<?php echo htmlentities("your text with special characters") ?>

234comments