summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2009-09-18 08:28:19 +0100
committerNick White <git@njw.me.uk>2009-09-18 08:28:19 +0100
commit705b1a62a491e76945e1b5a1a1a691552d5993e4 (patch)
tree71615a6702ef0ce0423c5ccc64fb72f77c7774a3
parent4a990db44980aee2b88c1ceecfe71e697d173556 (diff)
downloadnjw-website-source-705b1a62a491e76945e1b5a1a1a691552d5993e4.tar.bz2
njw-website-source-705b1a62a491e76945e1b5a1a1a691552d5993e4.zip
Removed unused RSS feed and code
-rw-r--r--includes/rss.php93
-rw-r--r--rss.php27
2 files changed, 0 insertions, 120 deletions
diff --git a/includes/rss.php b/includes/rss.php
deleted file mode 100644
index d752f26..0000000
--- a/includes/rss.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/*
- * Copyright (C) 2009 Nick White
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-header("Content-Type: application/rss+xml");
-
-function extract_description($body)
-{
- $body = explode("\n", $body);
- $description = strip_tags($body[0]); /* use first line of body */
- return $description;
-}
-
-function rss_header($metadatafile)
-{
- print("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
- print("<rss version=\"2.0\">\n");
-
- /* get variables to use for channel metadata */
- include($_SERVER['DOCUMENT_ROOT'] . $metadatafile);
-
- print("<channel>\n");
- print("\t<title>" . $title . "</title>\n");
- print("\t<link>" . "http://" . $_SERVER['HTTP_HOST'] . "</link>\n");
- $description = extract_description($body);
- print("\t<description>" . $description . "</description>\n");
- print("\t<pubDate>" . date("r") . "</pubDate>\n");
- if (isset($copyright) && !empty($copyright))
- print("\t<copyright>" . $copyright . "</copyright>\n");
- if (empty($language) || !isset($language))
- $language = "en";
- print("\t<language>" . $language . "</language>\n");
-}
-
-function create_item($dir, $file, $full=0)
-{
- unset($title, $body, $description, $language, $category, $pubdate);
- print("\t<item>\n");
- include($_SERVER['DOCUMENT_ROOT'] . "/" . $dir . "/" . $file);
- print("\t\t<title>" . $title . "</title>\n");
- print("\t\t<link>" . "http://" . $_SERVER['SERVER_NAME'] . "/" . $dir . "/" . $file . "</link>\n");
- print("\t\t<guid>" . "http://" . $_SERVER['SERVER_NAME'] . "/" . $dir . "/" . $file . "</guid>\n");
- $pubdate = filemtime($dir . "/" . $file);
- $pubdate = date("r", $pubdate);
- print("\t\t<pubDate>" . $pubdate . "</pubDate>\n");
- $category = ereg_replace("^text", "", $dir); /* dir after text */
- if (!empty($category))
- print("\t\t<category>" . $category . "</category>\n");
- if ($full)
- print("\t\t<description>" . strip_tags($body) . "</description>\n");
- else
- print("\t\t<description>" . extract_description($body) . "</description>\n");
- print("\t</item>\n");
-}
-
-function create_items_from_dir($dir, $full=0)
-{
- if ($handle = opendir($dir)) {
- while (false !== ($file = readdir($handle))) {
- if (!is_dir($file)) {
- if ($file[0] != "." && ereg(".php$", $file))
- create_item($dir, $file, $full);
- }
- else {
- if ($file[0] != ".")
- create_items_from_dir($dir . "/" . $file, $full);
- }
- }
- closedir($handle);
- }
-}
-
-function rss_footer()
-{
- print("</channel>\n");
- print("</rss>\n");
-}
-
-?>
diff --git a/rss.php b/rss.php
deleted file mode 100644
index 7ad938f..0000000
--- a/rss.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/*
- * Copyright (C) 2009 Nick White
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-include($_SERVER['DOCUMENT_ROOT'] . "/includes/rss.php");
-
-rss_header("/text/index.php");
-
-create_items_from_dir("text", 0);
-
-rss_footer();
-
-?>