} ?> <a class="view-detail-links" href="/messages_inbox.php"> Go to Inbox </a> </span> </span> <?php } ?> <?php $tradeNotiIns = new BuckysTradeNotification(); $newMsgNum = $tradeNotiIns->getNumOfNewMessages($userID); if ($newMsgNum) { $newMails = $tradeNotiIns->getReceivedMessages($userID); ?> <span class="notificationLinks" id="trade-notify-icon"> <span class="dropDownNotificationList"> <?php foreach ($newMails as $idx => $row) { $htmlBodyContent = ''; if ($row['activityType'] == BuckysTradeNotification::ACTION_TYPE_OFFER_ACCEPTED) { $actionUrl = '/trade/traded.php'; $htmlBodyContent .= sprintf('<span class="redBold">%s</span>', $row['senderName']); $htmlBodyContent .= sprintf('<span> accepted your </span>'); $htmlBodyContent .= sprintf('<span class="redBold">offer</span>'); } else { if ($row['activityType'] == BuckysTradeNotification::ACTION_TYPE_OFFER_DECLINED) { $actionUrl = '/trade/offer_declined.php'; $htmlBodyContent .= sprintf('<span class="redBold">%s</span>', $row['senderName']);
<?php } else { echo '<span class="notificationLinks no-mails inactive-notify no-data" id="emails-notifications-icon"><span class="dropDownNotificationList"><a href="/messages_inbox.php" class="nodata">No new messages</a></span></span>'; } ?> <?php $tradeNotiIns = new BuckysTradeNotification(); $newMsgFlag = 1; $newMsgNum = $tradeNotiIns->getNumOfNewMessages($userID, null, $newMsgFlag); if ($newMsgNum == 0) { $newMsgFlag = 0; $newMsgNum = $tradeNotiIns->getNumOfNewMessages($userID, null, $newMsgFlag); } if ($newMsgNum && $newMsgNum > 0) { $newTradeNotify = $tradeNotiIns->getReceivedMessages($userID, null, $newMsgFlag, $notificationLimit); ?> <span class="notificationLinks <?php if ($newMsgFlag == 0) { echo 'inactive-notify'; } ?> " id="trade-notify-icon"> <span class="dropDownNotificationList"> <?php render_footer_link_content('trade', $newTradeNotify); ?> </span> </span> <?php } else {
$type = isset($_REQUEST['type']) ? strtolower($_REQUEST['type']) : null; if (isset($_POST['action']) && $_POST['action'] == 'read') { switch ($type) { case 'my': BuckysActivity::markReadNotifications($userID); $notiData = BuckysActivity::getNotifications($userID, $notificationLimit, 0); $result['content'] = render_footer_link_content($type, $notiData, false); break; case 'forum': BuckysForumNotification::makeNotificationsToRead($userID); $notiData = BuckysForumNotification::getNewNotifications($userID, 0, $notificationLimit); $result['content'] = render_footer_link_content($type, $notiData, false); break; case 'trade': $tradeNotiIns = new BuckysTradeNotification(); $tradeNotiIns->markAsRead($userID); $notiData = $tradeNotiIns->getReceivedMessages($userID, null, 0, $notificationLimit); $result['content'] = render_footer_link_content($type, $notiData, false); break; case 'shop': $shopNotiIns = new BuckysShopNotification(); $shopNotiIns->markAsRead($userID); $notiData = $shopNotiIns->getReceivedMessages($userID, null, 0, $notificationLimit); $result['content'] = render_footer_link_content($type, $notiData, false); break; } echo json_encode($result); exit; } echo MSG_INVALID_REQUEST; exit;