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 '<!-- HTML generated from an RSS Feed by rss2html.php, http://www.FeedForAll.com/ a NotePage, Inc. product (http://www.notepage.com/) -->'.$itemString;
}
}
if (!isset($_REQUEST['buildURL'])) {
//
// Check variables that could be used if URL wrapper are disable or not working
// 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'];
}
if (function_exists('FeedForAll_scripts_contentOfCache')) {
$_cacheTTL = '';
if (isset($_POST['XMLCACHETTL'])) {
$_cacheTTL = $_POST['XMLCACHETTL'];
}
$_allowCachingXMLFiles = '';
if (isset($_POST['ALLOWXMLCACHE'])) {
$_allowCachingXMLFiles = $_POST['ALLOWXMLCACHE'];
}
$_outputCacheTTL = '';
if (isset($_POST['OUTCACHETTL'])) {
$_outputCacheTTL = $_POST['OUTCACHETTL'];
}
$_outputCacheFileName = '';
if (isset($_POST['OUTCACHENAME'])) {
$_outputCacheFileName = $_POST['OUTCACHENAME'];
}
}
// 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 'Allow Caching of the feed: <input type="checkbox" name="ALLOWXMLCACHE" ';
if ($_allowCachingXMLFiles == 'on') {
echo 'CHECKED';
}
echo '><br />'."\n";
echo 'Cache Time: <input type="text" name="XMLCACHETTL" size="5" value="'.$_cacheTTL.'"> (The number of seconds a file may be cached for before being fetched again)<br />'."\n";
echo 'Output Cache Time: <input type="text" name="OUTCACHETTL" size="5" value="'.$_outputCacheTTL.'"> (The number of seconds the output may be cached for before being recreated)<br />'."\n";
echo 'Output Cache Name: <input type="text" name="OUTCACHENAME" size="40" value="'.$_outputCacheFileName.'"> (This should be a unique name to prevent conflicts)<br />'."\n";
echo '<p>PHP Include (Due to security concerns many ISP have configured their servers to prevent this from working):<br /><nobr style="font-weight: bolder; color: red;"><?php<br />include("'.$answer.'");<br />?></nobr></p>'."\n";
}
if ($xmlContents != '' || $templateContents != '') {
echo '<br /><hr /><br />'."\n";
if ($xmlContents != '') {
echo '<h1>XML file</h1>'."\n";
if (($convertedXML = FeedForAll_scripts_convertEncoding($xmlContents, $missingEncodingDefault, $destinationEncoding)) === FALSE) {
// Conversions failed, probably becasue it was wrong or the routines were missing