Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

RSS contribution


urbancubed

Recommended Posts

I need help with this contribution please, keep getting errors.

 

http://www.angelic-giftstore.com/rss.php?o...27e51910c6fd455

 

$store_name = Angelic Giftstore;
$rss_title = angelic;
$weblink = http://www.angelic-gifstore.com;
$description = Religious Giftshop;
$email_address = [email protected];

 

I'm not sure what I've done wrong because that is where the lines of code are at.

Link to comment
Share on other sites

  • Replies 75
  • Created
  • Last Reply

Top Posters In This Topic

WEll I went back and installed an earlier version, which 'halfway' works :(

 

I have SEO urls, I did see a fix in the contribution section but when I tried it, got more parse errors.

 

http://www.angelic-giftstore.com/rss.php

 

The links go to "no product found"

 

I'm pretty sure I need to edit tthe second line of this part of the code here...

 

$link = HTTP_SERVER . DIR_WS_CATALOG; 
$link .= "product_info.php/products_id/" . $id;	
$model = $row["products_model"];
$image = $row["products_image"];
$price = $row["products_price"];

 

But just can't find out how to do that! Anyone know? Thank you.

 

 

I need help with this contribution please, keep getting errors.

 

http://www.angelic-giftstore.com/rss.php?o...27e51910c6fd455

 

$store_name = Angelic Giftstore;
$rss_title = angelic;
$weblink = http://www.angelic-gifstore.com;
$description = Religious Giftshop;
$email_address = [email protected];

 

I'm not sure what I've done wrong because that is where the lines of code are at.

Link to comment
Share on other sites

  • 4 weeks later...
Does the listing work for all of you? Since the date when the product was added is not included, my RSS in Apple Safari duplicates the feed every time I check it. It says, for example, "Today 16.05" at the right of the product name, but when viewing the feed later on it says "Today 17.00" together with the earlier "16.05" which results in duplicates of all products. Not sure how to explain this..

 

hi

 

i have encountered the same problem.

does anyone has solution for this bug?

 

many thanks!!~~

Link to comment
Share on other sites

  • 4 weeks later...

Hello,

 

I need help with adding Product Model to my products titles. I already added products_model to the $sql12 query, so here is what I got so far:

// Selectionne les noms et descriptions des produits

$sql2 = 'SELECT pd.products_name, p.products_model, pd.products_description FROM products p, products_description pd WHERE pd.products_id = \'' . $id . '\' AND pd.language_id = \'' . $lang_id . '\' LIMIT 1';

$sql2_result = mysql_query($sql2,$connection) or die('Couldn\'t execute query.');

$row2 = mysql_fetch_array($sql2_result);

 

// Mise au propre des données

$name = $row2['products_name'];

$model = $row2['products_model'];

$desc = $row2['products_description'];

 

// Conversion en UTF-8

$name = utf8_encode ($name);

$model = utf8_encode ($model);

$desc = utf8_encode ($desc);

$price = utf8_encode ($price);

$link = utf8_encode ($link);

 

// Tout le monde semble laisser les balises HTML

#$name = strip_tags($name);

#$model = strip_tags($model);

#$desc = strip_tags($desc);

#$price = strip_tags($price);

 

$image_url = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $image;

 

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

$model = str_replace('&','&',$model);

$desc = str_replace('&','&',$desc);

$link = str_replace('&','&',$link);

 

$name = str_replace('<','<',$name);

$model = str_replace('<','<',$model);

$desc = str_replace('<','<',$desc);

$link = str_replace('<','<',$link);

 

$name = str_replace('>','>',$name);

$model = str_replace('>','>',$model);

$desc = str_replace('>','>',$desc);

$link = str_replace('>','>',$link);

 

// Écriture de l'enregistrement

echo '<item>' . "\n";

echo ' <title>' , $name ,' [' , $model ,']' , '</title>' . "\n";

echo ' <link>' , $link , '</link>' . "\n";

echo ' <description>' . "\n";

echo $desc . "\n";

echo ' </description>' . "\n";

//No RSS-compliant#echo ' <price>' . $price . '</price>' . "\n";

if ($image != '') {

echo ' <image>' . "\n";

echo ' <url>' . $image_url . '</url>' . "\n";

echo ' <title>' . $name . $model . '</title>' . "\n";

echo ' <link>' . $link . '</link>' . "\n";

echo ' </image>' . "\n";

}

echo '</item>' . "\n";

}

// free resources and close connection

mysql_free_result($sql_result);

mysql_close($connection);

?>

</channel>

