The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Plugins How to detect that I'm producing content for the RSS output?

Creating and modifying plugins.
User avatar
blog.brockha.us
Regular
 
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany

Postby blog.brockha.us » Tue Dec 20, 2011 1:33 pm

A plugin of mine changes the article content using the "frontend_display" hook.
I would like to produce some other output, if the content is produced for any RSS. Is there a simple way to detect it?

Do I have to check the GET for having "rss.php"? That would be uncool, if some blog changed this name for any reason. Is there a better way (by checking some field in the eventData i.e.)?

Thanks.
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/

User avatar
onli
Regular
 
Posts: 1402
Joined: Tue Sep 09, 2008 10:04 pm

Postby onli » Tue Dec 20, 2011 4:38 pm

Hopefully there is a eventdata way.

Have a look at the freetag and the findmore-plugin. Those plugins use frontend_display:html;per_entry and frontend_display:rss-*. You could use those events.

User avatar
garvinhicking
Core Developer
 
Posts: 29497
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Wed Dec 21, 2011 10:28 am

Hi!

Also, you could check the $addData variable in the eventhook, in most cases this has a "from" signature; I'm not sure if that is vor RSS feeds.

also you can check on $serendipity['view'] that should point to an RSS feed source...

HTH,
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/

User avatar
blog.brockha.us
Regular
 
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany

Postby blog.brockha.us » Fri Dec 23, 2011 12:38 pm

Thanks to both of you! I'll check this out. :)
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/



Return to Plugins

Who is online

Users browsing this forum: No registered users and 3 guests