This blob has been accessed 325 times via Git panel.
- <?php
- error_reporting(E_ERROR);
- if (get_magic_quotes_gpc()) {
- function stripslashes_array($data) {
- if (is_array($data)) {
- foreach ($data as $key => $value) {
- $data[$key] = stripslashes_array($value);
- }
- return $data;
- }
- else {
- return stripslashes($data);
- }
- }
- $_REQUEST = stripslashes_array($_REQUEST);
- }
- if (file_exists("data/offset.txt")) {
- $offset = file_get_contents("data/offset.txt");
- }
- else {
- $offset = 0;
- }
- 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);
- $description = str_replace("&","&",$description);
- $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) {
- if (($entry_rss_items > $today) and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
- continue;
- }
- $private = "0";
- if (file_exists("data/items/$entry_rss_items/categories")) {
- if ($dh_cat_rss = opendir("data/items/$entry_rss_items/categories")) {
- while (($entry_cat_rss = readdir($dh_cat_rss)) !== false) {
- if ($entry_cat_rss != "." && $entry_cat_rss != "..") {
- if (file_exists("data/categories/$entry_cat_rss/private.txt")) {
- $private = $private + 1;
- }
- }
- }
- closedir($dh_cat_rss);
- }
- }
- if (($private > 0) and !file_exists("data/items/$entry_rss_items/cat.txt")) {
- continue;
- }
- if (file_exists("data/items/$entry_rss_items/passwd.txt")) {
- continue;
- }
- if (file_exists("data/items/$entry_rss_items/member.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;
- 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);
- $description = str_replace("&","&",$description);
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt")) {
- $badwords = file_get_contents("data/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $censor = file_get_contents("data/pf-censor.txt");
- }
- else {
- $censor = "[expletive]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
- }
- 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;
- 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);
- $description = str_replace("&","&",$description);
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt")) {
- $badwords = file_get_contents("data/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $censor = file_get_contents("data/pf-censor.txt");
- }
- else {
- $censor = "[expletive]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
- }
- 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;
- 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);
- $description = str_replace("&","&",$description);
- if (file_exists("data/pf.txt") and file_exists("data/pf-badwords.txt")) {
- $badwords = file_get_contents("data/pf-badwords.txt");
- if (file_exists("data/pf-censor.txt")) {
- $censor = file_get_contents("data/pf-censor.txt");
- }
- else {
- $censor = "[expletive]";
- }
- $description = preg_replace("/\b($badwords)\b/i",$censor,$description);
- }
- 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>";
- }
- }
- }
- ?>