diff --git a/e107_plugins/pm/private_msg_menu.php b/e107_plugins/pm/private_msg_menu.php index dc629a55f..b59655d15 100755 --- a/e107_plugins/pm/private_msg_menu.php +++ b/e107_plugins/pm/private_msg_menu.php @@ -26,6 +26,54 @@ if (!defined('e107_INIT')) { exit; } if (!e107::isInstalled('pm')) { return ''; } +/** + * Function to show a popup (if enabled) when new PMs arrive. + * + * @param array $pm_inbox - information about current state of inbox + * @param int $alertdelay - delay between popups, in seconds (defaults to 60 if pref not set) + * + * @return string - text for display + * + * @todo - check JS - may be some problems, especially if using debug in FF + */ +if(!function_exists('pm_show_popup')) +{ + function pm_show_popup($pm_inbox, $alertdelay = 0) + { + if($alertdelay == 0) { $alertdelay = 60; } + setcookie('pm-alert', 'ON', time()+$alertdelay); + $popuptext = " + +
+
+ --- ".LAN_PM." --- ".$pm_inbox['inbox']['new'].' '.LAN_PM_109." ".$pm_inbox['inbox']['unread'].' '.LAN_PM_37." + + |
+
- --- ".LAN_PM." --- ".$pm_inbox['inbox']['new'].' '.LAN_PM_109." ".$pm_inbox['inbox']['unread'].' '.LAN_PM_37." - - |
-