예제 #1
0
/**
 * Copyright (c) 2009 West Virginia University
 * 
 * Licensed under the MIT License
 * Redistributions of files must retain the above copyright notice.
 * 
 */
// various copy includes
require_once "../../config.gen.inc.php";
require_once "data/data.inc.php";
// records stats
require_once "../page_builder/page_header.php";
// libs
require_once "../../lib/rss_services.php";
$News = new RSS();
$items = $News->get_feed($news_srcs[$_REQUEST['src']]['url']);
$title = stripslashes($_REQUEST['title']);
$text = explode("\n", $items[$title]['text']);
$link = $items[$title]['link'];
$read_more = $news_srcs[$_REQUEST['src']]['read_more'];
$section = $news_srcs[$_REQUEST['src']]['title'];
$paragraphs = array();
foreach ($text as $paragraph) {
    if ($paragraph) {
        $paragraphs[] = str_replace('Read more ...', '', $paragraph);
    }
}
$long_date = str_replace(' 0:00:00', '', date("l, F j, Y G:i:s", $items[$title]['unixtime']));
require "templates/{$prefix}/detail.html";
$page->output();
예제 #2
0
<?php

/**
 * Copyright (c) 2009 West Virginia University
 * 
 * Licensed under the MIT License
 * Redistributions of files must retain the above copyright notice.
 * 
 */
require_once "../../../lib/rss_services.php";
require_once "../data/data.inc.php";
$Emergency = new RSS();
$emergencies = $Emergency->get_feed($emergency_rss_feed);
if ($emergencies === False) {
    echo 'Emergency information is currently not available';
} else {
    foreach ($emergencies as $title => $emergency) {
        $text = explode("\n", $emergency[$title]['text']);
        $paragraphs = array();
        foreach ($text as $paragraph) {
            if ($paragraph) {
                echo $paragraph;
            }
        }
    }
    // handle the case that an emergency RSS feed doesn't return data until emergency (like e2campus)
    if ($paragraphs == False) {
        echo "There is currently no emergency on campus.";
    }
}
예제 #3
0
 * Licensed under the MIT License
 * Redistributions of files must retain the above copyright notice.
 * 
 */
// various copy includes
require_once "../../config.gen.inc.php";
require_once "data/data.inc.php";
// records stats
require_once "../page_builder/page_header.php";
// libs
require_once "../../lib/rss_services.php";
require_once "lib/textformat.lib.php";
if (array_key_exists($_REQUEST['news'], $news_srcs)) {
    $rss_url = $news_srcs[$_REQUEST['news']]['url'];
    $section = $news_srcs[$_REQUEST['news']]['title'];
    $key = $_REQUEST['news'];
    $shared = true;
} else {
    $key = key($news_srcs);
    $rss_url = $news_srcs[$key]['url'];
    $section = $news_srcs[$key]['title'];
    $shared = false;
}
$News = new RSS();
$items = $News->get_feed($rss_url);
if ($shared == true) {
    require "templates/{$prefix}/shared.html";
} else {
    require "templates/{$prefix}/index.html";
}
$page->output();