The relevant code from modules/News/News.module.php:
Code: Select all
function ContentPostRender(&$content)
{
if ($this->GetPreference('showautodiscovery', 'yes') == 'yes')
{
#if (eregi('\{cms_module module=[\"\']?news[\"\']?', $content))
if (strpos($content, '<!-- Displaying News Module -->') !== FALSE)
{
global $gCms;
$config =& $gCms->GetConfig();
$matches = array();
$categories = '';
if (preg_match("/<!-- News Categories: '(.*?)' -->/", $content, $matches))
$categories = $matches[1];
$params = array("showtemplate"=>"false");
$url = '';
if ($this->GetPreference('autodiscoverylink', '') == '')
{
if (($config['assume_mod_rewrite'] == true || $config['internal_pretty_urls'] == true) && $config['use_hierarchy'] == true)
{
if ($config['assume_mod_rewrite'] == true)
$url = $config['root_url'].'/News/rss/'.rawurlencode($categories);
else
$url = $config['root_url'].'/index.php/News/rss/'.rawurlencode($categories);
}
else
$url = $config['root_url'].'/index.php?mact=News,cntnt01,rss&cntnt01showtemplate=false&cntnt01category='.rawurlencode($categories).'&cntnt01number=20&cntnt01returnid='.$gCms->variables['content_id'];
}
else
{
$url = $this->GetPreference('autodiscoverylink', '');
}
$text = '<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="'.$url.'" />';
if (function_exists('str_ireplace'))
{
$content = str_ireplace('</head>', $text.'</head>', $content);
}
else
{
$content = eregi_replace('<\/head>', $text.'</head>', $content);
}
}
}
}
Elijah