Zen Cart Logo
Forums / The Zen Pub / RSS reading

RSS reading

Locked

Views: 118

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
10 Feb 2008, 6:08 AM
#1
zinfandel avatar

zinfandel

Zen Follower

Join Date:
Feb 2007
Location:
NNJ
Posts:
205
Plugin Contributions:
0

RSS reading

So much jib-jab has been devoted to RSS feeding, however, I've searched around for a way to read RSS feeds into my Zen-Cart.

Has anyone come across a methodology by which to receive a feed and post it on the main page?

A good and useful response gets my utmost gratitude.
And, I'll drink a beer for the both of us. :yes:

10 Feb 2008, 8:14 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: RSS reading

Search for rss2html - google

10 Feb 2008, 10:33 PM
#3
zinfandel avatar

zinfandel

Zen Follower

Join Date:
Feb 2007
Location:
NNJ
Posts:
205
Plugin Contributions:
0

Re: RSS reading

slip of the finger

10 Feb 2008, 11:23 PM
#4
zinfandel avatar

zinfandel

Zen Follower

Join Date:
Feb 2007
Location:
NNJ
Posts:
205
Plugin Contributions:
0

Re: RSS reading

Thanks Kobra!

I did exactly that , infact I found this site informative: http://www.rss-specifications.com/displaying-rss-feeds.htm

And I got what I ended up using here: http://www.feedforall.com/free-php-script.htm

After copying the parser php, and the rss2html php into my root directory, I copied and customized the rss template and I placed the template in: includes/languages/english/html_includes/CUSTOM

The following is the code I place in define_main_page.php:

<div style="float:right; width:45%; margin: 5px; padding:5px; color:#e08a11; border:1px dotted

#ccc;">

<h1>Bible Verse of The Day</h1> <?php $XMLFILE = "http://abibleverse.org/main.xml "; $TEMPLATE = "includes/languages/english/html_includes/CUSTOM/rssTemplate.html"; $MAXITEMS = "1"; $NOFUTUREITEMS = "1"; @include("rss2html.php"); ?> </div>The result actually works great! However, the rest of the page doesn't load, and I can't figure out why . Any suggested reasons why it wouldn't?

Actually, I even have another div under this one and that loads fine also, but not the rest of the page. Is there something about the inclusion of the PHP file that breaks the machination of the cart?

Anyone's diligent efforts will be reward by my having two beers, one for me and one for you. By the grace of God, it is so much better to give than to receive; so I ask everyone to go out and give yourselves something nice today!

11 Feb 2008, 5:46 AM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: RSS reading

The following is the code I place in define_main_page.php:
Why on your cart main page??
If providing RSS feeds of products in your cart(As I think this is meant to Be) then these would not be in/on your cart.

11 Feb 2008, 6:19 AM
#6
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: RSS reading

I thought Zinfandel wanted to pull rss feed from somewhere to display on his cart. Otherwise he should use the rss feed mod in download section instead.

11 Feb 2008, 6:23 AM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: RSS reading

Yeah, I need to take more time re-reading the OP

11 Feb 2008, 1:20 PM
#8
zinfandel avatar

zinfandel

Zen Follower

Join Date:
Feb 2007
Location:
NNJ
Posts:
205
Plugin Contributions:
0

Re: RSS reading

That's correct Yellow, I'm putting together a religious website, and I found this other site that publishes a daily bible verse via RSS.
"Bible Verse of The Day", if you will.

I put it together, I tell ya, and it looks great, but there is something about the it that prevents anything beyond the define_main_page.php to be loaded.

I'm going to have to sift thru the code myself if no one comes up with any ideas.

Hey! Come on gang. I'm a COBOL/DB2/SQL programmer going on thirty years now. Programmers have huge egos, and a lot of reasons to want to help out so they can extoll their skill and prowess.

Please help out. I have the book and there's nothing in there about this.:book:

12 Feb 2008, 3:34 PM
#10
zinfandel avatar

zinfandel

Zen Follower

Join Date:
Feb 2007
Location:
NNJ
Posts:
205
Plugin Contributions:
0

Re: RSS reading

Well, with little few-worded prods from you guys I was able to solve the problem.

The rss2html.php uses a document template to parse the contents of the feed into. Naturally, the template variable in the script is called $template. I don't have to tell you what happens when the $template variable contains something other than what zen-cart put in there.

After renaming all instances of "$template" to "$rsstemplate" (including the external variable [$rssTEMPLATE] set in your code used to invoke the script), it worked as advertised.

Basically you can create any number of document HTML templates, and place these lines of PHP code anywhere in your site to display a feed where ever you want it to be.

<?php
$XMLFILE = "http://URL path/someRSS.xml ";
$rssTEMPLATE = "includes/languages/english/html_includes/CUSTOM/your_HTML_Template.html";
$MAXITEMS = "1";
$NOFUTUREITEMS = "1";
include("rss2html.php");
?>

For more information, I'll be glad to help out anyone who asks.
In the mean time, :cheers: