plugin: Hide include_content_item in RSS Feed
Written by kksou   
Tuesday, 20 May 2008

This plugin hides {include_content_item} tags in your RSS feed.

If you have installed the {include_content_item} plugin, 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 {include_content_item} tags will appear in the RSS feed too! This is usually undesirable.

This plugin will automatically hide all these {include_content_item} tags so that the RSS feed is FREE of these {include_content_item} tags.


Latest Version

v1.0.2 (for Joomla 1.0) and v1.5.2 (for Joomla 1.5)
Released December 9, 2008

  • fixed the warning message "Undefined variable: flag"
  • added hiding for the tags include_content_item, include_intro, and include_fulltext

Download


How to install (Joomla 1.0.x)

  1. Download the plugin and unzip it into a folder.
  2. From the Installers menu, select mambots. In the field "Install directory", enter the folder location (where you unzipped the file) and click Install.
  3. From the Mambots menu, select Site Mambots.
  4. Make sure the plugin "Hide include_content_item in RSS Feed" is published. If you see a cross in the Published column, just click on it. It will turn into a green tick.
  5. To use this plugin, you need to add a trigger to the RSS feed generator. In the original Joomla installation, there is no trigger during the generation of RSS feed. When there is no trigger, none of the plugin gets called. In order for Joomla to call the new plugin that we have just installed to hide the DirectPHP commands, we need to add a trigger.
  6. 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.

    1. Go to the folder <Joomla root folder>/components/com_rss, you will see a file called rss.php.
    2. Open this file rss.php in your favorite editor.
    3. Go to around Line 250, and add the three lines highlighted in yellow as follows:
    4. $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 );
      
    5. Save and close this file.

  7. For 1.0.x, there's one more "bug" that we need to fix. The bug will prevent the RSS feed generator from generating the rss file properly when triggering the plugins. Go to the folder <Joomla root folder>/mambots/content. You will see a file called mossef.php. Open this file in your favorite editor. Scroll all the way to the last line. You will find that there an additional tab character after ?>. The tab character is invisible. But if you move the cursor, you will know that it's a tab. Just delete that tab character and save it.
  8. That's it! But before we generate the rss file, let us erase any previous cached version of the rss file. Go to the folder <Joomla root folder>/cache. Delete all the rss*.xml files there.
  9. Try generate a fresh copy of your RSS feed. It should now be clean of any {include_content_item} tags!

How to install (Joomla 1.5.x)

  1. Download the plugin and unzip it into a folder.
  2. From the Extensions menu, select Install/Uninstall. In the field "Install directory", enter the folder location (where you unzipped the file) and click Install.
  3. From the Extensions menu, select Plugin Manager.
  4. Enable the plugin "Hide include_content_item in RSS Feed" - make sure there is a green tick in the Enabled column.
  5. To use this plugin, you need to add a trigger to the RSS feed generator. In the original Joomla installation, there is no trigger during the generation of RSS feed. When there is no trigger, none of the plugin gets called. In order for Joomla to call the new plugin that we have just installed to hide the DirectPHP commands, we need to add a trigger.
  6. 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.

    1. Go to the folder <Joomla root folder>/libraries/joomla/document/feed/renderer, you will see a file called rss.php.
    2. Open this file rss.php in your favorite editor.
    3. Go to around Line 110, and add the three lines highlighted in yellow as shown below:
    4. 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";
      	}
      

    5. Save and close this file.

  7. That's it! But before we generate the rss file, let us erase any previous cached version of the rss file. Go to the folder <Joomla root folder>/cache. Delete the file rss_com_content.xml.
  8. Try generate a fresh copy of your RSS feed. It should now be clean of any {include_content_item} tags!

 

Comments  

 
# quoleAburbbub 2013-01-06 01:14
great site www.kksou.com. Offtopic: Do you like the new film in the series of "The Lord of the Rings" - "The Hobbit"?"
making your own herbal tea levitra bestellen atlanta cancer care
 
 
# quoleAburbbub 2013-01-06 23:14
great site www.kksou.com. Offtopic: Do you like the new film in the series of "The Lord of the Rings" - "The Hobbit"?"
pharmacy technician jobs in wichita ks levitra 10mg schmelztablette n anal sexual pictures
 
 
# dokumaxx 2013-05-30 11:16
Is there a Version of Hide include_content _item in RSS Feed for Joomla 2.5?
 
< Prev   Next >

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2015. kksou.com. All Rights Reserved