public function getNotificationCountAction()
 {
     $request = $_GET;
     $token = isset($request['TOKEN']) ? trim($request['TOKEN']) : null;
     if (!$token) {
         return ['STATUS_CODE' => STATUS_CODE_BAD_REQUEST, 'DATA' => buckys_api_get_error_result('Api token should not be blank')];
     }
     if (!($userID = BuckysUsersToken::checkTokenValidity($token, "api"))) {
         return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => buckys_api_get_error_result('Api token is not valid.')];
     }
     $newMessageCount = BuckysMessage::getNumOfNewMessages($userID);
     $newNotificationCount = BuckysActivity::getNumberOfNotifications($userID);
     $friendRequestCount = BuckysFriend::getNumberOfReceivedRequests($userID);
     $results = [];
     $results['new_message'] = $newMessageCount;
     $results['new_notification'] = $newNotificationCount;
     $results['friend_request'] = $friendRequestCount;
     return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => ["STATUS" => "SUCCESS", "RESULT" => $results]];
 }
                </li>
                <!-- End Videos -->
            </div>

            <li class="right">
                <a href="/logout.php" class="p_menu">Log Out</a>
            </li>

            <!-- notifications Icons -->
            <li class="rightIcons">
                <?php 
    $newMsgFlag = 1;
    $notifications = BuckysActivity::getNumberOfNotifications($userID, $newMsgFlag);
    if ($notifications == 0) {
        $newMsgFlag = 0;
        $notifications = BuckysActivity::getNumberOfNotifications($userID, $newMsgFlag);
    }
    if ($notifications > 0) {
        $notificationsList = BuckysActivity::getNotifications($userID, $notificationLimit, $newMsgFlag);
        ?>
                    <span class="notificationLinks <?php 
        if ($newMsgFlag == 0) {
            echo 'inactive-notify';
        }
        ?>
" id="my-notifications-icon">
                        <span class="notification-count"><?php 
        if ($newMsgFlag != 0) {
            echo '+' . $notifications;
        } else {
            echo 0;
Ejemplo n.º 3
0
		<!-- Search -->
        <li><a href="/search.php" class="p_menu">Search</a><!-- 1 Columns Menu Item -->
        </li>
		<!-- End Search -->		
		
		<li id="lft-last-li">
            <a href="/credits.php"><b>&#946; <?php 
    echo number_format($BUCKYS_GLOBALS['user']['credits'], 2);
    ?>
</b></a>
        </li>
        <li class="right"><a href="/logout.php">Log Out</a></li>
        <!-- notifications Icons -->
        <li class="rightIcons"> 
            <?php 
    $notifications = BuckysActivity::getNumberOfNotifications($userID);
    if ($notifications > 0) {
        $notificationsList = BuckysActivity::getNotifications($userID, 5, 1);
        ?>
            <span class="notificationLinks" id="my-notifications-icon">
                <span class="notification-count"><?php 
        echo $notifications;
        ?>
</span>
                    <span class="dropDownNotificationList">
                        <?php 
        foreach ($notificationsList as $row) {
            echo BuckysActivity::getActivityHTML($row, $userID);
        }
        ?>
                        <a class="view-detail-links" href="/account.php">