Luke
Code Helper
^.^
Posts: 6
Luke said 0 great things
|
Post by Luke on Jul 3, 2009 6:13:01 GMT -8
Browser Tested: IE and FF 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:GuestsNo New Private Messages1 New Private Messagex New Private MessagesPlacement: 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.
|
|
¢ØRTÄñÄ
Not New Member
Keep your head down, there's two of us in here now!
Posts: 10
¢ØRTÄñÄ said 0 great things
|
Post by ¢ØRTÄñÄ on Jan 12, 2010 21:52:06 GMT -8
Previews are dead!
|
|
|
Post by Wormopolis on Jan 13, 2010 0:56:10 GMT -8
Luke has those stored so we will have to wait until he sees this to fix that.
|
|