X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   RSS feeds (https://forum.x-cart.com/showthread.php?t=8367)

jpierry 07-07-2004 07:27 AM

RSS feeds
 
has anyone every tried to add an RSS feed to X-Cart?

jpsowin 07-07-2004 08:31 AM

No, but good idea... :)

jpierry 07-07-2004 09:24 AM

yeah I thought so too...if anyone has an idea on how this works, can you let me know?

dgtalzack 07-08-2004 11:18 AM

I'm looking into doing this as well. Have you picked out any RSS feed reading software? I'm looking at Magpie:

http://magpierss.sourceforge.net/

It seems pretty simple to put together. I'm gonna try to plug it into my install w/o creating some horrible gaping security hole. :)

jpierry 07-15-2004 10:42 AM

let me know how it goes. I would like to know. I'll also look into that code.

dgtalzack 07-22-2004 08:39 AM

So I've implemented magpie-rss. I built a table in the db to store the rss info, then set up a cron job to get the feed once an hour and overwrite the old feed data. Then I just fetch the data in config.php and make it available to smarty. Made a customer/newsfeed.tpl that loops through the data and displays it. Pretty easy, about an hour and a half of work.

B00MER 07-22-2004 02:38 PM

:arrow: http://www.cart-lab.com/lab/customer/rss.php

If anyones interested in the code let me know I'll put it up under freebies. Original code adopted by: Christian Jц╦rgensen (http://www.razor.dk) Just modified by me to work with Smarty/X-Cart.

dgtalzack 07-22-2004 03:14 PM

Cool, nice mod. I'd've definitely grabbed it for this site if I hadn't already written my own, but I'd be interested in using it in the future.

mream 01-23-2005 06:45 AM

Boomer,

I like the looks of your page. I just came across this post, and would be very interested in getting a copy of your code.

Thanks!

Ana 02-14-2005 08:09 AM

RSS Feed
 
Boomer,

That mod for RSS feeds looks great! We are very interested in it. Please let us know when you've posted the code.

Thanks!

Regards,

Ana

Leather Lust Enterprises
Leather Lingerie & Erotic Apparel
Sexy High Heels & Fetish Footwear

B00MER 02-16-2005 08:28 AM

Freebies Page:
:arrow: http://www.cart-lab.com/lab/customer/pages.php?pageid=3

Direct Link:
:arrow: http://www.cart-lab.com/lab/files/freebies/cart-lab_rss_feeds.zip

Ana 02-16-2005 08:51 AM

Thanks Boomer!

Regards,

Ana

Leather Lust Enterprises
Leather Lingerie & Erotic Apparel
Sexy High Heels & Fetish Footwear

fuzzy 02-18-2005 07:57 PM

Hey Boomer!
Cool mod!
It works great in 3.5x, but returns a blank page
(<HTML><HEAD></HEAD><BODY></BODY></HTML>)
in version 4.0.6 and 4.0.9

No php errors in the log either.
Any ideas?

Thanks!!

B00MER 02-19-2005 09:38 AM

Haven't tried the mod with 4.0, Other than includes/requirement statements or expat - XML Parser module is missing are the only things that come to mind. hth.

fuzzy 02-19-2005 10:54 AM

Well, I almost have it working.
I moved the rss.php to the cart root, (cart/rss.php) and now the feeds
show fine.
But the rest of the page, is not right. ie; head, cats yada yada.
Sooo.. I know the mod will work in 4.0.9.

Please excuse my extream lack of script knowlage! I'm just learning this
smarty arse stuff. lol!

Ana 02-19-2005 01:18 PM

Thanks for the update, Fuzzy.

I'm somewhere between 4.0.2 and 4.0.11.... though 4.0.2 is live.

Hadn't gotten to working with this yet, but following this thread like a hawk. I imagine I will be delving into it before the weekend is over.

WARNING: Not an XCART wizard.


Regards,

Ana

_________________
X-Cart version 4.0.2
Leather Lust Enterprises
Leather Lingerie & Erotic Apparel
Sexy High Heels & Fetish Footwear

fuzzy 02-19-2005 01:42 PM

Sooo close, yet, well you know!

But I don't think I'm doing this right!
http://rdcenterprises.com/4.0.9/customer/rss.php

Go ahead and laugh. ;-)

To get that much to work I changed ...

Code:

# require X-Cart functions
require "./auth.php";
require $xcart_dir."/include/categories.php";


to...
Code:

# require X-Cart functions
require "../auth.php";
require "../include/categories.php";


Which makes no sence to me, cause all the other php files work with
require "./auth.php";
require $xcart_dir."/include/categories.php";

Me thinks the wrong end of the stick is being chewed on. hehe!

fuzzy 02-20-2005 01:49 PM

Hey Ana,
I got it to work in 4.0.6. (I use the term "work" loosly!)
http://www.rdcenterprises.com/cart/feed1_nyt.php
The hack job I did prolly breaks all kinds of smarty rules, but
at least it's working & not causing any errors.

humm...
Wonder if we could "bribe" a certian Guru to tweaking it correctly
for 4.0x?

oooohhh Boomer!!! :wink:

Ana 02-24-2005 11:46 AM

got it working in 4.0.2 but also with some major mods in the rss.tpl and a minor mod in the rss.php.

work still in progress.

Ana

fuzzy 02-24-2005 01:30 PM

LOL!!
I did major in both! hehehe!
Since search engines can see the feed(s) I made it so they can now
see and follow the links to my other feeds.

But since I'm just a newbe, it's pretty primitive! :oops:
Take a peek here

vortexonline 02-25-2005 06:36 AM

