Jump to content
Ralph2

RSS Feed contribution support thread

Recommended Posts

For anyone else having the same problem here is the fix.

 

Find:

 

// Enter your main shopping cart link

define(WEBLINK, HTTP_SERVER);

 

Change To:

 

define(WEBLINK, 'http://www.yourdomain/catalog/enter any folder here')

 

Example (what I chose that fixed mine):

 

define(WEBLINK, 'http://www.shedsforlessdirect.com/products/rss.php');

Share this post


Link to post
Share on other sites

Hi,

 

I installed faaliyet's RSS Feed v2.2 on my site a few months ago and everything worked fine. But I noticed today that the RSS for individual categories no longer works (in Firefox 3 or IE 7...but does work in Safari 4). The main Catalog RSS still works fine (with all browsers).

 

With the categories rss it shows the title and description, but no logo, or any products. When I do a view source it shows the code is there.

 

I did a validation for the feed at beta.feedvalidator.org

 

and got the following error:

 

line 12, column 68: XML parsing error: <unknown>:12:68: not well-formed (invalid token) [help]

 

<atom:link href="http://www.foryoursalon.com/rss.php?language=&cPath=25" rel ...

^

 

Also in IE 7 I get:

More information

 

A semi colon character was expected.

Line: 12 Character: 69

 

<atom:link href="http://www.foryoursalon.com/rss.php?language=&cPath=25" rel="self" type="application/rss+xml" />

 

I've check all over the code in rss.php to find a missing ; but cannot find it. Also, checked the forum at applied the fix for (invalid token) but that didn't work.

 

As I said, all worked a few months ago, but not now. I'm running PHP version 5.2.9.

 

 

Here is my site:

http://www.foryoursalon.com/

 

Also, I f I could get some help adding prices to the feed, again folowed what was on the forum, but did not work. Since there is buy now graphic link in the feed it doesn't make sense without a price.

 

Please help!

 

Thanks!

 

- Ken

Edited by NolaMan

Share this post


Link to post
Share on other sites

Hello

Anyone succeed to remove first empy line

#

# <?xml version="1.0" encoding="windows-1251"?>

line 2, column 0: XML parsing error: <unknown>:2:0: xml declaration not at start of external entity

I have double check - no empty spaces in files, STS is set correct, after first row everything is OK

Thank You

Share this post


Link to post
Share on other sites

Thanks for this useful Add-On.

 

Here I have a question that I hope u can help me :

 

How to locate the RSS icon to the place where I want?

 

 

For example, If I want to place the RSS icon to the Header aera of the NEW PRODUCTS FOR MONTH box in the mainpage, How can I do that?

 

 

Thanks

 

 

Kind Regards

 

 

JUN

Share this post


Link to post
Share on other sites

Just added.....

 

Contribution found here: http://addons.oscommerce.com/info/1513

 

RSS Feed v2.2a - Add Manufacturer, Model #, Price + More to Feed

 

See it in action here: http://www.foryoursalon.com/rss.php?language=en Catalog RSS Feed

http://www.foryoursalon.com website

 

This is an update for RSS Feed v2.2 by faaliyet (23- Mar- 2009).

 

You must download and install RSS Feed v2.2 first.

This is not full package.

Only contains manual install Instructions and rss.php file.

 

v2.2a Changes:

--------------------------

-Added Manufacturer, Model # and Price to feed items (you can use all, or comment out the ones you don't want).

- Based on how Newegg.com feeds look.

- Price will display either regular price or special price (if it is on special).

- Currently all is hard-coded in rss.php file so no external "defines". You can change that if you want

but I felt unnecessary at this time .

- Also, Prices: Sorry, since my my store is only in dollars I have not included code for multi-currency stores. (hard-coded)

-Added Screenshot to see what it will look like.

-Added <copyright> </copyright> channel element (to of course display your copyright info).

-Added <width> </width><height></height> channel elements so as to make the store logo a clickable link to website

 

-Updated: Commented out <atom:link href....... rel="self"> tag because it was (again causing problems with the rss feed renderings in IE and Firefox [at least for me]).

