4683 Posts in 1048 Topics by 664 members
Jump to:If this is your first visit, you will need to register before you can post. However, you can browse all messages below.
| Page: 1 , 2 | go to end | Reply | |
| Author | Topic: Blog Comment RSS feeds | 2568 views |

28 April 2008 at 7:40pm
Hey,
Im wanting to know when I get comments on my blog, and as there isnt any kind of email notification when you get comments I was wanting to have a RSS feed for all my blog comments.
How do i hack my code to do this?
THANKS
~Joel
Last edited: 28 April 2008 at 7:57pm

28 April 2008 at 8:07pm
we have been discussing the idea of email notification - theres a ticket on open about it assigned to me. I think and so do a few others that email is to invasive and so an RSS is the way to go. I have written up a little method that seems to work for me :D
Check it out at http://pastie.caboo.se/187947. Pretty simple function, just select the comments as dataobjects and output to an RSS feed!
I have that in the Page_Controller class and to view / subscribe its available at yoursite.com/home/commentrss.
If you have any improvements on it that would be great to hear!
EDIT: this is actually built-into silverstripes page comment class. I should have looked more throughly - Visit yoursite.com/PageComment/rss to see the latest comments. No need for custom code
Last edited: 28 April 2008 at 8:59pm

28 April 2008 at 8:17pm
Hey Willr
That would be great if this feature was built in!
Could you please be a bit more specific on the instructions? Where do i paste the code from pastie etc?
Thanks

28 April 2008 at 8:21pm
just playing round but it might be nice for users to be able to subscribe as well I guess. If you want to add a little RSS icon in the browser window add this code to your Page_Controller -> init() function
RSSFeed::linkToFeed($this->Link() . "commentrss", "Latest Comments");
That will create a link in the <head> section to the commentrss feed and a nice little icon in the browser!

28 April 2008 at 8:22pm
Sorry paste that code in your Page.php file -> in the Page_Controller class.

28 April 2008 at 8:31pm
PERFECT! your a legend!
Thanks for the help! SO quick too :)

28 April 2008 at 8:55pm
Oh no... when I go to my site it now says:
Fatal error: Cannot redeclare class RSSWidget in /home/.nevil/FOLDERNAME/MYSITE.net.nz/FOLDERNAME/blog/code/RSSWidget.php on line 44
?????? Whats up ??????
| 2568 views | |||
| go to top | Reply Next > |