function getStoryFromRequest() { $news_office = new NewsOffice(); if(isSearchResult()) { $search_results = $news_office->get_search_results($_REQUEST['query'], seekSearchID()+$_REQUEST['search_id'], 1); return $search_results['items'][0]; } else { return $news_office->get_news_story(channelID(), $_REQUEST['story_id']); } }
require_once WEBROOT . "page_builder/page_header.php"; require_once WEBROOT . "page_builder/page_tools.php"; require_once LIBDIR . "NewsOffice.php"; require_once "story_request_lib.php"; define("MAX_DECK_LENGTH", 50); $story_id = seekStoryID(); $channel_id = channelID(); $news_office = new NewsOffice(); if(isSearchResult()) { $seek_search_id = seekSearchID(); $search_query = $_REQUEST['query']; $search_results = $news_office->get_search_results($search_query, $seek_search_id, 10); $stories = $search_results['items']; $search_results_count = $search_results['totalResults']; if($search_results_count > $seek_search_id + 10) { $next_search_id = $seek_search_id + 10; } else { $next_search_id = NULL; } if($seek_search_id >= 10) { $previous_search_id = $seek_search_id - 10; } $extra_params = newsHomeQueryArray();