Example #1
0
function print_rss_feed($file)
{
    global $savant;
    $feed_id = intval(basename($file));
    $cache_file = AT_CONTENT_DIR . 'feeds/' . $feed_id . '_rss.cache';
    $title_file = AT_CONTENT_DIR . 'feeds/' . $feed_id . '_rss_title.cache';
    ob_start();
    //if file doesn't exist or is more than AT_FEED_TIMEOUT old
    if (!file_exists($cache_file) || time() - filemtime($cache_file) > AT_FEED_TIMEOUT) {
        make_cache_file($feed_id);
    }
    if (file_exists($cache_file)) {
        readfile($cache_file);
        echo '<br /><small>' . _AT('new_window') . '</small>';
    } else {
        echo _AT('no_content_avail');
    }
    $savant->assign('dropdown_contents', ob_get_contents());
    ob_end_clean();
    $savant->assign('title', @file_get_contents($title_file));
    $savant->display('include/box.tmpl.php');
}
Example #2
0
} else if (isset($_POST['submit'])) {
	$missing_fields = array();

	if (trim($_POST['title']) == '') {
		$missing_fields[] = _AT('title');
	}
	if (trim($_POST['url']) == '') {
		$missing_fields[] = _AT('url');
	}
	if ($missing_fields) {
		$missing_fields = implode(', ', $missing_fields);
		$msg->addError(array('EMPTY_FIELDS', $missing_fields));
	}

	if (!$msg->containsErrors()) {
		$output = make_cache_file(0);
		if (!isset($output) || empty($output)) {
			$msg->addError('FEED_NO_CONTENT');
		}
	}

	if ($msg->containsErrors()) {
		unset($_POST['confirm']);
	}

} else if (isset($_POST['submit_no'])) {
	$msg->addFeedback('CANCELLED');

} else if (isset($_POST['submit_yes'])) {
	$_POST['url'] = $addslashes($_POST['url']);
Example #3
0
/* Copyright (c) 2002-2010                                              */
/* Inclusive Design Institute                                           */
/* http://atutor.ca														*/
/*																		*/
/* This program is free software. You can redistribute it and/or        */
/* modify it under the terms of the GNU General Public License          */
/* as published by the Free Software Foundation.                        */
/************************************************************************/
// $Id$
define('AT_INCLUDE_PATH', '../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
admin_authenticate(AT_ADMIN_PRIV_RSS);
if (isset($_POST['back'])) {
    header('Location: index.php');
    exit;
}
require AT_INCLUDE_PATH . 'header.inc.php';
$feed_id = intval($_GET['fid']);
$cache_file = AT_CONTENT_DIR . 'feeds/' . $feed_id . '_rss.cache';
$title_file = AT_CONTENT_DIR . 'feeds/' . $feed_id . '_rss_title.cache';
if (!file_exists($cache_file) || time() - filemtime($cache_file) > 21600) {
    make_cache_file($feed_id);
}
?>


<?php 
$savant->assign('cache_file', $cache_file);
$savant->assign('title_file', $title_file);
$savant->display('admin/system_preferences/preview.tmpl.php');
require AT_INCLUDE_PATH . 'footer.inc.php';