Post by Former Member on Dec 1, 2012 2:26:13 GMT -8
I have the following codes running on v4 - I'd really like to run them again in v5 please.
Ex members names don't show in black font, written by Chris!
Global Footer:
Give guests an avatar:
Ex members names don't show in black font, written by Chris!
Global Footer:
<style type="text/css">
.guest_profile {color:black;}
.guest_profile .guest_name {font-weight:bold;}
.guest_name {color:#337147;} </style>
<script type="text/javascript">
<!--
(function(){ /* style guest names */
if(/display|recent|search2/.test(pb_action)){
var mpTD = document.getElementsByTagName('td'),a=0,b=mpTD.length,c,d
for(;a<b;a++){
if((c=mpTD[a]) && (d=c.firstChild) && c.width=="20%" && d.nodeName=="A" && d.name && c.innerHTML.match(/>([^<]+?)<br\s*\/?>Guest<br\s*\/?>/i)){
c.innerHTML = c.innerHTML.replace(RegExp.$1,'<span class="guest_name">'+RegExp.$1+'</span>');
c.className="guest_profile";
}
}
}else if(/(home|boardindex)/.test(pb_action)){
var pbRows = document.getElementsByTagName('tr'),a=0,b=pbRows.length,c,d,e,lastpost=-1,createdby=-1
for(;a<b;a++){
if((c=pbRows[a].firstChild) && /(title|cat)bg/.test(c.className)){
d=RegExp.$1;e=c.colSpan; e--;
while((c=c.nextSibling)){
e += c.colSpan?c.colSpan:1;
if(/Started by/.test(c.innerHTML)){createdby=e;}
if(/Last\sPost/.test(c.innerHTML)){lastpost=e;}
}
if("title"==d)createdby=-1;
}else if(lastpost>0 && (c=pbRows[a].cells[lastpost])){
if(/>by([^<]+)/.test(c.innerHTML)){
c.innerHTML = c.innerHTML.replace(/>by([^<]+)/,'>by<span class="guest_name">$1</span>');
}
if(createdby>0 && (c=pbRows[a].cells[createdby]) && !c.getElementsByTagName('a')[0]){
d= (c.innerText||c.textContent).replace(/^\s+/,'').replace(/\s+$/,'')
c.innerHTML = c.innerHTML.replace(d,'<span class="guest_name">'+ d +'</span>');
}
}else if((c=pbRows[a].lastChild) && !pbRows[a].previousSibling && /Newest Member:([^<]+)/.test(c.innerHTML)){
c.innerHTML = c.innerHTML.replace(/Newest Member:([^<]+)/,'Newest Member:<span class="guest_name">$1</span>');
}
}
}})()
// -->
</script>
Give guests an avatar:
<script type="text/javascript">
<!--
// replace "guest" in MP with image
// request by victory
// by Wormpolis - www.wormocodes.com
// keep header intact
var gImage="http://i493./rr297/WWWF_08/Avatars/Barrow.gif";
var replaceGuest=false; //set true to replace "Guest" with image, set false to just add image
var centerMP=true;
var messageUnderImage="";
for (tds=document.getElementsByTagName('td'), e=0; e<tds.length; e++) {
if (tds[e].width=='20%' && tds[e].vAlign=='top' && tds[e].innerHTML.match(/<br>Guest<br>/i)) {
var nwInnerds=(centerMP ? '<center>' : '');
nwInnerds+=(replaceGuest ? tds[e].innerHTML=tds[e].innerHTML.replace(/Guest/,'<br><img src="'+gImage+'" \/>') : tds[e].innerHTML+'<br><br><img src="'+gImage+'" \/><br><br>');
nwInnerds+=messageUnderImage+'<br><br>'+(centerMP ? '</center>' : '');
tds[e].innerHTML=nwInnerds;
}
}
// -->
</script>