Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 1 votes

RSS Feed contribution support thread


360 replies to this topic

#301 andremen

  • Community Member
  • 23 posts
  • Real Name:Andre Meneguini
  • Gender:Male
  • Location:NY

Posted 25 August 2009, 13:41

View Postzozzoozzz, on Aug 25 2009, 09:33 AM, said:

Can anybody tell me how to set the letter-spacing of the Social Bookmark in my store when I have installed the Rssfeed ADD-ON on my store?



thanks

I have a idea, maybe it help you.
U just need to move it inside of the table, All files are inside some table any way!
On the table tag < table > add border like number 10 this away yoyu will see easy, move where you like to be ( criate new < tr> or < td > if need) and you be good to go.
easy way if you use dreamwear, but not necessary.

#302 DAVID3733

  • Community Member
  • 155 posts
  • Real Name:DAVID
  • Location:essex UK

Posted 01 September 2009, 12:18

I have been trying to get this fantastic contb working on a few of my sites for ages now and it is working on sme really well

I have a unusaul set up running RC2a and multi store contrib, i can get the rss working on 2 of the 4 stores, stores id 3 and 4 work perfect but stores id 1 nd 2 do not

I have edited the Rss.php to hopefully only include the store that i want in the RSS feed which also works but for stores 1 and 2 something wierd is happening and i cant wok it out, it is not showing the updated items, just the same ones everyday, i assume this is a problem with the SQL statement but i cant work it out, please finnd below the code for shop 1, could someone please look at it to see where i am going wrong, the only difference with stores 3 and 4 is the stores id (produscts to stores id= 1)

<?php
/*
  $Id: rss.php,v 2.0 2007/05/12 19:30:06 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

/*
 * Include the application_top.php script
 */
require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_RSS);

$navigation->remove_current_page();

// If the language is not specified
  $lang_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$languages_id . "'");

// Recover the code (fr, en, etc) and the id (1, 2, etc) of the current language
if (tep_db_num_rows($lang_query)) {
  $lang_a = tep_db_fetch_array($lang_query);
	$lang_code = $lang_a['code'];
}

define(RSS_STRIP_HTML_TAGS,false);
// If the default of your catalog is not what you want in your RSS feed, then
// please change this three constants:
// Enter an appropriate title for your website
define(RSS_TITLE, STORE_NAME);
// Enter your main shopping cart link
define(WEBLINK, HTTP_SERVER);
// Enter a description of your shopping cart
define(DESCRIPTION, TITLE);
/////////////////////////////////////////////////////////////
//That's it.  No More Editing (Unless you renamed DB tables or need to switch
//to SEO links (Apache Rewrite URL)
/////////////////////////////////////////////////////////////

$store_name = STORE_NAME;
$rss_title = RSS_TITLE;
$weblink = WEBLINK;
$description = DESCRIPTION;
$email_address = STORE_OWNER_EMAIL_ADDRESS;

$subtitle = '';

function replace_problem_characters($text) {
	$in[] = '@&(amp|#038);@i'; $out[] = '&';
	$in[] = '@&(#036);@i'; $out[] = '$';
	$in[] = '@&(quot);@i'; $out[] = '"';
	$in[] = '@&(#039);@i'; $out[] = '\'';
	$in[] = '@&(nbsp|#160);@i'; $out[] = ' ';
	$in[] = '@&(hellip|#8230);@i'; $out[] = '...';
	$in[] = '@&(copy|#169);@i'; $out[] = '(c)';
	$in[] = '@&(trade|#129);@i'; $out[] = '(tm)';
	$in[] = '@&(lt|#60);@i'; $out[] = '<';
	$in[] = '@&(gt|#62);@i'; $out[] = '>';
	$in[] = '@&(laquo);@i'; $out[] = '«';
	$in[] = '@&(raquo);@i'; $out[] = '»';
	$in[] = '@&(deg);@i'; $out[] = '°';
	$in[] = '@&(mdash);@i'; $out[] = '—';
	$in[] = '@&(reg);@i'; $out[] = '®';
	$in[] = '@&(–);@i'; $out[] = '-';
	$text = preg_replace($in, $out, $text);
	return $text;
}

