Post by Cam on Nov 8, 2010 4:05:30 GMT
Wrote this at school today. And this is my 1,000th post ;D
Name of the code: [CB] PM bar text in nav-bar v3
Cross Browser? Sure is, tested in: Chrome, Safari, Firefox and internet explorer Not opera though, (doesn't have it).
What does this code do? This code adds a PM bar like thing to the nav-bar or menu what ever you choose to call it! This version is different than the other ones for a few reasons. This one, if you have NO new messages at all displays something different to if you do have a message. Also, if you have a message, it will display a pop up box saying you have a new message. There is also a PM admin feature which I thought could come to some use ALSO THERE IS ANOTHER COOL FEATURE! This code has a cool thing where if you have one message it will write 1 new message, if you have two it will write 2 new messages Thanks to Russell for pointing that feature out
This is what it looks like if you have one new message:
This is what the alert pop up box looks like:
This is what it looks like with no messages at all:
And with two new messages it looks like this:
If you want to see what it looks like as a guest go here: lukescodetestsite.proboards.com/index.cgi?board=pmm
Editable? Only edit if you know what you are doing, it's only 51 lines of code so it's not too hard to edit if you know what your doing, but if your wanting to re-make this please PM me or reply to this thread first
Code:
<script type="text/javascript">
<!--
//[CB] PM bar text in nav-bar v3
// Made and Copyright Luke - do not repost, claim as own rip etc
// codercommunity.proboards.com
// No editing required at all for this code! Just put in headers and go!
if(pb_username=="Guest"){
var pmtextl = document.getElementsByTagName('td')[5];
pmtextl.innerHTML += '<BR>Hello Guest, please <a href="/index.cgi?action=login">login</a> or <a href="/index.cgi?action=register">register</a>. <a href="/index.cgi?action=forgotpassword" class="guestlinks">Forgot Password?</a> ';
}
else if(pb_username!="Guest"){
var Message_Font=document.getElementsByTagName('font').item(2).innerHTML;
var New_PM=(Message_Font.match(/<\/a>, (.+?) (is|are) new./i))? RegExp.$1 : '';
var Total_PM=(Message_Font.match(/>(.+?) message(s)?<\/a>/i))? RegExp.$1 : '';
if(New_PM==1){
var userhas = '';
}else{
var userhas = 's';
}
var pmtext = document.getElementsByTagName('td')[5];
if(New_PM==0){
pmtext.innerHTML += '<BR>Hello, <a href="/index.cgi?action=viewprofile">'+pb_username+'.</a> You have no new messages.<BR> <a href="/index.cgi?action=pmsend">Compose a new message</a> | <a href="/index.cgi?action=pm&view=2">Outbox</a> | <a href="/index.cgi?action=pmbackup">Backup Messages</a> | <a href="/index.cgi?action=pmprefs">Personal Messages Preferences</a> | <a href="/index.cgi?action=pmsend&to=admin">PM the administrator</a> ';
}
if(New_PM>0){
pmtext.innerHTML += '<BR>Hello, <a href="/index.cgi?action=viewprofile">'+pb_username+'.</a> <a href="/index.cgi?action=pm">You have '+New_Messages+' new message'+userhas+'</a>. '+Total_Messages+' total messages.<BR> <a href="/index.cgi?action=pmsend">Compose a new message</a> | <a href="/index.cgi?action=pm&view=2">Outbox</a> | <a href="/index.cgi?action=pmbackup">Backup Messages</a> | <a href="/index.cgi?action=pmprefs">Personal Messages Preferences</a> | <a href="/index.cgi?action=pmsend&to=admin">PM the administrator</a> ';
}
}
if(New_PM>0){
alert('Hello '+pb_username+'! You have a new personal message!');
}
//-->
</script>
End of code
Copyright information You make not re-post, rip, steal etc. You can not re-make this with out the permission of the creator (ME ;D ) You may not re-post with out my written permission.
Support: Go here if you need any support with this code, do not ask for support in this thread!
Name of the code: [CB] PM bar text in nav-bar v3
Cross Browser? Sure is, tested in: Chrome, Safari, Firefox and internet explorer Not opera though, (doesn't have it).
What does this code do? This code adds a PM bar like thing to the nav-bar or menu what ever you choose to call it! This version is different than the other ones for a few reasons. This one, if you have NO new messages at all displays something different to if you do have a message. Also, if you have a message, it will display a pop up box saying you have a new message. There is also a PM admin feature which I thought could come to some use ALSO THERE IS ANOTHER COOL FEATURE! This code has a cool thing where if you have one message it will write 1 new message, if you have two it will write 2 new messages Thanks to Russell for pointing that feature out
This is what it looks like if you have one new message:
This is what the alert pop up box looks like:
This is what it looks like with no messages at all:
And with two new messages it looks like this:
If you want to see what it looks like as a guest go here: lukescodetestsite.proboards.com/index.cgi?board=pmm
Editable? Only edit if you know what you are doing, it's only 51 lines of code so it's not too hard to edit if you know what your doing, but if your wanting to re-make this please PM me or reply to this thread first
Code:
<script type="text/javascript">
<!--
//[CB] PM bar text in nav-bar v3
// Made and Copyright Luke - do not repost, claim as own rip etc
// codercommunity.proboards.com
// No editing required at all for this code! Just put in headers and go!
if(pb_username=="Guest"){
var pmtextl = document.getElementsByTagName('td')[5];
pmtextl.innerHTML += '<BR>Hello Guest, please <a href="/index.cgi?action=login">login</a> or <a href="/index.cgi?action=register">register</a>. <a href="/index.cgi?action=forgotpassword" class="guestlinks">Forgot Password?</a> ';
}
else if(pb_username!="Guest"){
var Message_Font=document.getElementsByTagName('font').item(2).innerHTML;
var New_PM=(Message_Font.match(/<\/a>, (.+?) (is|are) new./i))? RegExp.$1 : '';
var Total_PM=(Message_Font.match(/>(.+?) message(s)?<\/a>/i))? RegExp.$1 : '';
if(New_PM==1){
var userhas = '';
}else{
var userhas = 's';
}
var pmtext = document.getElementsByTagName('td')[5];
if(New_PM==0){
pmtext.innerHTML += '<BR>Hello, <a href="/index.cgi?action=viewprofile">'+pb_username+'.</a> You have no new messages.<BR> <a href="/index.cgi?action=pmsend">Compose a new message</a> | <a href="/index.cgi?action=pm&view=2">Outbox</a> | <a href="/index.cgi?action=pmbackup">Backup Messages</a> | <a href="/index.cgi?action=pmprefs">Personal Messages Preferences</a> | <a href="/index.cgi?action=pmsend&to=admin">PM the administrator</a> ';
}
if(New_PM>0){
pmtext.innerHTML += '<BR>Hello, <a href="/index.cgi?action=viewprofile">'+pb_username+'.</a> <a href="/index.cgi?action=pm">You have '+New_Messages+' new message'+userhas+'</a>. '+Total_Messages+' total messages.<BR> <a href="/index.cgi?action=pmsend">Compose a new message</a> | <a href="/index.cgi?action=pm&view=2">Outbox</a> | <a href="/index.cgi?action=pmbackup">Backup Messages</a> | <a href="/index.cgi?action=pmprefs">Personal Messages Preferences</a> | <a href="/index.cgi?action=pmsend&to=admin">PM the administrator</a> ';
}
}
if(New_PM>0){
alert('Hello '+pb_username+'! You have a new personal message!');
}
//-->
</script>
End of code
Copyright information You make not re-post, rip, steal etc. You can not re-make this with out the permission of the creator (ME ;D ) You may not re-post with out my written permission.
Support: Go here if you need any support with this code, do not ask for support in this thread!