Skip to content

Instantly share code, notes, and snippets.

@fbrnc
Created Aug 2, 2011
Embed
What would you like to do?
Export comments to rss
page = PAGE
page.config {
disableAllHeaderCode = 1
xhtml_cleaning = 0
admPanel = 0
disablePrefixComment = 1
noPageTitle = 1
# xmlprologue = xml_11
additionalHeaders = Content-type:application/rss+xml
}
page.wrap (
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dsq="http://www.disqus.com/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.0/"
>
<channel>
|
</channel>
</rss>
)
page.10 = CONTENT
page.10 {
table = tx_comments_comments
select {
pidInList = 6
recursive = 99
orderBy = tstamp desc
where = NOT deleted AND NOT hidden AND approved
}
renderObj = COA
renderObj {
wrap = <item>|</item>
10 = RECORDS
10 {
source.field = pid
tables = pages
dontCheckPid = 1
conf.pages = COA
conf.pages {
10 = TEXT
10.field = title
10.trim = 1
10.wrap = <title><![CDATA[|]]></title>
20 = TEXT
20 {
stdWrap.typolink {
parameter.field = uid
forceAbsoluteUrl = 1
returnLast = url
}
wrap = <link>|</link>
}
30 = TEXT
30.wrap = <content:encoded>|</content:encoded>
40 = TEXT
40.field = uid
40.wrap = <dsq:thread_identifier>pages_|</dsq:thread_identifier>
50 = TEXT
50.field = tstamp
50.date = Y-m-d H:i:s
50.wrap = <wp:post_date_gmt>|</wp:post_date_gmt>
60 = TEXT
60.value = open
60.wrap = <wp:comment_status>|</wp:comment_status>
}
}
20 = COA
20 {
wrap = <wp:comment>|</wp:comment>
10 = TEXT
10.field = uid
10.wrap = <wp:comment_id>|</wp:comment_id>
20 = TEXT
20.field = firstname
20.trim = 1
20.wrap = <wp:comment_author><![CDATA[|]]></wp:comment_author>
30 = TEXT
30.field = email
30.trim = 1
30.wrap = <wp:comment_author_email><![CDATA[|]]></wp:comment_author_email>
40 = TEXT
40.field = homepage
40.trim = 1
40.wrap = <wp:comment_author_url><![CDATA[|]]></wp:comment_author_url>
50 = TEXT
50.field = remote_addr
50.wrap = <wp:comment_author_IP>|</wp:comment_author_IP>
60 = TEXT
60.field = tstamp
60.date = Y-m-d H:i:s
60.wrap = <wp:comment_date_gmt>|</wp:comment_date_gmt>
70 = TEXT
70.field = content
70.trim = 1
70.wrap = <wp:comment_content><![CDATA[|]]></wp:comment_content>
80 = TEXT
80.field = approved
80.wrap = <wp:comment_approved>|</wp:comment_approved>
90 = TEXT
90.value = 0
90.wrap = <wp:comment_parent>|</wp:comment_parent>
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment