Print Page | Close Window

MOD: Integrate country flags

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=19967
Printed Date: 29 March 2026 at 5:17am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: MOD: Integrate country flags
Posted By: Ali Bilgrami
Subject: MOD: Integrate country flags
Date Posted: 21 May 2006 at 2:21pm
ok its done...scotty_32 thanks mate
 
http://www.mosaicgreen.com/test/flag.zip - http://www.mosaicgreen.com/test/flag.zip
 
included are two asp files
 
member_profile.asp
forum_posts.asp
 
V8 Rel. 8.02
 
/Flags Directory
 
containing flags of almost 140+ countries.



Replies:
Posted By: gölge
Date Posted: 21 May 2006 at 4:10pm
i think you dont have to  keep flag information to show. you can make flagnames same with country names in country list so when a user select a country, the flag path appeared automatically with a variable.
 
example:
dim country
 
when a user selected a country from list you can transfer the countryname to flagname with that variable
 
country = country_list.value
 
flagpath = "..../forum/flags/" & country & ".gif"
 
i think this can help you.
 
%>
<script language="JavaScript">
your function () {
 
your java code here

}
</script>
 
you can use tjava with this code in vb.  place the code before html tags...


Posted By: wistex
Date Posted: 22 May 2006 at 5:49pm
It would probably be better to write the code in ASP/VBScript instead of JavaScript, since JavaScript won't always be executed (since its client side)but ASP/VBScript will (since its server side).

-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums


Posted By: Ali Bilgrami
Date Posted: 22 May 2006 at 6:33pm
well ive done this
 
after this code
 

'If the is a location display it
           If strAuthorLocation <> "" Then Response.Write(vbCrLf & "   <br />" & strTxtLocation & ": " & strAuthorLocation)
around line number 876 in forum_posts.asp
add these lines

Response.Write(vbCrLf & "  <br />" & "<img src=flags/" & strAuthorLocation & ".gif")
Response.Write(vbCrLf&"  <br />")
 
also you'll need the flags directory i've uploaded put it in the forum's main directory and that'll be it...


Posted By: wistex
Date Posted: 22 May 2006 at 6:43pm
Thanks, I've been looking for this.
 
The only problem I see is that the strAuthorLocation displays the full country name, and the GIFs you provided use abbreviations.
 
In my case, since I don't want to modify the strAuthorLocation to be abbreviations, I would add a CASE statement to convert the country name to the appropriate GIF name.


-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums


Posted By: Ali Bilgrami
Date Posted: 22 May 2006 at 7:35pm
ok some countries which has a space in their names like United Kingdom are not showing flags...in the pic properties it only shows the first word of their name...why is that? any ideas?


Posted By: Ali Bilgrami
Date Posted: 22 May 2006 at 7:37pm
yeah well i've converted the country names into full so i'll re-upload the file...


Posted By: wistex
Date Posted: 30 May 2006 at 4:45am

Yes, the web does not like space in the filenames.

Did you get it working?


-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums


Posted By: Ali Bilgrami
Date Posted: 30 May 2006 at 2:37pm
No Cry
have you?


Posted By: Ali Bilgrami
Date Posted: 30 May 2006 at 2:39pm
how about an if statement between the name and extension to check spaces? if found add and concatenate? i dunno how will it be done though :S  simply dont want to write hell lot of case statements in forum posts :S


Posted By: Scotty32
Date Posted: 30 May 2006 at 4:17pm
Originally posted by Ali Bilgrami Ali Bilgrami wrote:

ok some countries which has a space in their names like United Kingdom are not showing flags...in the pic properties it only shows the first word of their name...why is that? any ideas?


the reason why it does this is because you need to put quotes round the image url, if you leave it how you had it in the example (eg <img src=flags/united kingdom.gif> the space breaks the url

so try doing this:
Response.Write(vbCrLf & "  <br />" & "<img src=""flags/" & strAuthorLocation & ".gif"">")


notice the double quotes (in red) this makes the asp ignore it, and continue to the string


-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: Ali Bilgrami
Date Posted: 31 May 2006 at 7:30am
thanks man....working like a charm



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net