|
Post by Wormopolis on Jan 19, 2010 6:44:42 GMT -8
ah yeah.. yours has some weird edits done to it. imma play with a fresh copy.
|
|
|
Post by eveready on Jan 19, 2010 7:02:54 GMT -8
I remember getting it off of some obscure coding site a long time ago, but I did a search to find it over at studio zero. I'm not surprised if they don't exactly match.
|
|
|
Post by Wormopolis on Jan 19, 2010 22:19:31 GMT -8
the code you have for Jersey number deletes the location field.
How about this... I will write a custom code for Jersey Number so you can keep location field, and make it compatible with this code we are currently struggling through.
I cant make the current code work with it, because the code as you have it conflicts.
|
|
|
Post by eveready on Jan 20, 2010 3:49:38 GMT -8
If you're willing, then sure. It doesn't even have to use the location field. That just happens to be the code that I found that kind of fit into what I was trying to do. It's up to you, since I don't know if one's easier than the other but maybe the signature field could be used to store the data? I have very,very few members that have signatures. Whatever you like though.
|
|
|
Post by Wormopolis on Jan 20, 2010 8:18:12 GMT -8
I can still use location field, but I want to write it where it doesnt destroy the data.
while we are on the subject, how were you going to have the member choose their team? the same way as the jersey number? if so, I could just write it into the same code.
|
|
|
Post by eveready on Jan 20, 2010 8:47:16 GMT -8
Their team gets chosen with the NHL icons code by iAlex. It's a dropdown on the modify profile page.
|
|
|
Post by Wormopolis on Jan 20, 2010 14:47:38 GMT -8
ok. I will look over his code to see where he stores the result. hopefully he doesnt destroy an existing field.
|
|
|
Post by Wormopolis on Jan 22, 2010 0:07:51 GMT -8
I have jersey number showing in there, I just need to write the custom code to pick it from modify profile.
|
|
|
Post by eveready on Jan 22, 2010 2:03:27 GMT -8
It's looking good.
|
|
|
Post by Wormopolis on Jan 23, 2010 22:26:00 GMT -8
here is the code to add in a Jersey number
<script type="text/javascript"> <!-- // Jersey number in MP
// modify Profile part if (document.modifyForm) { nwstuff=modifyForm.location.parentNode.parentNode.parentNode.cloneNode(true); prejers=(modifyForm.location.value.match(/%(\d+)%/) ? RegExp.$1 : ''); locRow=modifyForm.location.parentNode.parentNode.parentNode; nwstuff.firstChild.firstChild.innerHTML="Jersey Number"; drpdwn="<select name='jersey'><option value=''>---</option>"; for (i=1; i<100; i++) drpdwn+="<option value="+i+">"+i+"</option>"; drpdwn+="</select>"; nwstuff.firstChild.nextSibling.firstChild.innerHTML=drpdwn; nwstuff.firstChild.nextSibling.nextSibling.firstChild.innerHTML="choose jersey number."; locRow.parentNode.insertBefore(nwstuff, locRow); if (prejers) modifyForm.jersey.selectedIndex=parseInt(prejers); modifyForm.location.value=modifyForm.location.value.replace(/%(\d+)%/,'');
function updateJersey() { if (modifyForm.jersey.value) modifyForm.location.value='%'+modifyForm.jersey.value+'%'+modifyForm.location.value; }
if (document.addEventListener) { document.modifyForm.addEventListener('submit',updateJersey,false); } else { document.modifyForm.attachEvent('onsubmit',updateJersey); } } // display part for (tds=document.getElementsByTagName('td'), t=0; t<tds.length; t++) { if (tds[t].width=='20%' && tds[t].className.match(/windowbg/) && tds[t].vAlign=='top') { for (cur=tds[t].firstChild; cur!=tds[t].lastChild; cur=cur.nextSibling) { if (cur.nodeName.match(/text/) && cur.nodeValue.match(/location:/i) && cur.nodeValue.match(/%(\d+)%/)) { jnum=RegExp.$1; cur.nodeValue=cur.nodeValue.replace(/%(\d+)%/,''); cur.parentNode.insertBefore(document.createTextNode("Jersey Number: "+jnum),cur); cur.parentNode.insertBefore(document.createElement('br'),cur); break; } } } if (tds[t].width=='80%' && tds[t].className.match(/windowbg/) && tds[t].vAlign=='top') { for (cur=tds[t].getElementsByTagName('td'), c=0; c<cur.length; c++) { if (cur[c].width=='25%' && cur[c].innerHTML.match(/location:/i) && cur[c].nextSibling.innerHTML.match(/%(\d+)%/)) { jnum=RegExp.$1; cur[c].nextSibling.innerHTML=cur[c].nextSibling.innerHTML.replace(/%(\d+)%/,''); break; } } } }
// --> </script>
I still need to figure out how to extract the Jersey color and logo image.
|
|
|
Post by eveready on Jan 24, 2010 5:41:43 GMT -8
^ I stuck it in my board
|
|
|
Post by Wormopolis on Jan 24, 2010 11:22:36 GMT -8
how does it look? I moved personal text underneath the avatar. The logo code will need to have 1 line of code edited in order to work with my code (but it wont affect the code overall).
there is an array at the top of my code where you can put in the URLs for the jersey pictures. it is in the same order as the logos from the logo code.
|
|
|
Post by eveready on Jan 25, 2010 19:42:45 GMT -8
Everything's looking good.
|
|
|
Post by Wormopolis on Jan 25, 2010 21:41:10 GMT -8
ok, here is the code then:
<script type="text/javascript"> <!-- // eveready post remodel - hockey style // by Wormopolis - concept by eveready
var jerseyColors=[ "http://img683.imageshack.us/img683/3092/jerseytemplate.png", "http://img683.imageshack.us/img683/3092/jerseytemplate2.png" ];
if (location.href.match(/thread=368/)) { for (tds=document.getElementsByTagName('td'), e=0; e<tds.length; e++) { if (tds[e].width=='20%' && tds[e].className.match(/windowbg/) && tds[e].vAlign=='top') { auth=rank=stars=ctitle=status= warn=warnbar=''; jerseyback=joined=loc= postcount=gender=karma=avt= contacts=ptext=''; stuffArray=tds[e].innerHTML.split(/<br>/i); for (s=0; s<stuffArray.length; s++) { //retrieve MP parts if (stuffArray[s].match(/action=viewprofile/) && auth=='') { auth=stuffArray[s]; rank=stuffArray[s+1]; stars=stuffArray[s+2]; if (!stuffArray[s+3].match(/member is/)) { ctitle=stuffArray[s+3]; } } var status; if (stuffArray[s].match(/member is/i) && status=='') { status=stuffArray[s]; } var warn, warnbar; if (stuffArray[s].match(/warning level/i) && warn=='') { warn=stuffArray[s]; warnbar=stuffArray[s+1]; } var joined; if (stuffArray[s].match(/joined:/i) && joined=='') { joined=stuffArray[s]; } var loc; if (stuffArray[s].match(/location:/i) && loc=='') { loc=stuffArray[s]; } var postcount; if (stuffArray[s].match(/posts:/i) && postcount=='') { postcount=stuffArray[s]; } var gender; if (stuffArray[s].match(/gender:/i) && gender=='') { gender=stuffArray[s]; } var karma; if (stuffArray[s].match(/karma:/i) && karma=='') { karma=stuffArray[s]; } } avAreaStuff=tds[e].getElementsByTagName('center'); if (avAreaStuff[0]) { if (avAreaStuff[0].firstChild.nodeName.match(/img/i)) avt=avAreaStuff[0].firstChild; contacts=avAreaStuff[0].getElementsByTagName('a'); brks=avAreaStuff[0].getElementsByTagName('br'); for (br=0; br<brks.length; br++) { if (brks.nextSibling && brks.nextSibling.nodeName.match(/br/i)) { if (brks.nextSibling.nextSibling && brks.nextSibling.nextSibling.nodeName.match(/text/i)) { ptext=brks.nextSibling.nextSibling.nodeValue; break; } } } } // ok.. whew teampick=0; if (ptext && ptext.match(/\[Sj1:(\d+)\]/)) { teampick=RegExp.$1-1; ptext=ptext.replace(/\[Sj1:(\d+)\]/,''); } for (dv=tds[e].getElementsByTagName('div'), d=0; d<dv.length; d++) { if (dv[d].className=='miniprofile') jerseyback=dv[d].firstChild; } bgJersColors=jerseyColors[teampick]; postCell=tds[e].nextSibling; nwRw=postCell.firstChild.insertRow(1); nwRw.insertCell(0); nwRw.cells[0].colSpan=3; nwRw.cells[0].style.height='25'; nwRw.onclick=function() {pb_bubble=1; this.nextSibling.nextSibling.style.display='none'; this.nextSibling.style.display='';} nwTbl=nwRw.cells[0].appendChild(document.createElement('table')); nwTbl.width='100%'; nwRw=nwTbl.insertRow(0); nwRw.insertCell(0);nwRw.insertCell(0);nwRw.insertCell(0); nwRw.cells[0].width=nwRw.cells[1].width=nwRw.cells[2].width='33%' nwRw.cells[0].align='left'; nwRw.cells[0].innerHTML=rank+" "+stars; nwRw.cells[1].align='center'; nwRw.cells[1].innerHTML=warn+" "+warnbar; nwRw.cells[2].align='right'; nwRw.cells[2].innerHTML=status; tds[e].style.display="none"; postCell.colSpan=2;
// hidden row nwRw=postCell.firstChild.insertRow(2); nwRw.style.display='none'; nwRw.onclick=function() {this.nextSibling.style.display=''; this.style.display='none'; pb_bubble=0;} nwRw.insertCell(0); nwRw.cells[0].colSpan=3; nwRw.cells[0].align='center'; nwTbl=nwRw.cells[0].appendChild(document.createElement('table')); nwTbl.width='674'; nwTbl.style.height='400'; nwTbl.style.backgroundImage='url('+bgJersColors+')'; nwTbl.cellSpacing="0"; nwRw=nwTbl.insertRow(0); nwRw.insertCell(0);nwRw.insertCell(0);nwRw.insertCell(0);nwRw.insertCell(0); nwRw.cells[0].align=nwRw.cells[1].align=nwRw.cells[2].align=nwRw.cells[3].align='center'; nwRw.cells[0].style.color=nwRw.cells[1].style.color=nwRw.cells[2].style.color=nwRw.cells[3].style.color='000000'; nwRw=nwTbl.insertRow(0); nwRw.insertCell(0);nwRw.insertCell(0);nwRw.insertCell(0);nwRw.insertCell(0); nwRw.cells[0].align=nwRw.cells[1].align=nwRw.cells[2].align=nwRw.cells[3].align='center'; nwRw.cells[0].style.color=nwRw.cells[1].style.color=nwRw.cells[2].style.color=nwRw.cells[3].style.color='000000'; nwRw=nwTbl.insertRow(0); nwRw.insertCell(0);nwRw.insertCell(0);nwRw.insertCell(0);nwRw.insertCell(0); nwRw.cells[0].align=nwRw.cells[1].align=nwRw.cells[2].align=nwRw.cells[3].align='center'; nwRw.cells[0].style.color=nwRw.cells[1].style.color=nwRw.cells[2].style.color=nwRw.cells[3].style.color='000000';
nwRw.cells[0].width='20%'; nwRw.cells[1].width='30%'; nwRw.cells[2].width='30%' nwTbl.rows[0].cells[0].style.height='75'; nwTbl.rows[1].cells[0].style.height='10'; nwTbl.rows[2].cells[0].style.height='120'; nwRw.cells[3].innerHTML=joined+"<br>"+postcount+"<br>"+karma+"<br>"+gender+"<br>"; nwTbl.rows[1].cells[2].innerHTML=auth; nwTbl.rows[1].cells[2].align='center'; nwTbl.rows[1].cells[2].vAlign='bottom'; if (jerseyback) nwTbl.rows[0].cells[1].appendChild(jerseyback); nwTbl.rows[0].cells[1].vAlign='bottom'; if (avt) nwTbl.rows[2].cells[1].appendChild(avt); if (ptext) { nwTbl.rows[2].cells[1].appendChild(document.createElement('br')); nwTbl.rows[2].cells[1].appendChild(document.createTextNode(ptext)); } jerseynum="00"; if (loc.match(/%(\d+)%/)) { jerseynum=RegExp.$1; loc=loc.replace(/%(\d+)%/, '') } jersStuff="<font style='font-size:56'>"+jerseynum+ "</font><br>"; nwTbl.rows[2].cells[2].innerHTML=jersStuff+loc.replace(/location:/i,''); nwTbl.rows[2].cells[2].align='center'; nwTbl.rows[2].cells[2].vAlign='top'; if (contacts.length>0) { for (c=0;c<contacts.length; c++) {nwTbl.rows[2].cells[3].appendChild(contacts[c]); nwTbl.rows[2].cells[3].appendChild(document.createElement('br')); } } } } }
// --> </script>
and the line in the logo code that needs to change:
iTd.item(i).innerHTML=iTd.item(i).innerHTML.replace(/\[Sj1:(\d+)\]/g, '');
needs to be:
if (!location.href.match(/board=/)) iTd.item(i).innerHTML=iTd.item(i).innerHTML.replace(/\[Sj1:(\d+)\]/g, '');
|
|
|
Post by Wormopolis on Jan 25, 2010 21:47:06 GMT -8
also: logo code MUST run before the post remodel or it wont find the logo.
|
|