I fixed the error in the above code, I think. It needs parentheses:
if ($platform = 'windows')
But the query still doesn’t work. When the page is viewed on a Windows machine, it does not load the pc.css stylesheet.
switch($platform){case:"windows":/* your code */break;}
looks fine to me, maybe check your editors’ encoding once.
DOS/Linux have different line ending, matters with server-side code.
I’d assume that the CSS styles are just unevenly supported – or not layered out in the expected way. Would just preg_match() only for Safari browsers and show them an additional CSS file (only a very simple pattern for 1 single browser, to be able to use it on a live site, considering each pageload); just use FireBug or Chrome DOM inspector to see what’s going on.
Think there’s some conditional functions as well, adding Safari like that might be most compatible/portable … e.g. is_Safari()… to be added into the theme’s functions.php
Sure one could also think Windows needs to be fixed – I’d just use FireFox or Chrome on any platform as reference for a browser which supports CCS3 and then fix “the rest”.
Besides I wouldn’t trust a code-editor’s syntax highlight too much (it’s just meant to help), rather matters what PHP interpreter, DOM inspector and JS debugger says… http://www.php.net/manual/en/function.error-reporting.php
function is_AppleWebkit(){
if(preg_match("/\sapplewebkit\/(\d+\.\d+)/", strtolower($_SERVER["HTTP_USER_AGENT"]), $a)){
return true;
}
else {
return false;}
}
http://www.useragentstring.com/pages/Safari
^ something like that into functions.php (it’s an untested pattern) to be available in the theme’s header.php – just would need to have mobile Safari considered as well. I’d even add it to the repository, if you could confirm it catches the browser; just don’t have any Mac have, the last one was a Motorola 68k Emu 🙂
it’s just recommend to check for single browsers with simple regex-pattern, because everything else might delay the page-load event by some milliseconds. i mean, the more simple the pattern are – the quicker the match is made by the regex-engine; and the load process continues a little sooner.