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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am
Location: Deatsville, AL

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

Post 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
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
skylark
New Member
New Member
Posts: 8
Joined: Sun Dec 31, 2006 11:03 pm

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

Post 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
Post Reply

Return to “CMSMS Core”