We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Facebook-esque Message Notification on Page
Topic Started: Dec 17 2011, 04:12 PM (523 Views)
Ulti
Member Avatar
Member
[ *  * ]
Board Address: http://s7.zetaboards.com/Burnin_Rubber/
Board Software: ZetaBoards
Description: On Facebook, if you get a notification or message, the page title will go from "Facebook" to "Facebook (1)" or however many notifications/messages you have unseen; I believe Twitter does the same thing.

I'm looking for a code that, whenever a user gets a new message in his or her inbox, they too will get a number in parentheses in the page titles of the site until they read it. So, my board's name is Burning Rubber, when they have a new message, the page title will read as "Burning Rubber (1)",
the Off-Topic Forum will go to "Off-Topic Forum (1)" and so on.
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
Place this in Above the Board
Code:
 
<script type='text/javascript'>
var PM = $('#menu_pm strong small');
if(PM.length && PM.text() != "0"){
$('title').text($('title').text()+" ("+ PM.text()+")");
}
</script>
Offline Profile Goto Top
 
Ulti
Member Avatar
Member
[ *  * ]
Worked perfectly!! Thanks. :D
Offline Profile Goto Top
 
Lout-ZNR
Member Avatar
He came, he saw...
[ *  *  * ]
Will that still work if the message is unread but the PM Toast has gone due to a reload or page switch?
Offline Profile Goto Top
 
Ulti
Member Avatar
Member
[ *  * ]
PM Toast?
If I go to a new page and didn't read the PM, the (1) is still there.
Edited by Ulti, Dec 17 2011, 09:59 PM.
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
Lout
Dec 17 2011, 09:58 PM
Will that still work if the message is unread but the PM Toast has gone due to a reload or page switch?
Yes, it sees if there is a PM by looking at the number next to the inbox, the PM toast only lasts for one page and that page needs to be ready before the toast appears so if the user changes page before the page is ready then the toast will never show :( so the only way to accurately see if there is a PM is by looking at the number of unread PMs.
Edited by Quozzo, Dec 17 2011, 10:42 PM.
Offline Profile Goto Top
 
Brendan
Member Avatar


Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic