"; // the log webmaster $log_webmaster = "crusher "; // optionally a logo image for your log, comment this out if you have no logo $log_logo = "http://nutteloze.info/img/logo.gif"; // the maximum amount of characters per post you want in the feed, 0 for no limit $summary_length = 1000; // the maximum amount of posts you want listed in the feed $list_length = 15; // ----------------------------------------------------------------------- // the script starts here // DO NOT CHANGE ANYTHING BELOW THIS POINT // ----------------------------------------------------------------------- function xmlentities($data) { $position = 0; $length = strlen($data); $escapeddata = ""; for ($position=0; $position<$length; $position++) { $character = substr($data, $position, 1); $code = ord($character); switch($code) { case 34: $character = """; break; case 38: $character = "&"; break; case 39: $character = "'"; break; case 60: $character = "<"; break; case 62: $character = ">"; break; default: if ($code<32 || $code>127) $character = ("&#".strval($code).";"); break; } $escapeddata .= $character; } return $escapeddata; } function writerss($items) { global $log_title, $log_link, $log_description, $log_language, $log_editor, $log_webmaster, $log_logo; echo "\n"; echo "\n"; echo " \n"; echo " $log_title\n"; echo " $log_link\n"; echo " ".xmlentities($log_description)."\n"; echo " ".$log_language."\n"; echo " ".xmlentities($log_editor)."\n"; echo " ".xmlentities($log_webmaster)."\n"; echo " ".$items[0]['date']."\n"; echo " http://backend.userland.com/rss092\n"; if (isset($log_logo)) { echo " \n"; echo " $log_title\n"; echo " $log_logo\n"; echo " $log_link\n"; echo " ".xmlentities($log_description)."\n"; echo " \n"; } foreach ($items as $item) { echo " \n"; echo " ".xmlentities($item['title'])."\n"; echo " ".$item['url']."\n"; echo " ".xmlentities($item['text'])."\n"; echo " \n"; } echo " \n"; echo "\n"; } function getitem($num) { global $archivedir, $archivewebdir, $archiveext, $summary_length; $itemfile = "{$archivedir}{$num}.cgi"; $result['url'] = "{$archivewebdir}{$num}{$archiveext}"; if (file_exists("{$itemfile}")) { $fp1 = fopen("{$itemfile}", "r"); fgets($fp1, 4096); fgets($fp1, 4096); $data = fgets($fp1, 4096); $inarray = explode("|", $data); $text = ""; foreach ($inarray as $piece) { if ($piece == "*") $text .= " "; else $text .= $piece; } $description = strip_tags($text); if ($summary_length > 0) { $len = strlen($description); if ($len > $summary_length) { $description = substr($description, 0, $summary_length - 3); $description .= "..."; } } fclose($fp1); $result['text'] = $description; } return $result; } header("Content-Type: text/xml"); if (file_exists("{$cgidir}gm-entrylist.cgi")) { $fp = fopen("{$cgidir}gm-entrylist.cgi", "r"); for ($count = 0; !feof($fp) && $count < $list_length; $count++) { $line = trim(fgets($fp, 4096)); // upgrade php to 4.2.0+ if (! $line) continue; $pieces = explode("|", $line); $num = sprintf("%08d", $pieces[0]); $item = getitem($num); $item['title'] = $pieces[2]; $item['date'] = "{$pieces[3]} {$pieces[4]}"; $items[] = $item; } fclose($fp); writerss($items); } ?>