Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

RSS feeds

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 05-25-2005, 05:06 PM
 
jclick jclick is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 48
 

Default

OK. For someone that does not know about tweaking all of these files, how would I get RSS feeds to my site? I'm at 4.0.9 currently. I've downloaded the mod from cart-lab and followed the instructions. This is what I get: http://www.4clicksgps.com/customer/rss.php. Do you have to sign up for some type of RSS service before doing this? Thanks.
__________________
X-Cart version 4.0.9
Operation system Linux
MySQL server 4.0.22-standard
MySQL client 4.0.22

My Location:
Concord, North Carolina

My site is a work in progress by a web newbie so no hard poking please!
www.4ClicksGPS.com
Reply With Quote
  #32  
Old 05-26-2005, 05:18 AM
  redace's Avatar 
redace redace is offline
 

Member
  
Join Date: Feb 2003
Posts: 11
 

Default

Quote:
Originally Posted by jclick
OK. For someone that does not know about tweaking all of these files, how would I get RSS feeds to my site?

Do you have to sign up for some type of RSS service before doing this? Thanks.

In order for you to display RSS feeds, you need some sources of data. Basically, RSS is only an XML file that lives on various website. You can find them pretty easily, just look for a little box with either XML or RSS on it. It will contain a link to the feed file. Copy those URLS and save them. They are the service. No signing up needed! (Think of RSS as an alternate to HTML, your program does the special news feed parsing, instead of a browser.)


You need to edit the customer/rss.php file, scroll down to the # RSS Feed Urls section, and type in the saved feed URLs from above you want to display. Then also edit a matching description in the # RSS Feed Names section to match the new feed. Once you have it updated, re-upload the rss.php to your site. It should now go out and read the RSS files and display them when you click on the cart page.

Congrats! You are now an official file tweaker!
__________________
X-Cart version 4.0.19 live
Feed Manager
Marketing Manager
PHP 4.4.4
MySQL server 4.0.27-standard
Apache Web Server [linux]
Site http://www.wizzywig.com
Reply With Quote
  #33  
Old 06-13-2005, 09:34 AM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default

I have the code working to generate the RSS feeds as long as I use the direct php link....but I would like to include as an embedded page in my site.

Can anyone give me instructions.....

Thanks,

Louise
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #34  
Old 09-26-2005, 08:18 PM
 
Abdul Abdul is offline
 

Member
  
Join Date: Jul 2004
Location: Miami
Posts: 17
 

Default help with this mod

I'm trying to get this mod to work but no luck i spend too much already. can someone please let me know how to do it. I'm using 4.0.15 with Fashion mosaic skin.
here is what i'm getting http://www.certifiedcomp.com/store/rss.php Thanks in advance
__________________
X-Cart 4.1.7 Gold
Reply With Quote
  #35  
Old 10-01-2005, 04:46 PM
 
fuzzy fuzzy is offline
 

Advanced Member
  
Join Date: Jun 2004
Location: oHIo
Posts: 77
 

Default

Here's Boomer's RSS mod updated to work with 4.0.12 -4.0.16.
Should work with all 4.0 versions, but I haven't tested below 4.0.12.
Note!
The installation is a bit different than the 3.0xx version. (more of a option really)
Also, just to keep things simple & avoid some bald spots, you might
not want to change any of the code/feed URLs, until AFTER you've uploaded/ tested the mod & know it works.

Step 1:
Log into your admin & go to "Languages" and create a lbl_rssfeed. This is
what will show in the crumb trail. ie: "Home :: Live News"

Step 2:
Create a rss.php file with the code below & upload to /xcart/rss.php.
rss.php
Code:
<?php /* X-Cart RSS Parser Original code adopted by Christian Jц╦rgensen (http://www.razor.dk) Modified for X-Cart by Jared Blalock (http://www.cart-lab.com) */ # require X-Cart functions require "./auth.php"; require $xcart_dir."/include/categories.php"; if ($active_modules["Manufacturers"]) include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php"; # Edit these URLS of RSS/XML feeds you'd like to have on your site # RSS Feed Urls $backends = array("http://www.ecommercetimes.com/perl/syndication/rssfull.pl", "http://www.wired.com/news/feeds/rss2/0,2610,10,00.xml", "http://headlines.internet.com/internetnews/ec-news/news.rss", "http://www.sitepoint.com/recent.rdf", "http://p.moreover.com/cgi-local/page?c=E%2Dcommerce%20news&o=rss", "http://p.moreover.com/cgi-local/page?c=Online%20marketing%20news&o=rss", "http://p.moreover.com/cgi-local/page?c=Web%20developer%20news&o=rss"); # RSS Feed Names $backend_names = array("E-Commerce Times", "Wired News: E-Biz", "E-Commerce News (internet.com)", "SitePoint.com Recent Articles", "E-Commerce News (moreover.com)", "Online Marketing (moreover.com)", "Web Developer News (moreover.com)"); # Set default if none selected if(!$backend) $backend = $backends[0]; # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # NO NEED TO EDIT BELOW # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Some vars used later on $insideitem = false; $tag = ""; $title = ""; $description = ""; $link = ""; function startElement($parser, $tagName, $attrs) { // The function used when an element is encountered global $insideitem, $tag; if ($insideitem) { $tag = $tagName; } elseif ($tagName == "ITEM") { $insideitem = true; } } function characterData($parser, $data) { // The function used to parse all other data than tags global $insideitem, $tag, $title, $description, $link; if ($insideitem) { switch ($tag) { case "TITLE": $title .= $data; break; case "DESCRIPTION": $description .= $data; break; case "LINK": $link .= $data; break; } } } function endElement($parser, $tagName) { // This function is used when an end-tag is encountered. global $insideitem, $tag, $title, $description, $link, $feed; if ($tagName == "ITEM") { # modified by cart-lab.com $feed .= "<li type='disc'>".htmlspecialchars(trim($title))." "; $feed .= trim($description)." "; $title = $description = $link = $insideitem = false; # modified by cart-lab.com } } // Now to the parsing itself. Starts by creating it: $xml_parser = xml_parser_create(); // Then setup the handlers: xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); // Open the actual datafile: $fp = fopen($backend, r); // Run through it line by line and parse: while ($data = fread($fp, 4096)) { xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } // Close the datafile fclose($fp); // Free any memmory used xml_parser_free($xml_parser); # modified by cart-lab.com add to by rdcenterprises.com so blame me if it doesn't work! ;-) $smarty->assign("main","rss"); $smarty->assign("feeds",$feed); $smarty->assign("backend",$backend); $smarty->assign("backends",$backends); $smarty->assign("backend_names",$backend_names); $location[] = array(func_get_langvar_by_name("lbl_rssfeed")); $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); ?>

