[request] Country Flags in Profile
Dec 19, 2012 13:16:13 GMT -8
shazaam2005 and catatonicgalaxy like this
Post by Little Devil on Dec 19, 2012 13:16:13 GMT -8
I am using this code at the moment and I find it is a good code to know where people are from when they post something
<!—Country Flags in Profiles
<!—Country Flags in Profiles
Global Footer -->
<script type="text/javascript">
<!--
/* Location/Country Flags, profile edittable by california
©2005, SoCal Codes, socal.proboards26.com */
var country = new Array();
//Edit Here (these are just examples)
var imgPath="http://s1180./x404/riverinajack/Small%20Flags/Forum%20Flags/";
country[0] = ['Australia','Australia.gif'];
country[1] = ['Belgium','Belgium.gif'];
country[2] = ['Cambodia','Cambodia.gif'];
country[3] = ['Canada','Canada.gif'];
country[4] = ['China','China.gif'];
country[5] = ['Cyprus','Cyprus.gif'];
country[6] = ['France','France.gif'];
country[7] = ['Germany','Germany.gif'];
country[8] = ['Hungary','Hungary.gif'];
conurty[9] = ['Iceland','Iceland.gif'];
country[10] = ['India','India.gif'];
country[11] = ['Indonesia','Indonesia.gif'];
country[12] = ['Ireland','Ireland.gif'];
country[13] = ['Italy','Italy.gif'];
country[14] = ['Japan','Japan.gif'];
country[15] = ['Jersey','Jersey.gif'];
country[16] = ['Mexico','Mexico.gif'];
country[17] = ['New Zealand','New_Zealand.gif'];
country[18] = ['Pakistan','Pakistan.gif'];
country[19] = ['Philippines'.'Philippines.gif'];
country[20] = ['Poland','Poland.gif'];
country[21] = ['Qatar','Qatar.gif'];
country[22] = ['Russia','Russia.gif'];
country[23] = ['Singapore','Singapore.gif'];
country[24] = ['South Africa','South_Africa.gif'];
country[25] = ['Sweden','Sweden.gif'];
country[26] = ['Taiwan','Taiwan.gif'];
country[27] = ['Thailand','Thailand.gif'];
country[28] = ['United Kingdom','United_Kingdom.gif'];
country[29] = ['United States','United_States.gif'];
// No Edit
var td=document.getElementsByTagName("td");
if(location.href.match(/=modifypro/) && document.modifyForm){
var locBox=document.modifyForm.location;
var newSel=document.createElement("select");
newSel.id="flagSel";
var flagImg = new Image();
flagImg.id="flag";
flagImg.style.marginLeft="10px";
flagImg.style.display="none";
newSel.options[0] = new Option("Select a Country","");
newSel.options[1] = new Option("--------------","");
for(i=0;i<country.length;i++){
newSel.options[newSel.options.length] = new Option(country[0],country[1]);
}
newSel.options[newSel.options.length] = new Option("Other...","other");
newSel.onchange=function(){
var flag=document.getElementById("flag");
var flagSel=document.getElementById("flagSel");
if(this.options[this.selectedIndex].value=="other"){
this.style.display="none";
locBox.style.display='';
locBox.value='';
locBox.focus();
flag.style.display="none";
flagSel.style.bottom="0px";
}else if(this.options[this.selectedIndex].value==""){
flag.style.display="none";
flagSel.style.bottom="0px";
}else{
flag.style.display="";
flag.src=imgPath+this.options[this.selectedIndex].value;
flagSel.style.bottom="10px";
}
return true;
}
locBox.parentNode.insertBefore(newSel,locBox);
locBox.parentNode.insertBefore(flagImg,locBox);
locBox.style.display="none";
var flagSel=document.getElementById("flagSel");
flagSel.style.position="relative";
for(i=0;i<country.length;i++){
if(locBox.value==country[1]){
flagSel.selectedIndex=i+2;
document.getElementById("flag").src=imgPath+locBox.value;
document.getElementById("flag").style.display="";
flagSel.style.bottom="10px";
break;
}
}
document.modifyForm.onsubmit=function(){
var flagOpt=flagSel.options[flagSel.selectedIndex].value;
if(flagOpt.match(/\./)){
locBox.value=flagOpt;
}
return true;
}
}else if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/)){
for(i=0;i<td.length;i++){
var t=td.innerHTML;
if(td.width=="20%" && t.match(/location: (.+?)<br/i)){
var loc=RegExp.$1;
for(j=0;j<country.length;j++){
if(loc==country[j][1]){
var imgCode='<img src="'+imgPath+country[j][1]+'" alt="'+country[j][0]+'" />';
td.innerHTML=t.replace('ion: '+loc,'ion: '+imgCode);
}
}
}else if(location.href.match(/on=viewpr/) && td.width=="25%" && t.match(/cation:/)){
for(j=0;j<country.length;j++){
if(td[i+1].innerHTML.indexOf(country[j][1]) != -1){
var imgCode='<img src="'+imgPath+country[j][1]+'" alt="'+country[j][0]+'" />';
td[i+1].innerHTML=td[i+1].innerHTML.replace(country[j][1],imgCode);
}
}
}
}
}
// -->
</script>
Is there any chance of getting a plugin to use this code
This is the site I get the flags from
www.flags.net/fullindex.htm
thanks a lot
LD[/div]