function getVideosAction() { $request = $_GET; $videoClass = new BuckysVideo(); $categoryID = isset($request['cat']) ? buckys_escape_query_integer($request['cat']) : null; $videoID = isset($request['video']) ? buckys_escape_query_integer($request['video']) : null; $token = isset($request['TOKEN']) ? trim($request['TOKEN']) : null; if (!$token) { return ['STATUS_CODE' => STATUS_CODE_BAD_REQUEST, 'DATA' => ['STATUS' => 'ERROR', 'ERROR' => 'Api token should not be blank']]; } if ($token != THENEWBOSTON_PUBLIC_API_KEY) { return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => ['STATUS' => 'ERROR', 'ERROR' => 'Api token is not valid.']]; } $videos = $videoClass->getVideos($categoryID); return ['STATUS_CODE' => STATUS_CODE_OK, "DATA" => $videos]; }
echo $row['ownerName']; ?> </a> </div> <div class="td td-content"> <?php switch ($row['objectType']) { case 'post': echo '<a href="/posts.php?user='******'ownerID'] . '&post=' . $row['objectID'] . '">Post - ' . $row['objectID'] . '</a>'; break; case 'comment': $tPost = BuckysComment::getPost($row['objectID']); echo '<a href="/posts.php?user='******'poster'] . '&post=' . $tPost['postID'] . '">Comment - ' . $row['objectID'] . '</a>'; break; case 'video_comment': echo '<a href="/videos.php?video=' . BuckysVideo::getVideoIDByCommentID($row['objectID']) . '">Video Comment - ' . $row['objectID'] . '</a>'; break; case 'topic': echo '<a href="/forum/topic.php?id=' . $row['objectID'] . '">Forum Topic - ' . $row['objectID'] . '</a>'; break; case 'message': echo '<a href="/messages_read.php?message=' . $row['objectID'] . '">Message - ' . $row['objectID'] . '</a>'; break; case 'reply': echo '<a href="/forum/topic.php?id=' . BuckysForumReply::getForumID($row['objectID']) . '">Forum Reply - ' . $row['objectID'] . '</a>'; break; case 'trade_item': echo '<a href="/trade/view.php?id=' . $row['objectID'] . '">Trade Item - ' . $row['objectID'] . '</a>'; break; case 'shop_item': echo '<a href="/shop/view.php?id=' . $row['objectID'] . '">Shop Product - ' . $row['objectID'] . '</a>';
/** * Delete Objects * * @param Array $ids */ public static function deleteObjects($ids) { global $db; if (!is_array($ids)) { $ids = [$ids]; } $ids = $db->escapeInput($ids); $query = $db->prepare("SELECT * FROM " . TABLE_REPORTS . " WHERE reportID IN (" . implode(", ", $ids) . ")"); $rows = $db->getResultsArray($query); foreach ($rows as $row) { if ($row['objectType'] == 'post') { $post = $db->getRow("SELECT * FROM " . TABLE_POSTS . " WHERE postID=" . $row['objectID']); BuckysPost::deletePost($post['poster'], $post['postID']); } else { if ($row['objectType'] == 'comment') { //Getting Data $comment = $db->getRow("SELECT * FROM " . TABLE_POSTS_COMMENTS . " WHERE commentID=" . $row['objectID']); BuckysComment::deleteComment($comment['commenter'], $comment['commentID']); } else { if ($row['objectType'] == 'video_comment') { //Getting Data $comment = $db->getRow("SELECT * FROM " . TABLE_VIDEO_COMMENTS . " WHERE commentID=" . $row['objectID']); BuckysVideo::deleteVideoComment($comment['commentID']); } else { if ($row['objectType'] == 'message') { //Delete Message $db->query("DELETE FROM " . TABLE_MESSAGES . " WHERE messageID=" . $row['objectID']); } else { if ($row['objectType'] == 'topic') { //Delete Topic BuckysForumTopic::deleteTopic($row['objectID']); } else { if ($row['objectType'] == 'reply') { //Delete Topic BuckysForumReply::deleteReply($row['objectID']); } else { if ($row['objectType'] == 'shop_item') { //Delete Shop Product $shopProdIns = new BuckysShopProduct(); $shopProdIns->removeProductByUserID($row['objectID'], $row['reportedID']); } else { if ($row['objectType'] == 'trade_item') { //Delete Trade Item $tradeItemIns = new BuckysTradeItem(); $tradeItemIns->removeItemByUserID($row['objectID'], $row['reportedID']); } } } } } } } } //Delete the row on the report table $db->query("DELETE FROM " . TABLE_REPORTS . " WHERE reportID=" . $row['reportID']); } return; }
<?php /** * Show All Videos */ require dirname(__FILE__) . '/includes/bootstrap.php'; $videoClass = new BuckysVideo(); $subjectID = isset($_GET['subject']) ? buckys_escape_query_string($_GET['subject']) : 0; $categoryID = isset($_GET['cat']) ? buckys_escape_query_integer($_GET['cat']) : null; $videoID = isset($_GET['video']) ? buckys_escape_query_integer($_GET['video']) : null; if ($videoID) { $video = $videoClass->getVideo($videoID); if (!$video) { buckys_redirect("/videos.php", MSG_INVALID_REQUEST, MSG_TYPE_ERROR); exit; } $categoryID = $video['categoryID']; } if ($categoryID) { $category = $videoClass->getCategory($categoryID); $categoryVideos = $videoClass->getVideos($categoryID); if (!$videoID) { $video = $categoryVideos[0]; } //Getting Forum Recent Posts $topics = BuckysForumTopic::getTopics(1, 'publish', $category['forumCategoryID'], 'lastReplyDate DESC', 10); $forumCategory = BuckysForumCategory::getCategory($category['forumCategoryID']); //Get Prev, Next Video $prevVideoId = null; $nextVideoId = null; foreach ($categoryVideos as $idx => $v) {