I'm using RSS2Html, and I want to slip a strip tag in here so that any <br> tags in the rss feed's description (as well as other tags) will be eliminated. Where would I do that, and how?
// Set the following variable useFopenURL to one if you want/need to use
// fopen() instead of CURL
$useFopenURL = 0;
// If XLMFILE is passed as part of the URL, XMLFILE=, then it will be used
// otherwise the the file below is used.
//$XMLfilename = "http://examlple.com/sample.xml";
$XMLfilename = $RSSFEEDURL;
// If TEMPLATE is passed as part of the URL. TEMPLATE=, then it will be used
// otherwise the the file below is used.
//$TEMPLATEfilename = "http://examlple.com/sample-template.html";
$TEMPLATEfilename = "sample-template.htm";
// Since some feeds may have titles or descriptins in the feed or items that
// are longer then want fits in your HTML page it is possible to trim them
// with the following 4 variables. A values of 0 (ZERO) displays the full
// length.
// CAUTION: Do not limit a title or description that has HTML in it, the
// will not produce a valid HTML page.
$limitFeedTitleLength = 0; // Not limited, in the URL as FeedTitleLength=
$limitFeedDescriptionLength = 0; // Not limited, in the URL as FeedDescriptionLength=
$limitItemTitleLength = 0; // Not limited, in the URL as ItemTitleLength=
$limitItemDescriptionLength = 0; // Not limited, in the URL as ItemDescriptionLength=
// Timezone - If your server is not in the same timezone as you are the timezone
// of the times and dates produced in the above from can be controlled with the
// below code. Just uncomment the following line and change the desired time
// offset.
// putenv("TZ=+04:00");
// Registered user of FeedForAll and FeedForAll Mac product(s) have access
// to a caching module. This enables it's use if it is installed.
$allowCachingXMLFiles = 0;
// File access level: The variable $fileAccessLevel can be used limit what files
// and type of files (local or remote) can be used with rss2html.php
// -1 = Remote files are NOT allowed, only local files allowed for template
// and feed which have filenames ending in extensions in the
// $allowedTemplateExtensions and $allowedFeedExtensions lists below
// 0 = Remote files and any local files allowed for template and feed
// 1 = Remote files and only local files allowed for template and feed
// which have filenames ending in extensions in the
// $allowedTemplateExtensions and $allowedFeedExtensions lists below
// 2 = No local files allowed, remote files only.
$fileAccessLevel = 1;
// Allowed file extensions is a list of the allowable extensions for local for
// the template and the feed. New entries can be added by following the example
// below.
$allowedTemplateExtensions = Array(".html", ".htm", ".shtml");
$allowedFeedExtensions = Array(".xml", ".rss");
// Destination Encoding: By default rss2html.php converts all feeds to UTF-8
// and then produces webpages in UTF-8 because UTF-8 is capable of displaying
// all possible characters.
$destinationEncoding = "UTF-8";
// Missing Encoding Default: Some feeds do not specify the character set
// they are encoded in. The XML specification states that if there is no
// encoding specified the XML file, all RSS feeds are XML, must be encoded
// in UTF-8, but experience has show differently. This specifies the
// encoding that will be used for feeds that don't specify the encoding.
//$missingEncodingDefault = "UTF-8";
$missingEncodingDefault = "ISO-8859-1";
// Escape Ampersand In Links: Proper HTML requires that a link with an
// apersand in while inside of an HTML page have that '&' converted to
// '&'.
$escapeAmpInLinks = 1;
// If using cURL, make sure it exists
if (($useFopenURL == 0) && !function_exists("curl_init")) {
$useFopenURL = 1;
}
if ($useFopenURL) {
ini_set("allow_url_fopen", "1");
ini_set("user_agent", 'FeedForAll rss2html.php v2');
}
@include("FeedForAll_rss2html_pro.php");
if (function_exists("FeedForAll_rss2html_pro") === FALSE) {
Function FeedForAll_rss2html_pro($source) {
// This is the place to do any processing that is desired
return $source;
}
}
if (function_exists("FeedForAll_rss2html_readFile") === FALSE) {
Function FeedForAll_rss2html_readFile($filename, $useFopenURL, $useCaching = 0) {
if ($useCaching);
$GLOBALS["ERRORSTRING"] = "";
$result = "";
if (stristr($filename, "://")) {
if ($useFopenURL) {
if (($fd = @fopen($filename, "rb")) === FALSE) {
return FALSE;
}
while (($data = fread($fd, 4096)) != "") {
$result .= $data;
}
fclose($fd);
} else {
// This is a URL so use CURL
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $filename);
curl_setopt($curlHandle, CURLOPT_HEADER, 0);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlHandle, CURLOPT_USERAGENT, "FeedForAll rss2html.php v2");
// curl_setopt($curlHandle, CURLOPT_AUTOREFERER, 1);
curl_setopt($curlHandle, CURLOPT_REFERER, $filename);
curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curlHandle, CURLOPT_MAXREDIRS, 10);
$result = curl_exec($curlHandle);
if (curl_errno($curlHandle)) {
$GLOBALS["ERRORSTRING"] = curl_error($curlHandle);
curl_close($curlHandle);
return FALSE;
}
curl_close($curlHandle);
}
} else {
// This is a local file, so use fopen
if (($fd = @fopen($filename, "rb")) === FALSE) {
return FALSE;
}
while (($data = fread($fd, 4096)) != "") {
$result .= $data;
}
fclose($fd);
}
return $result;
}
}
if (function_exists("FeedForAll_rss2html_convertEncoding") === FALSE) {
Function FeedForAll_rss2html_convertEncoding($XMLstring) {
GLOBAL $missingEncodingDefault;
GLOBAL $destinationEncoding;
if (function_exists("FeedForAll_rss2html_limitLength") === FALSE) {
Function FeedForAll_rss2html_limitLength($initialValue, $limit = 0) {
if (($limit == 0) || (strlen($initialValue) <= $limit )) {
// ZERO is for not limited
return $initialValue;
}
// Cut the text at the exact point, ignoring if it is in a word.
$result = substr($initialValue, 0, $limit);
// Check to see if there are any space we can trim at and if it is not
// too far from where we are
$lastSpace = strrchr($result,' ');
if (($lastSpace !== FALSE) && (strlen($lastSpace) < 20)) {
// lose any incomplete word at the end
$result = substr($result, 0, -(strlen($lastSpace)));
// Append elipses, ... , to show it was truncated
$result .= " ...";
}
if (function_exists("FeedForAll_rss2html_CreateUniqueLink") === FALSE) {
Function FeedForAll_rss2html_CreateUniqueLink($title, $description, $link, $guid, $XMLfilename, $itemTemplate) {
GLOBAL $TEMPLATEfilename;
$match = Array();
while (preg_match("/~~~ItemUniqueLinkWithTemplate=.*~~~/", $itemTemplate, $match) !== FALSE) {
if ((count($match) == 0) || ($match[0] == "")) {
// All done
return $itemTemplate;
}
$replace = "http://$_SERVER[SERVER_NAME]$_SERVER[SCRIPT_NAME]?XMLFILE=".FeedForAll_rss2html_encodeURL($XMLfilename)."&TEMPLATE=".FeedForAll_rss2html_encodeURL($TEMPLATEfilename);
$itemTemplate = FeedForAll_rss2html_str_replace($match[0], $replace, $itemTemplate);
}
if ($title);
if ($description);
if ($link);
if ($guid);
return $itemTemplate;
}
}
if (function_exists("FeedForAll_rss2html_UseUniqueLink") === FALSE) {
Function FeedForAll_rss2html_UseUniqueLink($title, $description, $link, $guid) {
if ($title);
if ($description);
if ($link);
if ($guid);
return -1;
}
}
if (function_exists("FeedForAll_rss2html_EscapeLink") === FALSE) {
Function FeedForAll_rss2html_EscapeLink($link) {
GLOBAL $escapeAmpInLinks;
if ((strstr($link, "://") !== FALSE) && $escapeAmpInLinks) {
// In HTML a link with an & must be converted to &
// And for here without :// it is not a link, since relative
// URLs are not allowed
$link = str_replace("&", "&", $link);
}
return $link;
}
}
if (function_exists("FeedForAll_rss2html_AddIdentity") === FALSE) {
Function FeedForAll_rss2html_AddIdentity($itemString) {
return "".$itemString;
}
}
if (!isset($_REQUEST["buildURL"])) {
if (isset($_REQUEST["XMLFILE"])) {
if (stristr($_REQUEST["XMLFILE"], "file"."://")) {
// Not allowed
;
}
elseif (stristr($_REQUEST["XMLFILE"], "://")) {
if ($fileAccessLevel == -1) {
echo "Configuration setting prohibit using remote files, exiting\n";
exit -1;
} else {
// URL files are allowed
$XMLfilename = $_REQUEST["XMLFILE"];
}
} else {
if (($fileAccessLevel == 1) || ($fileAccessLevel == -1)) {
if (FeedForAll_rss2html_validExtension(basename($_REQUEST["XMLFILE"]), $allowedFeedExtensions) === FALSE) {
echo "Configuration setting prohibit using the specified feed file, exiting\n";
exit -1;
}
$XMLfilename = basename($_REQUEST["XMLFILE"]);
}
elseif ($fileAccessLevel == 2) {
echo "Configuration setting prohibit using local files, exiting\n";
exit -1;
} else {
// It is local and must be in the same directory
$XMLfilename = basename($_REQUEST["XMLFILE"]);
}
}
}
if (isset($_REQUEST["TEMPLATE"])) {
if (stristr($_REQUEST["TEMPLATE"], "file"."://")) {
// Not allowed
;
}
elseif (stristr($_REQUEST["TEMPLATE"], "://")) {
if ($fileAccessLevel == -1) {
echo "Configuration setting prohibit using remote files, exiting\n";
exit -1;
} else {
// URL files are allowed
$TEMPLATEfilename = $_REQUEST["TEMPLATE"];
}
} else {
if (($fileAccessLevel == 1) || ($fileAccessLevel == -1)) {
if (FeedForAll_rss2html_validExtension(basename($_REQUEST["TEMPLATE"]), $allowedTemplateExtensions) === FALSE) {
echo "Configuration setting prohibit using the specified template file, exiting\n";
exit -1;
}
$TEMPLATEfilename = basename($_REQUEST["TEMPLATE"]);
}
elseif ($fileAccessLevel == 2) {
echo "Configuration setting prohibit using local files, exiting\n";
exit -1;
} else {
// It is local and must be in the same directory
$TEMPLATEfilename = basename($_REQUEST["TEMPLATE"]);
}
}
}
if (isset($_REQUEST["FeedTitleLength"])) {
$limitFeedTitleLength = abs($_REQUEST["FeedTitleLength"]);
}
if (isset($_REQUEST["FeedDescriptionLength"])) {
$limitFeedDescriptionLength = abs($_REQUEST["FeedDescriptionLength"]);
}
if (isset($_REQUEST["ItemTitleLength"])) {
$limitItemTitleLength = abs($_REQUEST["ItemTitleLength"]);
}
if (isset($_REQUEST["ItemDescriptionLength"])) {
$limitItemDescriptionLength = abs($_REQUEST["ItemDescriptionLength"]);
}
//
// Maximum number of items to be displayed
//
$FeedMaxItems = 3;
if (isset($_REQUEST["MAXITEMS"])) {
$FeedMaxItems = $_REQUEST["MAXITEMS"];
}
$NoFutureItems = FALSE;
if (isset($_REQUEST["NOFUTUREITEMS"])) {
$NoFutureItems = TRUE;
}
//
// As much as I hate globals, they are needed due to the
// recusive nature of the parser
$insidechannel = FALSE;
$level_channel = 0;
$insidechannelimage = FALSE;
$level_channelimage = 0;
$insideitem = FALSE;
$level_item = 0;
class FeedForAll_rss2html_RSSParser {
var $gotROOT = 0;
var $feedTYPE = "RSS";
var $level = 0;
var $tag = "";
var $title = "";
var $description = "";
var $contentEncoded = "";
var $link = "";
var $pubdate = "";
var $pubdateDC = "";
var $enclosureURL = "";
var $enclosureLength = "";
var $enclosureType = "";
var $categoryArray = Array();
var $category = "";
var $categoryDomain = "";
var $guid = "";
var $author = "";
var $comments = "";
var $source = "";
var $sourceURL = "";
var $DcCreator = "";
var $creativeCommons = "";
var $rssMeshExtra = "";
var $fimageURL = "";
var $fimageTitle = "";
var $fimageLink = "";
var $FeedTitle = "";
var $FeedDescription = "";
var $FeedContentEncoded = "";
var $FeedLink = "";
var $FeedPubDate = "";
var $FeedPubDateDC = "";
var $FeedPubDate_t = 0;
var $FeedLastBuildDate = "";
var $FeedImageURL = "";
var $FeedImageTitle = "";
var $FeedImageLink = "";
var $FeedCreateiveCommons = "";
//
// When adding new Item elements, be sure to update the sort below
var $ItemTitle = Array();
var $ItemDescription = Array();
var $ItemContentEncoded = Array();
var $ItemLink = Array();
var $ItemPubDate = Array();
var $ItemPubDate_t = Array();
var $ItemEnclosureURL = Array();
var $ItemEnclosureLength = Array();
var $ItemEnclosureType = Array();
var $ItemCategoryArray = Array();
var $ItemGuid = Array();
var $ItemAuthor = Array();
var $ItemComments = Array();
var $ItemSource = Array();
var $ItemSourceURL = Array();
var $ItemCreateiveCommons = Array();
var $ItemRssMeshExtra = Array();
function startElement($parser, $tagName, $attrs) {
GLOBAL $insidechannel;
GLOBAL $level_channel;
GLOBAL $insidechannelimage;
GLOBAL $level_channelimage;
GLOBAL $insideitem;
GLOBAL $level_item;
function endElement($parser, $tagName) {
GLOBAL $insidechannel;
GLOBAL $level_channel;
GLOBAL $insidechannelimage;
GLOBAL $level_channelimage;
GLOBAL $insideitem;
GLOBAL $level_item;
GLOBAL $NoFutureItems;
function characterData($parser, $data) {
GLOBAL $insidechannel;
GLOBAL $level_channel;
GLOBAL $insidechannelimage;
GLOBAL $level_channelimage;
GLOBAL $insideitem;
GLOBAL $level_item;
if (($data == "") || ($data == NULL)) {
} else {
if (($insideitem) && ($this->level == $level_item+1)) {
switch ($this->tag) {
case "TITLE":
$this->title .= $data;
break;
case "DESCRIPTION":
$this->description .= $data;
break;
case "CONTENT:ENCODED":
$this->contentEncoded .= $data;
break;
case "SUMMARY":
$this->description .= $data;
break;
case "LINK":
$this->link .= $data;
break;
case "PUBDATE":
$this->pubdate .= $data;
break;
case "DC:DATE":
$this->pubdateDC .= $data;
break;
case "MODIFIED":
$this->pubdateDC .= $data;
break;
case "GUID":
$this->guid .= $data;
break;
case "AUTHOR":
$this->author .= $data;
break;
case "COMMENTS":
$this->comments .= $data;
break;
case "SOURCE":
$this->source .= $data;
break;
case "CATEGORY":
$this->category .= $data;
break;
case "DC:CREATOR":
$this->DcCreator .= $data;
break;
case "CREATIVECOMMONS:LICENSE":
$this->creativeCommons .= $data;
break;
case "RSSMESH:EXTRA":
$this->rssMeshExtra .= $data;
break;
}
}
elseif ($insidechannelimage) {
switch ($this->tag) {
case "TITLE":
$this->fimageTitle .= $data;
break;
case "DESCRIPTION":
$this->description .= $data;
break;
case "CONTENT:ENCODED":
$this->contentEncoded .= $data;
break;
case "TAGLINE":
$this->description .= $data;
break;
case "LINK":
$this->link .= $data;
break;
case "PUBDATE":
$this->FeedPubDate .= $data;
break;
case "DC:DATE":
$this->FeedPubDateDC .= $data;
break;
case "MODIFIED":
$this->FeedPubDateDC .= $data;
break;
case "LASTBUILDDATE":
$this->FeedLastBuildDate .= $data;
break;
case "CREATIVECOMMONS:LICENSE":
$this->FeedCreateiveCommons .= $data;
break;
}
}
}
if ($parser);
}
}
}
if (($template = FeedForAll_rss2html_readFile($TEMPLATEfilename, $useFopenURL)) === FALSE) {
if ($GLOBALS["ERRORSTRING"] == "") {
echo "Unable to open template $TEMPLATEfilename, exiting\n";
} else {
echo "Unable to open template $TEMPLATEfilename with error <b>$GLOBALS[ERRORSTRING]</b>, exiting\n";
}
exit -1;
}
if (FeedForAll_rss2html_isTemplate($template) === FALSE) {
echo "$TEMPLATEfilename is not a valid rss2html.php template file, exiting\n";
exit -1;
}
if (strstr($template, "~~~NoFutureItems~~~")) {
$NoFutureItems = TRUE;
}
if (($XML = FeedForAll_rss2html_readFile($XMLfilename, $useFopenURL, $allowCachingXMLFiles)) === FALSE) {
if ($GLOBALS["ERRORSTRING"] == "") {
echo "Unable to open RSS Feed $XMLfilename, exiting\n";
} else {
echo "Unable to open RSS Feed $XMLfilename with error <b>$GLOBALS[ERRORSTRING]</b>, exiting\n";
}
exit -1;
}
if (strstr(trim($XML), "<?xml") === FALSE) {
$XML = "<?xml version=\"1.0\"?>\n$XML";
}
$XML = strstr(trim($XML), "<?xml");
if (($convertedXML = FeedForAll_rss2html_convertEncoding($XML)) === FALSE) {
// Conversions failed, probably becasue it was wrong or the routines were missing
$convertedXML = $XML;
$xml_parser = xml_parser_create();
} else {
$xml_parser = xml_parser_create($destinationEncoding);
}
// Since ' is not HTML, but is XML convert.
$template = str_replace("'", "'", $template);
if (!headers_sent()) {
// Send the Content-Type to force $destinationEncoding
header("Content-Type: text/html; charset=$destinationEncoding");
}
echo FeedForAll_rss2html_pro($template);
} else {
if (!headers_sent()) {
// Send the Content-Type to force $destinationEncoding
header("Content-Type: text/html; charset=$destinationEncoding");
}
echo "<html><head><title>rss2html.php URL tool</title><meta http-equiv=\"content-type\" content=\"text/html;charset=$destinationEncoding\"></head><body bgcolor=\"#EEEEFF\">\n";
//
// We are in "buildURL" mode to help create properly encoded URLs to pass to rss2html.php
$_xml = "";
if (isset($_POST["XML"])) {
$_xml = $_POST["XML"];
}
$_template = "";
if (isset($_POST["TEMPLATE"])) {
$_template = $_POST["TEMPLATE"];
}
$_maxitems = "";
if (isset($_POST["MAXITEMS"])) {
$_maxitems = $_POST["MAXITEMS"];
}
$_nofutureitems = "";
if (isset($_POST["NOFUTUREITEMS"])) {
$_nofutureitems = $_POST["NOFUTUREITEMS"];
}
// Display the entry form
echo "<center><h1>RSS2HTML.PHP LINK TOOL</h1></center>\n";
echo "<p>To assist with the with the creation of properly encoded URLs for use with rss2html.php this tool has been created. Fill in the URLs or file paths for both the XML file and your template file in the boxes below and then click "Submit". The program will then return the URLs properly encoded in a string that calls rss2html.php. You can click on this link to test the results. The program will also indicate if it was unable to open either of the URLs it was given.</p>\n";
echo "<form action=\"$_SERVER[PHP_SELF]\" method=\"POST\">\n";
echo "<input type=\"hidden\" name=\"buildURL\" value=\"1\">\n";
echo "URL form the XML file: (ie. http://www.myserver.com/file.xml)<br><input type=\"text\" name=\"XML\" size=\"100\" value=\"$_xml\"><br>\n";
echo "URL form the template file: (ie. http://www.myserver.com/template.html)<br><input type=\"text\" name=\"TEMPLATE\" size=\"100\" value=\"$_template\"><br>\n";
echo "<b>Optional items:</b><br>\n";
echo "Maximum items: <input type=\"text\" name=\"MAXITEMS\" size=\"5\" value=\"$_maxitems\"> (Use negative numbers for the last X items)<br>\n";
echo "No future items: <input type=\"checkbox\" name=\"NOFUTUREITEMS\" ";
if ($_nofutureitems == "on") {
echo "CHECKED";
}
echo "> (Use negative numbers for the last X items)<br>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"Submit\">\n";
echo "</form>\n";
$xmlContents = "";
$templateContents = "";
if (isset($_POST["submit"])) {
if ($_SERVER["REQUEST_METHOD"] != "POST") {
exit;
}
echo "<hr>\n";
if (isset($_POST["XML"]) && $_POST["XML"] != "") {
$XMLfilename = "";
if (stristr($_POST["XML"], "file"."://")) {
// Not allowed
;
}
elseif (stristr($_POST["XML"], "://")) {
if ($fileAccessLevel == -1) {
echo "<p style=\"color: red;\">Configuration setting prohibit using remote files</p>\n";
} else {
// URL files are allowed
$XMLfilename = $_POST["XML"];
}
} else {
if (($fileAccessLevel == 1) || ($fileAccessLevel == -1)) {
if (FeedForAll_rss2html_validExtension(basename($_POST["XML"]), $allowedFeedExtensions) === FALSE) {
echo "<p style=\"color: red;\">Configuration setting prohibit using the specified feed file</p>\n";
} else {
$XMLfilename = basename($_POST["XML"]);
}
}
elseif ($fileAccessLevel == 2) {
echo "<p style=\"color: red;\">Configuration setting prohibit using local files</p>\n";
} else {
// It is local and must be in the same directory
$XMLfilename = basename($_POST["XML"]);
}
}
if ($XMLfilename != "") {
if (($xmlContents = FeedForAll_rss2html_readFile($_POST["XML"], $useFopenURL)) === FALSE) {
if ($GLOBALS["ERRORSTRING"] == "") {
echo "<p>The XML file <b>$_POST[XML]</b> could not be opened.</p>\n";
} else {
echo "<p>The XML file <b>$_POST[XML]</b> could not be opened with the error <b>$GLOBALS[ERRORSTRING]</b>.</p>\n";
}
} else {
echo "<p>The XML file <b>$_POST[XML]</b> was SUCCESSFULLY opened</p>\n";
}
}
}
if (isset($_POST["TEMPLATE"]) && $_POST["TEMPLATE"] != "") {
$TEMPLATEfilename = "";
if (stristr($_POST["TEMPLATE"], "file"."://")) {
// Not allowed
;
}
elseif (stristr($_POST["TEMPLATE"], "://")) {
if ($fileAccessLevel == -1) {
echo "<p style=\"color: red;\">Configuration setting prohibit using remote files</p>\n";
} else {
// URL files are allowed
$TEMPLATEfilename = $_POST["TEMPLATE"];
}
} else {
if (($fileAccessLevel == 1) || ($fileAccessLevel == -1)) {
if (FeedForAll_rss2html_validExtension(basename($_POST["TEMPLATE"]), $allowedTemplateExtensions) === FALSE) {
echo "<p style=\"color: red;\">Configuration setting prohibit using the specified template file</p>\n";
} else {
$TEMPLATEfilename = basename($_POST["TEMPLATE"]);
}
}
elseif ($fileAccessLevel == 2) {
echo "<p style=\"color: red;\">Configuration setting prohibit using local files</p>\n";
} else {
// It is local and must be in the same directory
$TEMPLATEfilename = basename($_POST["TEMPLATE"]);
}
}
if ($TEMPLATEfilename != "") {
if (($templateContents = FeedForAll_rss2html_readFile($_POST["TEMPLATE"], $useFopenURL)) === FALSE) {
if ($GLOBALS["ERRORSTRING"] == "") {
echo "<p>The template file <b>$_POST[TEMPLATE]</b> could not be opened.</p>\n";
} else {
echo "<p>The template file <b>$_POST[TEMPLATE]</b> could not be opened with the error <b>$GLOBALS[ERRORSTRING]</b>.</p>\n";
}
}
elseif (FeedForAll_rss2html_isTemplate($templateContents) === FALSE) {
echo "$_POST[TEMPLATE] is not a valid rss2html.php template file\n";
$templateContents = "";
} else {
echo "<p>The template file <b>$_POST[TEMPLATE]</b> was SUCCESSFULLY opened</p>\n";
}
}
}
if ($xmlurl != "") {
echo "<p>URL for the XML file properly encoded:<br><pre>$xmlurl</pre></p>\n";
}
if ($templateurl != "") {
echo "<p>URL for the template file properly encoded:<br><pre>$templateurl</pre></p>\n";
}
echo "<h2>Example Usage</h2>\n";
echo "<p>Click on link to view results: <a href=\"$answer\" target=\"_blank\">$answer</a></p>\n";
echo "<p>Server Side Include:<br><pre><!--#INCLUDE VIRTUAL="".basename($_SERVER["PHP_SELF"])."?$ssi" --></pre></p>\n";
I'm using RSS2Html, and I want to slip a strip tag in here so that any <br> tags in the rss feed's description (as well as other tags) will be eliminated. Where would I do that, and how?
// Set the following variable useFopenURL to one if you want/need to use
// fopen() instead of CURL
$useFopenURL = 0;
// If XLMFILE is passed as part of the URL, XMLFILE=, then it will be used
// otherwise the the file below is used.
//$XMLfilename = "http://examlple.com/sample.xml";
$XMLfilename = $RSSFEEDURL;
// If TEMPLATE is passed as part of the URL. TEMPLATE=, then it will be used
// otherwise the the file below is used.
//$TEMPLATEfilename = "http://examlple.com/sample-template.html";
$TEMPLATEfilename = "sample-template.htm";
// Since some feeds may have titles or descriptins in the feed or items that
// are longer then want fits in your HTML page it is possible to trim them
// with the following 4 variables. A values of 0 (ZERO) displays the full
// length.
// CAUTION: Do not limit a title or description that has HTML in it, the
// will not produce a valid HTML page.
$limitFeedTitleLength = 0; // Not limited, in the URL as FeedTitleLength=
$limitFeedDescriptionLength = 0; // Not limited, in the URL as FeedDescriptionLength=
$limitItemTitleLength = 0; // Not limited, in the URL as ItemTitleLength=
$limitItemDescriptionLength = 0; // Not limited, in the URL as ItemDescriptionLength=
// Timezone - If your server is not in the same timezone as you are the timezone
// of the times and dates produced in the above from can be controlled with the
// below code. Just uncomment the following line and change the desired time
// offset.
// putenv("TZ=+04:00");
// Registered user of FeedForAll and FeedForAll Mac product(s) have access
// to a caching module. This enables it's use if it is installed.
$allowCachingXMLFiles = 0;
// File access level: The variable $fileAccessLevel can be used limit what files
// and type of files (local or remote) can be used with rss2html.php
// -1 = Remote files are NOT allowed, only local files allowed for template
// and feed which have filenames ending in extensions in the
// $allowedTemplateExtensions and $allowedFeedExtensions lists below
// 0 = Remote files and any local files allowed for template and feed
// 1 = Remote files and only local files allowed for template and feed
// which have filenames ending in extensions in the
// $allowedTemplateExtensions and $allowedFeedExtensions lists below
// 2 = No local files allowed, remote files only.
$fileAccessLevel = 1;
// Allowed file extensions is a list of the allowable extensions for local for
// the template and the feed. New entries can be added by following the example
// below.
$allowedTemplateExtensions = Array(".html", ".htm", ".shtml");
$allowedFeedExtensions = Array(".xml", ".rss");
// Destination Encoding: By default rss2html.php converts all feeds to UTF-8
// and then produces webpages in UTF-8 because UTF-8 is capable of displaying
// all possible characters.
$destinationEncoding = "UTF-8";
// Missing Encoding Default: Some feeds do not specify the character set
// they are encoded in. The XML specification states that if there is no
// encoding specified the XML file, all RSS feeds are XML, must be encoded
// in UTF-8, but experience has show differently. This specifies the
// encoding that will be used for feeds that don't specify the encoding.
//$missingEncodingDefault = "UTF-8";
$missingEncodingDefault = "ISO-8859-1";
// Escape Ampersand In Links: Proper HTML requires that a link with an
// apersand in while inside of an HTML page have that '&' converted to
// '&'.
$escapeAmpInLinks = 1;
// If using cURL, make sure it exists
if (($useFopenURL == 0) && !function_exists("curl_init")) {
$useFopenURL = 1;
}
if ($useFopenURL) {
ini_set("allow_url_fopen", "1");
ini_set("user_agent", 'FeedForAll rss2html.php v2');
}
@include("FeedForAll_rss2html_pro.php");
if (function_exists("FeedForAll_rss2html_pro") === FALSE) {
Function FeedForAll_rss2html_pro($source) {
// This is the place to do any processing that is desired
return $source;
}
}
if (function_exists("FeedForAll_rss2html_readFile") === FALSE) {
Function FeedForAll_rss2html_readFile($filename, $useFopenURL, $useCaching = 0) {
if ($useCaching);
$GLOBALS["ERRORSTRING"] = "";
$result = "";
if (stristr($filename, "://")) {
if ($useFopenURL) {
if (($fd = @fopen($filename, "rb")) === FALSE) {
return FALSE;
}
while (($data = fread($fd, 4096)) != "") {
$result .= $data;
}
fclose($fd);
} else {
// This is a URL so use CURL
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $filename);
curl_setopt($curlHandle, CURLOPT_HEADER, 0);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlHandle, CURLOPT_USERAGENT, "FeedForAll rss2html.php v2");
// curl_setopt($curlHandle, CURLOPT_AUTOREFERER, 1);
curl_setopt($curlHandle, CURLOPT_REFERER, $filename);
curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curlHandle, CURLOPT_MAXREDIRS, 10);
$result = curl_exec($curlHandle);
if (curl_errno($curlHandle)) {
$GLOBALS["ERRORSTRING"] = curl_error($curlHandle);
curl_close($curlHandle);
return FALSE;
}
curl_close($curlHandle);
}
} else {
// This is a local file, so use fopen
if (($fd = @fopen($filename, "rb")) === FALSE) {
return FALSE;
}
while (($data = fread($fd, 4096)) != "") {
$result .= $data;
}
fclose($fd);
}
return $result;
}
}
if (function_exists("FeedForAll_rss2html_convertEncoding") === FALSE) {
Function FeedForAll_rss2html_convertEncoding($XMLstring) {
GLOBAL $missingEncodingDefault;
GLOBAL $destinationEncoding;
if (function_exists("FeedForAll_rss2html_limitLength") === FALSE) {
Function FeedForAll_rss2html_limitLength($initialValue, $limit = 0) {
if (($limit == 0) || (strlen($initialValue) <= $limit )) {
// ZERO is for not limited
return $initialValue;
}
// Cut the text at the exact point, ignoring if it is in a word.
$result = substr($initialValue, 0, $limit);
// Check to see if there are any space we can trim at and if it is not
// too far from where we are
$lastSpace = strrchr($result,' ');
if (($lastSpace !== FALSE) && (strlen($lastSpace) < 20)) {
// lose any incomplete word at the end
$result = substr($result, 0, -(strlen($lastSpace)));
// Append elipses, ... , to show it was truncated
$result .= " ...";
}
if (function_exists("FeedForAll_rss2html_CreateUniqueLink") === FALSE) {
Function FeedForAll_rss2html_CreateUniqueLink($title, $description, $link, $guid, $XMLfilename, $itemTemplate) {
GLOBAL $TEMPLATEfilename;
$match = Array();
while (preg_match("/~~~ItemUniqueLinkWithTemplate=.*~~~/", $itemTemplate, $match) !== FALSE) {
if ((count($match) == 0) || ($match[0] == "")) {
// All done
return $itemTemplate;
}
$replace = "http://$_SERVER[SERVER_NAME]$_SERVER[SCRIPT_NAME]?XMLFILE=".FeedForAll_rss2html_encodeURL($XMLfilename)."&TEMPLATE=".FeedForAll_rss2html_encodeURL($TEMPLATEfilename);
$itemTemplate = FeedForAll_rss2html_str_replace($match[0], $replace, $itemTemplate);
}
if ($title);
if ($description);
if ($link);
if ($guid);
return $itemTemplate;
}
}
if (function_exists("FeedForAll_rss2html_UseUniqueLink") === FALSE) {
Function FeedForAll_rss2html_UseUniqueLink($title, $description, $link, $guid) {
if ($title);
if ($description);
if ($link);
if ($guid);
return -1;
}
}
if (function_exists("FeedForAll_rss2html_EscapeLink") === FALSE) {
Function FeedForAll_rss2html_EscapeLink($link) {
GLOBAL $escapeAmpInLinks;
if ((strstr($link, "://") !== FALSE) && $escapeAmpInLinks) {
// In HTML a link with an & must be converted to &
// And for here without :// it is not a link, since relative
// URLs are not allowed
$link = str_replace("&", "&", $link);
}
return $link;
}
}
if (function_exists("FeedForAll_rss2html_AddIdentity") === FALSE) {
Function FeedForAll_rss2html_AddIdentity($itemString) {
return "".$itemString;
}
}
if (!isset($_REQUEST["buildURL"])) {
if (isset($_REQUEST["XMLFILE"])) {
if (stristr($_REQUEST["XMLFILE"], "file"."://")) {
// Not allowed
;
}
elseif (stristr($_REQUEST["XMLFILE"], "://")) {
if ($fileAccessLevel == -1) {
echo "Configuration setting prohibit using remote files, exiting\n";
exit -1;
} else {
// URL files are allowed
$XMLfilename = $_REQUEST["XMLFILE"];
}
} else {
if (($fileAccessLevel == 1) || ($fileAccessLevel == -1)) {
if (FeedForAll_rss2html_validExtension(basename($_REQUEST["XMLFILE"]), $allowedFeedExtensions) === FALSE) {
echo "Configuration setting prohibit using the specified feed file, exiting\n";
exit -1;
}
$XMLfilename = basename($_REQUEST["XMLFILE"]);
}
elseif ($fileAccessLevel == 2) {
echo "Configuration setting prohibit using local files, exiting\n";
exit -1;
} else {
// It is local and must be in the same directory
$XMLfilename = basename($_REQUEST["XMLFILE"]);
}
}
}
if (isset($_REQUEST["TEMPLATE"])) {
if (stristr($_REQUEST["TEMPLATE"], "file"."://")) {
// Not allowed
;
}
elseif (stristr($_REQUEST["TEMPLATE"], "://")) {
if ($fileAccessLevel == -1) {
echo "Configuration setting prohibit using remote files, exiting\n";
exit -1;
} else {
// URL files are allowed
$TEMPLATEfilename = $_REQUEST["TEMPLATE"];
}
} else {
if (($fileAccessLevel == 1) || ($fileAccessLevel == -1)) {
if (FeedForAll_rss2html_validExtension(basename($_REQUEST["TEMPLATE"]), $allowedTemplateExtensions) === FALSE) {
echo "Configuration setting prohibit using the specified template file, exiting\n";
exit -1;
}
$TEMPLATEfilename = basename($_REQUEST["TEMPLATE"]);
}
elseif ($fileAccessLevel == 2) {
echo "Configuration setting prohibit using local files, exiting\n";
exit -1;
} else {
// It is local and must be in the same directory
$TEMPLATEfilename = basename($_REQUEST["TEMPLATE"]);
}
}
}
if (isset($_REQUEST["FeedTitleLength"])) {
$limitFeedTitleLength = abs($_REQUEST["FeedTitleLength"]);
}
if (isset($_REQUEST["FeedDescriptionLength"])) {
$limitFeedDescriptionLength = abs($_REQUEST["FeedDescriptionLength"]);
}
if (isset($_REQUEST["ItemTitleLength"])) {
$limitItemTitleLength = abs($_REQUEST["ItemTitleLength"]);
}
if (isset($_REQUEST["ItemDescriptionLength"])) {
$limitItemDescriptionLength = abs($_REQUEST["ItemDescriptionLength"]);
}
//
// Maximum number of items to be displayed
//
$FeedMaxItems = 3;
if (isset($_REQUEST["MAXITEMS"])) {
$FeedMaxItems = $_REQUEST["MAXITEMS"];
}
$NoFutureItems = FALSE;
if (isset($_REQUEST["NOFUTUREITEMS"])) {
$NoFutureItems = TRUE;
}
//
// As much as I hate globals, they are needed due to the
// recusive nature of the parser
$insidechannel = FALSE;
$level_channel = 0;
$insidechannelimage = FALSE;
$level_channelimage = 0;
$insideitem = FALSE;
$level_item = 0;
class FeedForAll_rss2html_RSSParser {
var $gotROOT = 0;
var $feedTYPE = "RSS";
var $level = 0;
var $tag = "";
var $title = "";
var $description = "";
var $contentEncoded = "";
var $link = "";
var $pubdate = "";
var $pubdateDC = "";
var $enclosureURL = "";
var $enclosureLength = "";
var $enclosureType = "";
var $categoryArray = Array();
var $category = "";
var $categoryDomain = "";
var $guid = "";
var $author = "";
var $comments = "";
var $source = "";
var $sourceURL = "";
var $DcCreator = "";
var $creativeCommons = "";
var $rssMeshExtra = "";
var $fimageURL = "";
var $fimageTitle = "";
var $fimageLink = "";
var $FeedTitle = "";
var $FeedDescription = "";
var $FeedContentEncoded = "";
var $FeedLink = "";
var $FeedPubDate = "";
var $FeedPubDateDC = "";
var $FeedPubDate_t = 0;
var $FeedLastBuildDate = "";
var $FeedImageURL = "";
var $FeedImageTitle = "";
var $FeedImageLink = "";
var $FeedCreateiveCommons = "";
//
// When adding new Item elements, be sure to update the sort below
var $ItemTitle = Array();
var $ItemDescription = Array();
var $ItemContentEncoded = Array();
var $ItemLink = Array();
var $ItemPubDate = Array();
var $ItemPubDate_t = Array();
var $ItemEnclosureURL = Array();
var $ItemEnclosureLength = Array();
var $ItemEnclosureType = Array();
var $ItemCategoryArray = Array();
var $ItemGuid = Array();
var $ItemAuthor = Array();
var $ItemComments = Array();
var $ItemSource = Array();
var $ItemSourceURL = Array();
var $ItemCreateiveCommons = Array();
var $ItemRssMeshExtra = Array();
function startElement($parser, $tagName, $attrs) {
GLOBAL $insidechannel;
GLOBAL $level_channel;
GLOBAL $insidechannelimage;
GLOBAL $level_channelimage;
GLOBAL $insideitem;
GLOBAL $level_item;
function endElement($parser, $tagName) {
GLOBAL $insidechannel;
GLOBAL $level_channel;
GLOBAL $insidechannelimage;
GLOBAL $level_channelimage;
GLOBAL $insideitem;
GLOBAL $level_item;
GLOBAL $NoFutureItems;
function characterData($parser, $data) {
GLOBAL $insidechannel;
GLOBAL $level_channel;
GLOBAL $insidechannelimage;
GLOBAL $level_channelimage;
GLOBAL $insideitem;
GLOBAL $level_item;
if (($data == "") || ($data == NULL)) {
} else {
if (($insideitem) && ($this->level == $level_item+1)) {
switch ($this->tag) {
case "TITLE":
$this->title .= $data;
break;
case "DESCRIPTION":
$this->description .= $data;
break;
case "CONTENT:ENCODED":
$this->contentEncoded .= $data;
break;
case "SUMMARY":
$this->description .= $data;
break;
case "LINK":
$this->link .= $data;
break;
case "PUBDATE":
$this->pubdate .= $data;
break;
case "DC:DATE":
$this->pubdateDC .= $data;
break;
case "MODIFIED":
$this->pubdateDC .= $data;
break;
case "GUID":
$this->guid .= $data;
break;
case "AUTHOR":
$this->author .= $data;
break;
case "COMMENTS":
$this->comments .= $data;
break;
case "SOURCE":
$this->source .= $data;
break;
case "CATEGORY":
$this->category .= $data;
break;
case "DC:CREATOR":
$this->DcCreator .= $data;
break;
case "CREATIVECOMMONS:LICENSE":
$this->creativeCommons .= $data;
break;
case "RSSMESH:EXTRA":
$this->rssMeshExtra .= $data;
break;
}
}
elseif ($insidechannelimage) {
switch ($this->tag) {
case "TITLE":
$this->fimageTitle .= $data;
break;
case "DESCRIPTION":
$this->description .= $data;
break;
case "CONTENT:ENCODED":
$this->contentEncoded .= $data;
break;
case "TAGLINE":
$this->description .= $data;
break;
case "LINK":
$this->link .= $data;
break;
case "PUBDATE":
$this->FeedPubDate .= $data;
break;
case "DC:DATE":
$this->FeedPubDateDC .= $data;
break;
case "MODIFIED":
$this->FeedPubDateDC .= $data;
break;
case "LASTBUILDDATE":
$this->FeedLastBuildDate .= $data;
break;
case "CREATIVECOMMONS:LICENSE":
$this->FeedCreateiveCommons .= $data;
break;
}
}
}
if ($parser);
}
}
}
if (($template = FeedForAll_rss2html_readFile($TEMPLATEfilename, $useFopenURL)) === FALSE) {
if ($GLOBALS["ERRORSTRING"] == "") {
echo "Unable to open template $TEMPLATEfilename, exiting\n";
} else {
echo "Unable to open template $TEMPLATEfilename with error <b>$GLOBALS[ERRORSTRING]</b>, exiting\n";
}
exit -1;
}
if (FeedForAll_rss2html_isTemplate($template) === FALSE) {
echo "$TEMPLATEfilename is not a valid rss2html.php template file, exiting\n";
exit -1;
}
if (strstr($template, "~~~NoFutureItems~~~")) {
$NoFutureItems = TRUE;
}
if (($XML = FeedForAll_rss2html_readFile($XMLfilename, $useFopenURL, $allowCachingXMLFiles)) === FALSE) {
if ($GLOBALS["ERRORSTRING"] == "") {
echo "Unable to open RSS Feed $XMLfilename, exiting\n";
} else {
echo "Unable to open RSS Feed $XMLfilename with error <b>$GLOBALS[ERRORSTRING]</b>, exiting\n";
}
exit -1;
}
if (strstr(trim($XML), "<?xml") === FALSE) {
$XML = "<?xml version=\"1.0\"?>\n$XML";
}
$XML = strstr(trim($XML), "<?xml");
if (($convertedXML = FeedForAll_rss2html_convertEncoding($XML)) === FALSE) {
// Conversions failed, probably becasue it was wrong or the routines were missing
$convertedXML = $XML;
$xml_parser = xml_parser_create();
} else {
$xml_parser = xml_parser_create($destinationEncoding);
}
// Since ' is not HTML, but is XML convert.
$template = str_replace("'", "'", $template);
if (!headers_sent()) {
// Send the Content-Type to force $destinationEncoding
header("Content-Type: text/html; charset=$destinationEncoding");
}
echo FeedForAll_rss2html_pro($template);
} else {
if (!headers_sent()) {
// Send the Content-Type to force $destinationEncoding
header("Content-Type: text/html; charset=$destinationEncoding");
}
echo "<html><head><title>rss2html.php URL tool</title><meta http-equiv=\"content-type\" content=\"text/html;charset=$destinationEncoding\"></head><body bgcolor=\"#EEEEFF\">\n";
//
// We are in "buildURL" mode to help create properly encoded URLs to pass to rss2html.php
$_xml = "";
if (isset($_POST["XML"])) {
$_xml = $_POST["XML"];
}
$_template = "";
if (isset($_POST["TEMPLATE"])) {
$_template = $_POST["TEMPLATE"];
}
$_maxitems = "";
if (isset($_POST["MAXITEMS"])) {
$_maxitems = $_POST["MAXITEMS"];
}
$_nofutureitems = "";
if (isset($_POST["NOFUTUREITEMS"])) {
$_nofutureitems = $_POST["NOFUTUREITEMS"];
}
// Display the entry form
echo "<center><h1>RSS2HTML.PHP LINK TOOL</h1></center>\n";
echo "<p>To assist with the with the creation of properly encoded URLs for use with rss2html.php this tool has been created. Fill in the URLs or file paths for both the XML file and your template file in the boxes below and then click "Submit". The program will then return the URLs properly encoded in a string that calls rss2html.php. You can click on this link to test the results. The program will also indicate if it was unable to open either of the URLs it was given.</p>\n";
echo "<form action=\"$_SERVER[PHP_SELF]\" method=\"POST\">\n";
echo "<input type=\"hidden\" name=\"buildURL\" value=\"1\">\n";
echo "URL form the XML file: (ie. http://www.myserver.com/file.xml)<br><input type=\"text\" name=\"XML\" size=\"100\" value=\"$_xml\"><br>\n";
echo "URL form the template file: (ie. http://www.myserver.com/template.html)<br><input type=\"text\" name=\"TEMPLATE\" size=\"100\" value=\"$_template\"><br>\n";
echo "<b>Optional items:</b><br>\n";
echo "Maximum items: <input type=\"text\" name=\"MAXITEMS\" size=\"5\" value=\"$_maxitems\"> (Use negative numbers for the last X items)<br>\n";
echo "No future items: <input type=\"checkbox\" name=\"NOFUTUREITEMS\" ";
if ($_nofutureitems == "on") {
echo "CHECKED";
}
echo "> (Use negative numbers for the last X items)<br>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"Submit\">\n";
echo "</form>\n";
$xmlContents = "";
$templateContents = "";
if (isset($_POST["submit"])) {
if ($_SERVER["REQUEST_METHOD"] != "POST") {
exit;
}
echo "<hr>\n";
if (isset($_POST["XML"]) && $_POST["XML"] != "") {
$XMLfilename = "";
if (stristr($_POST["XML"], "file"."://")) {
// Not allowed
;
}
elseif (stristr($_POST["XML"], "://")) {
if ($fileAccessLevel == -1) {
echo "<p style=\"color: red;\">Configuration setting prohibit using remote files</p>\n";
} else {
// URL files are allowed
$XMLfilename = $_POST["XML"];
}
} else {
if (($fileAccessLevel == 1) || ($fileAccessLevel == -1)) {
if (FeedForAll_rss2html_validExtension(basename($_POST["XML"]), $allowedFeedExtensions) === FALSE) {
echo "<p style=\"color: red;\">Configuration setting prohibit using the specified feed file</p>\n";
} else {
$XMLfilename = basename($_POST["XML"]);
}
}
elseif ($fileAccessLevel == 2) {
echo "<p style=\"color: red;\">Configuration setting prohibit using local files</p>\n";
} else {
// It is local and must be in the same directory
$XMLfilename = basename($_POST["XML"]);
}
}
if ($XMLfilename != "") {
if (($xmlContents = FeedForAll_rss2html_readFile($_POST["XML"], $useFopenURL)) === FALSE) {
if ($GLOBALS["ERRORSTRING"] == "") {
echo "<p>The XML file <b>$_POST[XML]</b> could not be opened.</p>\n";
} else {
echo "<p>The XML file <b>$_POST[XML]</b> could not be opened with the error <b>$GLOBALS[ERRORSTRING]</b>.</p>\n";
}
} else {
echo "<p>The XML file <b>$_POST[XML]</b> was SUCCESSFULLY opened</p>\n";
}
}
}
if (isset($_POST["TEMPLATE"]) && $_POST["TEMPLATE"] != "") {
$TEMPLATEfilename = "";
if (stristr($_POST["TEMPLATE"], "file"."://")) {
// Not allowed
;
}
elseif (stristr($_POST["TEMPLATE"], "://")) {
if ($fileAccessLevel == -1) {
echo "<p style=\"color: red;\">Configuration setting prohibit using remote files</p>\n";
} else {
// URL files are allowed
$TEMPLATEfilename = $_POST["TEMPLATE"];
}
} else {
if (($fileAccessLevel == 1) || ($fileAccessLevel == -1)) {
if (FeedForAll_rss2html_validExtension(basename($_POST["TEMPLATE"]), $allowedTemplateExtensions) === FALSE) {
echo "<p style=\"color: red;\">Configuration setting prohibit using the specified template file</p>\n";
} else {
$TEMPLATEfilename = basename($_POST["TEMPLATE"]);
}
}
elseif ($fileAccessLevel == 2) {
echo "<p style=\"color: red;\">Configuration setting prohibit using local files</p>\n";
} else {
// It is local and must be in the same directory
$TEMPLATEfilename = basename($_POST["TEMPLATE"]);
}
}
if ($TEMPLATEfilename != "") {
if (($templateContents = FeedForAll_rss2html_readFile($_POST["TEMPLATE"], $useFopenURL)) === FALSE) {
if ($GLOBALS["ERRORSTRING"] == "") {
echo "<p>The template file <b>$_POST[TEMPLATE]</b> could not be opened.</p>\n";
} else {
echo "<p>The template file <b>$_POST[TEMPLATE]</b> could not be opened with the error <b>$GLOBALS[ERRORSTRING]</b>.</p>\n";
}
}
elseif (FeedForAll_rss2html_isTemplate($templateContents) === FALSE) {
echo "$_POST[TEMPLATE] is not a valid rss2html.php template file\n";
$templateContents = "";
} else {
echo "<p>The template file <b>$_POST[TEMPLATE]</b> was SUCCESSFULLY opened</p>\n";
}
}
}
if ($xmlurl != "") {
echo "<p>URL for the XML file properly encoded:<br><pre>$xmlurl</pre></p>\n";
}
if ($templateurl != "") {
echo "<p>URL for the template file properly encoded:<br><pre>$templateurl</pre></p>\n";
}
echo "<h2>Example Usage</h2>\n";
echo "<p>Click on link to view results: <a href=\"$answer\" target=\"_blank\">$answer</a></p>\n";
echo "<p>Server Side Include:<br><pre><!--#INCLUDE VIRTUAL="".basename($_SERVER["PHP_SELF"])."?$ssi" --></pre></p>\n";