Bring the message notification popup back to vB5 with this temporary pure Javascript solution that uses the existing vB5 dialog style.
Add this as an inline script or external js file in the footer template right after the footer rollup js. Or you can make it as a Hook if you want.
Note: If user does not read the new message or delete any notification, the prompt will always appear when any page is loaded. This could be annoying to users.
Enjoy!
Add this as an inline script or external js file in the footer template right after the footer rollup js. Or you can make it as a Hook if you want.
Code:
$(document).ready(function() { if (location.pathname.indexOf('/forum/privatemessage/') == -1) { //don't prompt when in the PM page itself var notifCount = Number($('.notifications-count').first().text()); if (notifCount > 0) { openConfirmDialog({ iconType: 'warning', title: 'New Messages', message: 'You have <strong>' + notifCount + '</strong> new message(s) in the Message Center.<br />Would you like to open it now?', buttonLabel: { yesLabel: 'Open', noLabel: 'Cancel' }, onClickYes: function() { //if you want to open in new window var w = window.open(pageData.baseurl + '/privatemessage/index', '_blank'); if (!w) { openAlertDialog({ title: 'Popup Blocked', message: 'The popup window is blocked. Please unblock or allow popups for ' + location.host + '.' }); } //if you want to open in the same window, remove new window block above, then uncomment this //location.href = pageData.baseurl + '/privatemessage/index'; } }); } } });
Enjoy!
Comment