Post by Luke on Jun 27, 2009 8:25:42 GMT -8
Description: This will place PM text (viewed in example) anywhere you want. Perfect for people who have tables and want to incorporated there PM menu in there.
Preview:
Guests
No New Private Messages
1 New Private Message
x New Private Messages
Placement: Wherever you want the PM text to display.
Style: The PM text has a id of "pmtext" if you want to use CSS to style it.
<script type="text/javascript">
<!--
/* Anywhere PM Text V1*/
/* By Luke */
/* support.proboards.com/ */
/* Open Source */
var bar = " <b>|</b> <a href='/index.cgi?action=pm&view=2'>Outbox</a> <b>|</b> <a href='/index.cgi?action=pmprefs'>Preferences</a> <b>|</b> <a href='/index.cgi?action=pmsend'>Send Private Message</a></font>";
var td = document.getElementsByTagName('td');
document.write("<div id='pmtext' align='center'>");
if(td[2].innerHTML.match(/, (\d+)\ (are|is) new./i)){
var newPM = RegExp.$1;
}
if(pb_username!='Guest'){
if(!document.cookie.match(/PMs=/)){
document.cookie="PMs="+newPM+"&alt=yes;";
} else {
cookPM = document.cookie.split('PMs=')[1].split('&')[0];
if(cookPM!=newPM){
document.cookie='PMs='+newPM+'&alt=yes;';
}
}
if(newPM>1){
document.write("<font size=1><a href='/index.cgi?action=pm'>" + newPM + " New Private Messages</a>" + bar);
} else if(newPM==1){
document.write("<font size=1><a href='/index.cgi?action=pm'>1 New Private Message</a>" + bar);
} else {
document.write("<font size =1><a href='/index.cgi?action=pm'>No New Private Messages</a>" + bar);
}
document.cookie="PMs="+newPM+"&alt=no;";
} else {
document.write("<font size=1>Welcome Guest, Please <a href='/index.cgi?action=login'><b>Login</b></a> or <a href='/index.cgi?action=register'><b>Register</b></a> to view Private Messages.");
}
document.write("</div>");
document.getElementsByTagName("font")[1].style.display='none';
document.getElementsByTagName("td")[2].style.display='none';
//-->
</script>
Remove the blue if not wanted to center.
PM me if you need help.
Preview:
Guests
No New Private Messages
1 New Private Message
x New Private Messages
Placement: Wherever you want the PM text to display.
Style: The PM text has a id of "pmtext" if you want to use CSS to style it.
<script type="text/javascript">
<!--
/* Anywhere PM Text V1*/
/* By Luke */
/* support.proboards.com/ */
/* Open Source */
var bar = " <b>|</b> <a href='/index.cgi?action=pm&view=2'>Outbox</a> <b>|</b> <a href='/index.cgi?action=pmprefs'>Preferences</a> <b>|</b> <a href='/index.cgi?action=pmsend'>Send Private Message</a></font>";
var td = document.getElementsByTagName('td');
document.write("<div id='pmtext' align='center'>");
if(td[2].innerHTML.match(/, (\d+)\ (are|is) new./i)){
var newPM = RegExp.$1;
}
if(pb_username!='Guest'){
if(!document.cookie.match(/PMs=/)){
document.cookie="PMs="+newPM+"&alt=yes;";
} else {
cookPM = document.cookie.split('PMs=')[1].split('&')[0];
if(cookPM!=newPM){
document.cookie='PMs='+newPM+'&alt=yes;';
}
}
if(newPM>1){
document.write("<font size=1><a href='/index.cgi?action=pm'>" + newPM + " New Private Messages</a>" + bar);
} else if(newPM==1){
document.write("<font size=1><a href='/index.cgi?action=pm'>1 New Private Message</a>" + bar);
} else {
document.write("<font size =1><a href='/index.cgi?action=pm'>No New Private Messages</a>" + bar);
}
document.cookie="PMs="+newPM+"&alt=no;";
} else {
document.write("<font size=1>Welcome Guest, Please <a href='/index.cgi?action=login'><b>Login</b></a> or <a href='/index.cgi?action=register'><b>Register</b></a> to view Private Messages.");
}
document.write("</div>");
document.getElementsByTagName("font")[1].style.display='none';
document.getElementsByTagName("td")[2].style.display='none';
//-->
</script>
Remove the blue if not wanted to center.
PM me if you need help.