Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 1 votes

RSS Feed contribution support thread


360 replies to this topic

#281 addicted

  • Community Member
  • 60 posts
  • Real Name:Nemam

Posted 07 July 2009, 14:45

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

#282 garnet

  • Community Member
  • 119 posts
  • Real Name:az

Posted 07 July 2009, 21:37

Hi all
Just a quick question
why my date of the rss feed is in 1979. See below

http://beta.feedvalidator.org/check.cgi?ur...3Flanguage%3Dbg

How can I fix this?

Thanks.
OSC beginner

#283 sanbikes

  • Community Member
  • 19 posts
  • Real Name:Carlos

Posted 14 July 2009, 17:40

I'm friends with a problem, install the feeds, but the categories are appearing duplicated.
What may be happening?
see the link

http://www.cardsdigers.com/loja/bbrasil-te...os-c-22_62.html

#284 sanbikes

  • Community Member
  • 19 posts
  • Real Name:Carlos

Posted 14 July 2009, 17:41

I'm friends with a problem, install the feeds, but the categories are appearing duplicated.
What may be happening?
see the link

http://www.cardsdigers.com/loja/bbrasil-te...os-c-22_62.html

#285 zozzoozzz

  • Community Member
  • 219 posts
  • Real Name:JUN

Posted 28 July 2009, 01:11

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

#286 NolaMan

  • Community Member
  • 13 posts
  • Real Name:Ken Stock

Posted 02 August 2009, 23:25

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 &nbsp; 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!

#287 zozzoozzz

  • Community Member
  • 219 posts
  • Real Name:JUN

Posted 04 August 2009, 01:24

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

#288 DAVID3733

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

Posted 14 August 2009, 18:51

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

#289 NolaMan

  • Community Member
  • 13 posts
  • Real Name:Ken Stock

Posted 18 August 2009, 18:43

View PostDAVID3733, on Aug 14 2009, 02:51 PM, said:

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, 18 August 2009, 18:45.


#290 Xpajun

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

Posted 21 August 2009, 17:19

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


Does anyone have an idea on a cure?

#291 Xpajun

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

Posted 22 August 2009, 08:47

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('&','&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);

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?

#292 GemRock

  • Community Member
  • 2,069 posts
  • Real Name:Ken
  • Gender:Male
  • Location:UK

Posted 22 August 2009, 10:18

View PostXpajun, on Aug 22 2009, 09:47 AM, said:

...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.

#293 Xpajun

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

Posted 23 August 2009, 20:50

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, 23 August 2009, 20:55.


#294 Xpajun

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

Posted 23 August 2009, 22:00

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

#295 GemRock

  • Community Member
  • 2,069 posts
  • Real Name:Ken
  • Gender:Male
  • Location:UK

Posted 23 August 2009, 23:28

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, 23 August 2009, 23:28.

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.

#296 andremen

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

Posted 24 August 2009, 16:55

Hi!!
Thanks everyone for make this a great contribution.
Someone is having the same problem of me?
On my rss.php is showing but not the picture, it is broken.

http://www.flooringsupplystore.com/rss.php?language=en

Any ideas?

#297 Xpajun

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

Posted 24 August 2009, 18:17

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

#298 Xpajun

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

Posted 24 August 2009, 19:05

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

#299 zozzoozzz

  • Community Member
  • 219 posts
  • Real Name:JUN

Posted 25 August 2009, 08:33

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

#300 Xpajun

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

Posted 25 August 2009, 09:14

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