Views: 1822
Rating: 4

MUserAgentPanel

Submitted By: root
Licence: PRADO

Displays content according to the user agent or operating system of the person browsing your pages.

Files
14.71 KB
225 downloads
MUserAgentPanel.php



Info

MUserAgentPanel can hide its content from users which use the "wrong" browser or operating system. Therefore the component checks a given UserAgentString or uses $_SERVER[HTTP_USER_AGENT] by default.
You can simply use it like a TLabel component to display a short hint or you can use it as a Mutli-Tag component there you can write a lot of stuff in between the tags.

Below you can see, that everyone who does not use Windows as operating system will see the Question. All other guys get a blank <div/> area.

Code:
<com:MUserAgentPanel OS="Windows" MatchMode="NEQ">
Why dont you use a microsoft operating system?
</com:MUserAgentPanel>

If you want to show a nice and warm welcome to all IE users, then take the following source. Shocked
Code:
<com:MUserAgentPanel Text="Hello Microsoft!" Encode="false" Browser="Internet Explorer" MatchMode="EQ" />

This component is currently tested on my own development system. This means: WinXP Tablet PC Edition, Firefox 1.5.0.3, IE 6.0 SP2. So please could you test it on other systems to get bugs out of the component



Please note: This is currently a beta preview and has known bugs. Please see the PRADO forums if you have suggestions or problems using it.