2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2002-2010 */
\r
6 /* Inclusive Design Institute */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or */
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /************************************************************************/
\r
15 define('AT_INCLUDE_PATH', '../../../include/');
\r
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
18 admin_authenticate(AT_ADMIN_PRIV_RSS);
\r
20 if (isset($_POST['submit_no'])) {
\r
21 $msg->addFeedback('CANCELLED');
\r
22 header('Location: index.php');
\r
24 } else if (isset($_POST['submit_yes'])) {
\r
25 $feed_id = intval($_POST['fid']);
\r
28 $sql = "DELETE FROM ".TABLE_PREFIX."feeds WHERE feed_id=$feed_id";
\r
29 $result = mysql_query($sql, $db);
\r
31 //delete feed title from lang
\r
32 $sql = "DELETE FROM ".TABLE_PREFIX."language_text WHERE term='".$feed_id."_rss_title'";
\r
33 $result = mysql_query($sql, $db);
\r
36 @unlink(AT_CONTENT_DIR.'/feeds/'.$feed_id.'_rss.cache');
\r
37 @unlink(AT_CONTENT_DIR.'/feeds/'.$feed_id.'_rss_title.cache');
\r
38 @unlink(AT_CONTENT_DIR.'/feeds/'.$feed_id.'_rss.inc.php');
\r
40 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
\r
41 header('Location: index.php');
\r
45 require(AT_INCLUDE_PATH.'header.inc.php');
\r
47 $feed_id = intval($_GET['fid']);
\r
48 $sql = "SELECT * FROM ".TABLE_PREFIX."feeds WHERE feed_id=".$feed_id;
\r
49 $result = mysql_query($sql, $db);
\r
50 $row = mysql_fetch_assoc($result);
\r
53 $msg->addError('FEED_NOT_FOUND');
\r
54 $msg->printErrors();
\r
56 $hidden_vars['delete_feed'] = TRUE;
\r
57 $hidden_vars['fid'] = $feed_id;
\r
59 $title = file_get_contents(AT_CONTENT_DIR.'/feeds/'.$feed_id.'_rss_title.cache');
\r
60 $msg->addConfirm(array('DELETE_FEED', $title), $hidden_vars);
\r
61 $msg->printConfirm();
\r
64 require(AT_INCLUDE_PATH.'footer.inc.php');
\r