1
council
How to Syndicate a Xoops site (rss)
  • 2004/12/25 12:42

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Happy Holidays!

I'd like to syndicate my XOOPS site. I've googled the following instructions and would like to know how I adapt them to Xoops. "qGetTuorials" is the example the instructions use. I'm supposing my cfquery name would be "gnews" right?


<CFQUERY NAME="qGetTutorials" datasource="MyDSN">
SELECT *
FROM Tutorials
WHERE Tutorial_status = <cfqueryparam cfsqltype="CF_SQL_INTEGER" null="no" value="1">
ORDER BY tutorial_id
</CFQUERY>

<cfsavecontent variable="theXML">
<cfoutput><?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- RSS generated by EasyCFM.COM, LLC. on #now()# -->
<rss version="2.0">
<channel>
<title>EasyCFM.COM Tutorials</title>
<link>http://www.easycfm.com</link>
<description>All the EasyCFM.COM Tutorials!</description>
<language>en-us</language>
<copyright>Copyright 2003 EasyCFM.COM, LLC.</copyright>
<docs>http://backend.userland.com/rss/</docs>
<lastBuildDate>#dateformat(now(), "ddd, dd mmm yyyy")# #timeformat(now(), "HH:mm:ss")# EST</lastBuildDate>
<image>
<title>EasyCFM.COM</title>
<url>http://www.easycfm.com/images/logo.gif</url>
<link>http://www.easycfm.com</link>
</image>
</cfoutput>

<cfloop from="1" to="#qGetTutorials.RecordCount#" index="ctr">
<!--- Here let's clean up and ensure that all values are XML Compliant --->
<cfscript>
title = replace(qGetTutorials.tutorial_title[ctr], "<", "<", "ALL");
description = replace(qGetTutorials.tutorial_description[ctr], "<", "<", "ALL");
description = replace(description, "&", "&", "ALL");
description = replace(description, '"', "'", "ALL");
date = dateformat(qGetTutorials.tutorial_posted_date[ctr], "ddd, dd mmm yyyy");
time = timeformat(qGetTutorials.tutorial_posted_date[ctr], "HH:mm:ss") & " EST";
author = replace(qGetTutorials.tutorial_author[ctr], "<", "<", "ALL");
author_email = replace(qGetTutorials.tutorial_author_email[ctr], "at>", "@", "ALL");
author_email = replace(author_email, "<", "<", "ALL");
</cfscript>

<!--- this is the area your users will really want, these are the actual RSS items.. where you have your news or your content itself --->
<cfoutput>
<item>
<title>#title#</title>
<description>#description#</description>
<link>http://tutorial#qGetTutorials.tutorial_id[ctr]#.easycfm.com</link>
<author>#author_email# (#author#)</author>
<pubDate>#date# #time#</pubDate>
</item>
</cfoutput>
</cfloop>
<cfoutput>
</channel>
</rss>
</cfoutput>
</cfsavecontent>

Now you have the option of load this from this file or you can save it to an actual .XML file, that choice is up to you! What's the difference you ask?

Login

Who's Online

138 user(s) are online (76 user(s) are browsing Support Forums)


Members: 0


Guests: 138


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits