Here are the smalls hack for andrazk:
I’ve also changed the chunks to export in true rss 2.0 format. it’s validated in rss validator and works for me in netvibes.
1) docid = ’*’ :
edit the file jot.db.class.inc.php in the includes folder of the snippet :
Function GetCommentCount, at the end :
replace :
$sql = 'SELECT count(id) FROM '.$this->tbl["content"].' WHERE uparent = '.$docid.' AND tagid = "' . $tagid .'"'.$where;
return intval($modx->db->getValue($sql));
by :
if ($docid == '*') {
$sql = 'SELECT count(id) FROM '.$this->tbl["content"].' WHERE tagid = "' . $tagid .'"'.$where;
} else
{
$sql = 'SELECT count(id) FROM '.$this->tbl["content"].' WHERE uparent = '.$docid.' AND tagid = "' . $tagid .'"'.$where;
}
return intval($modx->db->getValue($sql));
Function GetComments, at the end :
replace :
$sql = "select a.* from " . $tbl . " as a " . $tblcustom . " where uparent = '" . $docid . "' and tagid = '" . $tagid ."' and mode = '0' " . $where . $orderby . $limit;
#print $sql;
return $this->GetCommentsArray($sql);
by :
if ($docid == '*') {
$sql = "select a.* from " . $tbl . " as a " . $tblcustom . " where tagid = '" . $tagid ."' and mode = '0' " . $where . $orderby . $limit;
} else
{
$sql = "select a.* from " . $tbl . " as a " . $tblcustom . " where uparent = '" . $docid . "' and tagid = '" . $tagid ."' and mode = '0' " . $where . $orderby . $limit;
}
#print $sql;
return $this->GetCommentsArray($sql);
That’s all for the ’*’ hack.
RSS 2.0 output :
JotTplXML :
[+comment.published:is=`1`:then=`
<item>
<title><![CDATA[ [+comment.title:esc+] ]]></title>
<link><![CDATA[ http://www.mysite.com/index.php?id=[+comment.uparent+] ]]></link>
<author><![CDATA[ [+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`+]`:esc+] ]]></author>
<guid isPermaLink="false">[+comment.id+]</guid>
<pubDate>[+comment.createdon:date=`%a, %e %b %Y %H:%M:%S %z`+] </pubDate>
<description><![CDATA[ [+comment.content:esc:nl2br:esc+] ]]></description>
</item>
`:strip+]
JotXML :
<?xml version="1.0"?>
[[JotRSS?docid=`*` &placeholders=`1` &output=`0` &tplComments=`JotTplXML` &pagination=`0`]]
<rss version="2.0">
<channel>
<title>last comments</title>
<link><![CDATA[http://www.mysite.com]]></link>
<description>comments</description>
<language>fr</language>
<copyright>perso</copyright>
<ttl>1</ttl>
[+jot.html.comments+]
</channel></rss>
(you can of course change the datas inside <title>, <link>, <description>, <language>, <copyright> and <ttl>