Loading...
 
Features / Usability

Features / Usability


Where to put browser sniffing?

posts: 4656 Japan

I have visitors to my site that use old Amiga browsers that don't work well with normal Tiki themes. I've made a compatible theme for them, but would like it served automatically with PHP browser sniffing instead of only after they manage to find and select it. Any ideas? TIA.

-- Gary

posts: 71 United States
Try tiki-setup.php or tiki-setup_base.php. Those two files are included on every tiki page.

posts: 12
You may wish to check out the templates (.tpl) in the templates directory of your tiki installation. There is already a browser sniffing script in one of the template files, although I forget where... and also how deeply it sniffs. It does check for IE/Mozilla and also for uncommon browsers such as Konquerer - this is the very beauty of open source. But it is really hard to find - this is the ugliness of open source.

posts: 2881 United Kingdom
header.tpl is the obvious solution around the current CSS file line wrap
Copy to clipboard
{php} if (sniff sniff code) { echo "usual theme" } else { echo "amaiga theme line" } {/php}


:) Damian

posts: 4656 Japan

Thanks, Damian. I'm using phpsniff, and I modified Tiki's header.tpl. to serve a selected CSS file to particular browsers. For the record, the details are here.

-- Gary