Post by Justin on Sept 5, 2011 8:03:45 GMT -5
Made this forever ago, updated it around Christmas, It needs another update but I don't feel like updating it Might make a v2 when PBv5 is released .
<table id="pmbar" class="bordercolor" align="center" width="92%" height="5%" cellpadding="0" cellspacing="1" style="position: relative; bottom: 1px;">
<tr>
<td id="Left_Cell" class="menubg" width="100%">
</td>
<td class="menubg" width="50%">
</td>
</tr>
</table>
<script type="text/javascript">
<!--
/* ---------------------------------------------------------------------------------
Justin's PM bar - Special thanks to Wrighty, Alex, and James for the help.
do not repost without permission from the author [justin@justinsherrard.info]
Last Update - 12/30/10
--------------------------------------------------------------------------------------
*/
var Left_Cell=document.getElementById('Left_Cell');
if(pb_username=="Guest"){
Left_Cell.innerHTML='<div style="float:left">Welcome Guest</div> <div style="float:right"> <a href=\"/index.cgi?action=login\">Please Login</a> <a href=\"/index.cgi?action=register\">or Register</a> |<a href=\"/index.cgi?action=forgotpassword\">Forgot Password</a></div>';
}else if(pb_username!="Guest"){
var Message_Font=document.getElementsByTagName('font').item(2).innerHTML;
var New_Messages=(Message_Font.match(/<\/a>, (.+?) (is|are) new./i))? RegExp.$1 : '';
var Total_Messages=(Message_Font.match(/>(.+?) message(s)?<\/a>/i))? RegExp.$1 : '';
if(New_Messages==1){
var idkwhattonamethis = '';
}else{
var idkwhattonamethis = 's';
}
Left_Cell.innerHTML='<div style="float:left">Welcome <a href=\"/index.cgi?action=viewprofile\">' + pb_displayname + '</a> , you have <a href=\"/index.cgi?action=pm\"> ' + New_Messages + '</a> new message' + idkwhattonamethis + ' and a total of <a href=\"/index.cgi?action=pm\"> ' + Total_Messages + '</a> Message' + idkwhattonamethis + ' </div> <div style="float:right"> <a href=\"/index.cgi?action=modifyprofile&user=' + pb_username + '\">Modify Profile</a> | <a href=\"/index.cgi?action=pmprefs\">PM Preferences</a> | <a href=\"/index.cgi?action=pmsend\">Compose</a> </div>';
}
document.getElementsByTagName('body').item(0).insertBefore(document.getElementById('pmbar'), document.getElementsByTagName('table').item(0).nextSibling);
//-->
</script>