function strip_html_tags($str) {
// $document should contain an HTML document.
// This will remove HTML tags, javascript sections
// and white space. It will also convert some
// common HTML entities to their text equivalent.

	$search = array ("'<script[^>]*?>.*?</script>'si",  // Strip out javascript
					 "'<[/!]*?[^<>]*?>'si",		  // Strip out HTML tags
					 //"'([rn])[s]+'",				// Strip out white space
					 "'&(quot|#34);'i",				// Replace HTML entities
					 "'&(amp|#38);'i",
					 "'&(lt|#60);'i",
					 "'&(gt|#62);'i",
					 "'&(nbsp|#160);'i",
					 "'&(iexcl|#161);'i",
					 "'&(cent|#162);'i",
					 "'&(pound|#163);'i",
					 "'&(copy|#169);'i",
					 "'&#(d+);'e");					// evaluate as php
	
	$replace = array ("",
					 "",
					 //"\1",
					 "\"",
					 "&",
					 "<",
					 ">",
					 " ",
					 chr(161),
					 chr(162),
					 chr(163),
					 chr(169),
					 "chr(\1)");
	
	return preg_replace($search, $replace, $str);
}


  if(!function_exists('eval_rss_urls')) {
	function eval_rss_urls($string) {
			// rewrite all local urls to absolute urls
		return preg_replace_callback("/(href|src|action)=[\"']{0,1}(\.{0,2}[\\|\/]{1})(.*?)[\"']{0,1}( .*?){0,1}>/is","rewrite_rss_local_urls",$string);
		//"/(href|src|action)=[\"']{0,1}(\.{2}[\\|\/]{1})(.*?)[\"']{0,1}( .*?){0,1}>/is"
	}
  } 

	  function rewrite_rss_local_urls($string) {

	$repl_text = $string[0];
	$repl_by = HTTP_SERVER.'\\';
	$repl_len = 0;
	
	$index_pos = strpos  ( $repl_text , '..');
	if ($index_pos > -1) {
		$repl_len = 2;	
	} else {
	 	$index_pos = strpos  ( $repl_text , '\"\\');	
		if ($index_pos > -1) {
			$repl_len = 0;	
			$index_pos+=1;
		}
	}
	if ($index_pos > -1) {
		substr_replace($repl_text, $repl_by, $index_pos,2 );	
	}
		ob_start();
			echo $repl_text;
			$return = ob_get_contents();
		   ob_end_clean();
		return $return;
	}
	
// to strip html or not to strip html tags
if (isset($HTTP_GET_VARS['html'])) {
	if ($HTTP_GET_VARS['html']=='false') {
		$strip_html_tags = true;	
	} else {
		$strip_html_tags = false;	
	}
} else {
	$strip_html_tags = RSS_STRIP_HTML_TAGS;
}

