|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
ok im trieing to make an rss news feed from my database, this is what i have so far but it isnt working for some reason:
Code:
<cfsetting enablecfoutputonly="yes"> <cfquery name="news_list" datasource="#datasourcename#" blockfactor="100"> SELECT ID, title, content, dateposted, poster, image, layout FROM news ORDER BY ID DESC </cfquery> <cfsavecontent variable="theXML"> <cfoutput><?xml version="1.0" encoding="ISO-8859-1" ?> <!--RSS GENERATED BY FMREHAB.COM ON #now()#--> <rss version="2.0"> <channel> <title>#sitename#</title> <description>#description#</description> <language>en-us</language> <copyright>#sitename# 2005</copyright> <docs>#address#/rss/</docs> <lastBuildDate>#dateFormat(now())# #timeFormat(now())# EST</lastBuildDate> </cfoutput> <cfloop from="1" to="#news_list.recordcount#" index="ctr"> <cfscript> title = relpace(news_list.title[crt], "<", "<", "ALL"); content = relpace(news_list.content[crt], "<", "<", "ALL"); content = relpace(content, "&", "&", "ALL"); content = relpace(content, "", "'", "ALL"); date = dateformat(news_list.dateposted[crt], "ddd, dd mmm yyyy"); poster = relpace(news_list.poster[crt], "<", "<", "ALL"); </cfscript> <cfoutput> <item> <title>#title#</title> <description>#paragraphFormat(content)#</description> <link>http://www.fmrehab.com/news.cfm?ID=#ID#</link> <author>#poster#</author> <pubDate>#date#</pubDate> </item> </cfoutput> </cfloop> <cfoutput> </channel> </rss> </cfoutput> </cfsavecontent> <cfx_filemanager action = "write" userid = "hidden" password = "hidden" file = "#directory#/rss/rss_news.xml" output = "#thexml#" > my host is making me use a special replacement tag for cffile. and this is the error "Error Diagnostic Information An error occurred while evaluating the expression: title = relpace(news_list.title[crt], "<", "<", "ALL"); content = relpace(news_list.content[crt], "<", "<", "ALL"); content = relpace(content, "&", "&", "ALL"); content = relpace(content, "", "'", "ALL"); date = dateformat(news_list.dateposted[crt], "ddd, dd mmm yyyy"); poster = relpace(news_list.poster[crt], "<", "<", "ALL"); " Any help is appreciated.
__________________
MostarDesigns.com |
|
#2
|
|||
|
|||
|
Not sure what the error actually is (I'm assuming it is something inside the CFX file but no idea what...).
I did find this article on creating RSS with CF, but if the problem is in the CFX tag it might not help much. Here it is anyway: http://www.alphafilter.com/?inc=article&aid=97
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > creating an RSS feed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|