|
|
#1 |
|
Senior Member
Join Date: Jan 2008
Posts: 124
Rep Power: 9 ![]() |
Greetings all:
So here is my dilemma.... This is what it says when I go to validate the RSS feed: Code:
Sorry This feed does not validate. line 11, column 17: Invalid email address: MISTY (7 occurrences) [help] <author>MISTY</author> ^line 12, column 4: Undefined item element: date (7 occurrences) [help] <date>2008-02-19 15:53:03</date> ^Source: http://www.sandrailsonly.curbstoners.com/external.php <rss version="0.92"> <channel> <title>SandRailsOnly.com Classifieds</title> <link>http://www.sandrailsonly.curbstoners.com</link> <description>DESCRIPTION</description> <docs>http://backend.userland.com/rss092</docs> <language>en</language> <item> <link>http://www.sandrailsonly.curbstoners.com/viewlisting.php?view=16</link> <title>Red Head Motor Sports</title> <author>MISTY</author> <date>2008-02-19 15:53:03</date> </item> <item> <link>http://www.sandrailsonly.curbstoners.com/viewlisting.php?view=13</link> <title>2007 Sandwinder LTX LS2 - 480HP Used 3x Times</title> <author>ccie6872</author> <date>2008-02-12 15:04:33</date> </item> <item> <link>http://www.sandrailsonly.curbstoners.com/viewlisting.php?view=12</link> <title>1100cc dune buggy for one rider</title> <author>tycentre</author> <date>2008-02-12 15:01:23</date> </item> <item> <link>http://www.sandrailsonly.curbstoners.com/viewlisting.php?view=11</link> <title>Dune Buggy</title> <author>jacanchola</author> <date>2008-02-09 22:57:08</date> </item> <item> <link>http://www.sandrailsonly.curbstoners.com/viewlisting.php?view=10</link> <title>FEDERAL SANDRAIL</title> <author>FEDERAL SANDRAIL</author> <date>2008-02-08 22:17:37</date> </item> <item> <link>http://www.sandrailsonly.curbstoners.com/viewlisting.php?view=9</link> <title>2002 5.3 Vortec Engine</title> <author>DuneDaddy</author> <date>2008-02-04 22:20:27</date> </item> <item> <link>http://www.sandrailsonly.curbstoners.com/viewlisting.php?view=8</link> <title>2008 LS1 Dual Sport Sand Rail</title> <author>DuneDaddy</author> <date>2008-02-04 21:49:36</date> </item> </channel> </rss> Code:
<?php
/*
* 68 Classifieds
*
* All source code & content (c) Copyright 2006, 68 Classifieds
* unless specifically noted otherwise.
*
* @Author $Author: Eric $ (68 Classifieds)
* @copyright 68 Classifieds
* @link http://www.68classifieds.com
* @version 3.1
* @$Revision: 1.2 $
* @Updated: $Date: 2006/06/21 12:45:41 $
* @package 68 Classifieds
*
*/
require_once('includes/init.php');
//now setup the search query
$count="";
$sSQL="SELECT p.id, p.owner, p.title, p.featured, p.section, p.description, p.price, p.dateadded, p.expiration, p.pBold, p.pHighlighted, u.state, u.city, u.country, u.username FROM ".PREFIX."products AS p LEFT JOIN ".PREFIX."users AS u ON p.owner = u.id WHERE p.expiration > NOW() AND p.display = 'Y' ";
//now get the search fields
if (isset($_REQUEST['type'])&& $_REQUEST['type']<>"")
{
$arr_childs = array((int)$_REQUEST['type']);
get_ids($arr_childs);
$sSQL .= ( empty($arr_childs) ) ? '': " AND p.section IN (". implode(', ', $arr_childs) .")";
}
if (isset($_REQUEST['state'])&& $_REQUEST['state']<>"")
{
$sSQL .= " AND u.state = '".mysql_real_escape_string($_REQUEST['state'])."'";
}
if (isset($_REQUEST['city'])&& $_REQUEST['city']<>"")
{
$sSQL .= " AND u.city = '".mysql_real_escape_string($_REQUEST['city'])."'";
}
if (isset($_REQUEST['country'])&& $_REQUEST['country']<>"")
{
$sSQL .= " AND u.country = '".mysql_real_escape_string($_REQUEST['country'])."'";
}
if (isset($_REQUEST['owner'])&& $_REQUEST['owner']<>"")
{
$sSQL .= " AND p.owner = ".(int)$_REQUEST['owner'];
}
if (isset($_REQUEST['searchtext'])&& $_REQUEST['searchtext']<>"")
{
$searchtext=trim(mysql_real_escape_string($_REQUEST['searchtext']));
$sSQL .= " AND (p.title LIKE '%".$searchtext."%' OR p.description LIKE '%".$searchtext."%')";
}
//search price//
$minprice=(int)trim(@$_REQUEST['minprice']);
$maxprice=(int)trim(@$_REQUEST['maxprice']);
if($minprice == "")
$minprice=0;
if($maxprice == "")
$maxprice=9999999;
$sSQL .= " AND p.price BETWEEN ". $minprice ." AND ". $maxprice;
//now group by
$sSQL .= " GROUP BY p.id, p.owner, p.title, p.featured, p.section, p.description, p.price, p.dateadded, p.expiration ,u.state, u.city, u.country";
if($count>0)
{
$sSQL.=" HAVING count(sValue) = ".$count;
}
$sSQL .= " ORDER BY p.dateadded DESC";
//now limit
if(isset($_GET['limit']) && $_GET['limit']<>"")
{
$sSQL .= " LIMIT ". (int)$_GET['limit'];
}
else
{
$sSQL .= " LIMIT 15";
}
//buld array of listings
$ads = array();
$result = $db->query($sSQL);
while ($rs=$result->fetch())
{
$ads[] = $rs;
}
// set XML type and nocache headers
header('Content-Type: text/xml');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
// print out the page header
echo '<rss version="0.92">' . "\r\n";
echo "<channel>\r\n";
echo "\t<title>" . htmlspecialchars($title) . "</title>\r\n";
echo "\t<link>".URL."</link>\r\n";
echo "\t<description>" . htmlspecialchars(DESCRIPTION). "</description>\r\n";
echo "\t<docs>http://backend.userland.com/rss092</docs>\r\n";
echo "\t<language>en</language>\r\n";
// list returned threads
if (!empty($ads))
{
foreach ($ads AS $listing)
{
echo "\t\t\t<item>\r\n";
echo "\t\t\t\t<link>". URL ."/viewlisting.php?view=".$listing['id']."</link>\r\n";
echo "\t\t\t\t<title>" . htmlspecialchars($listing[title]) . "</title>\r\n";
echo "\t\t\t\t<author>" . $listing[username] . "</author>\r\n";
echo "\t\t\t\t<date>" . $listing['dateadded'] . "</date>\r\n";
echo "\t\t\t</item>\r\n";
}
}
//close the feed
echo "</channel>\r\n";
echo "</rss>";
?>
__________________
~~ Lorren Any advice is always appreciated. ![]() v 3.1.10 Developer; v 4 Developer |
|
|
|
|
|
#2 |
|
Coder
Join Date: Mar 2006
Posts: 4,564
Rep Power: 111 ![]() ![]() |
looks like its looking for a valid e-mail address for author and your date format is incorrect.
|
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Jan 2008
Posts: 124
Rep Power: 9 ![]() |
Quote:
I tried to correct it myself and then got parsing errors.... Anyone?
__________________
~~ Lorren Any advice is always appreciated. ![]() v 3.1.10 Developer; v 4 Developer |
|
|
|
|
|
|
#4 | |
|
Coder
Join Date: Mar 2006
Posts: 4,564
Rep Power: 111 ![]() ![]() |
Quote:
As far as the date goes you never stated what standard you are trying to validate to, so once again without more info from you its tough to offer a solution. Do you need the date to conform to RFC-822 standards? |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Oodle XML feed | cheesegrits | v3.1 Modules & Modifications | 14 | 02-17-2009 09:10 AM |
| RSS Feed not working | abkeller | v3.1 Modules & Modifications | 10 | 08-04-2007 03:13 PM |
| Special Character in Listings stops feed! | garysr | v3.1 Questions & Support | 6 | 01-09-2007 10:29 PM |
| RSS feed to HTML page | SkGold | v3.1 Modules & Modifications | 10 | 12-29-2006 05:39 PM |
| Oodle Feed XML | CB | v3.1 Questions & Support | 8 | 09-25-2006 05:50 AM |