Webmastersite.net
Register Log In

Using Country Flag Images
Using Country Flag Image with Dynamic Country Lis

Comments on Using Country Flag Images

tradenet
Forum Regular

Usergroup: Customer
Joined: Oct 14, 2004

Total Topics: 54
Total Comments: 127
Posted Jun 11, 2008 - 1:33 PM:

Using Country Flag Images with Dynamic Country List
  • Display a user's flags in the user's profile
  • Display users' flags in the Members List of a site
  • Display country flags on member sign up.
  • Display Member country flags on line or countries who's online
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 13, 2008 - 1:14 AM:

This is clearly a custom project with no general utility. Estimate, if you supply all the flag images: 1-3 hours.
tradenet
Forum Regular

Usergroup: Customer
Joined: Oct 14, 2004

Total Topics: 54
Total Comments: 127
Posted Jun 13, 2008 - 11:14 AM:

It may not lend itself to any general utilty, but certainly would be great eye candy. wink
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 13, 2008 - 8:49 PM:

I guess that's a matter of opinion, but I think it'd be annoying-looking clutter.
chris
Member

Usergroup: Customer
Joined: May 04, 2008
Location: Liège, BELGIUM

Total Topics: 13
Total Comments: 43
chris
Posted Jun 14, 2008 - 4:03 AM:

Hi tradenet,

not sure if I understand what you mean, but impo this can be easily done within your templates. You just need a custom field COUNTRY for MEMBERS (in case you don't have one yet). It should be a SELECT-BOX with all available countries. Then name the country-flag-images something like "flag_brasilia.gif", "flag_germany.gif, "flag_france.gif", etc. and upload all images to the images-folder. Then just place <img src="{IMAGESURL}/flag_{MEMBERCOUNTRY}.gif" alt="{MEMBERCOUNTRY}" /> wherever you want the flag to appear. Perhaps not a perfect solution but done within 10 minutes.

No guarantee that it works, was just what came to my mind first.

Cheers,
Chris
tradenet
Forum Regular

Usergroup: Customer
Joined: Oct 14, 2004

Total Topics: 54
Total Comments: 127
Posted Jun 14, 2008 - 12:40 PM:

chris wrote:
Hi tradenet,

not sure if I understand what you mean, but impo this can be easily done within your templates. You just need a custom field COUNTRY for MEMBERS (in case you don't have one yet). It should be a SELECT-BOX with all available countries. Then name the country-flag-images something like "flag_brasilia.gif", "flag_germany.gif, "flag_france.gif", etc. and upload all images to the images-folder. Then just place <img src="{IMAGESURL}/flag_{MEMBERCOUNTRY}.gif" > wherever you want the flag to appear. Perhaps not a perfect solution but done within 10 minutes.

No guarantee that it works, was just what came to my mind first.

Cheers,
Chris




An interesting alternative, I'll play with that one.
tradenet
Forum Regular

Usergroup: Customer
Joined: Oct 14, 2004

Total Topics: 54
Total Comments: 127
Posted Jun 14, 2008 - 12:41 PM:

Paul wrote:
I guess that's a matter of opinion, but I think it'd be annoying-looking clutter.




Yeah, however when you are dealing with a multilingual website, pictures are a "thousand words".
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 15, 2008 - 2:04 PM:

Capitalization and spaces are the likely problems with chris' method. But if you already have a "country" field, you could make a member pseudomethod like this:
$pseudomethods[] = 'countryflag';
function countryflag($object)
{ // return flag image
$flagimg = strtolower(str_replace(' ', '', $object->country));
return "<img src='{IMAGESURL}/flags/$flagimg.gif'>";
}

and then the images can be named in lowercase with spaces removed in a flags subdirectory, and displayed with {MEMBERCOUNTRYFLAG}.
tradenet
Forum Regular

Usergroup: Customer
Joined: Oct 14, 2004

Total Topics: 54
Total Comments: 127
Posted Jun 16, 2008 - 9:49 AM:

Ah intresting pseudomethods. Have to give that a go. Thanks.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.