Detector class DOCS
AUTHOR: Piotr MaliĆski
Contact: riklaunim@gmail.com
Site: http://www.cms.rk.edu.pl - Polish
License: LGPL
Requirements: PHP5, XAJAX link
This "class" allows you to detect screen resolution and available web browser plugins of a user visiting your site.
HOW TO USE
1. Download xajax and unpack it into the directory with the detector class (if you want different place edit plugins.php)
2. Include (include, iframe could work also) browser_plugins.php into a page.
3. plugins.php will try to write 2 files to a current directory (edit it if you want different paths). The directory has to have write access.
4. plugins.php will create plugins.txt and screen.txt containing the data.
5a. browser_plugins.php contains a simple class which parses data from plugins.txt
5b. screen.php contains a simple class which parses data from screen .txt
browser_plugins.php
$x = new browser_plugins('PATCH TO PLUGINS.TXT'); - where the PATCH is a full path to plugins.txt like: 'plugins.txt' for current directory.
METHODS:
is_plugin($name) - will return true if $name is found in plugin list (example: is_plugin('java')). all data in plugins.txt is lowercase.
get_plugins_array() - returns an array with plugins names and filenames of those plugins
screen.php
$x = new screen('PATCH TO SCREEN.TXT'); - where the PATCH is a full path to screen.txt like: 'screen.txt' for current directory.
METHODS:
resolution() - returns an array with width ($array[0]) and height ($array[1]) of user resoluton.
See example.php