<?php 
    } else {
        echo '<span class="notificationLinks inactive-notify no-data" id="trade-notify-icon"><span class="dropDownNotificationList"><span class="nodata">Nothing to see here</span></span></span>';
    }
    ?>

                <?php 
    $shopNotiIns = new BuckysShopNotification();
    $newMsgFlag = 1;
    $newMsgNum = $shopNotiIns->getNumOfNewMessages($userID, null, $newMsgFlag);
    if ($newMsgNum == 0) {
        $newMsgFlag = 0;
        $newMsgNum = $shopNotiIns->getNumOfNewMessages($userID, null, $newMsgFlag);
    }
    if ($newMsgNum && $newMsgNum > 0) {
        $newShopNotify = $shopNotiIns->getReceivedMessages($userID, null, $newMsgFlag, $notificationLimit);
        ?>
                    <span class="notificationLinks <?php 
        if ($newMsgFlag == 0) {
            echo 'inactive-notify';
        }
        ?>
" id="shop-notify-icon">
                        <span class="dropDownNotificationList">
                            <?php 
        render_footer_link_content('shop', $newShopNotify);
        ?>
                        </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;