I use the following code to display the number of unread messages of registered users in the template.
<?php if (messages_get_unread_count() != 0) { ?> <div id="message_count"> <div class="countspan"> <?php echo messages_get_unread_count(); ?> </div> </div> <?php } ?>
This works great, but a page refresh is required for updating. Since I actively use ajax-driven navigation throughout the site and the user applications in it, this is not a satisfactory solution.
How to automatically update the counter?
I played with the "lvive notifications" plugin, which checks srver every 10 seconds to provide live notifications, but of course this does not interact with my custom unread message count.
Any ideas guys? I really could take help.
source share