Included in install file is an explaination and possible temporary fix. But, this is not really needed (do a Google search on "Missing atom:link with rel="self"

and see what I mean. http://beta.feedvalidator.org/ Feed Validator only suggests as "Recommendation" and removal doesn't invalidate feed anyway.

This tag was working for me a few months ago, but not anymore maybe related to php upgrade to PHP version 5.2.9 on my server - YMMV.

 

Issues Un-Resolved (since v2.2):

---------------------------------------

- atom:link href as listed above.

- still a problem with   and ereg tags in the descriptions

- Top Category feeds not displaying when Top category has sub-categories (sub-categories show fine).

Example:

Category 1 ===> displays fine

Category 2 ===> DOESN'T DISPLAY

L Sub-Category 1 ===> displays fine

L Sub-Category 2 ===> displays fine

Category 3 ===> displays fine

 

NOTE: Not full package, replacement rss.php included to use if you haven't already modified the original.

 

ALSO: Finnished working on RSS feed for Specials and Featured Products (I'll upload soon)

 

Thanx to faaliyet for all his work on this contribution!

Share this post


Link to post
Share on other sites

I have installed the useful ADD-ON but here have some problems :

 

 

1.MY store can be viewed by FIREFOX correctly and not by IE and google chrome when I click the rss feed icon.

 

2.Top Category feeds not displaying when Top category has sub-categories (sub-categories show fine).

Example:

Category 1 ===> displays fine

Category 2 ===> DOESN'T DISPLAY

L Sub-Category 1 ===> displays fine

L Sub-Category 2 ===> displays fine

Category 3 ===> displays fine

 

 

 

anybody can help?

 

 

 

thanks

Share this post


Link to post
Share on other sites

I have a general question

 

I have RSS installed now, think its a great contribution, not really familiar about the way it should be used, i intend to submit it to various places and not sure how many i should have in the feed.

 

I have over 10,000 products but should i have only 20/30 in the RSS with regular updates (which is very quite often) or all of my products ?

 

any help would be appreciated

 

 

Thank you


David

Share this post


Link to post
Share on other sites
I have a general question

 

I have RSS installed now, think its a great contribution, not really familiar about the way it should be used, i intend to submit it to various places and not sure how many i should have in the feed.

 

I have over 10,000 products but should i have only 20/30 in the RSS with regular updates (which is very quite often) or all of my products ?

 

any help would be appreciated

 

 

Thank you

 

10,000 products would be WAY too much! Just think how long it would take the feed to load, besides no one is going to go through a feed with 10,000 products in it. Think of an RSS feed as "The Latest News" about what's on your site. I our case the News relates to the latest products added. The way this RSS feed contribution is set up is to show the latest Products added, on Index page it will show the latest (XX amount) products added (All), then in each catagory and manufaturers page it will show the latest (XX amount) products added for each category or manufacturers page. All based on what amount you set in admin.

 

Starting with 20 or 30 is the right move, especially if you add new products often. Take a look around other popular ecommerce sites with feeds and see what number they display. Usually between 20- 50 items per feed is normal. I wouldn't go above 50.

 

The only exception would be for a Specials feed or Featured products feed (which I am working on) since you want to show all those items "on Special" or "featured" and no be limited to what you set in admin.

 

-Nolaman

Edited by NolaMan

Share this post


Link to post
Share on other sites

The only major problem I'm getting at the moment is that rss.php is not converting code from the database so á stays as á and not á so all my Cyrillic script turns out as &****;&****; and so on

 

 

Does anyone have an idea on a cure?


Currently...:

 

Working with osCommerce 2.3.1

Now working with Phoenix

Add-Ons so far Installed:

Not all of these installed yet on Phoenix - some are and the rest will be

 

Add date and order number to invoice and packing slip,

Products Cycle Slideshow,

Detailed Monthly Sales,

Holiday Settings,

Tracking Module for 2.3

Share this post


Link to post
Share on other sites

I've found the cause - it's all the following coding:

 

lines 54 - 113

function replace_problem_characters($text) {
$formattags = array("&"); 	
$replacevals = array("&");
$text = str_replace($formattags, $replacevals, $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);
}

 

 

lines 247 - 252

// 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);

 

lines 350 - 353

  $name = utf8_encode(replace_problem_characters($name));
 $desc = utf8_encode(replace_problem_characters($desc));
 $link = utf8_encode($link);

 

lines 377

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

 

lines 396 - 441

  // 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('&','&',$name);
 $desc = str_replace('&','&',$desc);
 $link = str_replace('&','&',$link);
 //$cat_name = str_replace('&','&',$cat_name);

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

 $name = str_replace('>','>',$name);
 $desc = str_replace('>','>',$desc);
 $link = str_replace('>','>',$link);
 $cat_name = str_replace('>','>',$cat_name);

 

which amounts to all the 'replace problem characters' script

 

Questions are:

 

Why is this script there?

 

Can it be removed? (yes it works without it)

 

If the script is really needed is there another solution?


Currently...:

 

Working with osCommerce 2.3.1

Now working with Phoenix

Add-Ons so far Installed:

Not all of these installed yet on Phoenix - some are and the rest will be

 

Add date and order number to invoice and packing slip,

Products Cycle Slideshow,

Detailed Monthly Sales,

Holiday Settings,

Tracking Module for 2.3

Share this post


Link to post
Share on other sites
...If the script is really needed is there another solution?

no.its needed ONLY when it does what it says. when it doesn't then replace problem characters becomes create_problem_characters.

delete or comment all but the last line

return $text;

,

return preg_replace($search, $replace, $str);

becomes

return $str;

 

Ken


commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Share this post


Link to post
Share on other sites

Right first of all thank you Ken for that answer but I fear my problem has more depth :(

 

The fix worked in as much as the languages showed up properly - well the Chinese and the Cyrillic show perfectly with it removed...

 

 

but all the western scripts show as blank pages :rolleyes: <EDIT> Thought I'd better define a blank page - it shows the RSS page, including logos and RSS heading, but no context within the box. </EDIT>

 

The offending code is:

 

function replace_problem_characters($text) {
$formattags = array("&"); 	
//	$replacevals = array("&");
  $text = str_replace($formattags, $replacevals, $text);
//	$in[] = '@&(amp|#038);@i'; $out[] = '&';

 

If I edit out $formattags and $text everything would work but the western won't (in fact any language file that has

define('CHARSET', 'iso-8859-1');

defined except english.php).

 

I've tried reopening the 'language'.php in UTF-8 but that causes another problem (I think maybe because the script is not UTF-8 compatible?)

 

So I'm afraid I'm back to asking "any ideas please?"

Edited by Xpajun

Currently...:

 

Working with osCommerce 2.3.1

Now working with Phoenix

Add-Ons so far Installed:

Not all of these installed yet on Phoenix - some are and the rest will be

 

Add date and order number to invoice and packing slip,

Products Cycle Slideshow,

Detailed Monthly Sales,

Holiday Settings,

Tracking Module for 2.3

Share this post


Link to post
Share on other sites

Addition to the above post:

 

What is actually happening is that the replace problem characters is removing the & and so is destroying special character codes


Currently...:

 

Working with osCommerce 2.3.1

Now working with Phoenix

Add-Ons so far Installed:

Not all of these installed yet on Phoenix - some are and the rest will be

 

Add date and order number to invoice and packing slip,

Products Cycle Slideshow,

Detailed Monthly Sales,

Holiday Settings,

Tracking Module for 2.3

Share this post


Link to post
Share on other sites

rather than spending days figuring out someone else code, a work around may be a better solution:

switch (language_code) {
case "this lang-code":
 do what ever works for this language;
 break;
case "this other lang-code":
 do the other bit that works for that language;
 break;
default:
 ...
}

FF may show page whereby IE may not. IE (v8) needs catching up.

 

Ken

Edited by GemRock

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Thanks again for your input Ken - think I may take a hard look at the contribution and get it working as I want (it has a few other problems that need sorting as well).

 

Won't be starting til the end of the week though when I can access my local test site (cant afford to have the store broken ;) )

 

Might have to ask a few more questions though if you don't mind


Currently...:

 

Working with osCommerce 2.3.1

Now working with Phoenix

Add-Ons so far Installed:

Not all of these installed yet on Phoenix - some are and the rest will be

 

Add date and order number to invoice and packing slip,

Products Cycle Slideshow,

Detailed Monthly Sales,

Holiday Settings,

Tracking Module for 2.3

Share this post


Link to post
Share on other sites

Andre,

 

You are having a browser problem, I don't see your images in FF on a mac yet I see them on Safari but I can't tell you the reason why you might be getting the problem and I don't


Currently...:

 

Working with osCommerce 2.3.1

Now working with Phoenix

Add-Ons so far Installed:

Not all of these installed yet on Phoenix - some are and the rest will be

 

Add date and order number to invoice and packing slip,

Products Cycle Slideshow,

Detailed Monthly Sales,

Holiday Settings,

Tracking Module for 2.3

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I don't have social bookmark so I can't help you - have you tried asking the question here?


Currently...:

 

Working with osCommerce 2.3.1

Now working with Phoenix

Add-Ons so far Installed:

Not all of these installed yet on Phoenix - some are and the rest will be

 

Add date and order number to invoice and packing slip,

Products Cycle Slideshow,

Detailed Monthly Sales,

Holiday Settings,

Tracking Module for 2.3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×