Page 1 of 1

Re: Feed Auto-Discovery URL: WHAT IS? (repost)

Posted: Wed Dec 20, 2006 6:09 am
by Elijah Lofgren
I've never used it myself but looking at the code it looks like it lets you choose a different URL to use for the XML web feed.

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);
				}
			}
		}
	}
Hope this helps,

Elijah

Re: Feed Auto-Discovery URL: WHAT IS? (repost)

Posted: Mon Jul 02, 2007 5:57 pm
by skylark
Hi, I have the same question as the original poster...I have version 1.06 cms.

How is the XML or rss feed being generated, and where does it reside?

I checked the box for Feed Auto-Discovery URL, but when I go to a feed reader and ask it to find my rss feed, it says it can't find it. I have news items up...as you can see:

my url in development is: tobegroup.ca/tobe/cms

Thanks