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)
-   -   Syndicate X-Cart news as RSS 2.0 Channel (https://forum.x-cart.com/showthread.php?t=19661)

justy 07-17-2008 09:32 AM

Re: Syndicate X-Cart news as RSS 2.0 Channel
 
I've put test stories up using the news module, and they appear on the website's news page. But the feed made by the news_feed.php file only shows as blank. I get no errors.

zaa 07-17-2008 10:17 PM

Re: Syndicate X-Cart news as RSS 2.0 Channel
 
Quote:

Originally Posted by justy
I've put test stories up using the news module, and they appear on the website's news page. But the feed made by the news_feed.php file only shows as blank. I get no errors.


I've just checked the news_feed.php file on X-Cart 4.1.9, 4.1.10 installations on our development server and failed to reproduce the issue.
You might need to add output of debug information to the script and check where it fails, etc.

justy 07-18-2008 06:17 AM

Re: Syndicate X-Cart news as RSS 2.0 Channel
 
For the news_feed.php, I'm getting these errors:

PHP Parse error: syntax error, unexpected T_SL in news_feed.php on line 62
PHP Parse error: syntax error, unexpected T_STRING in news_feed.php on line 64

They seem to happen at

Code:

$items_code .= <<<EX
        <item> 
            <title>{$m['subject']}</title>
            <description><![CDATA[{$m['body']}]]></description>
            <link>$news_page_url</link>
            <guid isPermaLink="false">{$m['newsid']}@$news_page_url</guid>
            <pubDate>$pubDate</pubDate>
        </item>

EX;
    }


Which is interesting, because Dreamweaver's syntax highlighting chokes on the <<<EX string as well.

zaa 07-18-2008 06:30 AM

Re: Syndicate X-Cart news as RSS 2.0 Channel
 
1 Attachment(s)
Quote:

Originally Posted by justy
For the news_feed.php, I'm getting these errors:

PHP Parse error: syntax error, unexpected T_SL in news_feed.php on line 62
PHP Parse error: syntax error, unexpected T_STRING in news_feed.php on line 64

They seem to happen at

Code:

$items_code .= <<<EX
        <item> 
            <title>{$m['subject']}</title>
            <description><![CDATA[{$m['body']}]]></description>
            <link>$news_page_url</link>
            <guid isPermaLink="false">{$m['newsid']}@$news_page_url</guid>
            <pubDate>$pubDate</pubDate>
        </item>

EX;
    }


Which is interesting, because Dreamweaver's syntax highlighting chokes on the <<<EX string as well.


Try to copy&paste text of provided script using, for example, notepad.
Apparently current editor mangles the file in some way.

PS. I've attached the news_feed.php script to this message, you can try to us it.

justy 07-18-2008 07:00 AM

Re: Syndicate X-Cart news as RSS 2.0 Channel
 
zaa, that worked perfectly. Thanks!

RCTOYS 09-09-2008 06:04 AM

Re: Syndicate X-Cart news as RSS 2.0 Channel
 
Hello,

I got an error while using this latest code (never used before).

Code:

INVALID SQL: 1054 : Unknown column 'date' in 'field list'
SQL QUERY FAILURE:SELECT COUNT(*) as msg_count, MAX(date) AS last_date FROM xcart_newslists AS nl LEFT JOIN xcart_newsletter AS n ON n.listid = nl.listid WHERE nl.avail='Y' AND nl.show_as_news='Y' AND n.show_as_news = 'Y' ORDER BY n.date DESC


Anyone can help me ?

X-CART version 4.1.7

JWait 10-06-2008 04:44 AM

Re: Syndicate X-Cart news as RSS 2.0 Channel
 
Quote:

Originally Posted by zaa

Note: The script is intended for displaying of news. If you would like to create a feed with the latest store products, etc then you need to adjust it according to your needs.

Best regards,


What would need to be adjusted to create a feed with the latest store products?

Acquamarina 01-10-2012 08:28 AM

Re: Syndicate X-Cart news as RSS 2.0 Channel
 
Is there a version of news_feed.php for 4.4.4?


All times are GMT -8. The time now is 04:22 AM.

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