Post by Nick on Dec 21, 2009 15:57:59 GMT -5
The Top Pm Bar V4+ is released! Our mission for V4+ was to make the code more user friendly and have less potential bugs. Here are the new features:
GLOBAL HEADERS:
<style type="text/css">
#mypms {font-family: Arial; font-size: 12px;}
</style>
<script type="text/javascript">
<!--
/* Top Pm Bar V4+
Created by Nick
This code is copyrighted 2009 by
nbCircuits
Streamlined by Subdevo
and toppmbarv4plus.proboards.com/
*/
var GName="Guest";
var displayil=1; // Display Important Links? 1=Yes, 0=No
var imURLS=[]; // DO NOT TOUCH THIS LINE
imURLS[0]=["http://www.google.com","Google"];
imURLS[1]=["http://www.proboards.com","ProBoards"];
imURLS[2]=["http://www.gmail.com","Gmail"];
var get=document.getElementsByTagName("td")[2]; get.style.display="none";
var wel="<center>Welcome "; var sa="<a href=/index.cgi?action="; var nx="";
var pb_time=document.getElementsByTagName('font')[2].innerHTML.split(/<br\s?\/?>/i)[1];
for(var x=0;x<imURLS.length;x++){nx+='<option value="'+imURLS[x][0]+'">'+imURLS[x][1]+'<\/option>';}
var imlinks="<br /><select onchange=\"document.location.href=this.value\"><option selected=\"selected\">Important Links<\/option>";
imlinks=(displayil)?(imlinks+nx+"<\/select>"):"";
pb_time='</a>. It is currently '+pb_time+'. '+imlinks+'</center>';
var Message=GName+', Please '+sa+'login>Login</a> or '+sa+'register>Register';
if(pb_username!="Guest"){
if(get.innerHTML.match(/, (\d+)\ (are|is) new./i)){pmNew=RegExp.$1;}
Message=sa+'viewprofile>'+pb_displayname+'</a>, You Have '+sa+'pm>'+pmNew+' New Message(s)';
}
Message=wel+Message+pb_time; var pmCell=document.createElement("div");
with(pmCell){id="mypms"; className="catbg"; innerHTML=Message;}
var tb=document.getElementsByTagName("table")[1];
tb.parentNode.insertBefore(pmCell,tb);
//-->
</script>
The part of the code in red is what you want to appear in the top pm bar when guests come to your site. You can change it to outsider or whatever else you would like.
The part in Green is an option for if you want to display the important links dropdown menu or not. Put the number 1 there to keep the Important links on, and put in a 0 if you don't want the important links to show
The code in blue is what will display in your important links dropdown. It coes to the following layout:
imURLS[NEXT NUMBER]=["URL","NAME OF SITE]
The next number part is the number that follows the number in the last important link line.
Bugs --
- Uses HTML Comment code so if the page doesn't load correctly, you won't see a bunch of ugly code
- CSS Span has been changed to mypms to reduce potential bugs due to the fact that span is commonly used in other codes
- Many lines have been shortened so the code is more compact and uses less space
- Adding Important links is way easier
GLOBAL HEADERS:
<style type="text/css">
#mypms {font-family: Arial; font-size: 12px;}
</style>
<script type="text/javascript">
<!--
/* Top Pm Bar V4+
Created by Nick
This code is copyrighted 2009 by
nbCircuits
Streamlined by Subdevo
and toppmbarv4plus.proboards.com/
*/
var GName="Guest";
var displayil=1; // Display Important Links? 1=Yes, 0=No
var imURLS=[]; // DO NOT TOUCH THIS LINE
imURLS[0]=["http://www.google.com","Google"];
imURLS[1]=["http://www.proboards.com","ProBoards"];
imURLS[2]=["http://www.gmail.com","Gmail"];
var get=document.getElementsByTagName("td")[2]; get.style.display="none";
var wel="<center>Welcome "; var sa="<a href=/index.cgi?action="; var nx="";
var pb_time=document.getElementsByTagName('font')[2].innerHTML.split(/<br\s?\/?>/i)[1];
for(var x=0;x<imURLS.length;x++){nx+='<option value="'+imURLS[x][0]+'">'+imURLS[x][1]+'<\/option>';}
var imlinks="<br /><select onchange=\"document.location.href=this.value\"><option selected=\"selected\">Important Links<\/option>";
imlinks=(displayil)?(imlinks+nx+"<\/select>"):"";
pb_time='</a>. It is currently '+pb_time+'. '+imlinks+'</center>';
var Message=GName+', Please '+sa+'login>Login</a> or '+sa+'register>Register';
if(pb_username!="Guest"){
if(get.innerHTML.match(/, (\d+)\ (are|is) new./i)){pmNew=RegExp.$1;}
Message=sa+'viewprofile>'+pb_displayname+'</a>, You Have '+sa+'pm>'+pmNew+' New Message(s)';
}
Message=wel+Message+pb_time; var pmCell=document.createElement("div");
with(pmCell){id="mypms"; className="catbg"; innerHTML=Message;}
var tb=document.getElementsByTagName("table")[1];
tb.parentNode.insertBefore(pmCell,tb);
//-->
</script>
The part of the code in red is what you want to appear in the top pm bar when guests come to your site. You can change it to outsider or whatever else you would like.
The part in Green is an option for if you want to display the important links dropdown menu or not. Put the number 1 there to keep the Important links on, and put in a 0 if you don't want the important links to show
The code in blue is what will display in your important links dropdown. It coes to the following layout:
imURLS[NEXT NUMBER]=["URL","NAME OF SITE]
The next number part is the number that follows the number in the last important link line.
Bugs --