$result[] = ["id" => $row['userID'], 'label' => $row['fullName'], 'value' => $row['fullName'], 'hash' => buckys_encrypt_id($row['userID'])]; } echo json_encode($result); buckys_exit(); } if (isset($_POST['action']) && $_POST['action'] == 'send-money') { if (!isset($_POST['receiverID']) || !isset($_POST['receiverIDHash']) || !isset($_POST['amount']) || !buckys_check_id_encrypted($_POST['receiverID'], $_POST['receiverIDHash'])) { buckys_redirect('/credits.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $result = BuckysTransaction::sendCredits($_POST['receiverID'], $_POST['amount']); if ($result === true) { buckys_redirect('/credits.php', MSG_SENT_CREDITS_SUCCESSFULLY); } else { buckys_redirect('/credits.php', $result, MSG_TYPE_ERROR); } exit; } $page = isset($_GET['page']) ? $_GET['page'] : 1; $totalCount = BuckysTransaction::getNumOfCreditActivities($userID); //Init Pagination Class $pagination = new Pagination($totalCount, BuckysTransaction::$COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); $activities = BuckysTransaction::getCreditActivities($TNB_GLOBALS['user']['userID'], $page); buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('credits.css'); buckys_enqueue_javascript('credits.js'); buckys_enqueue_javascript('payment.js'); $TNB_GLOBALS['content'] = 'credits'; $TNB_GLOBALS['title'] = "Credits - " . TNB_SITE_NAME; $TNB_GLOBALS['payerID'] = $userID; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
<?php require dirname(dirname(__FILE__)) . '/includes/bootstrap.php'; if (!buckys_check_user_acl(USER_ACL_REGISTERED)) { buckys_redirect('/forum', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } if (isset($_POST['action'])) { if ($_POST['action'] == 'create-topic') { $result = BuckysForumTopic::createTopic($_POST); if ($result == 'publish' || $result == 'pending') { buckys_redirect("/forum", MSG_TOPIC_POSTED_SUCCESSFULLY . ($result == 'pending' ? ' ' . MSG_POST_IS_UNDER_PREVIEW : ''), MSG_TYPE_SUCCESS); } else { buckys_redirect("/forum/create_topic.php", $result, MSG_TYPE_ERROR); } } } $curCatID = isset($_GET['category']) ? $_GET['category'] : 0; $categories = BuckysForumCategory::getAllCategories(); buckys_enqueue_stylesheet('editor/jquery.cleditor.css'); buckys_enqueue_stylesheet('uploadify.css'); buckys_enqueue_stylesheet('forum.css'); buckys_enqueue_javascript('jquery-migrate-1.2.0.js'); buckys_enqueue_javascript('uploadify/jquery.uploadify.js'); buckys_enqueue_javascript('editor/jquery.cleditor.js'); //buckys_enqueue_javascript('editor/jquery.cleditor.bbcode.js'); $view['action_type'] = 'create'; $BUCKYS_GLOBALS['headerType'] = 'forum'; $BUCKYS_GLOBALS['content'] = 'forum/create_topic'; $BUCKYS_GLOBALS['title'] = 'Create a New Topic - BuckysRoomForum'; require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
<?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";
<?php require dirname(dirname(__FILE__)) . '/includes/bootstrap.php'; buckys_enqueue_stylesheet('shop.css'); buckys_enqueue_javascript('shop.js'); $TNB_GLOBALS['content'] = 'shop/index'; $TNB_GLOBALS['headerType'] = 'shop'; //Get Top Users $shopProductIns = new BuckysShopProduct(); $catIns = new BuckysShopCategory(); $view = []; $view['recent_products'] = $shopProductIns->getRecentProducts(10); $view['categories'] = $catIns->getCategoryList(0); $TNB_GLOBALS['title'] = 'BuckysRoomShop - Buy and Sell Items with Bitcoin'; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
$paramPageID = isset($_GET['pid']) ? intval($_GET['pid']) : null; $pageData = $pageIns->getPageByID($paramPageID); //If the parameter is null, goto homepage if (!buckys_not_null($pageData)) { buckys_redirect('/index.php'); } $page = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1; $totalCount = $pageFollowerIns->getNumberOfFollowers($pageData['pageID']); $pagination = new Pagination($totalCount, BuckysPageFollower::COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); //Get Friends $view['followers'] = $pageFollowerIns->getFollowers($pageData['pageID'], $page, BuckysPageFollower::COUNT_PER_PAGE); $view['pageData'] = $pageData; buckys_enqueue_stylesheet('profile.css'); buckys_enqueue_stylesheet('friends.css'); 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_stylesheet('page.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('page.js'); $BUCKYS_GLOBALS['content'] = 'followers'; $BUCKYS_GLOBALS['title'] = trim($pageData['title']) . "'s Followers - BuckysRoom"; //if logged user can see all resources of the current user require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
} if (!$toAddress) { buckys_redirect("/wallet.php", MSG_ENTER_BITCOINS_ADDRESS_OF_RECIPIENT, MSG_TYPE_ERROR); } if (!$amount || $amount <= 0) { buckys_redirect("/wallet.php", MSG_INVALID_BITCOIN_AMOUNT, MSG_TYPE_ERROR); } if (!$is_error) { $bitcoinClass->sendBitcoin($userID, $toAddress, $amount); } buckys_redirect("/wallet.php"); } $page = isset($_GET['page']) ? $_GET['page'] : 1; list($totalCount, $bitcoinBalance, $transactions) = $bitcoinClass->getTransactions($userID, $page, $bitcoinClass->COUNT_PER_PAGE); if (!$bitcoinBalance) { $bitcoinBalance = 0; } //Init Pagination Class $pagination = new Pagination($totalCount, $bitcoinClass->COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); //Getting Balance //$bitcoinBalance = $bitcoinClass->getWalletBalance($bitcoinInfo['bitcoin_guid'], buckys_decrypt($bitcoinInfo['bitcoin_password'])); buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('credits.css'); buckys_enqueue_javascript('wallet.js'); $TNB_GLOBALS['content'] = 'wallet'; $TNB_GLOBALS['title'] = "Wallet - " . TNB_SITE_NAME; $TNB_GLOBALS['payerID'] = $userID; $TNB_GLOBALS['meta'] = '<meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache">'; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
} if (isset($_GET['reply'])) { $replyTo = BuckysMessage::getMessage($_GET['reply']); } 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'] == 'compose_message') { //Show Results header('Content-type: application/xml'); if (!BuckysMessage::composeMessage($_POST)) { render_result_xml(['status' => 'error', 'message' => buckys_get_messages()]); } else { render_result_xml(['status' => 'success', 'message' => buckys_get_messages()]); } exit; } } buckys_enqueue_stylesheet('jquery-ui/jquery-ui.css'); buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('info.css'); buckys_enqueue_stylesheet('messages.css'); buckys_enqueue_javascript('jquery-ui.min.js'); buckys_enqueue_javascript('messages.js'); $TNB_GLOBALS['content'] = 'messages_compose'; $TNB_GLOBALS['title'] = "Compose Message - " . TNB_SITE_NAME; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
buckys_redirect('/reported.php?type=' . $reportType, MSG_REPORTED_OBJECT_REMOVED); } else { if ($_REQUEST['action'] == 'approve-objects') { BuckysReport::approveObjects($_REQUEST['reportID'], $reportType, $moderatorType); buckys_redirect('/reported.php?type=' . $reportType, MSG_REPORTED_OBJECT_APPROVED); } else { if ($_REQUEST['action'] == 'ban-users') { BuckysReport::banUsers($_REQUEST['reportID'], $reportType, $moderatorType); buckys_redirect('/reported.php?type=' . $reportType, MSG_BAN_USERS); } } } exit; } $page = isset($_GET['page']) ? $_GET['page'] : 1; $totalCount = BuckysReport::getReportedObjectCount($reportType); //Init Pagination Class $pagination = new Pagination($totalCount, BuckysReport::$COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); $objects = BuckysReport::getReportedObject($reportType, $page, BuckysReport::$COUNT_PER_PAGE); buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('moderator.css'); buckys_enqueue_stylesheet('moderator.css'); buckys_enqueue_stylesheet('prettify.css'); buckys_enqueue_javascript('prettyprint/run_prettify.js?skin=default&'); buckys_enqueue_javascript('reported.js'); $BUCKYS_GLOBALS['content'] = 'reported'; //Reported Object Type Label $reportLabel = array('post' => array('Post', 'Posts'), 'comment' => array('Comment', 'Comments'), 'message' => array('Message', 'Messages'), 'topic' => array('Topic', 'Topics'), 'reply' => array('Reply', 'Replies')); $BUCKYS_GLOBALS['title'] = "Manage Reported " . $reportLabel[$reportType][1] . " - BuckysRoom"; require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
if ($remindTimeString == '') { $remindTimeString = ceil($timeOffset / 60); if ($remindTimeString > 1) { $remindTimeString .= ' minutes'; } else { $remindTimeString .= ' minute'; } } if ($remindTimeString == '') { $remindTimeString = $timeOffset; if ($remindTimeString > 1) { $remindTimeString .= ' seconds'; } else { $remindTimeString .= ' second'; } } $page = isset($_GET['page']) ? $_GET['page'] : 1; $totalCount = BuckysModerator::getCandidatesCount($moderatorType); //Getting Current Moderator $currentModerator = BuckysModerator::getModerator($moderatorType); //Init Pagination Class $pagination = new Pagination($totalCount, BuckysModerator::$CANDIDATES_PER_PAGE, $page); $page = $pagination->getCurrentPage(); $candidates = BuckysModerator::getCandidates($moderatorType, $page); buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('moderator.css'); buckys_enqueue_javascript('moderator.js'); $BUCKYS_GLOBALS['content'] = 'moderator'; $BUCKYS_GLOBALS['title'] = "Moderator - BuckysRoom"; //if logged user can see all resources of the current user require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
require dirname(__FILE__) . '/includes/bootstrap.php'; //Getting Current User ID $userID = buckys_is_logged_in(); //If the parameter is null, goto homepage if ($userID) { buckys_redirect('/account.php'); } $token = isset($_REQUEST['token']) ? $_REQUEST['token'] : ''; if (!$token) { buckys_redirect('/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } if (!($userID = BuckysUsersToken::checkTokenValidity($token, 'password'))) { buckys_redirect('/register.php?forgotpwd=1', MSG_USER_TOKEN_LINK_NOT_CORRECT, MSG_TYPE_ERROR); } if (isset($_POST['action']) && $_POST['action'] == 'reset-password') { if (!$_POST['password'] || !$_POST['password']) { buckys_add_message(MSG_EMPTY_PASSWORD, MSG_TYPE_ERROR); } else { if ($_POST['password'] != $_POST['password']) { buckys_add_message(MSG_NOT_MATCH_PASSWORD, MSG_TYPE_ERROR); } else { $pwd = buckys_encrypt_password($_POST['password']); BuckysUser::updateUserFields($userID, ['password' => $pwd]); buckys_redirect('/index.php', MSG_PASSWORD_UPDATED); } } } buckys_enqueue_stylesheet('register.css'); buckys_enqueue_javascript('register.js'); $TNB_GLOBALS['content'] = 'reset_password'; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
<?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('uploadify.css'); buckys_enqueue_stylesheet('jquery.Jcrop.css'); 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_GLOBALS['content'] = 'trade/additem'; $BUCKYS_GLOBALS['headerType'] = 'trade'; $view = array(); $tradeCatIns = new BuckysTradeCategory(); $countryIns = new BuckysCountry(); $tradeItemIns = new BuckysTradeItem(); $tradeUserIns = new BuckysTradeUser(); $view['category_list'] = $tradeCatIns->getCategoryList(0); $view['country_list'] = $countryIns->getCountryList(); $view['action_name'] = 'editTradeItem'; $paramItemID = get_secure_integer($_REQUEST['id']); $paramType = get_secure_string($_REQUEST['type']); $view['item'] = null; switch ($paramType) { case 'relist': $view['no_credits'] = false; if (!$tradeUserIns->hasCredits($userID)) {
if ($_REQUEST['action'] == 'unban') { BuckysBanUser::unbanUsers($_REQUEST['bannedID']); buckys_redirect('/banned_users.php', MSG_UNBAN_USERS); } else { if ($_REQUEST['action'] == 'delete') { BuckysBanUser::deleteUsers($_REQUEST['bannedID']); buckys_redirect('/banned_users.php', MSG_DELETE_USERS); } else { if ($_REQUEST['action'] == 'deletebyid') { if (!isset($_REQUEST['userID']) || !BuckysUser::checkUserID($_REQUEST['userID'], false)) { buckys_redirect('/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } BuckysUser::deleteUserAccount($_REQUEST['userID']); buckys_redirect('/index.php', MSG_DELETE_USERS); } } } exit; } $page = isset($_GET['page']) ? $_GET['page'] : 1; $totalCount = BuckysBanUser::getBannedUsersCount(); //Init Pagination Class $pagination = new Pagination($totalCount, BuckysBanUser::$COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); $users = BuckysBanUser::getBannedUsers($page, BuckysBanUser::$COUNT_PER_PAGE); buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('moderator.css'); buckys_enqueue_javascript('banned_users.js'); $BUCKYS_GLOBALS['content'] = 'banned_users'; $BUCKYS_GLOBALS['title'] = "Manage Banned Users - BuckysRoom"; require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
<?php require dirname(__FILE__) . '/includes/bootstrap.php'; //Getting Current User ID if (!($userID = buckys_is_logged_in())) { buckys_redirect('/index.php', MSG_NOT_LOGGED_IN_USER, MSG_TYPE_ERROR); } if (isset($_POST['action']) && $_POST['action'] == 'create-photo') { //Add Photo if ($newID = BuckysPost::savePhoto($userID, $_POST)) { buckys_redirect('/photo_edit.php?photoID=' . $newID); } else { buckys_redirect('/photo_add.php'); } } //Getting UserData from Id $userData = BuckysUser::getUserData($userID); //Getting User Albums $albums = BuckysAlbum::getAlbumsByUserId($userID); buckys_enqueue_stylesheet('account.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('add_photo.js'); $BUCKYS_GLOBALS['content'] = 'photo_add'; $BUCKYS_GLOBALS['title'] = "Add Photo - BuckysRoom"; require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
} require_once DIR_FS_INCLUDES . "messages.php"; require_once DIR_FS_INCLUDES . "tables.php"; $db = new Database_Mysqli(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME); require_once DIR_FS_FUNCTIONS . "session.php"; require_once DIR_FS_FUNCTIONS . "general.php"; require_once DIR_FS_FUNCTIONS . "view.php"; //Session Start buckys_session_start(); //Init Global Values buckys_enqueue_javascript('jquery-1.9.0.js', false, false); buckys_enqueue_javascript('site.js'); buckys_enqueue_stylesheet('main.css'); $BUCKYS_GLOBALS['template'] = DEFAULT_THEME; $BUCKYS_GLOBALS['layout'] = 'layout'; $BUCKYS_GLOBALS['headerType'] = 'default'; //Define User Acl Constants BuckysUserAcl::defineAclConstants(); //Set User Data into Global Variable if (!($userID = buckys_is_logged_in())) { $BUCKYS_GLOBALS['user'] = array('userID' => 0, 'user_type' => 'Public', 'aclLevel' => 0, 'aclName' => 'Public'); } else { $BUCKYS_GLOBALS['user'] = BuckysUser::getUserBasicInfo($userID); } if (buckys_is_logged_in()) { buckys_enqueue_stylesheet('footer.css'); buckys_enqueue_stylesheet('jquery-ui/jquery-ui.css'); buckys_enqueue_javascript('jquery-ui.min.js'); buckys_enqueue_javascript('jquery.contextMenu.js'); buckys_enqueue_javascript('private_messenger.js'); }
$userID = buckys_is_logged_in(); $replyID = isset($_GET['replyID']) ? get_secure_integer($_GET['replyID']) : null; $replyData = $forumReplyIns->getReplyByID($replyID); if ($replyData && $replyData['creatorID'] == $userID && $replyData['topicID'] == $topicID) { //then you can edit this one $view['replyData'] = $replyData; $view['action_type'] = 'edit'; $view['replyID'] = $replyID; } else { //permission error buckys_redirect('/forum', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } } } } if (!isset($replyData) || !$replyData) { buckys_redirect("/forum", MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $topicData = BuckysForumTopic::getTopic($replyData['replyID']); $category = BuckysForumCategory::getCategory($topicData['categoryID']); $categories = BuckysForumCategory::getAllCategories(); buckys_enqueue_stylesheet('sceditor/themes/default.css'); buckys_enqueue_stylesheet('forum.css'); buckys_enqueue_stylesheet('publisher.css'); buckys_enqueue_stylesheet('uploadify.css'); buckys_enqueue_javascript('sceditor/jquery.sceditor.bbcode.js'); buckys_enqueue_javascript('uploadify/jquery.uploadify.js'); $TNB_GLOBALS['headerType'] = 'forum'; $TNB_GLOBALS['content'] = 'forum/post_reply'; $TNB_GLOBALS['title'] = 'Post Reply - thenewboston Forum'; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
require dirname(dirname(__FILE__)) . '/includes/bootstrap.php'; //Getting Current User ID if (!buckys_check_user_acl(USER_ACL_REGISTERED)) { buckys_redirect('/index.php', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } $userID = buckys_is_logged_in(); $classAds = new BuckysAds(); //Add Funds if (isset($_POST['action']) && $_POST['action'] == 'add-funds') { if (!buckys_check_form_token()) { buckys_redirect('/ads/advertiser.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $adID = buckys_escape_query_integer($_POST['id']); $adDetail = $classAds->getAdById($adID); if (!$adDetail || $adDetail['ownerID'] != $userID && buckys_check_user_acl(USER_ACL_MODERATOR)) { buckys_redirect('/ads/advertiser.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $result = $classAds->addFunds($userID, $adID, $_POST['amount']); buckys_add_message($classAds->last_message, $result ? MSG_TYPE_SUCCESS : MSG_TYPE_ERROR); } buckys_enqueue_stylesheet('publisher.css'); $adID = buckys_escape_query_integer($_GET['id']); $adDetail = $classAds->getAdById($adID); if (!$adDetail || $adDetail['ownerID'] != $userID && buckys_check_user_acl(USER_ACL_MODERATOR)) { buckys_redirect('/ads/advertiser.php'); } $TNB_GLOBALS['headerType'] = "ads"; $TNB_GLOBALS['content'] = "ads/view"; buckys_enqueue_javascript('jquery.number.js'); $TNB_GLOBALS['title'] = "View Ad - thenewboston Ads"; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
if (trim($_POST['album_name']) == '') { buckys_redirect('/photo_album_edit.php?albumID=' . $_POST['albumID'], MSG_ALBUM_TITLE_EMPTY, MSG_TYPE_ERROR); } BuckysAlbum::updateAlbum($_POST['albumID'], trim($_POST['album_name']), $_POST['visibility'], $_POST['photos']); buckys_redirect("/photo_album_edit.php?albumID=" . $_POST['albumID'], MSG_ALBUM_UPDATED); } else { if ($_POST['action'] == 'remove-from-album' || $_POST['action'] == 'add-to-album') { $photoID = $_POST['photoID']; $photo = BuckysPost::getPostById($photoID); //Check Photo Owner if ($photo['poster'] != $userID) { echo MSG_INVALID_REQUEST; exit; } if ($_POST['action'] == 'remove-from-album') { BuckysAlbum::removePhotoFromAlbum($albumID, $photoID); } else { BuckysAlbum::addPhotoToAlbum($albumID, $photoID); } //Add echo 'success'; exit; } } } buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('posting.css'); buckys_enqueue_javascript('album.js'); $BUCKYS_GLOBALS['content'] = 'photo_album_edit'; $BUCKYS_GLOBALS['title'] = "Edit Photo Album - BuckysRoom"; require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
<?php require dirname(dirname(__FILE__)) . '/includes/bootstrap.php'; //Getting Current User ID if (!buckys_check_user_acl(USER_ACL_REGISTERED)) { buckys_redirect('/index.php', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } $userID = buckys_is_logged_in(); $adClass = new BuckysAds(); if (isset($_POST['action']) && $_POST['action'] == 'create-ad') { if (!buckys_check_form_token()) { buckys_redirect('/ads/create_ad.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } else { if ($adClass->saveAd($userID, $_POST)) { buckys_redirect('/ads/advertiser.php?status=pending', $adClass->last_message); } else { buckys_redirect('/ads/create_ad.php?type=' . $_POST['type'], $adClass->last_message, MSG_TYPE_ERROR); } } } $adSizes = $adClass->getAdSizes(); $adType = isset($_GET['type']) && $_GET['type'] == 'Image' ? 'Image' : 'Text'; buckys_enqueue_stylesheet('publisher.css'); buckys_enqueue_stylesheet('uploadify.css'); buckys_enqueue_javascript('uploadify/jquery.uploadify.js'); buckys_enqueue_javascript('jquery.number.js'); buckys_enqueue_javascript('create_ad.js'); $TNB_GLOBALS['headerType'] = "ads"; $TNB_GLOBALS['content'] = "ads/create_ad"; $TNB_GLOBALS['title'] = "Create New Ad - thenewboston Ads"; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
} } else { if ($action == 'delete-topic') { // Delete Pending Topics //Getting Ids $topicIds = isset($_POST['tid']) ? $_POST['tid'] : null; if (!$topicIds) { buckys_redirect('/forum/pending_topcis.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $result = BuckysForumTopic::deletePendingTopics($topicIds); if ($result === true) { buckys_redirect('/forum/pending_topics.php', MSG_TOPIC_REMOVED_SUCCESSFULLY); } else { buckys_redirect('/forum/pending_topics.php', $result, MSG_TYPE_ERROR); } } } } //Getting Pending Topics $page = isset($_GET['page']) ? $_GET['page'] : 1; $total = BuckysForumTopic::getTotalNumOfTopics('pending'); $pagination = new Pagination($total, BuckysForumTopic::$COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); $topics = BuckysForumTopic::getTopics($page, 'pending', null, null, BuckysForumTopic::$COUNT_PER_PAGE); buckys_enqueue_javascript('jquery-migrate-1.2.0.js'); buckys_enqueue_stylesheet('forum.css'); buckys_enqueue_stylesheet('publisher.css'); $TNB_GLOBALS['headerType'] = 'forum'; $TNB_GLOBALS['content'] = 'forum/pending_topics'; $TNB_GLOBALS['title'] = 'Pending Topics - thenewboston Forum'; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
<?php require dirname(dirname(__FILE__)) . '/includes/bootstrap.php'; if (!($userID = buckys_is_logged_in())) { buckys_redirect('/register.php'); } buckys_enqueue_stylesheet('uploadify.css'); buckys_enqueue_stylesheet('jquery.Jcrop.css'); 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';
buckys_redirect('/index.php'); } //Getting UserData from Id $userData = BuckysUser::getUserLinks($userID); 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'] == 'save_links') { $data = array(); for ($i = 0; $i < count($_POST['title']); $i++) { $data[] = array('title' => $_POST['title'][$i], 'url' => $_POST['url'][$i], 'visibility' => $_POST['visibility'][$i]); } //Update User Phone numbers if (BuckysUser::updateUserLinks($userID, $data)) { echo 'Success'; } else { echo $db->getLastError(); } exit; } } buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('info.css'); buckys_enqueue_javascript('info.js'); $BUCKYS_GLOBALS['content'] = 'info_links'; $BUCKYS_GLOBALS['title'] = "Info Links - BuckysRoom"; require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
//Change user profile image if ($_POST['photo_visibility'] == 2) { if (!$photo['is_profile']) { BuckysPost::createProfileImage($photo, $_POST); } //Update profile image with old one BuckysUser::updateUserFields($userID, array('thumbnail' => $photo['image'])); } else { if ($userData['thumbnail'] == $photo['image']) { //If it was a profile image and now it is not, remove it from the profile image BuckysUser::updateUserFields($userID, array('thumbnail' => '')); } } //Save Album if (isset($_POST['album']) && $_POST['album'] != '' && isset($albums[$_POST['album']])) { BuckysAlbum::addPhotoToAlbum($_POST['album'], $photo['postID']); } buckys_redirect('/photo_edit.php?photoID=' . $photo['postID'], MSG_PHOTO_UPDATED, MSG_TYPE_SUCCESS); exit; } } $set_profile = isset($_GET['set_profile']) ? $_GET['set_profile'] : null; buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('posting.css'); buckys_enqueue_stylesheet('jquery.Jcrop.css'); buckys_enqueue_javascript('jquery.Jcrop.js'); buckys_enqueue_javascript('jquery.color.js'); buckys_enqueue_javascript('edit_photo.js'); $BUCKYS_GLOBALS['content'] = 'photo_edit'; $BUCKYS_GLOBALS['title'] = "Edit Photo - BuckysRoom"; require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
<?php require dirname(__FILE__) . '/includes/bootstrap.php'; buckys_enqueue_stylesheet('search.css'); buckys_enqueue_javascript('search.js'); $searchIns = new BuckysSearch(); $TNB_GLOBALS['content'] = 'search'; $TNB_GLOBALS['headerType'] = ''; $paramQueryStr = buckys_escape_query_string($_REQUEST['q']); $paramType = buckys_escape_query_string($_REQUEST['type']); $paramSort = buckys_escape_query_string($_REQUEST['sort']); $view = []; //Create Base URL for pagination of search page $view['page_base_url'] = buckys_pp_search_url($paramQueryStr, $paramType, $paramSort, true); $page = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1; $totalCount = $searchIns->getNumberOfSearchResult($paramQueryStr, $paramType); $pagination = new Pagination($totalCount, BuckysSearch::SEARCH_RESULT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); //Get Friends $view['search_result'] = $searchIns->search($paramQueryStr, $paramType, $paramSort, $page); //Display $TNB_GLOBALS['searchParamPP']['q'] = $paramQueryStr; $TNB_GLOBALS['searchParamPP']['type'] = $paramType; $TNB_GLOBALS['searchParamPP']['sort'] = $paramSort; if ($paramQueryStr != '') { $TNB_GLOBALS['title'] = $paramQueryStr . ' - ' . TNB_SITE_NAME . ' Search'; } else { $TNB_GLOBALS['title'] = TNB_SITE_NAME . ' Search'; } require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
buckys_redirect('/index.php'); } $postType = isset($_GET['type']) ? $_GET['type'] : 'all'; if (!in_array($postType, ['all', 'user', 'friends'])) { $postType = 'all'; } //if logged user can see all resources of the current user $canViewPrivate = $userID == $profileID || BuckysFriend::isFriend($userID, $profileID) || BuckysFriend::isSentFriendRequest($profileID, $userID); $posts = BuckysPost::getPostsByUserID($profileID, $userID, BuckysPost::INDEPENDENT_POST_PAGE_ID, $canViewPrivate, $postID, null, $postType); /*if( !buckys_not_null($posts) ) { //Goto Index Page buckys_redirect('/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); }*/ //Mark the notifications to read if ($postID) { BuckysActivity::markReadNotifications($userID, $postID); } buckys_enqueue_stylesheet('profile.css'); buckys_enqueue_stylesheet('posting.css'); buckys_enqueue_stylesheet('uploadify.css'); buckys_enqueue_stylesheet('jquery.Jcrop.css'); buckys_enqueue_stylesheet('publisher.css'); buckys_enqueue_javascript('uploadify/jquery.uploadify.js'); buckys_enqueue_javascript('jquery.Jcrop.js'); buckys_enqueue_javascript('posts.js'); $TNB_GLOBALS['content'] = 'posts'; if ($userData) { $TNB_GLOBALS['title'] = trim($userData['firstName'] . ' ' . $userData['lastName']) . "'s Posts - " . TNB_SITE_NAME; } require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
$totalCount = BuckysFriend::getNumberOfFriends($userID); } else { if ($type == 'pending') { $totalCount = BuckysFriend::getNumberOfPendingRequests($userID); } else { if ($type == 'requested') { $totalCount = BuckysFriend::getNumberOfReceivedRequests($userID); } } } //Init Pagination Class $pagination = new Pagination($totalCount, BuckysFriend::$COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); if ($type == 'all') { $friends = BuckysFriend::getAllFriends($userID, $page, BuckysFriend::$COUNT_PER_PAGE); } else { if ($type == 'pending') { $friends = BuckysFriend::getPendingRequests($userID, $page, BuckysFriend::$COUNT_PER_PAGE); } else { if ($type == 'requested') { $friends = BuckysFriend::getReceivedRequests($userID, $page, BuckysFriend::$COUNT_PER_PAGE); } } } buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('friends.css'); buckys_enqueue_javascript('friends.js'); $TNB_GLOBALS['content'] = 'myfriends'; $TNB_GLOBALS['title'] = "My Friends - " . TNB_SITE_NAME; //if logged user can see all resources of the current user require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
buckys_redirect('/forum'); } $orderBy = isset($_GET['orderby']) ? buckys_escape_query_string($_GET['orderby']) : 'oldest'; //Getting Replies $page = isset($_GET['page']) ? buckys_escape_query_integer($_GET['page']) : 1; $total = BuckysForumReply::getTotalNumOfReplies($topic['topicID'], 'publish'); $pagination = new Pagination($total, BuckysForumReply::$COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); $replies = BuckysForumReply::getReplies($topic['topicID'], 'publish', $page, $orderBy); $hierarchical = BuckysForumCategory::getCategoryHierarchical($topic['categoryID']); //Mark Forum Notifications to read if (buckys_check_user_acl(USER_ACL_REGISTERED)) { BuckysForumNotification::makeNotificationsToRead($TNB_GLOBALS['user']['userID'], null, $topic['topicID']); } if (buckys_check_user_acl(USER_ACL_MODERATOR)) { $reportID = BuckysReport::isReported($topicID, 'topic'); $categories = BuckysForumCategory::getAllCategories(); } buckys_enqueue_javascript('sceditor/jquery.sceditor.bbcode.js'); buckys_enqueue_javascript('uploadify/jquery.uploadify.js'); buckys_enqueue_javascript('highlight.pack.js'); buckys_enqueue_javascript('forum.js'); buckys_enqueue_stylesheet('sceditor/themes/default.css'); buckys_enqueue_stylesheet('obsidian.css'); buckys_enqueue_stylesheet('forum.css'); buckys_enqueue_stylesheet('publisher.css'); buckys_enqueue_stylesheet('uploadify.css'); $TNB_GLOBALS['headerType'] = 'forum'; $TNB_GLOBALS['content'] = 'forum/topic'; $TNB_GLOBALS['title'] = $topic['topicTitle'] . ' - thenewboston Forum'; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
} //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'); //Set Content $TNB_GLOBALS['content'] = 'account'; //Page Title $TNB_GLOBALS['title'] = 'My Account - ' . TNB_SITE_NAME; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
BuckysForumCategory::saveCategoryLink($categoryID, $link_title, $link_url); } } buckys_redirect("/forum/category.php?id=" . $categoryID, MSG_FORUM_SAVED, MSG_TYPE_SUCCESS); } $categoryID = isset($_GET['id']) ? $_GET['id'] : null; if ($categoryID != null) { $category = BuckysForumCategory::getCategory($categoryID); //Check Permission if (!$category || !buckys_is_admin() && !buckys_is_moderator() && !buckys_is_forum_admin($category['categoryID']) && !buckys_is_forum_moderator($category['categoryID'])) { buckys_redirect('/forum', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } } buckys_enqueue_stylesheet('sceditor/themes/default.css'); buckys_enqueue_stylesheet('forum.css'); buckys_enqueue_stylesheet('posting.css'); buckys_enqueue_stylesheet('publisher.css'); buckys_enqueue_stylesheet('uploadify.css'); buckys_enqueue_stylesheet('jquery.Jcrop.css'); buckys_enqueue_javascript('sceditor/jquery.sceditor.bbcode.js'); buckys_enqueue_javascript('uploadify/jquery.uploadify.js'); buckys_enqueue_javascript('jquery.Jcrop.js'); buckys_enqueue_javascript('edit_forum.js'); $TNB_GLOBALS['headerType'] = 'forum'; $TNB_GLOBALS['content'] = 'forum/edit_category'; if (!$categoryID) { $TNB_GLOBALS['title'] = 'Create a New Forum - thenewboston Forum'; } else { $TNB_GLOBALS['title'] = 'Edit Forum - thenewboston Forum'; } require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
if (!buckys_check_user_acl(USER_ACL_MODERATOR)) { buckys_redirect('/index.php', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } $classAds = new BuckysAds(); if (isset($_REQUEST['action'])) { if (!buckys_check_form_token()) { buckys_redirect('/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } if ($_REQUEST['action'] == 'reject-ads') { $classAds->rejectAds($_REQUEST['adID']); buckys_redirect('/manage_ads.php', MSG_AD_ADS_REJECTED); } else { if ($_REQUEST['action'] == 'approve-ads') { $classAds->approveAds($_REQUEST['adID']); buckys_redirect('/manage_ads.php', MSG_AD_ADS_APPROVED); } } } $page = isset($_GET['page']) ? $_GET['page'] : 1; $totalCount = $classAds->getPendingAdsCount(); //Init Pagination Class $pagination = new Pagination($totalCount, BuckysAds::$COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); $objects = $classAds->getPendingAds($page, BuckysAds::$COUNT_PER_PAGE); buckys_enqueue_javascript('manage_ads.js'); buckys_enqueue_stylesheet('account.css'); buckys_enqueue_stylesheet('moderator.css'); buckys_enqueue_stylesheet('publisher.css'); $TNB_GLOBALS['content'] = 'manage_ads'; $TNB_GLOBALS['title'] = "Moderator Panel"; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
//Get Prev, Next Video $prevVideoId = null; $nextVideoId = null; foreach ($categoryVideos as $idx => $v) { if ($v['videoID'] == $video['videoID']) { $nextVideoId = isset($categoryVideos[$idx + 1]) ? $categoryVideos[$idx + 1]['videoID'] : null; break; } $prevVideoId = $v['videoID']; } $subjectID = $category['subjectID']; } $videoSubject = $videoClass->getSubject($subjectID); $videoCategories = $videoClass->getVideoCategories($subjectID); if (isset($video)) { $videoInfo = $videoClass->getVideoInfo($video['code']); } buckys_enqueue_stylesheet('index.css'); buckys_enqueue_stylesheet('sceditor/themes/default.css'); buckys_enqueue_stylesheet('postlist.css'); buckys_enqueue_stylesheet('videos.css'); buckys_enqueue_javascript('sceditor/jquery.sceditor.bbcode.js'); buckys_enqueue_javascript('videos.js'); $TNB_GLOBALS['content'] = "videos"; /* Page title if(isset($videoInfo)) $TNB_GLOBALS['title'] = $videoInfo['entry']['title']['$t']; else */ $TNB_GLOBALS['title'] = TNB_SITE_NAME . " Videos and Tutorials - Free Educational Video Tutorials on Computer Programming, Adobe Software, Computer Science and More!"; require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";