function displayNotification() { include_once "includes/mail.include.php"; processNotifications(); $id = isset($_SESSION['sid']) ? $_SESSION['sid'] : $_SESSION['mid']; $scientist = isset($_SESSION['sid']); // find the number of unread notifications $notifications = getNotificationCount($id, $scientist); // find the number of unread messages; $unreadMessages = getMessageCount($id, $scientist)['unread']; if ($notifications > 0 || $unreadMessages > 0) { echo "<div id='warnmessage'>\n"; if ($notifications > 0) { echo "" . _("Attention: You have") . " {$notifications} " . _("new notifications") . ". <a href='notifications.php'> " . _("View") . "</a>.<br>"; } if ($unreadMessages > 0) { echo "" . _("Attention: You have") . " {$unreadMessages} " . _("new messages") . ". <a href='inbox.php'> " . _("View") . "</a>.<br>"; } echo "</div>\n"; echo "<br />\n"; } $query = "UPDATE Notifications SET status = 1 WHERE status = 0 AND mid = " . $_SESSION['mid'] . ";"; $result = mysql_query($query); }
/** * getPluginName * * Given the name of the section from the db, returns the translated text * * @param string $section * @return string */ function getPluginName($section) { switch ($section) { case 'admin_awards': return T_('Awards'); break; case 'admin_configuration': return T_('Configuration'); break; case 'admin_facebook': return 'Facebook'; break; case 'admin_foursquare': return 'Foursquare'; break; case 'admin_google': return 'Google'; break; case 'admin_instagram': return 'Instagram'; break; case 'admin_members': return T_('Members'); break; case 'admin_photogallery': return T_('Photo Gallery'); break; case 'admin_polls': return T_('Polls'); break; case 'admin_scheduler': return T_('Scheduler'); break; case 'admin_upgrade': return T_('Upgrade'); break; case 'admin_vimeo': return 'Vimeo'; break; case 'admin_whereiseveryone': return 'Foursquare'; break; case 'admin_youtube': return 'Google'; break; case 'addressbook': return T_('Address Book'); break; case 'calendar': return T_('Calendar'); break; case 'chat': return T_('Chat'); break; case 'contact': return T_('Contact Webmaster'); break; case 'documents': return T_('Documents'); break; case 'familynews': return T_('Family News'); break; case 'help': return T_('Help'); break; case 'messageboard': return T_('Message Board'); break; case 'members': return T_('Members'); break; case 'notification': return T_('Notifications') . getNotificationCount(); break; case 'photogallery': return T_('Photo Gallery'); break; case 'prayers': return T_('Prayers'); break; case 'profile': return T_('Profile'); break; case 'pm': return T_('Private Messages') . getPMCount(); break; case 'recipes': return T_('Recipes'); break; case 'settings': return T_('Settings'); break; case 'tree': return T_('Family Tree'); break; case 'videogallery': return T_('Video Gallery'); break; case 'whereiseveryone': return T_('Where Is Everyone'); break; default: return 'error'; break; } }