This blob has been accessed 313 times via Git panel.
- <?php
- if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
- $title_file = "data/title.txt";
- $description_file = "data/profile.php";
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- $author_file = "data/author.txt";
- $default_increase_file = "data/increase.txt";
- if (file_exists($default_increase_file)) {
- }
- else {
- $increase = 5;
- }
- $link = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
- $link = str_replace('//', '/', $link);
- $link = "http://" . $link;
- $fix_link = array('//index.php', '///index.php');
- $dir = "data/items";
- $feeds = $increase;
- if ($dh_rss_items = opendir($dir)) {
- while (($entry_rss_items = readdir($dh_rss_items)) !== false) {
- $cat_dir = file_get_contents("data/items/$entry_rss_items/category.txt");
- if (file_exists("data/categories/$cat_dir/private.txt") and !file_exists("data/items/$entry_rss_items/cat.txt")) {
- continue;
- }
- if ($entry_rss_items != "." && $entry_rss_items != ".." && fnmatch("*", $entry_rss_items) && !file_exists("data/items/$entry_rss_items/private.txt")) {
- $show_rss_items[] = $entry_rss_items;
- }
- }
- closedir($dh_rss_items);
- }
- rsort($show_rss_items);
- reset($show_rss_items);
- $count_rss_items = count($show_rss_items);
- if ($count_rss_items < $feeds) {
- $feeds = $count_rss_items;
- }
- if ($count_rss_items > 0) {
- if ($_REQUEST['ver'] == "0.91") {
- $rss091_count = $rss091_count + 1;
- chmod("data/rss-0.91.txt", 0666);
- header('Content-type: application/xml');
- echo "<rss version=\"0.91\">\n";
- echo "<channel>\n";
- echo "<title>$title</title>\n";
- echo "<link>$link</link>\n";
- echo "<description>$description</description>\n";
- echo "<language>en-US</language>\n";
- $increment_rss_entries = 0;
- $show_rss_entries = $feeds - 1;
- while ($increment_rss_entries <= $show_rss_entries) {
- echo "<item>\n";
- echo "<title>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/title.txt");
- echo "</title>\n";
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<link>$link</link>\n";
- echo "<description>";
- $description_file = "$dir/$show_rss_items[$increment_rss_entries]/body.txt";
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- echo $description;
- echo "</description>\n";
- echo "</item>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
- }
- echo "</channel>\n";
- echo "</rss>";
- }
- if ($_REQUEST['ver'] == "1.0") {
- $rss10_count = $rss10_count + 1;
- chmod("data/rss-1.0.txt", 0666);
- header('Content-type: application/xml');
- echo "<rdf:RDF\n";
- echo "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
- echo "xmlns=\"http://purl.org/rss/1.0/\"\n";
- echo "xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n";
- echo ">\n";
- echo "<channel rdf:about=\"$link\">\n";
- echo "<title>$title</title>\n";
- echo "<link>$link</link>\n";
- echo "<description>$description</description>\n";
- echo "<items>\n";
- echo "<rdf:Seq>\n";
- $increment_rss_entries = 0;
- $show_rss_entries = $feeds - 1;
- while ($increment_rss_entries <= $show_rss_entries) {
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<rdf:li rdf:resource=\"$link\"/>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
- }
- echo "</rdf:Seq>\n";
- echo "</items>\n";
- echo "</channel>\n";
- $increment_rss_entries = 0;
- while ($increment_rss_entries <= $show_rss_entries) {
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<item rdf:about=\"$link\">\n";
- echo "<title>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/title.txt");
- echo "</title>\n";
- echo "<link>$link</link>\n";
- echo "<description>";
- $description_file = "$dir/$show_rss_items[$increment_rss_entries]/body.txt";
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- echo $description;
- echo "</description>\n";
- echo "<dc:creator>$author</dc:creator>\n";
- echo "<dc:date>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/date.txt");
- echo "</dc:date>\n";
- echo "</item>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
- }
- echo "</rdf:RDF>";
- }
- if ($_REQUEST['ver'] == "2.0") {
- $rss20_count = $rss20_count + 1;
- chmod("data/rss-2.0.txt", 0666);
- header('Content-type: application/xml');
- echo "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n";
- echo "<channel>\n";
- echo "<title>$title</title>\n";
- echo "<link>$link</link>\n";
- echo "<description>$description</description>\n";
- echo "<language>en-US</language>\n";
- $increment_rss_entries = 0;
- $show_rss_entries = $feeds - 1;
- while ($increment_rss_entries <= $show_rss_entries) {
- echo "<item>\n";
- echo "<title>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/title.txt");
- echo "</title>\n";
- $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?entry=$show_rss_items[$increment_rss_entries]";
- $link = str_replace($fix_link, '/index.php', $link);
- echo "<link>$link</link>\n";
- echo "<description>";
- $description_file = "$dir/$show_rss_items[$increment_rss_entries]/body.txt";
- $description = strip_tags($description);
- $description = htmlentities($description, ENT_NOQUOTES);
- echo $description;
- echo "</description>\n";
- echo "<dc:creator>$author</dc:creator>";
- echo "<dc:date>";
- readfile("$dir/$show_rss_items[$increment_rss_entries]/date.txt");
- echo "</dc:date>\n";
- echo "</item>\n";
- $increment_rss_entries = $increment_rss_entries + 1;
- }
- echo "</channel>\n";
- echo "</rss>";
- }
- }
- }
- ?>