PDA

View Full Version : Flashing new PM'S


FRANKTHETANK 2
03-23-2007, 06:43 PM
I have this code that makes pm's flash, my buddy made this in java and now i have no clue were to put it. I was gonna share this if someone can tell me what template to put it in.

<script>//
userLinks=document.getElementById('userlinks');
if(userLinks.innerHTML.match("Inbox"))
{
newMsg=false;
a=userLinks.getElementsByTagName("A");
for(i=0;i<a.length;i++)if(a[i].innerHTML.match(/Inbox\s\([0-9]+\)/)&&a[i].innerHTML.match(/[0-9]+/)>0)newMsg=i;
if(newMsg)
{
inbox=a[newMsg];
inbox.style.fontWeight="Bold";
inbox.style.color="Red";
flash();
}
}
function flash()
{
if(inbox.style.visibility=="hidden")inbox.style.vi sibility="visible";
else inbox.style.visibility="hidden";
setTimeout("flash()",500)
}
</script>

FRANKTHETANK 2
03-25-2007, 06:52 PM
anyone?

MaestroX
03-25-2007, 07:36 PM
I would paste the code into your "headerinclude" template right at the bottom. That should work :)

But i'm wondering why you are choseing to use a script when a vb template conditional will do just fine. Any reason?

FRANKTHETANK 2
03-26-2007, 05:45 PM
Caz i could't find anything. I have no patience, once i look through 5 pages I give up. Bad trait to have on such a big site. Can you give me a name of something i can use.

MaestroX
03-28-2007, 03:49 PM
You can use this conditional in your template:

<if condition="$bbuserinfo['pmunread']">
<a href="private.php?$session[sessionurl]" rel="nofollow"><img src="$stylevar[imgdir_misc]/newpm.gif" alt="You have a new PM" border="0" align="right" /></a> </if>

It will display an image when a user has an uread pm. This can be modified to anything you need. :)