You could also try...
 
You could also try this link:

http://www.bigbold.com/rssdigest/index.html

Using the link of the feed, you can create the necessary link to display the feed.

Ana 02-25-2005 09:11 AM

Thanks vortex.

That is a nice way to put a limited amount of posts on a page. Now finding relevant blogs/rss to our content is going to be the challenge.

We'd like to incorporate an internal blog/forum. Not sure if anybody has done this in X-Cart though.

My next project.

Regards,

Ana

sabrina 02-27-2005 08:45 AM

RSS Feed
 
It's working but on top of page i got this:

Page not found!
The requested page does not exist or you are not allowed to access it!

http://www.indyplaza.com/buy/rss.php

offline 05-09-2005 10:46 AM

How would I integrate this script into my main home page? Thanks for any tips.

redace 05-17-2005 09:40 AM

Generating RSS feed from newsletter content
 
The previous entries seem to be focused on reading and displaying RSS feeds from other sources.

I'm contemplating on generating feed info based on internal x-cart newsletter items.
It shouldn't be too difficult to have a PHP script make a query from the database, and write out an XML file.

Anyone thinking trying this idea out? It would be a great addition to those X-cart users that have events, new products, sales etc. that they would want folks to know about. Now users can only subscribe to e-mail, which can easily get lost in the deluge of SPAM we all face these days. This could be a viable alternative.

I'll start investigating what it would entail to add a PHP script to generate a feed. Any one want to help, feel free to jump aboard :!:

jdiehl 05-17-2005 10:02 AM

I was playing with the idea of creating my own RSS feed also with information that I find on others RSS feeds (with the proper links in place) Plus Information from my own store, i.e. specials, new products.

I am playing with RSS 2.0 for PHP http://www.2rss.com/ for taking information from a database and writing an XML RSS Feed.

And I am playing with RSS2HTML from Feed For All at http://www.feedforall.com/download.htm for displaying that feed I generated myself. Both are free scripts

I've successfully integrated it into XCart no problem I just didn't finalize how it would look, and put it to the side because of other projects. All you have to do is call the RSS2HTML script from your xcart template and make sure that you've set it up to look the way you want. There is probably an easier way. I want to look at BOOMER's code for displaying in X-Cart, but I'll still use RSS 2.0 of PHP to create my own Feed.

One thing that you guys should keep in mind is, that if you are including any links from the RSS feeds you should use a little JavaScript to supply the link so that Search Engines will ignore the external links. External links will just be giving away Page Rank.

B00MER 05-17-2005 11:47 AM

Why waste the time with re-inventing the wheel, Just create a blog on www.blogger.com along with www.feedburner.com and you've got a solid way to keep customers informed while boosting incoming links for SEO as well as you've got a free easy way to offer a RSS feed of your blog.

This is what I did this little mod for so I could post my blog links as well as offer other external sources to get relative news. I tweaked it some and put the first 3 entries from my blog on my front page as well.

:wink:

jdiehl 05-17-2005 01:10 PM

I agree with that why spend the time when there are already free services out there? It's much easier to do it that way. I just have a personal preference to not rely on other people websites for content on my own website. For example I can set up a blogger on blogger.com and create a live feed from it and display that on my website, but then what happens if they go down for a day or worse get hacked? Or even decide to change their policies to charge for it, or include advertisements?

Personally if it's my website and my content then I want to rely on my own server. it'll take me a little longer to get it all squared away, but then if it goes down, my whole website is probably going down. And I'll never change my policy, and start charging myself. Haha.

Anyway it's all up to personal preference, and since I have my own server I am going to use it to it's full potential.

Thanks Boomer, the most important part of these forums is the ability to see everything from everyone's perspective and I appreciate your input. I might not go that route but it's something I wasn't aware of.

redace 05-17-2005 01:43 PM

My goal would be for the x-cart to update the rss.xml file everytime you use the newsletter module, and make changes to the the postings. I have no interest in bringing other external feeds for display.

It could be as simple as adding in a function call within the newsletter code, that wrote out the XML file. No display of the feed content anywhere, except possibly a button on the side menu that links to the XML file for users to subscribe with.

I liken this ability to the way X-cart has been updated with the ability to create and send Froogle updates automatically.

Like jdiehl says, I don't want to rely on external services like the blogger.coms to do the work, I guess I'm picky that way. :)

Still, you can use the aggro sites to send your feed on for more folks to see. No harm in that. :wink:

Ana 05-17-2005 05:53 PM

Agree with Boomer. We've incorporated our own news on a blog seperately from the store site. It is working wonders for traffic as well as sales. The internal RSS that Boomer was so gracious to share (thanks again, Boomer) feeds in external news to store site while our external news site and RSS is posted by our clients and staff.

It interacts nicely and as Boomer said, it helps with inbound links, especially when other sites start linking in to your rss feed. The possibilities are endless.

Ana

jclick 05-25-2005 05:06 PM

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.

redace 05-26-2005 05:18 AM

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! :D

dalmuti 06-13-2005 09:34 AM

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

Abdul 09-26-2005 08:18 PM

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

fuzzy 10-01-2005 04:46 PM

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! :D

halestorm 10-05-2005 04:29 PM

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

fuzzy 10-05-2005 04:45 PM

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! :wink:

rossco 01-14-2006 10:28 AM

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

MythNReality 01-18-2006 11:18 AM

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). :D

B00MER 01-18-2006 01:24 PM

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

:arrow: http://www.bcsengineering.com/store/customer/product.php?productid=132


All times are GMT -8. The time now is 12:10 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.