move code up one directory
[atutor.git] / mods / _standard / rss_feeds / preview.php
1 <?php   
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2010                                              */
6 /* Inclusive Design Institute                                           */
7 /* http://atutor.ca                                                                                                             */
8 /*                                                                                                                                              */
9 /* This program is free software. You can redistribute it and/or        */
10 /* modify it under the terms of the GNU General Public License          */
11 /* as published by the Free Software Foundation.                        */
12 /************************************************************************/
13 // $Id$
14
15 define('AT_INCLUDE_PATH', '../../../include/');
16 require(AT_INCLUDE_PATH . 'vitals.inc.php');
17
18 admin_authenticate(AT_ADMIN_PRIV_RSS);
19
20 if (isset($_POST['back'])) {
21         header('Location: index.php');
22         exit;
23 }
24
25 require (AT_INCLUDE_PATH.'header.inc.php');
26
27 $feed_id    = intval($_GET['fid']);
28 $cache_file = AT_CONTENT_DIR.'feeds/'.$feed_id.'_rss.cache';
29 $title_file = AT_CONTENT_DIR.'feeds/'.$feed_id.'_rss_title.cache';
30
31 if (!file_exists($cache_file) || ((time() - filemtime($cache_file)) > 21600) ) {
32         make_cache_file($feed_id);
33 }
34 ?>
35
36
37 <?php 
38 $savant->assign('cache_file', $cache_file);
39 $savant->assign('title_file', $title_file);
40 $savant->display('admin/system_preferences/preview.tmpl.php');
41 require (AT_INCLUDE_PATH.'footer.inc.php'); ?>