I wrote this hack for my board but didn't add another table to the database...think my way is a little more simple since it requires no DB change but the end result is the same.
In global.php
after:
// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));
I put:
PHP Code:
// Start Glow PM in Header Hack
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[user
id] AND messageread=0 AND folderid=0 $ignoreusers");
if ($unreadpm['messages']==0) {
$pmglow='PM';
} else {
$pmglow='<font color="red">New PM\'s</font>';
}
then in the header file just replace where the text that says PM is with the variable $pmglow and if the messages are unread it glows in red
New PM's and if all messages have been read than it just reads "PM" in the regular color.
If you are using an image you can change the attribute for $pmglow to swap out the image or put an effect on it...whatever you like.