<?php require dirname(__FILE__) . '/includes/bootstrap.php'; if (!($userID = buckys_is_logged_in())) { buckys_redirect('/index.php', MSG_NOT_LOGGED_IN_USER, MSG_TYPE_ERROR); } //Getting Activity Stream $stream = BuckysPost::getUserPostsStream($userID); //Get Activities $activities = BuckysActivity::getActivities($userID); if (!$activities) { $activities = []; } //Get Notifications $notifications = BuckysActivity::getNotifications($userID); //Mark the notifications to read BuckysActivity::markReadNotifications($userID); if (!$notifications) { $notifications = []; } buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('stream.css'); buckys_enqueue_stylesheet('posting.css'); buckys_enqueue_stylesheet('uploadify.css'); buckys_enqueue_stylesheet('jquery.Jcrop.css'); buckys_enqueue_javascript('uploadify/jquery.uploadify.js'); buckys_enqueue_javascript('jquery.Jcrop.js'); buckys_enqueue_javascript('jquery.color.js'); buckys_enqueue_javascript('posts.js'); buckys_enqueue_javascript('add_post.js'); buckys_enqueue_javascript('account.js');
<?php require dirname(__FILE__) . '/includes/bootstrap.php'; if (!($userID = buckys_is_logged_in())) { exit; } if ($_POST['action'] == 'activity-notification') { $acount = isset($_POST['acount']) ? intval($_POST['acount']) : 15; $rows = BuckysActivity::getActivities($userID, $acount); $activities = ''; foreach ($rows as $row) { $activities .= BuckysActivity::getActivityHTML($row, $userID); } if (count($rows) == $acount) { $activities .= "<div class='clear'></div><a href='#' class='view-more'>view more</a>"; } $ncount = isset($_POST['ncount']) ? intval($_POST['ncount']) : 15; $rows = BuckysActivity::getNotifications($userID, $ncount); $notifications = ''; foreach ($rows as $row) { $notifications .= BuckysActivity::getActivityHTML($row, $userID); } if (count($rows) == $ncount) { $notifications .= "<div class='clear'></div><a href='#' class='view-more'>view more</a>"; } render_result_xml(['notifications' => $notifications, 'activities' => $activities]); exit; }
</li> <!-- End Search --> <li id="lft-last-li"> <a href="/credits.php"><b>β <?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"> View All Notifications </a>
<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; } ?> </span>
<?php require dirname(__FILE__) . '/includes/bootstrap.php'; if (!($userID = buckys_is_logged_in())) { echo MSG_INVALID_REQUEST; exit; } $notificationLimit = 5; //This module will make the notifications as read. $result = ['success' => 1, 'content' => '']; $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();