I get the same email
php /home/rlnz/public_html/admin/cron/rss.php? 1 12> /dev/null
and for the record....
<?php
$cat = $argv[1];
$rss = $argv[2];
// HTTP/1.0
//Selects Categorys and Url from database
include_once("inc_sql.php");
$connect = db_connect(USERNAME, PASSWORD, HOSTNAME, DATABASE);
$category = $HTTP_GET_VARS['category'];
$filename = $HTTP_GET_VARS['source'];
//////defaults only first time
if (!$filename && !$category) {
$result = query("select PkCategory, Name from Categories where PkCategory = $cat");
while($row=mysql_fetch_array($result)){
$count++;
$name = urlencode($row[Name]);
$string.="cat$count=$name&data$count=$row[PkCategory]&";
}
$string.="categories=$count&";
$count=0;
$category=1;
}
if($category){
$result = query("select Name, Uri from Rss where FkCategory='$category' and PkRss = $rss");
while($row=mysql_fetch_array($result)){
$count++;
$name = urlencode($row[Name]);
$uri = urlencode($row[Uri]);
$string.="source$count=$name&uri$count=$uri&";
}
$string.="sources=$count&";
$count=0;
mysql_data_seek($result, 0);
$temp = mysql_fetch_array($result);
$filename = $temp[Uri];
}
//read the file
$fp = fopen($filename, "r");
if(!$fp) {
echo"Remote Feed Unavailable.\n";
exit;
}
while (!feof ($fp)) $data .= fgets($fp, 4096);
fclose ($fp);
$initPos = strpos($data, "<channel>"); //avoid the DTD declaration, non validating parse. Begin directly with channel
//parse the data
include_once("xmlclass.php");
$xml_parser = new xml();
$data = stripslashes(substr($data, $initPos));
$root_node = $xml_parser->parse($data);
$channel = array_shift($root_node["_ELEMENTS"]);
//Now we select some elements we want, discarding others (See rss specs 0.91, 0.92 and 2.0)
////// WHO title, description and link /////////////////////////////////////////////////////////
foreach ($channel["_ELEMENTS"] as $item){
if($item[_NAME]=="title") $base_name=$item[_DATA];
if($item[_NAME]=="link") $base_uri=$item[_DATA];
if($item[_NAME]=="description") $base_desc=$item[_DATA];
}
$base = "<b>Web:%20</b><a href=\"$base_uri\">$base_name</a><br>$base_desc<br>";
$string.="txt=$base";
/////////////////////////////////////////////////////////////////////////
////////// ITEMS --> items, description and link ////////////////////////////////////////////////////////
foreach ($channel["_ELEMENTS"] as $item){
//printf("ITEM: %s<br>", $item["_NAME"]);
if($item[_NAME]=="item") {
//stripslashes is needed since providers give links inside texts or titles
foreach ($item["_ELEMENTS"] as $tag){
if($tag["_NAME"]=="title") $news_title=$tag[_DATA];
if($tag["_NAME"]=="link") $news_uri=$tag[_DATA];
if($tag["_NAME"]=="description") $news_desc=$tag[_DATA];
}
$news .= "<b>$news_title</b><br>$news_desc<br><a href=\"$news_uri\" target=\"_new\">$news_uri</a><br><br>";
//// START SQL ADDING
require("../../time.php");
mysql_connect (localhost, **, **);
mysql_select_db (**);
$news_desc = mysql_escape_string($news_desc);
$news_title = mysql_escape_string($news_title);
//$result99 = mysql_query ("INSERT INTO news_rss (`rss_id`,`link`,`title`,`descr`,`time`) Values('','$news_uri','$news_title','$news_desc','$set_base_time')") or die("INSERT error: ".mysql_error());
///// END SQL ADDING
}
}
$string.=$news;
$string = stripslashes(str_replace("&", ";", $string));
////////////////////////////////////////////////////////////////////////////////
print ($string);
?>