You are here:  » rss returning with extra #-

Support Forum



rss returning with extra #-

Submitted by marco@flapper on Mon, 2010-11-08 21:41 in

Hi,
My RSS returns with an extra "#-" in the link.

So instead of this link http://www.mywebsite.com/product/Puzzel-Box-Comic.html, I get http://www.mywebsite.com/product/#-Puzzel-Box-Comic.html.

The RSS.php has this code:

<?php
  require("includes/common.php");
  header("Content-Type: text/xml");
  print "<?xml version='1.0' encoding='UTF-8'?>";
  print "<rss version='2.0' xmlns:atom='http://www.w3.org/2005/Atom'>";
  print "<channel>";
  print "<title>mywebsite</title>";
  print "<link>http://www.mywebsite.com/</link>";
  print "<description>mywebsite tips</description>";
  print "<atom:link href='http://www.mywebsite.com/rss.php' rel='self' type='application/rss+xml' />";
  $q = $_GET["q"];
  if (strlen($q) > 3)
 {
    $sql = "SELECT * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants, MATCH (name,description,category,brand) AGAINST ('".database_safe($q)."') AS relevance FROM `".$config_databaseTablePrefix."products` WHERE image_url <> '' AND MATCH (name,description,category,brand) AGAINST ('".database_safe($q)."') GROUP BY name LIMIT 5";
  }
  else
  {
    $sql = "SELECT * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants FROM `".$config_databaseTablePrefix."products` WHERE image_url <> '' AND search_name LIKE '%".database_safe($q)."%' GROUP BY name LIMIT 5";
  }
   if (database_querySelect($sql,$rows))
  {
    foreach($rows as $row)
    {
      print "<item>";
      if ($config_useRewrite)
      {
        $href = "product/".tapestry_hyphenate($row["name"]).".html";
      }
      else
      {
        $href = "products.php?q=".urlencode($row["name"]);
      }
     /* print "<title>".$row["name"]."</title>";*/
     print "<title>".$row["name"]." ".$row["price"]." EUR</title>";
print "<link>http://www.mywebsite.com".$config_baseHREF.$href."</link>";
print "<guid>http://www.mywebsite.com".$config_baseHREF.$href."</guid>";
print "<description><![CDATA[";
print "<a href='http://www.mywebsite.com".tapestry_buyURL($row)."'>";
print "<img border='0' width='150' src='".$row["image_url"]."' />";
print "</a>";
print $row["description"];
print "]]></description>";
print "</item>";
    }
  }
  print "</channel>";
  print "</rss>";
?>

Submitted by support on Tue, 2010-11-09 09:44

Hi Marco,

Is it absolutely consistent across all products? "#" would normally be removed by normalisation, but the "-" in front indicates that the product has a space at the start in the database...

If you're not sure, if you could email me a link to your site and your actual RSS.php script I'll check it out for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by marco@flapper on Tue, 2010-11-09 11:11

Hi,
Didn't look past the first one. It is not consistent. Guess it is a bad one in the feed.