// show the products of a specified manufacturer

	if (isset($HTTP_GET_VARS['manufacturers_id'])) {

	  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

// We are asked to show only a specific category

		$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description,
			   m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd
			   ON p2c.categories_id = cd.categories_id where p.products_status = '1' left join products_to_stores on ( products_to_stores.products_id = products.products_id )where p.products_status = '1' AND products_to_stores.stores_id='1' and p.products_to_rss='1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' 
			   GROUP BY p.products_id
		ORDER BY p.products_last_modified DESC
		LIMIT ". (int)MAX_RSS_ARTICLES."";

	  } else {

// We show them all

		$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description,
			   m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd
			   ON p2c.categories_id = cd.categories_id  where p.products_status = '1' left join products_to_stores on ( products_to_stores.products_id = products.products_id )where p.products_status = '1' AND products_to_stores.stores_id='1' and p.products_to_rss='1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id']  . "' 
			   GROUP BY p.products_id
		ORDER BY p.products_last_modified DESC
		LIMIT ". (int)MAX_RSS_ARTICLES."";


	  }
	  
	  $subtitle = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
	  $subtitle = tep_db_fetch_array($subtitle);
	  $subtitle = $subtitle['manufacturers_name'];
		$rss_title = BOX_INFORMATION_RSS_MANUFACTURER;
	} else if (tep_not_null($current_category_id)) {

// show the products in a given categorie

	  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
		$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description,
			   m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd
			   ON p2c.categories_id = cd.categories_id where p.products_status = '1' left join products_to_stores on ( products_to_stores.products_id = products.products_id )where p.products_status = '1' AND products_to_stores.stores_id='1' and p.products_to_rss='1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id  . "' 
			   GROUP BY p.products_id
		ORDER BY p.products_last_modified DESC
		LIMIT ". (int)MAX_RSS_ARTICLES."";

	  } else {
// We show them all
		$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description,
			   m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd
			   ON p2c.categories_id = cd.categories_id where p.products_status = '1' left join products_to_stores on ( products_to_stores.products_id = products.products_id )where p.products_status = '1' AND products_to_stores.stores_id='1' and p.products_to_rss='1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' 
			   and p2c.categories_id = '" . (int)$current_category_id  . "' 
			   GROUP BY p.products_id
		ORDER BY p.products_last_modified DESC
		LIMIT ". (int)MAX_RSS_ARTICLES."";
	  }

		$subtitle= tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
	  $subtitle = tep_db_fetch_array($subtitle);
	  $subtitle = $subtitle['categories_name'];
   	  $rss_title = BOX_INFORMATION_RSS_CATEGORY;

	} 
	
   else {
	
		// show realy al products
	   $listing_sql = "select " . $select_column_list . "p.products_status, p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description, p.products_last_modified,
		   m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join products_to_stores on ( products_to_stores.products_id = p.products_id )left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd
		  ON p2c.categories_id = cd.categories_id where p.products_status = '1' AND products_to_stores.stores_id='1' and p.products_to_rss='1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "'  
			   GROUP BY p.products_id
	 ORDER BY p.products_last_modified DESC
	LIMIT ". (int)MAX_RSS_ARTICLES."";
		
		$rss_title = BOX_INFORMATION_RSS;
	}
