• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » CountryCodes and Flags
CountryCodes and Flags
Clyde
Posts: 242
Reputation: 0

Message # 1 | 10:51 PM
I am able to get just a few country flags to show @ the forum.
However, the Ucoz $COUNTRY$ codes country ID (there are 3 $POST_COUNTRY$ etc.) are different than the standard ISO 3166 Country Flag code names.
example: ucoz lists 'Germany' in the country code instead of de ... so if I rename the gif from 'de.gif' to Germany.gif, it works fine. The problem is that other countries like U.S. is listed as 'United States' with the Ucoz code... I cannot rename from us.gif to United States.gif because file manager will make it United_States ... that dividing line in between is different than how the system has it so it doesn't show up. This happens with all countries that have 2 seperate words to their names. Also would be quite a task to have to manually rename all country flags wacko
I saw some threads in search referring to country flags here but it looks like they no longer exist. Is there a specific set of flags that are named to match ucoz ? -

Ucoz Website Since 2009
Sunny
Posts: 9296
Reputation: 456

Message # 2 | 12:16 PM
Clyde, please provide the code you are using.
I'm not active on the forum anymore. Please contact other forum staff.
Clyde
Posts: 242
Reputation: 0

Message # 3 | 1:45 PM
Sunny,
This is what I have in Appearance of Entries (Forum)

<?if($POST_COUNTRY_ID$)?>$COUNTRY_ID$<?endif?><img src="http://audioforum.my1.ru/FLAGS/$POST_COUNTRY$.gif"/>

The code works:

Germany shows since I had to rename from the standard 'de.png' to 'Germany.png'...the country code system here doesn't recognize 'de'.



the us.png flag doesn't show up since the system is looking for 'United States.png' instead of the standard 'us.png' for the flag. I can't rename the flag United States 'cause it has a 'space' between the 2 words... so if I rename to United_States it doesn't recognize it.

right clicking on link @ users post, shows that it is looking for an image named United States.png

Ucoz Website Since 2009
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 4 | 2:12 PM
Clyde, try using $POST_COUNTRY_ID$ for the links. smile
Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Clyde
Posts: 242
Reputation: 0

Message # 5 | 2:20 PM
Paradox,
Tried it that way also and other combinations too - $COUNTRY$, $POST_COUNTRY_ID$, $COUNTRY_ID$ - they all use the same spelling for country names wink

Ucoz Website Since 2009
Sunny
Posts: 9296
Reputation: 456

Message # 6 | 9:15 AM
Clyde, the following code works fine:

<?if($POST_COUNTRY_ID$)?><img src="http://yoursite/flags/$POST_COUNTRY_ID$.gif"/><?endif?>

$POST_COUNTRY_ID$ outputs two-letter country codes, like US for the United States, therefore there are no problems with the spaces. Just note that country codes are capitalized, therefore name the images US.gif etc.

I'm not active on the forum anymore. Please contact other forum staff.
Clyde
Posts: 242
Reputation: 0

Message # 7 | 4:45 PM
Sunny, Worked ! biggrin Thanks Much Sunny !

Added (2014-07-22, 10:45 AM)
---------------------------------------------
Add:
'Folder Limit Reached' - so I made a second Folder 'Flags2'.
Duplicated the code - it works but the people with countries in the 'Flags2' directory get a Broken Image File Picture together with their flag.
Any work around ? - I know HTML source allows for one image source in same line.


Ucoz Website Since 2009
Sunny
Posts: 9296
Reputation: 456

Message # 8 | 11:50 AM
Clyde, you could do something like this:

Code
<?if($POST_COUNTRY_ID$="US" or $POST_COUNTRY_ID$="DE" or $POST_COUNTRY_ID$="UK")?>link to the first folder<?else?>link to the second folder<?endif?>


Of course you will have to list all countries of the corresponding folder. Or you can try to find a third-party script that will display flags.

I'm not active on the forum anymore. Please contact other forum staff.
Clyde
Posts: 242
Reputation: 0

Message # 9 | 4:52 PM
Sunny,
Ok, will try that -
For now been sacrificing 'not so popular country names' and changing them to the active folder...
...also was thinking I have an "if not" command for avatars that if user has none, add this - might work in this situation...
Will play with it. Either way this is resolveable - Thanks for the suggestion Sunny ! biggrin

Ucoz Website Since 2009
Post edited by Clyde - Thursday, 2014-07-24, 4:52 PM
uCoz Community » For Webmasters » Custom Solutions » CountryCodes and Flags
  • Page 1 of 1
  • 1
Search: