plugin: Hide DirectPHP for RSS Feed |
| Written by kksou | ||
| Tuesday, 20 May 2008 | ||
|
This plugin hides DirectPHP commands in your RSS feed. If you have installed the DirectPHP plugin to run PHP commands, and you're also using the standard RSS feed generator that comes installed with Joomla 1.0 and 1.5, you will find that those PHP commands will appear in the RSS feed too! This is usually undesirable. This plugin will automatically hide all these PHP commands so that the RSS feed appear FREE of these PHP commands. Latest Version v1.02 (for Joomla 1.0) and v1.52 (for Joomla 1.5). Bug fix of a warning message of the variable DownloadJoomla 1.0.x: hide_DirectPHP_for_rss_feed_v1.02.zip
Joomla 1.5.x: hide_DirectPHP_for_rss_feed_v1.52.zip How to install (Joomla 1.0.x)
Note: If you've already installed the plugin "Hide DirectPHP for RSS Feed", "Hide include_content_item in RSS Feed" or "Hide jumi for RSS Feed" you can skip this step. The same trigger will trigger all these plugins. $database->setQuery( $query, 0, $info[ 'count' ] ); $rows = $database->loadObjectList(); global $_MAMBOTS; $_MAMBOTS->loadBotGroup( 'content' ); foreach ( $rows as $row ) { // title for particular item $item_title = htmlspecialchars( $row->title ); $item_title = html_entity_decode( $item_title ); // url link to article // & used instead of & as this is converted by feed creator $_Itemid = ''; $itemid = $mainframe->getItemid( $row->id ); if ($itemid) { $_Itemid = '&Itemid='. $itemid; } $item_link = 'index.php?option=com_content&task=view&id='. $row->id . $_Itemid; $item_link = sefRelToAbs( $item_link ); $results = $_MAMBOTS->trigger( 'onBeforeDisplayTitle', array( &$row, array(), 16) ); // removes all formating from the intro text for the description text $item_description = $row->introtext; $item_description = mosHTML::cleanText( $item_description ); $item_description = html_entity_decode( $item_description ); How to install (Joomla 1.5.x)
Note: If you've already installed the plugin "Hide DirectPHP for RSS Feed", "Hide include_content_item in RSS Feed" or "Hide jumi for RSS Feed" you can skip this step. The same trigger will trigger all these plugins.
if ($data->skipDays!="") {
$feed.= " <skipDays>".htmlspecialchars($data->skipDays,
ENT_COMPAT, 'UTF-8')."</skipDays>\n";
}
$dispatcher =& JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
for ($i=0; $i<count($data->items); $i++)
{
$results=$dispatcher->trigger('onBeforeDisplayTitle',
array(&$data->items[$i], array(), 16));
$feed.= " <item>\n";
$feed.= " <title>".
htmlspecialchars(strip_tags($data->items[$i]->title),
ENT_COMPAT, 'UTF-8')."</title>\n";
$feed.= " <link>".$url.$data->items[$i]->link."</link>\n";
$feed.= " <description><![CDATA[".
$this->_relToAbs($data->items[$i]->description)."]]></description>\n";
if ($data->items[$i]->author!="") {
$feed.= " <author>".htmlspecialchars(
$data->items[$i]->author, ENT_COMPAT, 'UTF-8')."</author>\n";
}
Version History
In version 1.0/1.5, the DirectPHP commands are still visible if you have a <p> (instead of <br />) after <?php. This version fixes this. |
||
| Last Updated ( Tuesday, 20 May 2008 ) | ||
| < Prev | Next > |
|---|




