buckys_redirect($return, MSG_FRIEND_REQUEST_ALREADY_RECEIVED, MSG_TYPE_ERROR); } exit; } if (!BuckysUsersDailyActivity::checkUserDailyLimit($userID, "friendRequests")) { if ($isAjax) { $resultXML = ['status' => 'error', 'message' => sprintf(MSG_DAILY_FRIEND_REQUESTS_LIMIT_EXCEED_ERROR, USER_DAILY_LIMIT_FRIEND_REQUESTS)]; render_result_xml($resultXML); } else { buckys_redirect($return, sprintf(MSG_DAILY_FRIEND_REQUESTS_LIMIT_EXCEED_ERROR, USER_DAILY_LIMIT_FRIEND_REQUESTS), MSG_TYPE_ERROR); } exit; } if (BuckysFriend::sendFriendRequest($userID, $friendID)) { if ($isAjax) { $resultXML = ['status' => 'success', 'message' => MSG_FRIEND_REQUEST_SENT, 'html' => 'Delete Friend Request', 'action' => 'send-friend-request', 'link' => '/myfriends.php?action=delete&friendID=' . $friendID . buckys_get_token_param()]; render_result_xml($resultXML); } else { buckys_redirect($return, MSG_FRIEND_REQUEST_SENT); } } else { if ($isAjax) { $resultXML = ['status' => 'error', 'message' => $db->getLastError()]; render_result_xml($resultXML); } else { buckys_redirect($return, $db->getLastError(), MSG_TYPE_ERROR); } } } } }
<br/> <a href="/myfriends.php?action=decline&friendID=<?php echo $profileID; echo buckys_get_token_param(); ?> &return=<?php echo base64_encode("/profile.php?user="******">Decline Friend Request</a> <br/> <?php } else { ?> <a href="/myfriends.php?action=request&friendID=<?php echo $profileID; echo buckys_get_token_param(); ?> &return=<?php echo base64_encode("/profile.php?user="******">Send Friend Request</a> <br/> <?php } } } //Show Message ?> <a href="/messages_compose.php?to=<?php echo $profileID; ?>
function render_footer_link_content($type, $data, $outFlag = true) { $userID = buckys_is_logged_in(); ob_start(); switch ($type) { case 'my': foreach ($data as $row) { echo BuckysActivity::getActivityHTML($row, $userID); } echo '<a class="view-detail-links" href="/account.php">View All Notifications</a>'; break; case 'friend': $count = 0; foreach ($data as $row) { $count++; if ($count > 5) { break; } ?> <div class="activityComment"> <a href="/profile.php?user=<?php echo $row['userID']; ?> "><img src="<?php echo BuckysUser::getProfileIcon($row); ?> " class="dropDownNotificationImages"/></a> <a href="/profile.php?user=<?php echo $row['userID']; ?> "><?php echo $row['fullName']; ?> </a> sent you new friend request <a href="/myfriends.php?action=decline&friendID=<?php echo $row['userID']; echo buckys_get_token_param(); ?> &return=<?php echo base64_encode("/profile.php?user="******" class="redButton">Decline</a> <a href="/myfriends.php?action=accept&friendID=<?php echo $row['userID']; echo buckys_get_token_param(); ?> &return=<?php echo base64_encode("/profile.php?user="******" class="redButton">Approve</a> <br clear="all"/> </div> <?php } ?> <a class="view-detail-links" href="/myfriends.php?type=requested"> View All Requests </a> <?php break; case 'forum': foreach ($data as $idx => $row) { ?> <?php if ($row['activityType'] == 'topic_approved' || $row['activityType'] == 'reply_approved') { ?> <div class="activityComment"> <span> <a href="/profile.php?user=<?php echo $row['userID']; ?> "><img src="<?php echo BuckysUser::getProfileIcon($TNB_GLOBALS['user']['userID']); ?> " class="dropDownNotificationImages"/></a> <!-- <span class="redBold"><?php echo $TNB_GLOBALS['user']['firstName'] . " " . $TNB_GLOBALS['user']['lastName']; ?> </span> <br />--> <?php if ($row['activityType'] == 'topic_approved') { ?> Your topic <a href="/forum/topic.php?id=<?php echo $row['activityType'] == 'topic_approved' ? $row['objectID'] : $row['actionID']; ?> "><?php echo buckys_truncate_string($row['topicTitle'], 30); ?> </a> has been approved <?php } else { ?> Your reply to <a href="/forum/topic.php?id=<?php echo $row['activityType'] == 'reply_approved' ? $row['objectID'] : $row['actionID']; ?> "><?php echo buckys_truncate_string($row['topicTitle'], 30); ?> </a> has been approved <?php } ?> <span class="createdDate"><?php echo buckys_format_date($row['createdDate']); ?> </span> <br clear="all"/> </span> </div> <?php } else { ?> <div class="activityComment"> <span> <a href="/profile.php?user=<?php echo $row['replierID']; ?> "><img src="<?php echo BuckysUser::getProfileIcon(['userID' => $row['replierID'], 'thumbnail' => $row['rThumbnail']]); ?> " class="dropDownNotificationImages"/></a> <a href="/profile.php?user=<?php echo $row['replierID']; ?> "><?php echo $row['rName']; ?> </a> replied to <?php echo $row['activityType'] == "replied_to_topic" ? "your" : "the"; ?> topic <a href="/forum/topic.php?id=<?php echo $row['objectID']; ?> &page=9999"><?php echo buckys_truncate_string($row['topicTitle'], 30); ?> </a> <span class="createdDate"><?php echo buckys_format_date($row['createdDate']); ?> </span> <br clear="all"/> </span> </div> <?php } ?> <?php } ?> <a class="view-detail-links" href="/forum"> Go to Forum </a> <?php break; case 'mail': foreach ($data as $idx => $row) { ?> <a class="singleNotificationListItem" href="/messages_read.php?message=<?php echo $row['messageID']; ?> "> <span> <img src="<?php echo BuckysUser::getProfileIcon($row['sender']); ?> " class="dropDownNotificationImages"/> <span class="redBold" style="font-weight:normal;"><?php echo $row['senderName']; ?> </span> <span style="font-size:11px; color:#888; float:right;"><?php echo buckys_format_date($row['created_date']); ?> </span> <br/> <?php echo substr($row['body'], 0, 120); if (strlen($row['body']) > 120) { echo "..."; } ?> </span> </a> <?php if ($idx > 4) { break; } } ?> <a class="view-detail-links" href="/messages_inbox.php">Go to Inbox</a> <?php break; case 'trade': foreach ($data as $idx => $row) { $htmlBodyContent = ''; if ($row['activityType'] == BuckysTradeNotification::ACTION_TYPE_OFFER_ACCEPTED) { $actionUrl = '/trade/traded.php'; $htmlBodyContent .= sprintf('<span class="redBold" style="font-weight:normal;">%s</span>', $row['senderName']); $htmlBodyContent .= sprintf('<span> accepted your </span>'); $htmlBodyContent .= sprintf('<span class="redBold" style="font-weight:normal;">offer</span>'); } else { if ($row['activityType'] == BuckysTradeNotification::ACTION_TYPE_OFFER_DECLINED) { $actionUrl = '/trade/offer_declined.php'; $htmlBodyContent .= sprintf('<span class="redBold" style="font-weight:normal;">%s</span>', $row['senderName']); $htmlBodyContent .= sprintf('<span> declined your </span>'); $htmlBodyContent .= sprintf('<span class="redBold" style="font-weight:normal;">offer</span>'); } else { if ($row['activityType'] == BuckysTradeNotification::ACTION_TYPE_OFFER_RECEIVED) { $actionUrl = '/trade/offer_received.php'; $htmlBodyContent .= sprintf('<span class="redBold" style="font-weight:normal;">%s</span>', $row['senderName']); $htmlBodyContent .= sprintf('<span> made you an </span>'); $htmlBodyContent .= sprintf('<span class="redBold" style="font-weight:normal;">offer</span>'); } else { if ($row['activityType'] == BuckysTradeNotification::ACTION_TYPE_FEEDBACK) { $actionUrl = '/feedback.php?user='******'<span class="redBold" style="font-weight:normal;">%s</span>', $row['senderName']); $htmlBodyContent .= sprintf('<span> left you </span>'); $htmlBodyContent .= sprintf('<span class="redBold" style="font-weight:normal;">feedback</span>'); $row['feedback'] = strip_tags($row['feedback']); if (strlen($row['feedback']) > 120) { $row['feedback'] = substr($row['feedback'], 0, 120) . '...'; } $htmlBodyContent .= sprintf('<span> "%s"</span>', $row['feedback']); } else { $actionUrl = '#'; //not sure if we can be here. } } } } ?> <a class="singleNotificationListItem" href="<?php echo $actionUrl; ?> "> <img src="<?php echo BuckysUser::getProfileIcon($row['senderID']); ?> " class="dropDownNotificationImages"/> <?php echo $htmlBodyContent; ?> </a> <?php } ?> <a class="view-detail-links" href="/trade/available.php">My Trading Account</a> <?php break; case 'shop': foreach ($data as $idx => $row) { $htmlBodyContent = ''; if ($row['activityType'] == BuckysShopNotification::ACTION_TYPE_PRODUCT_SOLD) { $actionUrl = '/shop/sold.php'; $htmlBodyContent .= sprintf('<span class="redBold" style="font-weight:normal;">%s</span>', $row['senderName']); $htmlBodyContent .= sprintf('<span> purchased your </span>'); $htmlBodyContent .= sprintf('<span class="redBold" style="font-weight:normal;">product</span>'); } else { $actionUrl = '#'; //not sure if we can be here. } ?> <a class="singleNotificationListItem" href="<?php echo $actionUrl; ?> "> <img src="<?php echo BuckysUser::getProfileIcon($row['senderID']); ?> " class="dropDownNotificationImages"/> <?php echo $htmlBodyContent; ?> </a> <?php } ?> <a class="view-detail-links" href="/shop/available.php">My Shop Account</a> <?php break; } $output = ob_get_contents(); ob_end_clean(); if ($outFlag == true) { echo $output; return true; } else { return $output; } }
if ($isAjax) { header('Content-type: application/xml'); } if (!buckys_check_form_token('request')) { if ($isAjax) { $resultXML = ['status' => 'error', 'message' => MSG_INVALID_REQUEST]; render_result_xml($resultXML); exit; } else { buckys_redirect('/page.php?pid=' . $paramPageID, MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } } $result = $pageFollowerIns->removeFollower($paramPageID, $userID); if ($result) { if ($isAjax) { $resultXML = ['status' => 'success', 'message' => 'MSG_FOLLOW_PAGE_SUCCESS', 'html' => 'follow', 'link' => '/page.php?action=follow&pid=' . $paramPageID . buckys_get_token_param()]; render_result_xml($resultXML); exit; } else { buckys_redirect('/page.php?pid=' . $paramPageID, MSG_UNFOLLOW_PAGE_SUCCESS, MSG_TYPE_SUCCESS); } } else { $resultXML = ['status' => 'error', 'message' => MSG_INVALID_REQUEST]; render_result_xml($resultXML); exit; } break; //==================== Add New Page ====================// //==================== Add New Page ====================// case '': break;
</div> </div> <?php render_pagethumb_link($pageData, 'mainProfilePic'); ?> <br/> <?php if (!$view['isMyPage']) { ?> <?php if ($view['isFollowed']) { echo sprintf('<a href="/page.php?pid=%d&action=unfollow' . buckys_get_token_param() . '">Unfollow Page</a> <br/>', $pageData['pageID']); } else { echo sprintf('<a href="/page.php?pid=%d&action=follow' . buckys_get_token_param() . '">Follow Page</a> <br/>', $pageData['pageID']); } ?> <?php } ?> <?php echo sprintf('<a href="/photos.php?pid=%d">View All Photos (%d)</a> <br/>', $pageData['pageID'], $numberOfPhotos); ?> <?php if ($view['isMyPage'] || buckys_is_admin()) { ?> <a href="javascript:void(0)" class="delete-this-page-btn">Delete this Page</a> <br/> <?php