//	echo $listing_sql;
// Execute SQL query and get result
$query = tep_db_query($listing_sql);

	/*
	 * If there are returned rows...
	 * Basic sanity check 
	 */
	if ( tep_db_num_rows($query) > 0 ){

if ($subtitle != '') $rss_title .= ' - '.$subtitle;

// Encoding to UTF-8
$store_name =  utf8_encode (replace_problem_characters($store_name));
$rss_title =  utf8_encode (replace_problem_characters($rss_title));
$weblink =  utf8_encode ($weblink);
$description =  utf8_encode (replace_problem_characters($description));
$email_address =  utf8_encode ($email_address);

	// SQL header(Last-Modified)
$last_modified = '';
$sql = "SELECT MAX(products_date_added) as mPla, MAX(products_last_modified) as mPlm FROM products WHERE products_to_rss = '1' ORDER BY products_id DESC LIMIT 1";
  $sql_result = tep_db_query($sql);
	$row = tep_db_fetch_array($sql_result);

	if ($row['mPlm'] != '') { $last_modified = $row['mPlm']; }
	else { $last_modified = $row['mpla']; }

  $headers = getallheaders(); 
  $refresh = 1; // refresca por defecto 
  $etag = md5($last_modified);

  if(isset($headers["If-Modified-Since"])) { // Verificamos fecha enviada por el lector RSS
	  $since = strtotime($headers["If-Modified-Since"]); 
	if($since >= strtotime($last_modified)) { $refresh = 0; }
  } 

  if(isset($headers["If-None-Match"])) { // Verificamos el ETag
	  if(strcmp($headers["If-None-Match"], $etag) == 0) {
	  $refresh = 0;
	} else {
	  $refresh = 1;
	}
  }

  if($refresh == 0) {
	header("HTTP/1.1 304 Not changed");
	// La primera línea de los headers debe ser el status
	// sino el Netcrap se lía y da "No Data"
	ob_end_clean(); // Descartamos los contenidos del búfer de salida en cola y lo deshabilitamos
  }


// Begin sending of the data
header('Content-Type: application/rss+xml; charset=UTF-8');
//header("Last-Modified: " . tep_date_raw($last_modified));
header('Last-Modified: ' .gmdate("D, d M Y G:i:s", strtotime($last_modified)). ' GMT');
//header('Last-Modified: ' .gmdate("D, d M Y G:i:s T",strtotime($last_modified)) . ' GMT');
header("ETag: " . md5($etag));
echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
echo '<?xml-stylesheet href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"?>' . "\n";
echo '<!-- RSS for ' . $store_name . ', generated on ' . gmdate("D, d M Y G:i:s", strtotime($last_modified)) . ' GMT'. ' -->' . "\n";
?>
<rss version="2.0"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:ecommerce="http://shopping.discovery.com/erss/"
  xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title><?php echo utf8_encode($rss_title); ?></title>
<link><?php echo $weblink;?></link>
<description><?php echo utf8_encode($description); ?></description>
<atom:link href="<?php echo tep_href_link(FILENAME_RSS,urlencode($_SERVER['QUERY_STRING']),'NONSSL',false ); ?>" rel="self" type="application/rss+xml" />
<webMaster><?php echo $email_address; ?></webMaster>
<language><?php echo $lang_code; ?></language>
<lastBuildDate><?php echo gmdate("D, d M Y G:i:s", strtotime($last_modified)). ' GMT'; ?></lastBuildDate>
<image>
  <url><?php echo $weblink . DIR_WS_CATALOG.'/images/rss_logo.jpg';?></url>
  <title><?php echo utf8_encode($rss_title); ?></title>
  <link><?php echo $weblink;?></link>
  <description><?php echo utf8_encode($description); ?></description>
</image>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<?php
// Format results by row
while( $row = tep_db_fetch_array($query) ){
  $id = $row['products_id'];

  // RSS Links for Ultimate SEO (Gareth Houston 10 May 2005)
  $link = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $id, 'NONSSL', false);

  $model = $row['products_model'];
  $image = $row['products_image'];
  $added = date(r,strtotime($row['products_date_added']));

  // Setting and cleaning the data
  $name = $row['products_name'];
  $desc = eval_rss_urls($row['products_description']);

  // Encoding to UTF-8  
  if ($strip_html_tags ==true) {
	  $name = strip_html_tags($name);
	  $desc = strip_html_tags($desc);
  }
  
  $name = utf8_encode(replace_problem_characters($name));
  $desc = utf8_encode(replace_problem_characters($desc));
  $link = utf8_encode($link);

  $manufacturer = $row['manufacturers_name'];
  $manufacturer = utf8_encode ($manufacturer);
  $price = tep_add_tax($row['products_price'], tep_get_tax_rate($row['products_tax_class_id']));
  if( $discount = tep_get_products_special_price($id) ) {
	$offer = tep_add_tax($discount, tep_get_tax_rate($row['products_tax_class_id']));
  } else {
	$offer = '';
  }

  $cat_name = $row['categories_name'];

  // Encoding to UTF-8
  $cat_name = utf8_encode (replace_problem_characters(strip_html_tags($cat_name)));

  // Setting the URLs to the images and buttons
  $relative_image_url = tep_image(DIR_WS_IMAGES . $image, $name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'style="float: left; margin: 0px 8px 8px 0px;"');
  $relative_image_url = str_replace('">', '', $relative_image_url);
  $relative_image_url = str_replace('<img src="', '', $relative_image_url);
  $image_url = HTTP_SERVER . DIR_WS_CATALOG . $relative_image_url;

  $relative_buy_url = tep_image_button('button_shopping_cart.gif', IMAGE_BUTTON_IN_CART, 'style="margin: 0px;"');
  $relative_buy_url = str_replace('">', '', $relative_buy_url);
  $relative_buy_url = str_replace('<img src="', '', $relative_buy_url);
  $buy_url = HTTP_SERVER . DIR_WS_CATALOG . $relative_buy_url;

  $relative_button_url = tep_image_button('button_more_info.gif', IMAGE_BUTTON_MORE_INFO, 'style="margin: 0px;"');
  $relative_button_url = str_replace('">', '', $relative_button_url);
  $relative_button_url = str_replace('<img src="', '', $relative_button_url);
  $button_url = HTTP_SERVER . DIR_WS_CATALOG . $relative_button_url;


  // http://www.w3.org/TR/REC-xml/#dt-chardata
  // The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form
  $name = str_replace('&','&amp;',$name);
  $desc = str_replace('&','&amp;',$desc);
  $link = str_replace('&','&amp;',$link);
  $cat_name = str_replace('&','&amp;',$cat_name);

  $name = str_replace('<','&lt;',$name);
  $desc = str_replace('<','&lt;',$desc);
  $link = str_replace('<','&lt;',$link);
  $cat_name = str_replace('<','&lt;',$cat_name);

  $name = str_replace('>','&gt;',$name);
  $desc = str_replace('>','&gt;',$desc);
  $link = str_replace('>','&gt;',$link);
  $cat_name = str_replace('>','&gt;',$cat_name);
  
  
  $buy_link = tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $id);
  // Encoding to UTF-8
  $buy_link = utf8_encode ($buy_link);
  $buy_link = str_replace('&','&amp;',$buy_link);
  $buy_link = str_replace('<','&lt;',$buy_link);
  $buy_link = str_replace('>','&gt;',$buy_link);

  // Writing the output
  echo '<item>' . "\n";
  echo '  <title>' . $name . '</title>' . "\n";
  echo '  <category>' . $cat_name . '</category>' . "\n";
  echo '  <link>' . $link . '</link>' . "\n";
  echo '  <description>'; // . "\n";
  if ($ecommerce=='' && $image != '') {
	echo '<![CDATA[<a href="' . $link . '"><img src="' . $image_url . '"></a>]]>';
  }
  echo $desc;
  if ($ecommerce=='') {
	echo '<![CDATA[<br><br><a href="' .$buy_link. '"><img src="' . $buy_url . '" border="0"></a>&nbsp;]]>';
	echo '<![CDATA[<a href="' . $link . '"><img src="' . $button_url . '" border="0"></a>]]>' . "\n";
  }
  echo '</description>' . "\n";
  echo '  <guid>' . $link . '</guid>' . "\n";
  echo '  <pubDate>' . gmdate("D, d M Y G:i:s", strtotime($added)). ' GMT' . '</pubDate>' . "\n";
  if($ecommerce!='') {
	echo '  <media:thumbnail url="' . $image_url . '">' . $image_url . '</media:thumbnail>' . "\n";
	echo '  <ecommerce:SKU>' . $id . '</ecommerce:SKU>' . "\n";
	echo '  <ecommerce:listPrice currency="' . DEFAULT_CURRENCY . '">' . $price . '</ecommerce:listPrice>' . "\n";
	if ($offer) {
	  echo '  <ecommerce:offerPrice currency="' . DEFAULT_CURRENCY . '">' . $offer . '</ecommerce:offerPrice>' . "\n";
	}
	echo '  <ecommerce:manufacturer>' . $manufacturer . '</ecommerce:manufacturer>' . "\n";
  }
  echo '</item>' . "\n";
}
}

