rocan
Not New Member
Posts: 5
rocan said 0 great things
|
Post by rocan on May 31, 2012 11:18:03 GMT -8
I found this code that had been made at a user request. I love the code, but I'd like to have it show the username, usergroup, and icon. Right now it just shows user name and icon, if someone could edit the code to display the usergroup as well that would be awesome!
<script type="text/javascript"> <!-- // stripped down MP v1.0 // by Wormopolis - [url]www.wormocodes.com[/url] // do not repost- keep header intact // request by doxl
var usersWhoCanSeeFullMP="admin|user2|user3"; //seperate by |
var uwcs=new RegExp('^('+usersWhoCanSeeFullMP+')$','');
if (pb_action.match(/(display|search2|viewprofile)/) && !pb_username.match(uwcs)) { for (tds=document.getElementsByTagName('td'), cc=0; cc<tds.length; cc++) { if (tds[cc].width=='20%' && tds[cc].className.match(/windowbg/) && tds[cc].vAlign=='top') { if (tds[cc].innerHTML.match(/<br>Guest<br>/i)) { var gname=tds[cc].getElementsByTagName('a')[1].nextSibling.nodeValue+' (Guest)'; tds[cc].innerHTML=gname; } else { var uname=tds[cc].getElementsByTagName('b')[0].cloneNode(true); var avtr=tds[cc].getElementsByTagName('center')[0].firstChild.cloneNode(true); tds[cc].innerHTML=''; tds[cc].appendChild(uname); tds[cc].appendChild(document.createElement('br')); tds[cc].appendChild(document.createElement('br')); var nwcntr = tds[cc].appendChild(document.createElement('center')); nwcntr.appendChild(avtr); } } } }
// --> </script>
|
|
|
Post by Wormopolis on May 31, 2012 20:05:50 GMT -8
try this
<script type='text/javascript'> <!-- // stripped down MP v1.1 // by Wormopolis - [url]www.wormocodes.com[/url] // do not repost- keep header intact // request by doxl
var usersWhoCanSeeFullMP='admin|user2|user3'; //seperate by |
var uwcs=new RegExp('^('+usersWhoCanSeeFullMP+')$','');
if (pb_action.match(/(display|search2|viewprofile)/) && !pb_username.match(uwcs)) { for (tds=document.getElementsByTagName('td'), cc=0; cc<tds.length; cc++) { if (tds[cc].width=='20%' && tds[cc].className.match(/windowbg/) && tds[cc].vAlign=='top') { if (tds[cc].innerHTML.match(/<br>Guest<br>/i)) { var gname=tds[cc].getElementsByTagName('a')[1].nextSibling.nodeValue+' (Guest)'; tds[cc].innerHTML=gname; } else { var uname=tds[cc].getElementsByTagName('b')[0].cloneNode(true); var gname=tds[cc].getElementsByTagName('b')[0].nextSibling.nextSibling.cloneNode(true); var avtr=tds[cc].getElementsByTagName('center')[0].firstChild.cloneNode(true); tds[cc].innerHTML=''; tds[cc].appendChild(uname); tds[cc].appendChild(document.createElement('br')); tds[cc].appendChild(gname); tds[cc].appendChild(document.createElement('br')); tds[cc].appendChild(document.createElement('br')); var nwcntr = tds[cc].appendChild(document.createElement('center')); nwcntr.appendChild(avtr); } } } }
// --> </script>
|
|
rocan
Not New Member
Posts: 5
rocan said 0 great things
|
Post by rocan on May 31, 2012 22:06:36 GMT -8
THIS WORKS BEAUTIFULLY! Thanks you so much, this is exactly what I wanted and allowed me to remove several codes I had in place to try and do the same thing.
|
|
|
Post by Wormopolis on May 31, 2012 23:11:48 GMT -8
might wan tto change the version info up in the header to 1.1 so it doesnt get mixed up with another version
|
|
rocan
Not New Member
Posts: 5
rocan said 0 great things
|
Post by rocan on Jun 1, 2012 0:55:50 GMT -8
Edited it to say v1.1 in my global. Thanks again!
|
|