本文整理汇总了PHP中BuckysUser::getUserBasicInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP BuckysUser::getUserBasicInfo方法的具体用法?PHP BuckysUser::getUserBasicInfo怎么用?PHP BuckysUser::getUserBasicInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BuckysUser
的用法示例。
在下文中一共展示了BuckysUser::getUserBasicInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: composeMessage
/**
* Create New Message
*
* @param mixed $data
*/
public function composeMessage($data)
{
global $db;
$receivers = $data['to'];
if (!buckys_not_null($receivers)) {
buckys_add_message(MSG_SENDER_EMPTY_ERROR, MSG_TYPE_ERROR);
return false;
}
if (trim($data['subject']) == '') {
buckys_add_message(MSG_MESSAGE_SUBJECT_EMPTY_ERROR, MSG_TYPE_ERROR);
return false;
}
if (trim($data['body']) == '') {
buckys_add_message(MSG_MESSAGE_BODY_EMPTY_ERROR, MSG_TYPE_ERROR);
return false;
}
$createdDate = date("Y-m-d H:i:s");
if (!is_array($receivers)) {
$receivers = array($receivers);
}
//Remove Duplicated Messages
$receivers = array_unique($receivers);
$nonFriend = array();
$sents = array();
$errors = array();
$isError = false;
foreach ($receivers as $receiver) {
//Create A message row for Sender
$sender = $data['userID'];
$receiverInfo = BuckysUser::getUserBasicInfo($receiver);
//confirm that current user and receiver is friend
/*if(!BuckysFriend::isFriend($receiver, $sender))
{
$nonFriend[] = $receiverInfo['firstName'] . " " . $receiverInfo['lastName'];
$isError = true;
continue;
}*/
$insertData = array('userID' => $sender, 'sender' => $sender, 'receiver' => $receiver, 'subject' => $data['subject'], 'body' => $data['body'], 'status' => 'read', 'created_date' => $createdDate);
$newId1 = $db->insertFromArray(TABLE_MESSAGES, $insertData);
//Create A message row for receiver
$sender = $data['userID'];
$insertData = array('userID' => $receiver, 'sender' => $sender, 'receiver' => $receiver, 'subject' => $data['subject'], 'body' => $data['body'], 'status' => 'unread', 'created_date' => $createdDate);
$newId2 = $db->insertFromArray(TABLE_MESSAGES, $insertData);
$sents[] = $receiverInfo['firstName'] . ' ' . $receiverInfo['lastName'];
}
if (count($sents) > 0) {
buckys_add_message(MSG_NEW_MESSAGE_SENT, MSG_TYPE_SUCCESS);
}
if (count($nonFriend) > 0) {
if (count($nonFriend) > 1) {
$msg = sprintf(MSG_COMPOSE_MESSAGE_ERROR_TO_NON_FRIENDS, implode(", ", $nonFriend));
} else {
$msg = sprintf(MSG_COMPOSE_MESSAGE_ERROR_TO_NON_FRIEND, $nonFriend[0]);
}
buckys_add_message($msg, MSG_TYPE_ERROR);
}
return !$isError;
}
示例2: buckys_api_format_date
function buckys_api_format_date($userID, $date, $format = 'F j, Y')
{
global $TNB_GLOBALS;
$timeOffset = 0;
$userInfo = BuckysUser::getUserBasicInfo($userID);
$timeOffset = $TNB_GLOBALS['timezone'][$userInfo['timezone']];
$strDate = "";
$now = time();
$today = date("Y-m-d");
$cToday = date("Y-m-d", strtotime($date));
if ($cToday == $today) {
$h = floor(($now - strtotime($date)) / 3600);
$m = floor(($now - strtotime($date)) % 3600 / 60);
$s = floor(($now - strtotime($date)) % 3600 % 60);
if ($s > 40) {
$m++;
}
if ($h > 0) {
$strDate = $h . " hour" . ($h > 1 ? "s " : " ");
}
if ($m > 0) {
$strDate .= $m . " minute" . ($m > 1 ? "s " : " ");
}
if ($strDate == "") {
if ($s == 0) {
$s = 1;
}
$strDate .= $s . " second" . ($s > 1 ? "s " : " ");
}
$strDate .= "ago";
} else {
$strDate = date($format, strtotime($date) + $timeOffset * 60 * 60);
// $strDate = date("F j, Y h:i A", strtotime($date));
}
return $strDate;
}
示例3: buckys_enqueue_stylesheet
buckys_enqueue_stylesheet('trade.css');
buckys_enqueue_javascript('uploadify/jquery.uploadify.js');
buckys_enqueue_javascript('jquery.Jcrop.js');
buckys_enqueue_javascript('jquery.color.js');
buckys_enqueue_javascript('trade.js');
buckys_enqueue_javascript('trade-edit.js');
buckys_enqueue_javascript('uploadify/flash_install.js');
$TNB_GLOBALS['content'] = 'trade/additem';
$TNB_GLOBALS['headerType'] = 'trade';
$view = [];
$tradeCatIns = new BuckysTradeCategory();
$countryIns = new BuckysCountry();
$tradeUserIns = new BuckysTradeUser();
$view['no_cash'] = false;
$view['no_credits'] = false;
if (!$tradeUserIns->hasCredits($userID)) {
$view['no_credits'] = true;
}
$userInfo = BuckysUser::getUserBasicInfo($userID);
$view['category_list'] = $tradeCatIns->getCategoryList(0);
$view['country_list'] = $countryIns->getCountryList();
$view['action_name'] = 'addTradeItem';
$view['page_title'] = 'Add an Item';
$view['type'] = 'additem';
$view['my_bitcoin_balance'] = BuckysBitcoin::getUserWalletBalance($userID);
$view['my_credit_balance'] = $userInfo['credits'];
if ($view['my_bitcoin_balance'] < TRADE_ITEM_LISTING_FEE_IN_BTC && $view['my_credit_balance'] < TRADE_ITEM_LISTING_FEE_IN_CREDIT) {
$view['no_cash'] = true;
}
$TNB_GLOBALS['title'] = 'Add an Item - BuckysRoomTrade';
require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
示例4: useCreditsInTrade
/**
* Use credits to place an item on trade section
*
* @param mixed $userID
* @param mixed $amount
*/
public function useCreditsInTrade($userID, $amount)
{
global $db;
$userIns = new BuckysUser();
$userInfo = $userIns->getUserBasicInfo($userID);
if (!$userInfo) {
return;
}
$userInfo['credits'] = $userInfo['credits'] - $amount;
$userIns->updateUserFields($userID, array('credits' => $userInfo['credits']));
$data = array('receiverID' => BuckysTransaction::BUCKYSROOM_ACCOUNT_ID, 'payerID' => $userID, 'activityType' => BuckysTransaction::ACTIVITY_TYPE_TRADE_ITEM_ADD, 'amount' => $amount, 'transactionID' => BuckysTransaction::NO_TRANSACTION_ID, 'receiverBalance' => 0, 'payerBalance' => $userInfo['credits'], 'createdDate' => date('Y-m-d H:i:s'));
$nId = $db->insertFromArray(TABLE_CREDIT_ACTIVITY, $data);
return $nId;
}
示例5: implode
} else {
$paramType = 'received';
}
if ($userID != buckys_is_logged_in()) {
$baseURLParts[] = "user=" . $userID;
}
$baseURL = '/feedback.php';
if (count($baseURLParts) > 0) {
$baseURL .= '?' . implode('&', $baseURLParts);
}
$view = [];
$feedbackIns = new BuckysFeedback();
$view['feedback'] = $feedbackIns->getFeedbackByUserID($userID, $paramType);
$view['feedback'] = fn_buckys_pagination($view['feedback'], $baseURL, $paramCurrentPage, COMMON_ROWS_PER_PAGE);
$view['myID'] = $userID;
$view['type'] = $paramType;
$view['myRatingInfo'] = $feedbackIns->getUserRating($userID);
$userData = $userIns->getUserBasicInfo($userID);
if ($userData) {
if ($paramType == 'given') {
$TNB_GLOBALS['title'] = trim($userData['firstName'] . ' ' . $userData['lastName']) . "'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";
示例6: dirname
<?php
require dirname(__FILE__) . '/includes/bootstrap.php';
//If the user is not logged in, redirect to the index page
if (!($userID = buckys_is_logged_in())) {
buckys_redirect('/index.php');
}
$userData = BuckysUser::getUserBasicInfo($userID);
if (isset($_GET['to'])) {
$receiver = BuckysUser::getUserData($_GET['to']);
}
if (isset($_POST['action'])) {
//Check the user id is same with the current logged user id
if ($_POST['userID'] != $userID) {
echo 'Invalid Request!';
exit;
}
//Save Address
if ($_POST['action'] == 'delete_messages') {
if (!BuckysMessage::deleteMessages($_POST['messageID'])) {
buckys_redirect('/messages_sent.php', "Error: " . $db->getLastError(), MSG_TYPE_ERROR);
} else {
buckys_redirect('/messages_sent.php', MSG_MESSAGE_REMOVED, MSG_TYPE_SUCCESS);
}
exit;
}
}
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$totalCount = BuckysMessage::getTotalNumOfMessages($userID, 'sent');
//Init Pagination Class
$pagination = new Pagination($totalCount, BuckysMessage::$COUNT_PER_PAGE, $page);
示例7: isset
$view['item'] = $tradeItemIns->getItemById($paramItemID);
$view['myID'] = $userID;
if (!isset($view['item']) || $view['item']['status'] == BuckysTradeItem::STATUS_ITEM_INACTIVE) {
buckys_redirect('/trade/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
//Check if the items owner is active one
$userData = $userIns->getUserData($view['item']['userID']);
if ($userData['status'] == BuckysUser::STATUS_USER_BANNED) {
buckys_redirect('/trade/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
//Read more info from DB
$catData = $tradeCatIns->getCategoryByID($view['item']['catID']);
$view['item']['categoryName'] = isset($catData) ? $catData['name'] : '';
$countryData = $countryIns->getCountryById($view['item']['locationID']);
$view['item']['locationName'] = isset($countryData) ? $countryData['country_title'] : '';
$view['item']['userInfo'] = $userIns->getUserBasicInfo($view['item']['userID']);
if (!isset($view['item']['userInfo'])) {
buckys_redirect('/trade/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
//Check if you can make an offer to this user. If this user decline your offer before for this item, then you can't send again
$view['offerDisabled'] = false;
if (!$userID || $userID == $view['item']['userID']) {
$view['offerDisabled'] = true;
} else {
/**
* If it has been set, then it means you can't make an offer if one of your offer declined by this user.
* When you enable this block, please note BuckysTradeOffer::addOffer() function, there are parts disabled
*/
//$view['offerDisabled'] = $tradeOfferIns->checkDeclinedOffer($view['item']['itemID'], null, $userID);
}
//If you are logged in, then get available to make an offer
示例8: deleteUserAccount
//.........这里部分代码省略.........
}
//Block Replies
$query = $db->prepare("SELECT count(r.replyID), r.topicID, t.categoryID FROM " . TABLE_FORUM_REPLIES . " AS r LEFT JOIN " . TABLE_FORUM_TOPICS . " AS t ON t.topicID=r.topicID WHERE r.status='publish' AND r.creatorID=%d GROUP BY r.topicID", $userID);
$rRows = $db->getResultsArray($query);
$db->query("UPDATE " . TABLE_FORUM_REPLIES . " SET `status`='suspended' WHERE creatorID=" . $userID . " AND `status`='publish'");
foreach ($rRows as $row) {
$db->query("UPDATE " . TABLE_FORUM_TOPICS . " SET `replies` = `replies` - " . $row['c'] . " WHERE topicID=" . $row['topicID']);
$db->query("UPDATE " . TABLE_FORUM_CATEGORIES . " SET `replies` = `replies` - " . $row['c'] . " WHERE categoryID=" . $row['categoryID']);
BuckysForumTopic::updateTopicLastReplyID($row['topicID']);
}
//Block Topics
$query = $db->prepare("SELECT count(topicID) AS tc, SUM(replies) AS rc, categoryID FROM " . TABLE_FORUM_TOPICS . " WHERE creatorID=%d AND `status`='publish' GROUP BY categoryID", $userID);
$tRows = $db->getResultsArray($query);
$db->query("UPDATE " . TABLE_FORUM_TOPICS . " SET `status`='suspended' WHERE creatorID=" . $userID . " AND `status`='publish'");
foreach ($tRows as $row) {
$db->query("UPDATE " . TABLE_FORUM_CATEGORIES . " SET `replies` = `replies` - " . $row['rc'] . ", `topics` = `topics` - " . $row['tc'] . " WHERE categoryID=" . $row['categoryID']);
BuckysForumCategory::updateCategoryLastTopicID($row['categoryID']);
}
//Block Reply Votes
$query = $db->prepare("SELECT count(voteID) AS c, objectID FROM " . TABLE_FORUM_VOTES . " WHERE voterID=%d AND voteStatus=1 GROUP BY objectID", $userID);
$vRows = $db->getResultsArray($query);
foreach ($vRows as $row) {
$db->query("UPDATE " . TABLE_FORUM_REPLIES . " SET `votes` = `votes` - " . $row['c'] . " WHERE replyID=" . $row['objectID']);
}
//Delete Reported Objects
$db->query("DELETE FROM " . TABLE_REPORTS . " WHERE objectID IN (SELECT postID FROM " . TABLE_POSTS . " WHERE poster=" . $userID . ")");
$db->query("DELETE FROM " . TABLE_REPORTS . " WHERE objectID IN (SELECT topicID FROM " . TABLE_FORUM_TOPICS . " WHERE creatorID=" . $userID . ")");
$db->query("DELETE FROM " . TABLE_REPORTS . " WHERE objectID IN (SELECT replyID FROM " . TABLE_FORUM_REPLIES . " WHERE creatorID=" . $userID . ")");
//Delete From banned Users
$db->query("DELETE FROM " . TABLE_BANNED_USERS . " WHERE bannedUserID=" . $userID);
//Delete Activities
$db->query("DELETE FROM " . TABLE_MAIN_ACTIVITIES . " WHERE userID=" . $userID);
//Delete Album Photos
$db->query("DELETE FROM " . TABLE_ALBUMS_PHOTOS . " WHERE album_id IN (SELECT albumID FROM " . TABLE_ALBUMS . " WHERE OWNER=" . $userID . ")");
//Delete ALbums
$db->query("DELETE FROM " . TABLE_ALBUMS . " WHERE OWNER=" . $userID);
//Delete Friends
$db->query("DELETE FROM " . TABLE_FRIENDS . " WHERE userID=" . $userID . " OR userFriendID=" . $userID);
//Delete Messages
$db->query("DELETE FROM " . TABLE_MESSAGES . " WHERE userID=" . $userID . " OR sender=" . $userID);
//Delete Private Messengers
$db->query("DELETE FROM " . TABLE_MESSENGER_BLOCKLIST . " WHERE userID=" . $userID . " OR blockedID=" . $userID);
$db->query("DELETE FROM " . TABLE_MESSENGER_BUDDYLIST . " WHERE userID=" . $userID . " OR buddyID=" . $userID);
$db->query("DELETE FROM " . TABLE_MESSENGER_MESSAGES . " WHERE userID=" . $userID . " OR buddyID=" . $userID);
//Delete Posts
$posts = $db->getResultsArray("SELECT * FROM " . TABLE_POSTS . " WHERE poster=" . $userID);
foreach ($posts as $post) {
//Delete Comments
$db->query("DELETE FROM " . TABLE_POSTS_COMMENTS . " WHERE postID=" . $post['postID']);
//Delete Likes
$db->query("DELETE FROM " . TABLE_POSTS_LIKES . " WHERE postID=" . $post['postID']);
//Delete hits
$db->query("DELETE FROM " . TABLE_POSTS_HITS . " WHERE postID=" . $post['postID']);
}
$db->query("DELETE FROM " . TABLE_POSTS . " WHERE poster=" . $userID);
//Delete Pages
$pageIns = new BuckysPage();
$pageIns->deletePageByUserID($userID);
//Delete Trade Section which are related to this user.
$tradeIns = new BuckysTradeItem();
$tradeIns->deleteItemsByUserID($userID);
//Delete Shop Section which are related to this user
$shopIns = new BuckysShopProduct();
$shopIns->deleteProductsByUserID($userID);
//Delete Comments
$db->query("DELETE FROM " . TABLE_POSTS_COMMENTS . " WHERE commenter=" . $userID);
//Delete Likes
$db->query("DELETE FROM " . TABLE_POSTS_LIKES . " WHERE userID=" . $userID);
//Delete Page Followers
$db->query("DELETE FROM " . TABLE_PAGE_FOLLOWERS . " WHERE userID=" . $userID);
//Getting Removed Topics
$topicIDs = $db->getResultsArray("SELECT topicID FROM " . TABLE_FORUM_TOPICS . " WHERE creatorID=" . $userID);
if (!$topicIDs) {
$topicIDs = [0];
}
//Delete Reply Votes
$db->query("DELETE FROM " . TABLE_FORUM_VOTES . " WHERE voterID=" . $userID);
$db->query("DELETE FROM " . TABLE_FORUM_VOTES . " WHERE objectID IN ( SELECT replyID FROM " . TABLE_FORUM_REPLIES . " WHERE creatorID=" . $userID . " OR topicID IN (" . implode(", ", $topicIDs) . ") )");
//Delete Replies
$db->query("DELETE FROM " . TABLE_FORUM_REPLIES . " WHERE creatorID=" . $userID . " OR topicID IN (" . implode(", ", $topicIDs) . ")");
//Delete Topics
$db->query("DELETE FROM " . TABLE_FORUM_TOPICS . " WHERE creatorID=" . $userID);
//Delete Users
/*$db->query("DELETE FROM " . TABLE_USERS . " WHERE userID=" . $userID);
$db->query("DELETE FROM " . TABLE_USERS_CONTACT . " WHERE userID=" . $userID);
$db->query("DELETE FROM " . TABLE_USERS_EDUCATIONS . " WHERE userID=" . $userID);
$db->query("DELETE FROM " . TABLE_USERS_EMPLOYMENTS . " WHERE userID=" . $userID);
$db->query("DELETE FROM " . TABLE_USERS_LINKS . " WHERE userID=" . $userID);
$db->query("DELETE FROM " . TABLE_USERS_TOKEN . " WHERE userID=" . $userID);*/
//Don't delete user from the database, just update the user's status
$db->query("UPDATE " . TABLE_USERS . " SET `status`=" . BuckysUser::STATUS_USER_DELETED . " WHERE userID=" . $userID);
//Send
$bitCoinInfo = BuckysUser::getUserBitcoinInfo($userID);
if ($bitCoinInfo) {
$userInfo = BuckysUser::getUserBasicInfo($userID);
$content = "Your " . TNB_SITE_NAME . " account has been deleted. However, you may still access your Bitcoin wallet at:\n" . "https://blockchain.info/wallet/login\n" . "Identifier: " . $bitCoinInfo['bitcoin_guid'] . "\n" . "Password: " . buckys_decrypt($bitCoinInfo['bitcoin_password']) . "\n";
//Send Email to User
buckys_sendmail($userInfo['email'], $userInfo['firstName'] . ' ' . $userInfo['lastName'], TNB_SITE_NAME . ' Account has been Deleted', $content);
}
}
示例9: foreach
<?php
foreach ($tradeList as $tradeData) {
$myPrefix = '';
$theirPrefix = '';
if ($tradeData['sellerID'] == $view['myID']) {
//I'm seller for this tradeData
$myPrefix = 'seller';
$theirPrefix = 'buyer';
} else {
//I'm buyer for this tradeData
$myPrefix = 'buyer';
$theirPrefix = 'seller';
}
$userIns = new BuckysUser();
$tradeData['theirBasicInfo'] = $userIns->getUserBasicInfo($tradeData[$theirPrefix . 'ID']);
$myTrackingNumber = $tradeData[$myPrefix . 'TrackingNo'];
$theirTrackingNumber = $tradeData[$theirPrefix . 'TrackingNo'];
// $myItemImage = fn_buckys_get_item_first_image_thumb($tradeData[$myPrefix . 'ItemImages']);
// $theirItemImage = fn_buckys_get_item_first_image_thumb($tradeData[$theirPrefix . 'ItemImages']);
$myItemImage = fn_buckys_get_item_first_image_normal($tradeData[$myPrefix . 'ItemImages']);
$theirItemImage = fn_buckys_get_item_first_image_normal($tradeData[$theirPrefix . 'ItemImages']);
$sendMessageLink = '/messages_compose.php?to=' . $tradeData[$theirPrefix . 'ID'];
$dateCreated = date('n/j/y', strtotime($tradeData['tradeCreatedDate']));
$myItemLink = '/trade/view.php?id=' . $tradeData[$myPrefix . 'ItemID'];
$theirItemLink = '/trade/view.php?id=' . $tradeData[$theirPrefix . 'ItemID'];
$totalRating = 'No';
$positiveRating = '';
if (isset($tradeData[$theirPrefix . 'TotalRating']) && $tradeData[$theirPrefix . 'TotalRating'] > 0) {
$totalRating = $tradeData[$theirPrefix . 'TotalRating'];
if (is_numeric($tradeData[$theirPrefix . 'PositiveRating'])) {
示例10: getActivityHTML
/**
* @param $row
* @param $userID
* @return string
*/
public static function getActivityHTML($row, $userID)
{
ob_start();
$user = BuckysUser::getUserBasicInfo($row['userID']);
$owner = BuckysUser::getUserBasicInfo($row['poster']);
$pagePostFlag = false;
if ($row['pageID'] != BuckysPost::INDEPENDENT_POST_PAGE_ID) {
$pageIns = new BuckysPage();
$pageData = $pageIns->getPageByID($row['pageID']);
}
if (isset($pageData)) {
$pagePostFlag = true;
}
if ($pagePostFlag) {
$objectLink = "/page.php?pid=" . $row['pageID'] . "&post=" . $row['objectID'];
$authorLink = '/page.php?pid=' . $row['pageID'];
} else {
$objectLink = "/posts.php?user=" . $row['poster'] . "&post=" . $row['objectID'];
$authorLink = '/profile.php?user=' . $row['poster'];
}
if ($row['activityType'] == 'like') {
?>
<div class="activityComment">
<?php
render_profile_link($user, 'replyToPostIcons');
?>
<span>
<a href="/profile.php?user=<?php
echo $row['userID'];
?>
"
class="userName"><?php
echo $user['firstName'] . " " . $user['lastName'];
?>
</a>
liked <?php
echo $row['poster'] == $userID ? 'your' : "<a href='/profile.php?user=" . $row['poster'] . "' class=\"userName\">" . $owner['firstName'] . " " . $owner['lastName'] . "'s</a>";
?>
<?php
switch ($row['type']) {
case "image":
echo "<a href='" . $objectLink . "'>photo</a>";
break;
case "video":
echo "<a href='" . $objectLink . "'>video</a>";
break;
case "text":
default:
echo "<a href='" . $objectLink . "'>post</a> ";
if (strlen(buckys_trunc_content($row['content'], 60)) > 0) {
echo '“' . buckys_trunc_content($row['content'], 60) . '”';
}
break;
}
?>
</span>
</div>
<?php
} else {
if ($row['activityType'] == 'comment') {
?>
<div class="activityComment">
<?php
render_profile_link($user, 'replyToPostIcons');
?>
<span>
<a href="/profile.php?user=<?php
echo $row['userID'];
?>
"
class="userName"><?php
echo $user['firstName'] . " " . $user['lastName'];
?>
</a>
left a comment on
<?php
if ($row['poster'] == $userID) {
echo 'your';
} else {
if ($row['poster'] == $row['userID']) {
//Getting User Data
$tUinfo = BuckysUser::getUserBasicInfo($row['userID']);
switch (strtolower($tUinfo['gender'])) {
case 'male':
echo 'his';
break;
case 'female':
echo 'her';
break;
break;
echo 'their';
break;
}
} else {
//.........这里部分代码省略.........
示例11: hasCredits
/**
* Check if you have credits
*
* @param integer $userID
*/
public function hasCredits($userID)
{
$userIns = new BuckysUser();
$userInfo = $userIns->getUserBasicInfo($userID);
if (!$userInfo) {
return;
}
return $userInfo['credits'] >= 1;
}
示例12: addUserToBuddylist
/**
* Add user to buddylist
*
* @param Int $userID
* @param Int $addedUserID
*/
public function addUserToBuddylist($userID, $addedUserID)
{
global $db;
//If the user is on the blocklist of current user
if (BuckysPrivateMessenger::isOnBlocklist($userID, $addedUserID)) {
return MSG_ADD_BLOCKED_USER_TO_BUDDYLIST_ERROR;
}
//If already added
if (BuckysPrivateMessenger::isOnBuddylist($userID, $addedUserID)) {
return true;
}
$status = 0;
//Getting Status
$addedUserMsgrSettings = BuckysUser::getUserBasicInfo($addedUserID);
if ($addedUserMsgrSettings['messenger_privacy'] == 'all' && !BuckysPrivateMessenger::isOnBlocklist($addedUserID, $userID)) {
$status = 1;
} else {
if ($addedUserMsgrSettings['messenger_privacy'] == 'buddy' && !BuckysPrivateMessenger::isOnBuddylist($addedUserID, $userID)) {
$status = 1;
}
}
//Add user to the buddylist
$query = $db->prepare("INSERT INTO " . TABLE_MESSENGER_BUDDYLIST . "(`userID`, `buddyID`, `status`)VALUES(%d, %d, 0)", $userID, $addedUserID);
$nID = $db->insert($query);
if (!$nID) {
return $db->getLastError();
}
$bID = BuckysPrivateMessenger::isOnBuddylist($addedUserID, $userID);
if ($bID) {
//If $userID is already in the $addedUserID's buddylist, update state
$query = $db->prepare("UPDATE " . TABLE_MESSENGER_BUDDYLIST . " SET `status` = 1 WHERE messengerBuddylistID=%d", $nID);
$db->update($query);
$query = $db->prepare("UPDATE " . TABLE_MESSENGER_BUDDYLIST . " SET `status` = 1 WHERE messengerBuddylistID=%d", $bID);
$db->update($query);
}
return true;
}
示例13: useCreditsInShop
/**
* Use credits to list products in shop
*
* @param mixed $userID
* @param {mixed|mixed} $amount
* @return int|null|string|void {mixed|mixed}
*/
public function useCreditsInShop($userID, $amount)
{
global $db;
$userIns = new BuckysUser();
$userInfo = $userIns->getUserBasicInfo($userID);
if (!$userInfo) {
return;
}
$userInfo['credits'] = $userInfo['credits'] - $amount;
if ($userInfo['credits'] < 0) {
return;
}
//you can't use this amount
$userIns->updateUserFields($userID, ['credits' => $userInfo['credits']]);
$data = ['receiverID' => BuckysTransaction::TNB_ACCOUNT_ID, 'payerID' => $userID, 'activityType' => BuckysTransaction::ACTIVITY_TYPE_SHOP_PRODUCT_ADD, 'amount' => $amount, 'transactionID' => BuckysTransaction::NO_TRANSACTION_ID, 'receiverBalance' => 0, 'payerBalance' => $userInfo['credits'], 'createdDate' => date('Y-m-d H:i:s')];
$nId = $db->insertFromArray(TABLE_CREDIT_ACTIVITY, $data);
return $nId;
}
示例14: hasCredits
/**
* Check if you have credits
*
* @param integer $userID
* @return bool
*/
public function hasCredits($userID, $minAmount = 1)
{
$userIns = new BuckysUser();
$userInfo = $userIns->getUserBasicInfo($userID);
if (!$userInfo) {
return false;
}
return $userInfo['credits'] >= $minAmount;
}
示例15: trim
$feedbackList = $view['feedback'];
$userIns = new BuckysUser();
if (!$view['myRatingInfo']) {
$view['myRatingInfo'] = [];
}
?>
<section id="main_section">
<?php
buckys_get_panel('trade_top_search');
?>
<section id="feedback-left-panel">
<?php
$myInfo = $userIns->getUserBasicInfo($view['myID']);
$myData = BuckysUser::getUserData($view['myID']);
$totalRating = 'No';
$positiveRating = '';
if ($view['myRatingInfo']['totalRating'] != '' && $view['myRatingInfo']['totalRating'] > 0) {
$totalRating = $view['myRatingInfo']['totalRating'];
if (is_numeric($view['myRatingInfo']['positiveRating'])) {
$positiveRating = number_format($view['myRatingInfo']['positiveRating'] / $totalRating * 100, 2, '.', '') . '% Positive';
}
}
?>
<div class="titles">
<?php
echo trim($myInfo['firstName'] . ' ' . $myInfo['lastName']);
?>
</div>