echo '</channel>' . "\n";
echo '</rss>' . "\n";

	/*
	 * Include the application_bottom.php script 
	 */
	include_once('includes/application_bottom.php');
?>

David

#303 dstebo

  • Community Member
  • 60 posts
  • Real Name:dstebo

Posted 10 September 2009, 12:58

When I use internet 7 appears this error when accessing RSS Feed

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/mysite.com/httpdocs/catalogo/includes/functions/database.php on line 103

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/mysite.com/httpdocs/catalogo/includes/functions/database.php:103) in /home/httpd/vhosts/mysite.com/httpdocs/catalogo/rss.php on line 300

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/mysite.com/httpdocs/catalogo/includes/functions/database.php:103) in /home/httpd/vhosts/mysite.com/httpdocs/catalogo/rss.php on line 302

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/mysite.com/httpdocs/catalogo/includes/functions/database.php:103) in /home/httpd/vhosts/mysite.com/httpdocs/catalogo/rss.php on line 304
[url="http://www.mysite.com"]http://www.mysite.com[/url] Loja Virtual  Mon, 22 Jun 2009 19:02:03 GMT  [url="http://www.mysite.com/catalogo//images/rss_logo.jpg"]http://www.mysite.com/catalogo//images/rss_logo.jpg[/url] [url="http://www.mysite.com"]http://www.mysite.com[/url] Loja Virtual [url="http://blogs.law.harvard.edu/tech/rss"]http://blogs.law.harvard.edu/tech/rss[/url] GAMES333 [url="http://www.mysite.com/catalogo/product_info.php?products_id=11"]http://www.mysite.com/catalogo/product_inf...?products_id=11[/url] ]]><strong><font color="#00f000"><font color="#ff0000">A busca por respostas continua...</font><br /></font><br /></strong>Você é um membro da equipe secundária do F.E.A.R., convocada para levantar mais informações sobre o projeto secreto de Armacham. A emoção de F.E.A.R., o jogo de tiro em primeira pessoa aclamado pela crítica, continua neste eletrizante pacote de expansão*.<br /><br /><br /><i>* Este pacote de expansão roda sozinho. Não requer o jogo <strong><font color="#ff0000">F.E.A.R.</font></strong></i><br />
 ]]>]]> [url="http://www.mysite.com/catalogo/product_info.php?products_id=11"]http://www.mysite.com/catalogo/product_inf...?products_id=11[/url] Wed, 11 Feb 2009 13:20:58 GMT LIVROS111 [url="http://www.mysite.com/catalogo/product_info.php?products_id=10"]http://www.mysite.com/catalogo/product_inf...?products_id=10[/url] ]]>Harry Potter


