inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jun 5, 2005 3:54:14 GMT -8
Simple code. Will show a button in the menu which will change depending on if you have new privates messages. Just follow the instructions in the top of the script.
Add this to your global header.
<script type="text/javascript"> <!--
// New/No new PM button in menu
// Image to show there are new private messages var newPM = "URL HERE";
// Image to show there are no new private messages var noPM = "URL HERE";
var pmLink = document.createElement("a"); var pmImg = document.createElement("img"); var pmCell = document.getElementsByTagName("td").item(2).innerHTML;
pmLink.href = "index.cgi?action=pm"; pmImg.border = "0";
if(pmCell.match(/you have <.+?>, (\d+) /i)){ switch(RegExp.$1){ case "0" : pmImg.src = noPM; pmImg.title = "You have no new private messages."; break; case "1" : pmImg.src = newPM; pmImg.title = "You have 1 new private message."; break; default : pmImg.src = newPM; pmImg.title = "You have " + RegExp.$1 + " new private messages."; } pmLink.appendChild(pmImg); document.getElementsByTagName("td").item(5).appendChild(pmLink); }
//--> </script>
|
|