New - New mail feature...

Joseph M Link link@mcs.anl.gov
Wed, 25 Jul 2001 09:42:14 -0500 (CDT)


Hello,

I just thought I'd share an idea that i have put into IMP.  Specifically, 
notifying the user of email through the title in the taskbar.

Separate the new_mail_popup option from the refresh delay (as it was before, i 
believe)... ie.  if refresh_delay not empty, check mail periodically. if 
newmail_popup is true, throw a popup everytime new mail is found...

regardless of the setting of newmail_popup, the title bar can be changed to 
display the mail status (either on an automatic refresh or manual)...

Here are the changes required for imp/status.php3

imediately after the if{$default->newmail_popup) block, add the following code..
(note, all these lines are intended to be single lines of code

else if($default->refresh_delay > 0)
{
     $script = '<script language="javascript">window.setTimeout
("window.location.reload();", ' .  ($default->refresh_delay * 
1000) . ');</script>';
}

if($mailinfo->unseen > 0)
{
    $script .= '<script language="javascript">window.parent.document.title 
=  "' . $mailinfo->unseen . ' New Messages - IMP";</script>';
}
else
{
    $script .= '<script language="javascript">window.parent.document.title 
= "No New Mail - IMP";</script>';
}


now, you'll know when you have new mail just by looking at the taskbar.

This email was hastily written, so if there are any questions, feel free to ask.


Joe