|
Pm Bar
Sept 17, 2006 21:07:39 GMT
I know its nooby, but its a good open source for people trying to learn JS that and i wasn't gunan submit it to the database LOL <script> //fredy's pm bar //Open Source
var fClassMenu = "windowbg" var hTD=document.getElementsByTagName('TD') var fT = document.getElementsByTagName("table")[0].insertRow(1) var fCell = fT.insertCell(0) fCell.align = "right" fCell.className = fClassMenu
var pms = []; if(hTD[2].innerHTML.match(/>(\d+) messages?<\/a>, (\d+) (are|is)/i)){ pms[0] = RegExp.$1; pms[1] = RegExp.$2; }
if(hTD[2].innerHTML.match(/Guest/i)){ fCell.innerHTML='[User: Guest][<a href="/index.cgi?action=login">Login</a>/<a href="/index.cgi?action=register">Register</a>]' } else { fCell.innerHTML='[User: <a href="/index.cgi?action=viewprofile&user='+pb_username+'">'+pb_displayname+'</a>][Messages: <a href="/index.cgi?action=pm">'+pms[0]+'</a> New: <a href="/index.cgi?action=pm">'+pms[1]+'</a>]' }
</script>
Last Edit: Sept 18, 2006 0:13:43 GMT by Chris
|
k
|
|
|