function getCategoriesAction() { $request = $_GET; $videoClass = new BuckysVideo(); $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.']]; } $subjectID = isset($request['subject']) ? buckys_escape_query_string($request['subject']) : 0; $videoCategories = $videoClass->getVideoCategories($subjectID); return ['STATUS_CODE' => STATUS_CODE_OK, "DATA" => $videoCategories]; }
$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) { 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 */