![]() | Welcome to Islandnet.com Locally owned and operated since 1993 |
| Create an Account • Pricing & Features • Domain Registration • Customer Sites • Help & Info | |
Saturday November 21 2009 | |
Web Gadget: inFlaginFlag is a gadget that displays an image of a country's flag in the size you request.
Current Version2009-05-25 16:04:04 NEWNote that you can check the version of a web gadget by loading it directly in your browser with the "version" keyword. For example, loading "inflag.php?version" will display the current version and tell you if there is a newer version available.
InstallationTo install this web gadget, place a copy of inflag.php in your web space. You can change the name to anything you'd like, as long as it ends with ".php". Note that this is an encoded and encrypted PHP file. It will look like gibberish to you, but the web server will know what to do with it. If you make any changes to this file it will cease to function, so be careful to upload it to your site in BINARY mode.
ConfigurationWhen this web gadget runs it will expect to find a configuration file to load settings from. The filename depends on the name that you gave to the web gadget itself. If you named it "inflag.php" then the configuration file must be named "flag_config.php" (that's an underscore in the middle). If you named it "fl.php" then the configuration file must be named "fl_config.php", and so on.The configuration file is a PHP script that contains a list of values in the "CONFIG" array. It will look something like this (but normally with many more settings):
Configuration Settings
Usage:To display a specific country's flag you must know the country's ISO code. You can use either the 2 character code, the 3 character code, or the numeric code. For example, Canada's ISO codes are CA, CAN, and 124. To display Canada's flag you can use any of the following:
<img src="inflag.php?a2=ca"> <img src="inflag.php?a3=can"> <img src="inflag.php?n=124"> Alternatively you can provide a hostname or IP address, and the country code will be deduced. For example:
<img src="inflag.php?host=aol.com"> If you don't specify a country code or a hostname/IP then it will choose a country code based on the IP address of the browser that is viewing the page. For example, your country's flag is:
<img src="inflag.php">
Example:To view the configuration file used in this example, click here.
|