Contributions
RSS Feed 0.1
This file allows you to have an RSS 0.92 valid feed of your products.
There are a few config options in the top of the file, but it's mostly plug and play, getting all of the requisite info from the application_top.php and configure.php files
Expand All / Collapse All
From php 5.2 the function ereg() is deprecated. Using 2.2a my server reported this error several time.
To fix it replace on line 266
if(ereg('HTTP_(.+)',$h,$hp)){
with
if(preg_match('/HTTP_(.+)/',$h,$hp)){
I also noticed the feed was not valid because the string
<?xml version="1.0" encoding="UTF-8" ?>
is not generated on the top of the rss file
If you notice that remove this line 306-307:
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";
Also on line 328 remove the © carachter from the <copyright> tag
Attached the modified file
RSS Feed v2.2a - Add Manufacturer, Model #, Price + More to Feed
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.95.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: Just finished working on RSS feed for Specials and Featured Products (I'll upload soon)
Thanx to faaliyet for all his work on this contribution!
Apply this "If!!! only if" you have this error:
#1062 - Duplicate entry '80' for key 'PRIMARY'
....
On questions that are asked to me this error is seem.id has been used as 80(id=80) that is the reason of it.
It means there is an other contribution that uses id 80.
If you have an error like that use the sql query down below.
insert into configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('888', 'RSS Articles', 'MAX_RSS_ARTICLES', '20', 'Number of articles displayed by the RSS feed', '3', '25', 'now()', 'now()', NULL, NULL);
ALTER TABLE products ADD products_to_rss TINYINT default '1' NOT NULL;
------------------------------------------------------------------------------
no file.
Seyhun Cavus(faaliyet)
RSS Feed v2.2 - FullPackage
v2.2 Changes:
------------------
-Added a file to upgrade from v2.1 to v2.2
-Added Screenshots (folder)
-Created History folder
-Cleared/Edited History Logs
-Added History Logs for the following RSS Feed v2.0
-Install.txt file is edited for v2.2
What's in v2.2 ?
---------------------
+RSS v2.1
+Small fix for v2.1 (chrish123's update)
+Adding both Category and Manufacturers Filtering(the bookworm's update)
+RSS Quick-set button in product listing(Jammerious's update)
+Small update for RSS links in index.php (my update)
Seyhun Cavus (faaliyet)
Small Fix for links
------------------------
-Open index.php file
------------------------------------------------------------------------------------------------
Find:
$rss_params = '&manufacturers_id='.(int)$HTTP_GET_VARS['manufacturers_id'];
Replace with:
$rss_params = '&manufacturers_id='.(int)$HTTP_GET_VARS['manufacturers_id'];
------------------------------------------------------------------------------------------------
Find:
$rss_params .= '&filter_id='.(int)$HTTP_GET_VARS['filter_id'];
Replace with:
$rss_params .= '&filter_id='.(int)$HTTP_GET_VARS['filter_id'];
------------------------------------------------------------------------------------------------
Find:
$rss_params = '&cPath='.$cPath;
Replace with:
$rss_params = '&cPath='.$cPath;
------------------------------------------------------------------------------------------------
-no file.
Seyhun Cavus (faaliyet)
This is a small mod that adds an option to the product listing which makes it possible
to quickly change the RSS status of a product. In the same manner as setting it on or off stock/availability.
Screenshot: http://www.shrani.si/f/a/LD/3Szw8hOW/oscrssmod1.png
Instructions included.
This is a slight modification of step 6 of the install process enabling the correct filtered feed to be auto detected by the browser.
so the feed detected by the browser will be the same as feed offered by the rss button at the bottom of the content
replace step 6 in the install instructions with this
-------------
STEP 6 (Modified)
-------------
Open all the php files within the catalog folder / root of your website (e.g. index.php, contact_us.php etc):
###Add before / above the </head> tag:
<?php
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include_once(DIR_WS_CLASSES . 'language.php');
$lng = new language;
}
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
?>
<link rel="alternate" type="application/rss+xml" title="<?php echo STORE_NAME . ' - ' . BOX_INFORMATION_RSS; ?>" href="<?php echo FILENAME_RSS, '?language=' . $key.((isset($_GET['cPath']))?'&cPath='.$_GET['cPath']:'').((isset($_GET['manufacturers_id']))?'&manufacturers_id='.$_GET['manufacturers_id']:''); ?>">
<?php
}
?>
Although theres still a problem with and ereg tags in the descriptions everything is fine, except I kept getting a feed error only on the category specific feed.
The error looked like this:
Internet Explorer cannot display this feed
This feed contains code errors.
Go back to the previous page.
More information
A semi colon character was expected.
Line: 12 Character: 68
<atom:link href="http://mysite.com/rss.php?language=&cPath=144" rel="self" type="application/rss+xml" />
I fixed it by:
Opening catalog/rss.php and find at line 318:
<atom:link href="<?php echo tep_href_link(FILENAME_RSS, $_SERVER['QUERY_STRING'], 'NONSSL', false ); ?>" rel="self" type="application/rss+xml" />
Replace with:
<atom:link href="<?php echo tep_href_link(FILENAME_RSS, $_SERVER['QUERY_STRING'] = str_replace('&','&',$_SERVER['QUERY_STRING']), 'NONSSL', false ); ?>" rel="self" type="application/rss+xml" />
-added getallheaders() fix by ereligare
-fixed self path link error
-fixed the token error when a description had an ampersand character in it.
-fixed dates to have a leading zero to validate correctly.
-added real name to email address for validation
-fixed images path, it had two /'s in it
-added update guides
-added update guide 1.2 to docs by faaliyet
complete package + Update Guides
This correct a bug when your server don't accept the php function getallheaders()
RSS FEED - MANUAL UPGRADE DOCUMENTATION from v1.2 to v2.0 (by faaliyet)
-Included documentation file for manual upgrade.
**Upgrade from v1.2 to v2.0
That's All.
-Cleaned up the code by making use of more default osCommerce functions
-Added an option to show catalog/categorie/manufacturer feeds (uses the same syntax as the osC index.php page)
-Added optional GET parameter "html={boolean]" to enable/disable html content (most feed readers doesn't have to much problems with html)
-Fixed the lastupdate time to be GMT
small update for previous installation.
in cataog/rss.php file
-Find:
header('Content-Type: application/xml; charset=utf-8');
header("Last-Modified: " . tep_date_gmt($last_modified));
-And replace with:
header('Content-Type: application/xml');
header("Last-Modified: " . tep_date_raw($last_modified));
no file...
Muchos clientes al pedir los ficheros no envían la cabecera If-Modified-Since si así
fuera, la respuesta sería un 304 Not Modified (de 84 bytes). Es decir las posibilidades
de gastar ancho de banda son:
1. Que el RSS se haya actualizado y nos lo bajemos (7KB)
2. Que el RSS NO se haya actualizado y nos lo bajemos (7KB)
3. Que el RSS NO se haya actualizado y recibamos un código 304 (84 bytes)
El primer caso y el tercero son correctos, el segundo no lo es, en un mundo perfecto
todos los programas actuarían perfectamente entre ellos y estos detalles no pasarían.
Suponiendo en el caso anterior que “sólo” el 10% de las peticiones no requieran
volver a bajar el RSS y lo hagan suponen un gasto de 700MB frente a los 8.2MB que
deberían ser. Casi 90 veces más gasto por un detalle a priori insignificante.
Si desea más información siga el siguiente enlace:
http://sigt.net/archivo/explicacion-de-la-cabecera-if-modified-since.xhtml
This release fixes a invalid characters bug in buy link.
This release fixes a security bug that allowed a SQL injection.
More info here:
http://forums.oscommerce.com/index.php?showtopic=254845&st=80
and:
http://www.bisente.com/blog/2007/07/31/corregido-bug-en-oscommerce-rss-feed/?lan=english
This is a modified version of Ralph2's plugin that adds Ecommerce tags to the feed.
More info on the Ecommerce RSS module here:
http://shopping.discovery.com/erss/
More info on the plugin here:
http://www.bisente.com/proyectos/oscommerce-rss-feed-ecommerce/?lan=english
Sample live feed with Ecommerce tags:
http://www.valquirias.com/rss.php?ecommerce=1
- Incorporated a shop logo to the feed
- Several bugfixes regarding: information box link and footer link. These links weren't working properly with multi language shops
Many thanks to Patrick Veverka and everyone else who has put some work into this fine contribution!
- Incorporated the possibility to decide whether a particular product should or should not be added to the feed
- Several bugfixes regarding: link rel, information box link and footer link. These links weren't working properly with multi language shops
- Incorporated the category tag, which makes it possible to have a feed reader (e.g. IE7's feed reader) filter products based on the categories they're in. This means that a feed will only show the products of the category which the customer has selected.
- Incorporated a changelog file
- Incorporated "more info" and "buy now" buttons to the feed and the package
- Incorporated a better looking RSS icon
- Incorperated a directory structure within the package
- Incorperated the possibility to set the number of articles displayed by the feed in the admin area
- Fixed the duplicate items bug
- Fixed the problems with adding images to a feed
- Improved the header code
- Improved the code which places the RSS icon on the pages of a webshop
- Made the feed output rss version 2.0 compliant
- Renamed to the README.txt to install.txt and cleaned up the text
- cleaned up the code of rss.php
- Translated the French sentences within rss.php into English
- Changed the extension of the RSS icon from PNG to JPG
- Opened a support thread on the forum which can be found here: http://forums.oscommerce.com/index.php?showtopic=254845
There have been reports that RSS 0.9 does not work for many people. Please try an earlier version before resorting to 0.9.
0.9 should only be tried IF you experience headers already sent issues with the earlier version.
Attached file is merely the instruction text.
I had Headers Already Sent errors with the previous version 0.8.3. Checked around for answers on the forum. Wasn't the only one with this problem, but no one had a solution.
I've modified an older, working version that did not have Headers Already Sent errors, added the encode_utf8, the date fix to prevent mulitiples of the product displaying, added more detail to the README file, added instructions on how to have all
of your product showing in the feed, etc.
This is the full version. I'm not a programmer, but was able to get this to work on my site, and have it validate. Maybe a real programmer will take an interest and check the code for cleanliness.
Hope this helps others who have experienced difficulties with the latest and/or older versions not validating.
I was experiencing some troubles when navigating through my site (aerotronic.nl) with FF.
Now I have the explanation and solution. Some links were an output of the navigation class. As the RSS page is called by FF on the first page visit after page load, the navigation class registers this as last requested page by the user. By echoing a link produced by the navigation class (on product_info I have placed a back link), you'll see that it will write rss.php?languaga=nl or so.
Therefore you should remove the rss.php page from the last visited pages with:
$navigation->remove_current_page();
(place after require('includes/application_top.php'); )
Great contribution! Thanks!
download is a dummy .txt
The feed from RSS Feed 0.8.3 + update does not validate at the W3C Feed validator (http://validator.w3.org/feed/).
To fix this, one small change is required
Replace (line 114):
$added = $row['products_date_added'];
with:
$added = date(r,strtotime($row['products_date_added']));
This still leaves a warning about a problematic date in lastBuildDate.
I don't know how to fix this right now.
(The download is a text file with these instructions)
Same as RSS Feed 0.8.3 (Full package) except included code for products date added.
I had problems in Safari's RSS since the publish date was wrong, it showed the actual time right now. Every time the feed updated I got duplicates of every product, ending up in hundreds of them. This is now fixed, the date when the products was added is now the publish date.
Some bugfixes from the previus release. The changes are in the code placed in the instructions file. It works like a charm!
Replaced all "iconv" functions for "utf8_encode" since it wasn't working in my hosting with Simple Template System (STS) and now it does.
----- ENGLISH -----
Convert in UTF-8 and sanityze the title and a few others strings;
Commented the <price> tag;
----- FRANÇAIS -----
Convertit en UTF-8 et nettoie aussi le titre et autres chaînes ;
Commenté la balise <price> ;
Works great, but the instructions were alittle garbled. This is just an easier to read install file in English.
----- ENGLISH -----
Now RSS feed is in UTF-8;
Special chars seems now to be okay;
Let leave HTML tags in $name and $desc, everybody seems to do like this;
We should drop the RSS tag <price> wich is not RSS compliant:
http://feedvalidator.org/
----- FRANÇAIS -----
Feed RSS maintenant en UTF-8 ;
Laissons les balises HTML dans $name et $desc, tout le monde semble le faire ;
On devrait supprimer la balise <price> qui n'est pas RSS compliant :
http://feedvalidator.org/
Simply Replace the following lines in rss.php.:
$link = HTTP_SERVER . DIR_WS_CATALOG;
// Uncomment this line out if you are using SEO links (Apache Rewrite URL)
//$link .= "product_info.php/products_id/" . $id . "&language=" . $lang_code;
// Comment out this line if you are NOT using SEO links
$link .= "product_info.php?products_id=" . $id;
With:
// Ultimate SEO Links for RSS (Added: 10 May 2005, Gareth Houston)
$link = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $id) ;
Ajout des caractères spéciaux
Addition of the special characters
----- ENGLISH -----
Added support for subcategories.
Subcategory IDs are denoted by parentcategory_subcategory and were being
ignored as the product to category table only lists the final subcategory
for the product, not it's parent category.
This is now fixed as if rss.php finds a category ID with x_y or x_y_z is takes the
last component to be the category for the product to category table lookup.
----- ENGLISH -----
Fixed little bug where products with status set to "red" where listed<br>
Added support for french accents
Added tax when item subject to tax
----- FRANÇAIS -----
Correction d'un bug qui listait des produits dont l'etat etait sur "rouge"<br>
Ajout de la gestion des accents francais
Ajout de la TVA lorsque l'article y est soumis
Demo here : http://www.mafianumerique.com/catalog/rss.php
(check out source to view image links)
----- ENGLISH -----
Fixes a typo on $cpath (must be $cPath)
----- FRANÇAIS -----
Correction d'une faute de frappe sur $cpath (doit être $cPath)
----- ENGLISH -----
Come back of the description & image field, as it was the case in v0.2.
Limitation to the category specified on the URL ("cPath=")
----- FRANÇAIS -----
Retour des champs description & image comme c'était le cas en v0.2.
Restriction à une catégorie spécifique en définissant « cPath= » dans l'URL.
----- ENGLISH -----
Bugfixe (again!) on the languages settings.
Full package.
----- FRANÇAIS -----
Encore des corrections de bugs concernant la gestion des langues.
Paquet complet.
----- ENGLISH -----
Bugfixe on the languages settings. Now use "rss.php?language=en" as osCommerce
does.
This is the full package.
----- FRANÇAIS -----
Correction de bug concernant la gestion des langues. Utiliser maintenant un
lien comme « rss.php?language=fr » comme le fait déjà osCommerce.
Il s'agit du paquet complet.
----- ENGLISH -----
Modified for:
- Show products' name in the language selected (rss.php?language=english);
- Show only MAX_DISPLAY_SEARCH_RESULTS items;
- Order by items id (last added, first listed);
- Do not show description field;
- Replace "&" by "&";
- Removed $sqlcount SQL query (what was the use?);
- Add some RSS items;
- Add a stylesheet link to the W3C's one;
Used at Nippon-Export :
http://www.nippon-export.com/
----- FRANÇAIS -----
Modifié pour :
- Affiche le nom des produits dans la langue choisie (rss.php?language=french) ;
- N'affiche que MAX_DISPLAY_SEARCH_RESULTS produits ;
- Range par numéro id (les derniers saisis en premier) ;
- N'affiche pas la description des produits ;
- Remplement des « & » par des « & » ;
- Suppression de la requête $sqlcount qui ne sert vraissemblablement à rien ;
- Ajout de quelques balises RSS ;
- Ajout d'un lien vers le stylesheet du W3C ;
Utilisé sur Nippon-Export :
http://www.nippon-export.com/
Fixed the rss.php file so it works without SEO links. Also fixed description tags so they work...
For those of you who can't get the feeds created by rss.php to validate I have figured out how to fix the problem. If you get an error like this
[line 2, column 0: XML Parsing error: :3:0: xml declaration not at start of external entity]
then read the included text file to see how I fixed the problem.
This file allows you to have an RSS 0.92 valid feed of your products.
There are a few config options in the top of the file, but it's mostly plug and play, getting all of the requisite info from the application_top.php and configure.php files
Note: Contributions are used at own risk.