Website reverts to wrong colors on cell phone

  • waterwalk
  • Topic Author
  • Visitor
  • Visitor
13 years 4 months ago - 13 years 4 months ago #9999 by waterwalk
Hi, I had bought the mobility template and customized it for a kids website. Currently the site is yellow and bright with pictures of kids etc. Someone just wrote to say that when they look at it on their cell phone the cell is black and looks really dark. I checked it out and the mobility template seems to be overriding the customization we had done with the yellows and it's huge (definitely not looking iPhone compatible as we saw on the mobility features). Is there some mobil setting somewhere that I need to be changing? It's weird to see a black site when the site is really yellow.

This is the site: kidscandoit.com
Last edit: 13 years 4 months ago by waterwalk.

Please Log in to join the conversation.

More
13 years 4 months ago #10004 by ivan.milic
Hi,

when you open index.php of template you can see:

$current_browser = 0;
$useragent=$_SERVER;
if(preg_match('/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile|o2|opera mini|palm( os)?|plucker|pocket|....
$current_browser = 1;

so that condition is probably not hitting that phone. You can put this afre <body> tag:

<?php echo 'TEST'.$_SERVER; ?>

then refresh page using that cel phone ,and you will see at beginning :

TEST:<devise browser name>

then remove that , and mdify preg string like this :

..
if(preg_match('/android|<devise browser name>|avantgo|bl...

Please Log in to join the conversation.

  • waterwalk
  • Topic Author
  • Visitor
  • Visitor
13 years 4 months ago #10383 by waterwalk
Getting a little confused now. It has taken me this long just to get access to the index.php page because of the way the IT is set up (had to have an administrator make the changes).

We added the string:

<?php echo 'TEST'.$_SERVER; ?>

and saw the 'test'

We added iphone and ipad to the list and it is still not working on either device. So code now looks like:

if(preg_match('/android|iphone|ipad|avantgo|bl...

We tried it using the capitalized version as well (iPhone|iPad) and that did not work either. This is very hard to get access to this file without having an IT person sitting right next to me (due to permissions issues). So I need to try and get this fixed asap and hopefully not have to keep bugging them. Can you tell me next steps?

Thanks.

Please Log in to join the conversation.

More
13 years 4 months ago #10400 by ivan.milic
If you saw only "test", without and value after from $_SERVER; then the browser on that device is not compatible.

this are values that should be returned from iPhone/iPod:


Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A110a Safari/419.3

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3

variable $current_browser should be set to 1 when mobile device is calling page.
Code:
if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== FALSE) { $current_browser = 1; } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') !== FALSE) { $current_browser = 1; }

Please Log in to join the conversation.

  • waterwalk
  • Topic Author
  • Visitor
  • Visitor
13 years 4 months ago #10447 by waterwalk
I saw the complete feedback that you talk about when I put in the test code. It said 'test' and then it followed with all the iPhone (and iPad) information. So those are compatible then, but adding 'iphone' and 'ipad' into the string did not work. Is there something else I need to add. It is not clear from what you wrote below. Thanks.

Please Log in to join the conversation.

More
13 years 4 months ago #10452 by ivan.milic
add that if statement after if statement with preg_match:

if(preg_match('/androi..... ......|zeto|zte\-/i',substr($useragent,0,4)))
$current_browser = 1;

if (strpos($_SERVER, 'iPhone') !== FALSE) {
$current_browser = 1;
}
elseif (strpos($_SERVER, 'iPod') !== FALSE) {
$current_browser = 1;
}

Please Log in to join the conversation.

Time to create page: 0.160 seconds
Powered by Kunena Forum