Textpattern Plugin : ajw_nofeed

13 December 2005 @ early morning | Comments (2)

Plugin Details

Download:
ajw_nofeed
Version:
0.1
Forum:
Read discussion
Status on this site:
Active

Please use forum for all bug reports and questions

Summary

This plugin will allow you to hide certain problematic body or excerpt content from being output in your RSS and Atom feeds. For instance, if for some reason your article has inline JavaScript the feed will likely break certain feedreaders.

There are likely only a few instances in which someone would need to use this plugin, but if it came in handy for me then there’s likely someone else out there who will find it useful as well.

Usage

Very simple, really. Download, install & activate the plugin. Next, enclose the offending chunk of content with the <txp:ajw_nofeed></txp:ajw_nofeed> plugin tags. The misbehaving content or markup will be parsed on your live site, but kept from invalidating or breaking your feeds.


2 comments

1

It doesn’t seems to work in TextPattern 4.0.5 :(

Henrik Gemal → gemal.dk/
2

Changing the source to this seems to work:

function ajw_nofeed($atts, $thing)
{
	global $permlink_mode;
	$feed = false;
	if ($permlink_mode == "messy") {
		if (gps('rss') || gps('atom'))
			$feed = true;
	} else {
		$req = serverSet('REQUEST_URI');
		extract(chopUrl($req));
		if ($u1 == 'rss' || $u1 == 'atom')
			$feed = true;
	}
	return ($feed ? '' : parse($thing));
}
Henrik Gemal → gemal.dk/

Comments are closed for this article.

Previously