Hello,
with .../feeds/comments.rss2 (and {$serendipityBaseURL}rss.php?version=2.0&type=comments&cid={$entry.id} for single entries) you can read the comments of a blog via rss-feed.
Is it possible to get trackbacks into this feed? I think trackbacks are a special kind of comments, so they should be readable by the feed, too.
comments AND trackbacks via rss-feed?
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
comments AND trackbacks via rss-feed?
Ciao, Stephan
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Ok, I used the day to explore the rss-s9y-code.
Now, I have coded new code for this request:
(My) s9y can export in the rss-feed now:
only the comments
only the trackbacks
both
by "rss.php?version=2.0&type=comments", "rss.php?version=2.0&type=trackbacks", "rss.php?version=2.0&type=comments_and_trackbacks"
You can see it in action at http://blog.stephan.manske-net.de/archi ... stand.html
and all these for the whole blog or for single articels.
I thougt my code is clean, where or how can I submit them to s9y?
Now, I have coded new code for this request:
(My) s9y can export in the rss-feed now:
only the comments
only the trackbacks
both
by "rss.php?version=2.0&type=comments", "rss.php?version=2.0&type=trackbacks", "rss.php?version=2.0&type=comments_and_trackbacks"
You can see it in action at http://blog.stephan.manske-net.de/archi ... stand.html
and all these for the whole blog or for single articels.
I thougt my code is clean, where or how can I submit them to s9y?
Ciao, Stephan
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Please post your patch here, you could psate it into http://nopaste.php-q.net/ for example.
Best regards,
Garvin
Please post your patch here, you could psate it into http://nopaste.php-q.net/ for example.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
OK, let's go:
All changes are marked with /* -stm: ... */
index.php
http://nopaste.php-q.net/227690#278
rss.php
http://nopaste.php-q.net/227691#31
http://nopaste.php-q.net/227691#88
functions.inc.php
http://nopaste.php-q.net/227693#931
functions_comments.inc.php
http://nopaste.php-q.net/227694#121
http://nopaste.php-q.net/227694#151
http://nopaste.php-q.net/227694#170
functions_rss.inc.php
http://nopaste.php-q.net/227695#45
at http://nopaste.php-q.net/227695#51 there is the patch I described also here: http://www.s9y.org/forums/viewtopic.php?t=6122 but it must be included in the new if-construct.
All changes are marked with /* -stm: ... */
index.php
http://nopaste.php-q.net/227690#278
rss.php
http://nopaste.php-q.net/227691#31
http://nopaste.php-q.net/227691#88
functions.inc.php
http://nopaste.php-q.net/227693#931
functions_comments.inc.php
http://nopaste.php-q.net/227694#121
http://nopaste.php-q.net/227694#151
http://nopaste.php-q.net/227694#170
functions_rss.inc.php
http://nopaste.php-q.net/227695#45
at http://nopaste.php-q.net/227695#51 there is the patch I described also here: http://www.s9y.org/forums/viewtopic.php?t=6122 but it must be included in the new if-construct.
Ciao, Stephan
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
There are two things more:
1) In the syndication-plugin:
for the "RSS 2.0 Kommentar" from
to
or: let the use config whether only comments or both.
But I think, both should be default for most users. I do not know why someone could whish to feed only the comments.
2) for the feed-templates:
in every feed-template replace
with
It would be the best, if every template-writer would make these changes, but as I see, the most templates do not have their own feed-tpl's, so it would be enough to make the change in the default-theme.
1) In the syndication-plugin:
for the "RSS 2.0 Kommentar" from
Code: Select all
/feeds/comments.rss2Code: Select all
/feeds/comments_and_trackbacks.rss2But I think, both should be default for most users. I do not know why someone could whish to feed only the comments.
2) for the feed-templates:
in every feed-template replace
Code: Select all
wfw:commentRss>{$serendipityBaseURL}rss.php?version={$metadata.version}&type=comments&cid={$entry.feed_id}</wfw:commentRss>Code: Select all
<wfw:commentRss>{$serendipityBaseURL}rss.php?version={$metadata.version}&type=comments_and_trackbacks&cid={$entry.feed_id}</wfw:commentRss>
Ciao, Stephan
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
You should really make yourself familiar with GNU Diff! Your changes were a pain in the behind to incorporate.
I changed it a bit, and the outcome is this:
http://svn.berlios.de/viewcvs/serendipi ... v&rev=1339
IMHO changing the default comment feed to include trackbacks is not so good. Trackbacks much more often contain spam, and IMHO it shouldn't trigger the RSS feed anytime. If people want to subscribe to that, they should IMHO do so explicitly? A patch to the syndication plugin should be made for this, I think.
Best regards and thanks for your work,
Garvin
You should really make yourself familiar with GNU Diff! Your changes were a pain in the behind to incorporate.
I changed it a bit, and the outcome is this:
http://svn.berlios.de/viewcvs/serendipi ... v&rev=1339
IMHO changing the default comment feed to include trackbacks is not so good. Trackbacks much more often contain spam, and IMHO it shouldn't trigger the RSS feed anytime. If people want to subscribe to that, they should IMHO do so explicitly? A patch to the syndication plugin should be made for this, I think.
Best regards and thanks for your work,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
I should - when I have the timeYou should really make yourself familiar with GNU Diff! Your changes were a pain in the behind to incorporate.
But, in what way is it possible to make comments to the change, when using diff?
Did it? OK, it is not my expirience, but if you say so ... yeah, these should not blown out in the world be RSS.IMHO changing the default comment feed to include trackbacks is not so good. Trackbacks much more often contain spam, and IMHO it shouldn't trigger the RSS feed anytime.
If I found the time ... I think there should be three possible feed-options, so the admin can show one, two or three feeds in the sidebar.If people want to subscribe to that, they should IMHO do so explicitly? A patch to the syndication plugin should be made for this, I think.
it was my pleasure!Best regards and thanks for your work,
Ciao, Stephan
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Now I take another look at your code, and there is something I would do in a slight different way.garvinhicking wrote:
I changed it a bit, and the outcome is this:
http://svn.berlios.de/viewcvs/serendipi ... v&rev=1339
Your Code:
Code: Select all
function serendipity_fetchComments($id, $limit = null, $order = '', $showAll = false, $type = 'NORMAL') {
if ($type == 'comments') {
$type = 'NORMAL';
} elseif ($type == 'trackbacks') {
$type = 'TRACKBACK';
} elseif ($type == 'comments_and_trackbacks') {
$type = '%';
}
If the calling function makes $type neither "comments", "trackback" nor "comments_and_trackbacks", then your if-construct will pass trough these wrong value!
I would prefer a) to take a different variable for the sql-statement and b) to make sure that only the three wanted values for the sql-statement can pass through:
Code: Select all
function serendipity_fetchComments($id, $limit = null, $order = '', $showAll = false, $commentType = 'comments') {
switch ($commentType) {
case 'comments_and_trackbacks':
$type = '%';
break;
case 'trackbacks':
$type = 'TRACKBACK';
break;
case 'comments':
default:
$type = 'NORMAL';
break;
}Code: Select all
if ($commentType == 'comments_and_trackbacks') {
$type = '%';
} elseif ($commentType == 'trackbacks') {
$type = 'TRACKBACK';
} else {
$type = 'NORMAL';
}
Ciao, Stephan
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
I understand your reasoning of the $type change, but I prefer to keep it in a BC way. I don't like changing function call parameters, so when adding new functionality, I would add that switch to the new input, and not change the old input/output...
IMHO in the end though, it boils down to the same SQL code: Users can put both "NORMAL" and "TRACKBACK" to the function, as well as "comments" and "trackbacks".
Thanks a lot,
Garvin
I understand your reasoning of the $type change, but I prefer to keep it in a BC way. I don't like changing function call parameters, so when adding new functionality, I would add that switch to the new input, and not change the old input/output...
IMHO in the end though, it boils down to the same SQL code: Users can put both "NORMAL" and "TRACKBACK" to the function, as well as "comments" and "trackbacks".
Thanks a lot,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/