Jump to Navigation

Country Icons

Country Icons

This module provides a set of country icons and an API for retrieving and displaying them. It was originally designed for use with the ip2cc module, which stores it's own set of country icons. I wanted to extract these icons from the ip2cc module as it really is additional functionality to that module, that is probably not needed by the majority of ip2cc users. However, it seems apparent that several other modules also include their own set of country flag icons, and would possibly benefit from sharing the resource...

Currently there are 5 API functions:

theme_countryicons_icon
theme_countryicons_sprite

countryicons_get_iconsets
countryicons_get_iconset
countryicons_get_icon_path

you can use countryicons_get_iconsets or countryicons_get_iconset to get details of available iconsets. countryicons_get_icon_path will return the path to a particular country icon. There are also 2 theming functions provided: theme_countryicons_icon returns a an icon as an img tag, whilst theme_countryicons_icon_sprite returns an icon that is generated using a css spriting technique adapted from this list apart article. This is ideal for use on pages that contain lots of flags as it will reduce the number of server requests (one request for all flags, rather than one per flag).

Currently, there is one set of icons (the famfamfam flag icons), but in the future, it will be possible to provide additional icon sets.

Modules that use Country Icons

Does your module use Country Icons? If so, please let me know and I'll add it to the list.


RELEASES

countryicons 6.x-1.0

RECENT ACTIVITY