#304 DAVID3733

  • Community Member
  • 155 posts
  • Real Name:DAVID
  • Location:essex UK

Posted 10 September 2009, 14:02

Sorry to mention it again, anybody get a chance to look at the post 2 before this one, i know its just a simple database query thats causeing the problem but i have spent hours and got no further forward

Thank you
David

#305 Xpajun

  • Community Member
  • 1,272 posts
  • Real Name:Julian
  • Gender:Male
  • Location:UK

Posted 10 September 2009, 18:37

View Postdstebo, on Sep 10 2009, 01:58 PM, said:

When I use internet 7 appears this error when accessing RSS Feed

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/mysite.com/httpdocs/catalogo/includes/functions/database.php on line 103

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/mysite.com/httpdocs/catalogo/includes/functions/database.php:103) in /home/httpd/vhosts/mysite.com/httpdocs/catalogo/rss.php on line 300

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/mysite.com/httpdocs/catalogo/includes/functions/database.php:103) in /home/httpd/vhosts/mysite.com/httpdocs/catalogo/rss.php on line 302

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/mysite.com/httpdocs/catalogo/includes/functions/database.php:103) in /home/httpd/vhosts/mysite.com/httpdocs/catalogo/rss.php on line 304
[url="http://www.mysite.com"]http://www.mysite.com[/url] Loja Virtual  Mon, 22 Jun 2009 19:02:03 GMT  [url="http://www.mysite.com/catalogo//images/rss_logo.jpg"]http://www.mysite.com/catalogo//images/rss_logo.jpg[/url] [url="http://www.mysite.com"]http://www.mysite.com[/url] Loja Virtual [url="http://blogs.law.harvard.edu/tech/rss"]http://blogs.law.harvard.edu/tech/rss[/url] GAMES333 [url="http://www.mysite.com/catalogo/product_info.php?products_id=11"]http://www.mysite.com/catalogo/product_inf...?products_id=11[/url] ]]><strong><font color="#00f000"><font color="#ff0000">A busca por respostas continua...</font><br /></font><br /></strong>Você é um membro da equipe secundária do F.E.A.R., convocada para levantar mais informações sobre o projeto secreto de Armacham. A emoção de F.E.A.R., o jogo de tiro em primeira pessoa aclamado pela crítica, continua neste eletrizante pacote de expansão*.<br /><br /><br /><i>* Este pacote de expansão roda sozinho. Não requer o jogo <strong><font color="#ff0000">F.E.A.R.</font></strong></i><br />
 ]]>]]> [url="http://www.mysite.com/catalogo/product_info.php?products_id=11"]http://www.mysite.com/catalogo/product_inf...?products_id=11[/url] Wed, 11 Feb 2009 13:20:58 GMT LIVROS111 [url="http://www.mysite.com/catalogo/product_info.php?products_id=10"]http://www.mysite.com/catalogo/product_inf...?products_id=10[/url] ]]>Harry Potter

