syslogic
Forum Replies Created
-
Forum: Plugins
In reply to: [Mobile Client Detection Plugin] Using query_vars to detect windowsit’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.
Forum: Plugins
In reply to: [Mobile Client Detection Plugin] Using query_vars to detect windowsfunction 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 🙂
Forum: Plugins
In reply to: [Mobile Client Detection Plugin] Using query_vars to detect windowsswitch($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
Probably it’s even crap to differ between tablet and phone on the server-side – since once it’s clear that it’s rather a touch-device,
one can load some JS framework to handle it. no matter if phone or tablet.
just for example (very outdated version of jQuery mobile, but it can at least list the posts): http://mobile.codefx.biz – quite the same on phone and tablet (even if the content isn’t too readable, of course)Sure it’s a little generalized to say Android 4 is a tablet –
but in 80% of the cases this might be a hit – the other 20% are rather a minority 🙂This is a theme developer tool, for more precise detection one should use a custom browsecap.ini … or switch mobile clients by .htaccess already.
By JS one can easily calculate available screen an it’s aspect ratio.
There’s not too many plugins around capable of pushing content through a few different themes – at the same time … which is the main application.
Besides a better patch might be to change the regex to include the required 1 device (that pattern just matches my devices, feel free to modify it according to your environment).
I won’t apply that patch, because it’s not better in any way.
Why should I fix one thing that will break another more likely thing?
that’s ridiculous. JB/ICS is per default a tablet built and rarely available on phones.Please just use JavaScript for detection of the screen resolution. Way to much processing for serving pages in real-time… sure i could preg_match for any f* device – but I just don’t care.
This plugin is just a proof of concept how to hook into the template engine properly.
Forum: Plugins
In reply to: [Mobile Client Detection Plugin] moblie client plug in info at bottom of pageHonestly, I don’t really see this as a bug – it’s intended behavior.
How else one could see it is working or where to place the alternate files?
Forum: Plugins
In reply to: [Mobile Client Detection Plugin] moblie client plug in info at bottom of pageyou need to disable debug output in the plugin options.
it still loads different templates instead then – but quietly.the paths are where it would expect the files, depending on the mode.
Forum: Reviews
In reply to: [Mobile Client Detection Plugin] No supportIt is not possible to detect screen resolution with PHP
so what is your problem?
great patch – how about droid tablets then? 🙂
there is no way to measure the screen resolution with PHP.
just use the other mode + JavaScript to see of it’s a phone or tablet.
Forum: Reviews
In reply to: [Mobile Client Detection Plugin] No supportWhy you don’t just use the board here instead of bugging me personally?
I couldn’t notice ‘any support’ on my PayPal either, so wtf?!
If you don’t understand the application the plugin performs –
this is most likely your problem, not exactly mine.It certainly does what it’s supposed to do –
I mean, do we have any support contract going on??If the plugin would have one more file, this one could be used for moving the drop-in a level upward; not much functionality contained – just a simple installer plug-in package which installs the drop-in.
How about …
if(!function_exists(‘wp_cache_add’)){
/* assuming a proper file location */
}
else {
/* notice the user to move the file */
}Like this activation won’t bug out while the user knows why it’s not working.
I’d have to see, just currently pretty busy and no donations at all yet.
I’m really not intending to starve from GPL idealism,
when I can choose daily from several commercial projects.
It’s like “What do you want to code today?” 🙂Nevertheless, thanks for pointing that out, will commit once verified.
Just changed that, thank you for notifying.