Post by Nick on Aug 5, 2008 23:45:17 GMT -5
BUG FIXED! The code now Cross Browser!
The Top Pm Bar V3 is now here! Some of the new features included from V2 are:
-- Please remember that the forum time does not display for guests.
This is a month early, so I hope you enjoy. You can use this or V2. But this one has a few more features, and I fixed a little glitch it would have at random times in V2. Although, I do not reccomend V1 because that has a few minor glitches.
So enough with that, time for the code.
Preview: Click Here
GLOBAL HEADERS!
<style type="text/css">
span
{
font-family: Arial;
font-size: 12px;
}
</style>
<script>
/*
Top Pm Bar V3
Created by Nick
Special Thanks to Wrighty
This code is copyrighted 2008 by
nbCircuits
and toppmbarv3.proboards.com/
*/
var GName = "Guest";
var get = document.getElementsByTagName("TD");
var pb_time = document.getElementsByTagName('font')[2].innerHTML.split(/<br\s?\/?>/i)[1];
document.getElementsByTagName('td').item(2).style.display="none";
if(pb_username == 'Guest'){
var Message = '<span><center>Welcome '+GName+', Please <a href=index.cgi?action=login>Login</a> or <a href=index.cgi?action=register>Register</a>.</center></span>';
}else{
if(get[2].innerHTML.match(/, (\d+)\ (are|is) new./i)){
pmNew = RegExp.$1;
}
var Message = '<span><center>Welcome <a href=/index.cgi?action=viewprofile>'+pb_displayname+'</a>, You Have <a href=/index.cgi?action=pm>'+pmNew+' New Message(s)</a>. It is currently '+pb_time+'</center></span>';
}
var pmBar = document.getElementsByTagName("table")[0].insertRow(0);
var pmCell = pmBar.insertCell(0) ;
pmCell.className="catbg";
pmCell.innerHTML = Message;
</script>
How To Edit:
Change the font in brown to the font that you would like to be displayed. It is set to a default to Arial
Change this variable to how many pixels you want your font to be. It is set to a default of 12 px
The will be the guest name. Whatever you want your guest to be called. Like, Loner for a cat site, Stray for a wolf site, ect.
I hope you enjoy this code. And I give a special thanks to Wrighty for helping me with the time function. V4 will be out this September or so and I am starting the code right now.
The Top Pm Bar V3 is now here! Some of the new features included from V2 are:
- Ability to set font size in pixels
- Ability to set custom font style
- View time in the bar
- Less bugs/glitches
-- Please remember that the forum time does not display for guests.
This is a month early, so I hope you enjoy. You can use this or V2. But this one has a few more features, and I fixed a little glitch it would have at random times in V2. Although, I do not reccomend V1 because that has a few minor glitches.
So enough with that, time for the code.
Preview: Click Here
GLOBAL HEADERS!
<style type="text/css">
span
{
font-family: Arial;
font-size: 12px;
}
</style>
<script>
/*
Top Pm Bar V3
Created by Nick
Special Thanks to Wrighty
This code is copyrighted 2008 by
nbCircuits
and toppmbarv3.proboards.com/
*/
var GName = "Guest";
var get = document.getElementsByTagName("TD");
var pb_time = document.getElementsByTagName('font')[2].innerHTML.split(/<br\s?\/?>/i)[1];
document.getElementsByTagName('td').item(2).style.display="none";
if(pb_username == 'Guest'){
var Message = '<span><center>Welcome '+GName+', Please <a href=index.cgi?action=login>Login</a> or <a href=index.cgi?action=register>Register</a>.</center></span>';
}else{
if(get[2].innerHTML.match(/, (\d+)\ (are|is) new./i)){
pmNew = RegExp.$1;
}
var Message = '<span><center>Welcome <a href=/index.cgi?action=viewprofile>'+pb_displayname+'</a>, You Have <a href=/index.cgi?action=pm>'+pmNew+' New Message(s)</a>. It is currently '+pb_time+'</center></span>';
}
var pmBar = document.getElementsByTagName("table")[0].insertRow(0);
var pmCell = pmBar.insertCell(0) ;
pmCell.className="catbg";
pmCell.innerHTML = Message;
</script>
How To Edit:
Change the font in brown to the font that you would like to be displayed. It is set to a default to Arial
Change this variable to how many pixels you want your font to be. It is set to a default of 12 px
The will be the guest name. Whatever you want your guest to be called. Like, Loner for a cat site, Stray for a wolf site, ect.
I hope you enjoy this code. And I give a special thanks to Wrighty for helping me with the time function. V4 will be out this September or so and I am starting the code right now.