</rss>

The problem is that all my products got the same model number instead of individuals. What am I doing wrong? Any help would be appreciated.

 

Thanks.

Edited by Irin
Link to comment
Share on other sites

  • 2 weeks later...

I just added this to my site

http://www.rainbowstop.com/peacem/rss.php?...c215d4b802d88ee

 

and i get this error

XML Parsing Error: not well-formed

Location: http://www.rainbowstop.com/peacem/rss.php?...c215d4b802d88ee

Line Number 8, Column 24:<description>T-shirts & buttoms</description>

-----------------------^

 

I don't know enough on how to fix this

Noppie

Link to comment
Share on other sites

Hi Guys,

 

I'm a newbie to RSS and have attempted to install this contribution, although all does not seem well.

 

Can you please have a look at my feed at www.ladyloving.com/rss.php. I was under the impression it should appear similar to an XML file but this is all text?

 

Thanks in advance.

 

Donna

 

PS. if you navigate to the main store, there is adult orientated/targetted merchandise.

Link to comment
Share on other sites

@Donna

 

It appears like a text file because the header includes a link to an XSLT definition file at W3.org which formats the output in your browser for you.

 

Its all sweet and dandy. No worries.

 

Thanks Alex, i fed it into and RSS reader earlier and was surprised at the results. My next question is...is it wise to alter this to show all your products, or just an example?

 

Also, are there any plans to update this to a later version of RSS?

 

Best Regards

 

Donna

Link to comment
Share on other sites

hi

 

i have encountered the same problem.

does anyone has solution for this bug?

 

many thanks!!~~

 

Hi maomao!

 

Products_date_added is now included in the feed, check the contribution area. It works!

Link to comment
Share on other sites

Hi,

 

I noticed that when submitting an rss into the feeder, the product links are all displayed with osCid, like <link>http://mysite.com/product_info.php?products_id=155&osCsid=0c1eacd1deb3e995edcc5541d981c712</link>. Is there any way to remove the osCid from the link?

 

Thanks.

 

Goto line 169:

Change

 

//No RSS-compliant#echo ' <price>' . $price . '</price>' . "\n";

 

to

 

echo ' <price>' . $price . '</price>' . "\n";

 

This will also show the item price on the result.

Edited by omidhz

Regards,

Link to comment
Share on other sites

Goto line 169:

Change

 

//No RSS-compliant#echo ' <price>' . $price . '</price>' . "\n";

 

to

 

echo ' <price>' . $price . '</price>' . "\n";

 

This will also show the item price on the result.

 

Sorry, the above change will only add the product price. Does not remove the Csid

Regards,

Link to comment
Share on other sites

  • 2 weeks later...

Hi

 

I have installed the latest & I am getting an error (when I click on the RSS button ) that I can't find anyone else has had!! :(

 

It is a Parse erroe: Syntax error, unexpected T_STRING in ...rss.php

 

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
*/
require('includes/application_top.php');

$connection = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD) or die('Couldn\'t make connection.');
// select database
$db = mysql_select_db(DB_DATABASE, $connection) or die(mysql_error());

// Si la langue n'est pas spécifiée
if ($HTTP_GET_VARS['language'] == '') {
 $lang_query = tep_db_query('select languages_id, code from ' . TABLE_LANGUAGES . ' where directory = \'' . $language . '\'');
} else {
 $cur_language = tep_db_output($HTTP_GET_VARS['language']);
 $lang_query = tep_db_query('select languages_id, code from ' . TABLE_LANGUAGES . ' where code = \'' . $cur_language . '\'');
}

 

The error line quoted is

 

} else {

 

I searched the error & it said that the $ needs a '); end but they all look like they do around here.

 

Please could someone help me?

 

Thanks

Julie

Link to comment
Share on other sites

Try using the double quoted version in place of the single quoted version for these lines of code.

 

require('includes/application_top.php');

$connection = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD)	or die("Couldn't make connection.");
// select database
$db = mysql_select_db(DB_DATABASE, $connection) or die(mysql_error());

// Si la langue n'est pas sp?cifi?e

if ($HTTP_GET_VARS['language'] == "") {
 $lang_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " where directory = '" . $language . "'");
} else {
 $cur_language = tep_db_output($HTTP_GET_VARS['language']);
 $lang_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " where code = '" . $cur_language . "'");
}

while (!succeed) {try()};

 

GMT -6:00

Link to comment
Share on other sites

Try using the double quoted version in place of the single quoted version for these lines of code.

 

require('includes/application_top.php');

