Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
Topic Information
Ned
Ned
feeds.php (2Kb)  
ViArt can allow customers to subscribe to rss feeds of articles from your site but its also useful to create a block within your site, for example on the home page, showing your companies latest information to visitors which was created as an article category item.
 
To create the ViArt block your website will need a rss parser to transform the rss feed into html in the block. There are several around but the one I describe here is "MagpieRSS" from http://magpierss.sourceforge.net It needs PHP4 and xml support on your webserver.
 
 
 
 
For installation download MagpieRSS and unzip it. To avoid files being overwritten by a ViArt upgrade create a new folder called "rss" in the root of the site. Binary upload four files, "rss_cache.inc", "rss_fetch.inc", "rss_parse.inc" and "rss_utils.inc" plus the directory "extlib" to the website. MagpieRSS will also create a folder called "cache".
 
 
Log into the site and in "Administration > System > Global Settings" in "Allow to run PHP code in" tick "Custom Blocks".
 
In the "Administration > Articles > Articles Settings > Edit Settings" for the category or categories you wish to appear tick "Activate RSS" as well as the breadcrumbs and categories tick boxes and set the number of articles and the field properties to give the required look to the articles. I activated the "News" category.
 
ViArt can call a file to create a block so I then created a custom block called "Feeds" with the contents set to "/rss/feeds.php" (which needs to be created later). Its best to call an external file rather than create it in the block software as some tags can be stripped.
 
In "Administration > CMS > CMS Settings" I loaded my news listing page from "Articles Categories Layout" and made sure the "News (Breadcrumb)" appeared on the page and also put my "Custom Blocks (Feeds)" on my "Main Pages > Home Page Layout".
 
 
If you now go to your site you won't see a "Feeds" custom block because the file is not there but if look at the articles that you have activated for rss you should see the rss icon to the right on the breadcrumb. Clicking this will load the RSS subscribe page of your site and the browser will show the category_id of the feed which you need to note.
 
 
 
The file "feeds.php" can be very simple showing one feed but in my case I wanted three news feeds so I created a table with three cells and in each cell set a different feed. Each is set as a list with a feed heading. You can of course alter this to taste.
 
One of the feeds I wanted was that of the news on my site so "$rss3" was set to the url of the category feed of my site. In the attached "feeds.php" file Ive set "$rss3" to ViArts News feed. I then uploaded the file into the "rss" directory and reloaded the home page to see that the news block had appeared.
 
 
 
HTH
Last modified: 27 Feb 2009 9:30 AM
 
tw (Guest)
tw (Guest)
Thanks for sharing. Care to post a link with the RSS feature from your site so that we have a visual example?
 
Ned
Ned
Ive done a very simple example at http://bayton.eu
 
giuse'
giuse'
I followed your instructions and inserted the link on my site, leaves:
------
Error:
MagpieRSS: Failed to fetch http://www.xxxxxx.it/articles_rss.php?category_id=74 (HTTP Response: HTTP/1.1 404 Not Found )
------
 
Because?
 
g
 
Ned
Ned
Umm.
The process is this. The ViArt software creates the RSS feed. Magpie looks at the feed and decodes it into html. ViArt calls the decoded html into the block for display.
 
Try putting the link above into the address bar of your browser where it should pull up the ViArt RSS feed directly from the software and offer you a bookmark.
 
If it doesn't the link is incorrect or the RSS feed isnt activated. If it does then you need to go back and check your steps again through the installation.
HTH
Last modified: 21 Nov 2009 12:10 PM