my fixes for the News modul rss functionality.

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
bladenet

my fixes for the News modul rss functionality.

Post by bladenet »

In case you use clean urls and the autodiscoverylink function doesn't work for you:

in News.module.php in function ContentPostRender

change from:

Code: Select all

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);
}
to this:

Code: Select all

if (($config['assume_mod_rewrite'] == true || $config['internal_pretty_urls'] == true) && $config['use_hierarchy'] == true)
{
	if ($config['assume_mod_rewrite'] == true && $config['page_extension'] != null)
			$url = $config['root_url'].'/News/rss/'.rawurlencode($categories).$config['page_extension'];
	else
			$url = $config['root_url'].'/index.php/News/rss/'.rawurlencode($categories);
}
Tested on:
CMS Made Simple 1.0.5 "Molokai"
News module 2.2

with config.php options:

Code: Select all

$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.htm';
$config['internal_pretty_urls'] = false; // works with $config['internal_pretty_urls'] = true; too
$config['use_hierarchy'] = true;
Write here if you find bug or it doesn't work in some situations.
Cheers.
bladenet

add category dependent rss button.

Post by bladenet »

If you need your {news category="Hardware" makerssbutton="true"} to produce a category dependent rss link:

in action.default.php of the news module:
change the appropriate code to: //sorry i don't have the original, i modified it heavely

Code: Select all

if (isset($params["makerssbutton"]))
{
	$params["showtemplate"] = "false";
	if (isset($params["category"]) && $params["category"] != '')
	{
	echo $this->CreateLink($id, 'rss', $returnid, "rss syndication", $params,'',false,false,'',true,'news/rss/'.$params["category"]);
	return;	
	}
	else
	{
	echo $this->CreateLink($id, 'rss', $returnid, "<img border=\"0\" src=\"images/cms/xml_rss.gif\" alt=\"RSS Newsfeed\" />", $params,'',false,false,'',true,'news/rss');
	return;
	}
}
As seen, you can change the image or make it display text indeed. It can be extended with the $lang() too.
Cheers. CMSMS is the best.
Post Reply

Return to “Tips and Tricks”