Conforums Support
Board Enhancements >> Hacks >> User's Location in mini profile
http://support.conforums.com/index.cgi?board=code&action=display&num=1165959357

User's Location in mini profile
Post by Garet on Dec 12th, 2006, 3:35pm

Well, what this code does is that the next time that someone modifies their profile it will 'Save' their location and then display it in their mini profile.

Click here for Preview

Global Footers (Main & Board Footers)
Cross Browser: IE & FF


If you have any problems, issues or questions then feel free to ask.


<script type="text/javascript">
<!--

/*Users Location in Mini Profile, by Zando*/
var zFo=document.creator
var tdz=document.getElementsByTagName("td")
var inp=document.getElementsByTagName("input")
if(location.href.match(/action=profile&username/) && !navigator.userAgent.indexOf("Opera")!=-1){
if(zFo.usertext.value.match(/{=}(.+){\/=}/)){
zFo.usertext.value=zFo.usertext.value.replace(/{=}(.+){\/=}/, '')
}
for(a=0;a<inp.length;a++){
if(inp[a].name.match(/moda/) && inp[a].value.match(/Change profile/)){
inp[a].onclick=function(){
var zTempText=zFo.usertext.value
zFo.usertext.value=zTempText+'{=}'+zFo.location.value+'{\/=}';
};
}
}
}
for(z=0;z<tdz.length;z++){
if(((tdz[z].width=="30%" && tdz[z].align=="center" && tdz[z].vAlign=="middle" && tdz[z].className.match(/windowbg(2)?/))||(tdz[z].width=="20%" && tdz[z].vAlign=="top" && tdz[z].className.match(/windowbg(2)?/))) && tdz[z].innerHTML.match(/{=}(.+){\/=}/)){
var zFinLoc=RegExp.$1
tdz[z].innerHTML=tdz[z].innerHTML.replace(/{=}(.+){\/=}/, '');
tdz[z].innerHTML+='<center><font size="1">Location: '+zFinLoc+'</font></center>';
if(tdz[z].innerHTML.match(/Location: (.+){\/=}{=}(.+)/)){
tdz[z].innerHTML=tdz[z].innerHTML.replace(/Location: (.+){\/=}{=}/, 'Location: ');
}
}
}

//-->
</script>