$connection = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD)	or die("Couldn't make connection.");
// select database
$db = mysql_select_db(DB_DATABASE, $connection) or die(mysql_error());

// Si la langue n'est pas sp?cifi?e

if ($HTTP_GET_VARS['language'] == "") {
 $lang_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " where directory = '" . $language . "'");
} else {
 $cur_language = tep_db_output($HTTP_GET_VARS['language']);
 $lang_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " where code = '" . $cur_language . "'");
}

Thanks for that TomThumb, but unfortunately that didn't work. Still the same error code. This is exactly what it says:

 

Parse error: Syntax error, unexpected T_STRING in /home/xxx/public_html/xxxx/rss.php on line 15

 

Nothing else.

 

Here is line 15

 

} else {

 

:blink: :blink:

 

Julie

Link to comment
Share on other sites

Does the listing work for all of you? Since the date when the product was added is not included, my RSS in Apple Safari duplicates the feed every time I check it. It says, for example, "Today 16.05" at the right of the product name, but when viewing the feed later on it says "Today 17.00" together with the earlier "16.05" which results in duplicates of all products. Not sure how to explain this..

 

Yes, I'm getting this aswell. Whenever my RSS reader wakes up it repeats everything as if it was a new item. No big deal for me as I mainly want it to provide data for an email generator, but would be nice to be able to use it as a published RSS feed.

Link to comment
Share on other sites

  • 1 month later...

I am getting 3 errors when validating. I've read thru this thread but dont see any insights.

Primary visual errors I am seeing are no images and no prices showing up

 

any input is appreciated. Thanks for the contribution.. very easy to install

here is the feed

 

 

This feed does not validate.

line 24, column 30: pubDate must be an RFC-822 date-time: 2006-06-21 11:47:10 (10 occurrences) [help]

<pubDate>2006-06-21 11:47:10</pubDate>

line 25, column 2: Undefined item element: image (10 occurrences) [help]

<image>  

In addition, this feed has an issue that may cause problems for some users. We recommend fixing this issue.

line 34, column 0: Invalid HTML: EOF in middle of construct, at line 1, column 113 (8 occurrences) [help]

<description>

-Dave

Link to comment
Share on other sites

  • 1 month later...
Is it possible to show only "Specials" instead of "New products"?

 

I want the same feature

Here is a mod that looks like it will work. Not sure if you can limit how many special products show up on the main page.

Link to comment
Share on other sites

Hi

 

Is rssfeed-0.8.3 the one to install?

 

And I feel really silly, but I haven't a clue about this...What parts of the rss.php do I have to amend please?

 

I get this error.

 

Only one top level element is allowed in an XML document.

Line: 2 Character: 2

 

<b>Warning</b>: mysql_connect(): Access denied for user: 'BD_SERVER_USERNAME@localhost' (Using password: YES) in <b>/home/xxxxxxx/public_html/xxxxx/rss.php</b> on line <b>8</b><br />

 

This is the rss file from the contribution.

 

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
*/
require('includes/application_top.php');

$connection = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD) or die('Couldn\'t make connection.');
// select database
$db = mysql_select_db(DB_DATABASE, $connection) or die(mysql_error());

// Si la langue n'est pas spécifiée
if ($HTTP_GET_VARS['language'] == '') {
 $lang_query = tep_db_query('select languages_id, code from ' . TABLE_LANGUAGES . ' where directory = \'' . $language . '\'');
} else {
 $cur_language = tep_db_output($HTTP_GET_VARS['language']);
 $lang_query = tep_db_query('select languages_id, code from ' . TABLE_LANGUAGES . ' where code = \'' . $cur_language . '\'');
}

// Récupère le code (fr, en, etc.) et l'id (1, 2, etc.) de la langue courante
if (tep_db_num_rows($lang_query)) {
 $lang_a = tep_db_fetch_array($lang_query);
$lang_code = $lang_a['code'];
$lang_id = $lang_a['languages_id'];
}

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

// Encodage en UTF-8
$store_name =  utf8_encode ($store_name);
$rss_title =  utf8_encode ($rss_title);
$weblink =  utf8_encode ($weblink);
$description =  utf8_encode ($description);
$email_address =  utf8_encode ($email_address);

// Nettoyage des chaînes
$store_name =  utf8_encode ($store_name);
$rss_title =  utf8_encode ($rss_title);
$weblink =  utf8_encode ($weblink);
$description =  utf8_encode ($description);
$email_address =  utf8_encode ($email_address);

