Code says...
If geolocates to either US or UK and 50% of the time (*), then show a banner of type banner_<countrycode>, otherwise show a banner of type banner_regular.
* A random number between 0 and 32000 is over 16000.
Okay, that's handy to know. Do I create a different class of banner for each region such as banner_uk? I understand the tempcode to a degree, but not sure how it will know which banner is which. I will have a play around and see what I can do with it, but what is simple in your mind is kinda muddled in mine :P
Anyway, this is not something I personally need as I said, but I thought as some people will be using Composr for multilingual sites, that this would tie in nicely with the internationalization aspects of Composr.
I'm going to drop this because I prefer the flexible Tempcode approach. If we start making display options for banners then it's a never-ending story -- countries may just be one of 30 variables being targeted (language, state, usergroup, past behaviours, demographics...).
Untested code...
{$BANNER,{$?,{$AND,{$EQ,{$GEOLOCATE},US,GB},{$GT,{$RAND},16000}},banner_{$GEOLOCATE},banner_regular}}
Code says...
If geolocates to either US or UK and 50% of the time (*), then show a banner of type banner_<countrycode>, otherwise show a banner of type banner_regular.
* A random number between 0 and 32000 is over 16000.
Anyway, this is not something I personally need as I said, but I thought as some people will be using Composr for multilingual sites, that this would tie in nicely with the internationalization aspects of Composr.
$GEOLOCATE returns 'GB', 'US', etc - the ISO country codes. I built that into the banner type names outputted by my Tempcode above.