What about Firefox does it work properly in that?

It would look as if your language is all messed up as well

Go here and enter the url of your RSS feed - ie. home/httpd/vhosts/mysite.com/httpdocs/catalogo/rss.php and validate - this will then tell you what is wrong with your RSS feed

Which version of RSS feed are you using?

#306 Xpajun

  • Community Member
  • 1,272 posts
  • Real Name:Julian
  • Gender:Male
  • Location:UK

Posted 10 September 2009, 18:41

View PostDAVID3733, on Sep 10 2009, 03:02 PM, said:

Sorry to mention it again, anybody get a chance to look at the post 2 before this one, i know its just a simple database query thats causeing the problem but i have spent hours and got no further forward

Thank you


I've kinda looked at it - but not deep enough to see anything wrong you could try the validation link I posted above to see if that will throw any light on your problem

#307 DAVID3733

  • Community Member
  • 155 posts
  • Real Name:DAVID
  • Location:essex UK

Posted 10 September 2009, 18:50

View PostXpajun, on Sep 10 2009, 07:41 PM, said:

I've kinda looked at it - but not deep enough to see anything wrong you could try the validation link I posted above to see if that will throw any light on your problem

All my feeds validate up ok, thats not the problem its that on 2 of the sites its not updating properly shows old products where the ones that work show the most recent updated products only, and i am using the same file for all the Shops, think its something to do with the categories part of the SQL, the first 2 shops which have an id of 1 and 2 are the problem shops, those that have an id of 2 and 3 are fine, so it must be someting i have done on the rss.php above thats causeing the issue, i have done something wrong trying to narrow down the SQL to only show for the shop it is intended for, which as i stated works fine for shop id 3 and 4 but not 1 and 2.
David

#308 brunorios

  • Community Member
  • 18 posts
  • Real Name:bruno rios

Posted 16 September 2009, 21:13

Error:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home2/cademeu/public_html/rss.php:1) in /home2/cademeu/public_html/includes/functions/sessions.php on line 97

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home2/cademeu/public_html/rss.php:1) in /home2/cademeu/public_html/includes/functions/sessions.php on line 97


It's all ok in Localhost, but in the server i get this error...

what's happening? thanks!!

#309 brunorios

  • Community Member
  • 18 posts
  • Real Name:bruno rios

Posted 16 September 2009, 21:52

in product_info.php:

Quote

Fatal error: Cannot redeclare class language in C:\Arquivos de programas\EasyPHP\www\cadeclean\includes\classes\language.php on line 16

why?
thanks!

#310 brunorios

  • Community Member
  • 18 posts
  • Real Name:bruno rios

Posted 16 September 2009, 22:04

so much bad characters...

http://www.feedvalidator.org/check.cgi?url...3Flanguage%3Dbr

how can I correct this?

thanks!

#311 Xpajun

  • Community Member
  • 1,272 posts
  • Real Name:Julian
  • Gender:Male
  • Location:UK

Posted 17 September 2009, 07:22

Headers already sent is probably due to white space somewhere in your scripts check out your language file as well (this gave me no end of problems)


Your validation is not bad ;) I had a lot worse to start with

In your products description you have w for width and h for height - change all the w to width and all the h to height

You have no categories - the category is taken as a title in RSS and should be there (but you might get away with this)

on line 12 remove <!-- at the begining and --> at the end

#312 brunorios

  • Community Member
  • 18 posts
  • Real Name:bruno rios

Posted 17 September 2009, 13:54

thanks for the help!