$store_name =  utf8_encode ($store_name);
$rss_title =  utf8_encode ($rss_title);
$weblink =  utf8_encode ($weblink);
$description =  utf8_encode ($description);
$email_address =  utf8_encode ($email_address);

$store_name =  utf8_encode ($store_name);
$rss_title =  utf8_encode ($rss_title);
$weblink =  utf8_encode ($weblink);
$description =  utf8_encode ($description);
$email_address =  utf8_encode ($email_address);

// Début de l'envoi des données
Header('Content-Type: application/xml');
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 ' . date(r) . ' -->' . "\n";
?>
<rss version="0.92">
<channel>
<title><?php echo $rss_title; ?></title>
<link><?php echo $weblink;?></link>
<description><?php echo $description; ?></description>
<webMaster><?php echo $email_address; ?></webMaster>
<language><?php echo $lang_code; ?></language>
<lastBuildDate><?php echo date(r); ?></lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<?php

// Create SQL statement
$category = $HTTP_GET_VARS['cPath'];
if ($category != '') {
 // Check to see if we are in a subcategory
 if (strrpos($category, '_') > 0) {
$category = substr($category, strrpos($category, '_') + 1, strlen($category));
 }
 $sql = 'SELECT p.products_id, products_model, products_image, products_price, products_tax_class_id FROM products p, products_to_categories pc WHERE p.products_id = pc.products_id AND pc.categories_id = \'' . $category . '\' AND products_status=1 ORDER BY products_id DESC LIMIT ' . MAX_DISPLAY_SEARCH_RESULTS;
} else {
 $sql = 'SELECT products_id, products_model, products_image, products_price,  products_tax_class_id FROM products WHERE products_status=1 ORDER BY products_id DESC LIMIT ' . MAX_DISPLAY_SEARCH_RESULTS;
}

// Execute SQL query and get result
$sql_result = mysql_query($sql,$connection) or die('Couldn\'t execute query.');

// Format results by row
while ($row = mysql_fetch_array($sql_result)) {
 $id = $row['products_id'];

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

 $model = $row['products_model'];
 $image = $row['products_image'];
 $price = $row['products_price'];
 $tax = $row['products_tax_class_id'];

 // Add VAt if product subject to VAT (might not be perfect if you have different VAT zones)
 $sql3 = 'SELECT tax_rate FROM tax_rates WHERE  tax_class_id = ' . $tax . ' LIMIT 1';
 $sql3_result = mysql_query($sql3,$connection) or die('Couldn\'t execute query.');
 $row3 = mysql_fetch_array($sql3_result);
 $tax = ($row3['tax_rate'] / 100)+1;
 $price = $price * $tax;
 $price = $currencies->format($price);

 // Selectionne les noms et descriptions des produits
 $sql2 = 'SELECT products_name, products_description FROM products_description WHERE products_id = \'' . $id . '\' AND language_id = \'' . $lang_id . '\' LIMIT 1';
 $sql2_result = mysql_query($sql2,$connection) or die('Couldn\'t execute query.');
 $row2 = mysql_fetch_array($sql2_result);

 // Mise au propre des données
 $name = $row2['products_name'];
 $desc = $row2['products_description'];

 // Conversion en UTF-8
 $name = utf8_encode ($name);
 $desc = utf8_encode ($desc);
 $price = utf8_encode ($price);
 $link = utf8_encode ($link);

 // Tout le monde semble laisser les balises HTML
 #$name = strip_tags($name);
 #$desc = strip_tags($desc);
 #$price = strip_tags($price);

 $image_url = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $image;

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

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

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

 // Écriture de l'enregistrement
 echo '<item>' . "\n";
 echo '  <title>' , $name , '</title>' . "\n";
 echo '  <link>' , $link , '</link>' . "\n";
 echo '  <description>' . "\n";
 echo $desc . "\n";
 echo '  </description>' . "\n";
 //No RSS-compliant#echo '  <price>' . $price . '</price>' . "\n";
 if ($image != '') {
echo '  <image>' . "\n";
echo '	<url>' . $image_url . '</url>' . "\n";
echo '	<title>' . $name . '</title>' . "\n";
echo '	<link>' . $link . '</link>' . "\n";
echo '  </image>' . "\n";
 }
 echo '</item>' . "\n";
}
// free resources and close connection
mysql_free_result($sql_result);
mysql_close($connection);
?>
</channel>
</rss>

 

Sorry to ask a silly question :blush:

 

Thanks Julie

 

ps. this is suitable for customers to click onto to see my latest products isn't it? I also can't see anything in admin to amend the length of the products taken?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...