<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dwight Jack Diary &#187; com_content</title>
	<atom:link href="http://www.dwightjack.com/diary/tag/com_content/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dwightjack.com/diary</link>
	<description>Diary of music, design and code</description>
	<lastBuildDate>Tue, 13 Jul 2010 20:46:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Joomla 1.5: Filter mambots and plugins&#8217; codes in PDF and print view</title>
		<link>http://www.dwightjack.com/diary/2009/05/19/joomla-filter-mambots-and-plugins-codes-in-pdf-print-view/</link>
		<comments>http://www.dwightjack.com/diary/2009/05/19/joomla-filter-mambots-and-plugins-codes-in-pdf-print-view/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:28:36 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[com_content]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[joomla plugin]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=156</guid>
		<description><![CDATA[Here is an effective and hack-free way to remove mambots and plugins' codes from your content in PDF and print view.]]></description>
			<content:encoded><![CDATA[<p>One of the coolest feature in Joomla content editor is the ability to insert specific modules&#8217; position whereaver you want. This is particularly usefull to load  inline banners or to add quick polls to an article/page just by inserting <code>{loadposition mypostion}</code> in your editor textarea.</p>
<p>In Joomla 1.5.x everything works fine when viewing the page as HTML, but in <strong>PDF and print friendly format</strong> view these shortcodes aren&#8217;t converted nor removed. Moreover displaying these contents could be unnecessary or unwanted.</p>
<p>This problem arise because in pdf and print view files in Joomla <code>com_content</code> component not all content plugins (those addons called <em>mambots</em>) are loaded. In PDF view file <code>components/com_content/views/article/view.pdf.php</code> there&#8217;s just one plugin (called <em>image</em>) loaded before the content is outputted (lines 68 -69):</p>
<pre><code>JPluginHelper::importPlugin('content', 'image');
$dispatcher-&gt;trigger('onPrepareContent', array (&amp; $article, &amp; $params, 0));</code></pre>
<h3>The (dirty) solution</h3>
<p>From a quick glance in the <code>plugins/content</code> folder i&#8217;ve noticed that there&#8217;s no any <code>image.php</code> plugin  file in a clean Joomla 1.5.10 installation. So i&#8217;ve decided to use this <em>hole</em> and create a custom plugin to clean my content without messing up the core <code>com_content</code> code.</p>
<p>After installing the plugin and activating it you are given (at the moment) two options:</p>
<ul>
<li> a radio to clean loadposition code (defaults to <code>Yes</code>)</li>
<li>a textarea for typing custom regular expressions (one per line).</li>
</ul>
<p>In this last field remember to omit backslashes (/) instead write curly brackets, for example <code>{code\s*[a-zA-Z]}</code></p>
<p>Here is the package for download: <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=8>plg_image (clean plugins code) (1.79 kB)</a></p>
<p>As always feedbacks and suggestions are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/05/19/joomla-filter-mambots-and-plugins-codes-in-pdf-print-view/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