1) but why the category is empty??? even if i puth the cPath, the category is empty:

http://www.cademeucalcado.com.br/rss.php?l...amp;cPath=22_31

2) if i put the code for the languages feeds in the header, when i'm in the product_info.php i get this error (just when the sts template is active):

Fatal error: Cannot redeclare class language in C:\Arquivos de programas\EasyPHP\www\cadeclean\includes\classes\language.php on line 16

thanks!

Edited by brunorios, 17 September 2009, 14:09.


#313 Xpajun

  • Community Member
  • 1,272 posts
  • Real Name:Julian
  • Gender:Male
  • Location:UK

Posted 17 September 2009, 18:08

Which version of RSS.php are you using?

#314 brunorios

  • Community Member
  • 18 posts
  • Real Name:bruno rios

Posted 17 September 2009, 18:36

View PostXpajun, on Sep 17 2009, 03:08 PM, said:

Which version of RSS.php are you using?

RSS Feed v2.2 (23.03.09)

#315 brunorios

  • Community Member
  • 18 posts
  • Real Name:bruno rios

Posted 18 September 2009, 15:32

my google reader shows a different sort order than the browser... why?

http://www.cademeucalcado.com.br/rss.php?language=br

Edited by brunorios, 18 September 2009, 15:33.


#316 paulchen2005

  • Community Member
  • 146 posts
  • Real Name:Paul

Posted 18 September 2009, 18:58

View PostNolaMan, on Aug 3 2009, 01:25 AM, said:

-Added Screenshot to see what it will look like.
Hi,

i have installed this great contrib and i installed your update but i can not see the page like your screenshot...

what must i do to see my page with products like your screenshot?

thank you very much,

best regards
Paul

#317 Xpajun

  • Community Member
  • 1,272 posts
  • Real Name:Julian
  • Gender:Male
  • Location:UK

Posted 18 September 2009, 19:17

Might be able to help with a link to see your page

#318 dstebo

  • Community Member
  • 60 posts
  • Real Name:dstebo

Posted 22 September 2009, 15:48

View PostXpajun, on Sep 10 2009, 03:37 PM, said:

What about Firefox does it work properly in that?

It would look as if your language is all messed up as well

Go here and enter the url of your RSS feed - ie. home/httpd/vhosts/mysite.com/httpdocs/catalogo/rss.php and validate - this will then tell you what is wrong with your RSS feed

Which version of RSS feed are you using?

Using - RSS Feed v2.2 (23.03.09)

#319 lordofcb

  • Community Member
  • 68 posts
  • Real Name:Homer Ford
  • Gender:Male
  • Location:Perth, West Australia

Posted 29 September 2009, 16:12

I thought I had everything working (version 2.2 march 23rd 2009), but am plagued with a few odd problems.
First off, when I go into admin, to copy one item to create a new one from it, I get the following error..

1062 - Duplicate entry '0-29' for key 1

insert into products_to_categories (products_id, categories_id) values ('0', '29')

[TEP STOP]

I already had the original duplicate key 80 error during setup and fixed it with the suggested patch. Using copy product is a very useful feature, sure is a lot easier than doing all products from scratch. I have no idea how to fix this one. Any ideas?
I have been able to add new products and categories etc with no problem. It was only when I tried the product copy function that this occured.

#320 lordofcb

  • Community Member
  • 68 posts
  • Real Name:Homer Ford
  • Gender:Male
  • Location:Perth, West Australia

Posted 29 September 2009, 16:17

I thought I had everything working (version 2.2 march 23rd 2009), but am plagued with a few odd problems.
First off, when I go into admin, to copy one item to create a new one from it, I get the following error..

1062 - Duplicate entry '0-29' for key 1

insert into products_to_categories (products_id, categories_id) values ('0', '29')

[TEP STOP]

I already had the original duplicate key 80 error during setup and fixed it with the suggested patch. Using copy product is a very useful feature, sure is a lot easier than doing all products from scratch. I have no idea how to fix this one. Any ideas?
I have been able to add new products and categories etc with no problem. It was only when I tried the product copy function that this occured.