Example #1
0
require_once LIBDIR . "NewsOffice.php";
require_once "story_request_lib.php";

$story = getStoryFromRequest();
$story_html = new HTMLFragment($story['body']);
$pages = $story_html->pages();
$page_count = sizeof($pages);
$current_page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 0;
$page_html = $pages[$current_page];
$page_content = $page_html->getBody();

$previous_page = ($current_page != 0) ? $current_page-1 : NULL;
$next_page = ($current_page+1 != $page_count) ? $current_page+1 : NULL;

$email_query = "mailto:?subject=" . rawurlencode($story['title']);
$email_query .= "&body=" . rawurlencode($story['description'] . "\n\n" . NewsOffice::story_link($story['story_id']));

if(isset($story['main_image']) && $story['main_image']) {
  $main_image = $story['main_image'];
  $total_photos = sizeof($story['images']) + 1;
}

if($total_photos == 1) {
  $see_instructions = "See 1 photo";
} else {
  $see_instructions = "See {$total_photos} photos";
}

require "{$page->branch}/detail.html";

$page->output();
function channels() {
  return NewsOffice::channels();
}
Example #3
0
<?php

$docRoot = getenv("DOCUMENT_ROOT");
require_once $docRoot . '/mobi-config/mobi_web_constants.php';
require_once WEBROOT . "api/api_header.php";
require_once LIBDIR . "NewsOffice.php";
log_api('newsoffice');

$news_office = new NewsOffice();
$news_office->use_development_feed();
$news_office->disable_cache();

$channel_id = $_REQUEST['channel'] ? $_REQUEST['channel'] : 0;

$story_id = isset($_REQUEST['story_id']) ? $_REQUEST['story_id'] : NULL;

echo $news_office->get_news_xml($channel_id, $story_id, 'dev')->saveXML();

?>
Example #4
0
<?php

$docRoot = getenv("DOCUMENT_ROOT");
require_once $docRoot . '/mobi-config/mobi_web_constants.php';
require_once WEBROOT . "api/api_header.php";
require_once LIBDIR . "NewsOffice.php";
log_api('newsoffice');

$news_office = new NewsOffice();

$channel_id = $_REQUEST['channel'] ? $_REQUEST['channel'] : 0;

$story_id = isset($_REQUEST['story_id']) ? $_REQUEST['story_id'] : NULL;

echo $news_office->get_news_xml($channel_id, $story_id)->saveXML();;

?>
Example #5
0
<?php
$docRoot = getenv("DOCUMENT_ROOT");

require_once $docRoot . "/mobi-config/mobi_web_constants.php";
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) {