Step 3:
Create the "rss.tpl" from the code below & upload to:
/xcart/skin1/customer/main/rss.tpl
rss.tpl
Code:
{capture name=dialog} <form name="feeds" method=post action=""> <select name="backend" onChange="document.feeds.submit();"> {$backend} {section name=oi loop=$backends} <option value="{$backends[oi]}" {if $backend eq $backends[oi]}selected{/if}>{$backend_names[oi]}</option> {/section} </select> </form> {$feeds} {/capture} {include file="dialog.tpl" title="E-Commerce News" content=$smarty.capture.dialog extra="width=100%"}

Step 4: (you can do this part in skin1/common_templates.tpl or /skin1/customer/home_main.tpl) I prefer the later, cause home_main.tpl
is called before common_templates.tpl.

K! Add the following code to the bottom of "/skin1/customer/home_main.tpl"
just BEFORE the
"{else}
{include file="common_templates.tpl"}
{/if}"
home_main.tpl
Code:
{elseif $main eq "rss"} {include file="customer/main/rss.tpl"}
So the bottom will look like so:
Code:
{elseif $main eq "rss"} {include file="customer/main/rss.tpl"} {else} {include file="common_templates.tpl"} {/if}
Step 5: Put a link on your home page.
I put mine at the bottom of the "/skin1/news.tpl"
ie: News from around the World
Now, call the rss.php with your browser. If it loads...ya be DONE!
__________________
X-Cart 4.0.12 Gold
Linux
Reply With Quote
  #36  
Old 10-05-2005, 04:29 PM
 
halestorm halestorm is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 44
 

Default

I tried the one from boomer and the one above. I followed the directions excatly.

Here is the error I get..


Fatal error: Smarty error: [in common_templates.tpl line 126]: syntax error: unexpected {elseif} (Smarty_Compiler.class.php, line 460) in /var/www/gamegeek/htdocs/Smarty-2.6.3/Smarty.class.php on line 1082

I'm on 4.11
__________________
...
x-cart-4.0.11

http://www.thegamegeek.net
Reply With Quote
  #37  
Old 10-05-2005, 04:45 PM
 
fuzzy fuzzy is offline
 

Advanced Member
  
Join Date: Jun 2004
Location: oHIo
Posts: 77
 

Default

Quote:
Originally Posted by halestorm
I tried the one from boomer and the one above. I followed the directions excatly.

Here is the error I get..


Fatal error: Smarty error: [in common_templates.tpl line 126]: syntax error: unexpected {elseif} (Smarty_Compiler.class.php, line 460) in /var/www/gamegeek/htdocs/Smarty-2.6.3/Smarty.class.php on line 1082

I'm on 4.11

Look at line 126. it should show {elseif} <--which is the prob.
the bottom of the file should look like sorta like:
Code:
{elseif $main eq "rss"} {include file="customer/main/rss.tpl"} {else} {include file="main/error_page_not_found.tpl"} {/if}

When looking at the "Smarty errors", the first part of the error will
let you know...
"What file is broke"...error: [in common_templates.tpl,
"What line caused the error"...line 126
and
"What caused the error"...syntax error: unexpected {elseif}.

You really don't need to bother with the
"(Smarty_Compiler.class.php, line 460)" yada yada stuff.
Well...in most cases!
__________________
X-Cart 4.0.12 Gold
Linux
Reply With Quote
  #38  
Old 01-14-2006, 10:28 AM
 
rossco rossco is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 97
 

Default

Superb............RSS feeds up and running in less than an hour

http://www.ross-co.co.uk/xcart/rss.php

....and for anyone wanting to use our feed here's the link

http://www.ross-co.co.uk/xcart/RSS-Feed-p-18.html
__________________
How loud do you want it?

X-Cart Gold 4.0.12 & 17
Reply With Quote
  #39  
Old 01-18-2006, 11:18 AM
  MythNReality's Avatar 
MythNReality MythNReality is offline
 

X-Adept
  
Join Date: Mar 2005
Location: S. Cali
Posts: 403
 

Default Re: RSS feeds

Quote:
Originally Posted by jpierry
has anyone every tried to add an RSS feed to X-Cart?

Yeah, I did, fuzzy has a mode posted...gee, fuzzy you beat me (by psting ahead of me).
__________________
_____________
Capture Your Mini-Me Look!

- X-CART Gold (Current Version) V4.6
- Reboot
- CDSEO
Reply With Quote
  #40  
Old 01-18-2006, 01:24 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Carrie at BCSE also has a newest products RSS feed available.

http://www.bcsengineering.com/store/customer/product.php?productid=132
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:45 PM.

   

 
X-Cart forums © 2001-2020