} else {
    $paramType = 'received';
}
if ($userID != buckys_is_logged_in()) {
    $baseURLParts[] = "user="******"'s Feedback Given - " . TNB_SITE_NAME;
    } else {
        $TNB_GLOBALS['title'] = trim($userData['firstName'] . ' ' . $userData['lastName']) . "'s Feedback Received- " . TNB_SITE_NAME;
        //Mark the activity (offer received) as read
        $tradeNotificationIns = new BuckysTradeNotification();
        $tradeNotificationIns->markAsRead($userID, BuckysTradeNotification::ACTION_TYPE_FEEDBACK);
    }
} else {
    $TNB_GLOBALS['title'] = 'Feedback - ' . TNB_SITE_NAME;
}
require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
Пример #2
0
<?php

require dirname(dirname(__FILE__)) . '/includes/bootstrap.php';
if (!($userID = buckys_is_logged_in())) {
    buckys_redirect('/index.php', MSG_NOT_LOGGED_IN_USER, MSG_TYPE_ERROR);
}
buckys_enqueue_stylesheet('trade.css');
buckys_enqueue_javascript('trade.js');
$BUCKYS_GLOBALS['content'] = 'trade/offer_received';
$BUCKYS_GLOBALS['headerType'] = 'trade';
$paramCurrentPage = get_secure_integer($_REQUEST['page']);
$paramTargetID = get_secure_integer($_REQUEST['targetID']);
$view = array();
//Get offer_received info
$tradeOfferIns = new BuckysTradeOffer();
$view['offers'] = $tradeOfferIns->getOfferReceived($userID, $paramTargetID);
$view['offers'] = buckys_trade_pagination($view['offers'], '/trade/offer_received.php', $paramCurrentPage, TRADE_ROWS_PER_PAGE);
$BUCKYS_GLOBALS['title'] = 'Offer Received - BuckysRoomTrade';
//Mark the activity (offer received) as read
$tradeNotificationIns = new BuckysTradeNotification();
$tradeNotificationIns->markAsRead($userID, BuckysTradeNotification::ACTION_TYPE_OFFER_RECEIVED);
$tradeOfferIns->markAsRead($userID, BuckysTradeOffer::STATUS_OFFER_ACTIVE);
require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
$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;