I just have made an update from 1.42 to 1.44. I can confirm your problem. The reason for this behaviour is that the news module is caching RSS files.
Take a look at the function in backendt.php:
...
header ('Content-Type:text/xml; charset=utf-8');
$story = new NewsStory();
$tpl = new XoopsTpl();
$tpl->xoops_setCaching(2);
$tpl->xoops_setCacheTime(3600);
if (!$tpl->is_cached('db:system_rss.html')) {
$xt = new NewsTopicT($topicid);
...
}
$tpl->display('db:system_rss.html');
If you set caching for this template on the if clause won't be called and you always get the last result of the category which has been cached. This cached file is:
--> %%0B^0B9^0B9E10B9%%db%3Asystem_rss.html
One possibility to solve this problem is to disable caching. But usually it is better to make an individual rss file for every category. It seems that the template engine only generates one file. The file above. This is insufficient for caching.
I'm not a php coder but the php syntax is very similar to C/C++. So it isn't really difficult to solve this problem. The Smarty template engine supports CacheID's. It is the second parameter. So we only have to give the name of the actual category as the cache id.
Replace the last code in backendt.php through this one:
header ('Content-Type:text/xml; charset=utf-8');
$story = new NewsStory();
$tpl = new XoopsTpl();
$tpl->xoops_setCaching(2);
$tpl->xoops_setCacheTime(3600);
$xt = new NewsTopic($topicid);
if (!$tpl->is_cached('db:system_rss.html', htmlspecialchars($xt->topic_title(), ENT_QUOTES) )) {
$sarray = $story->getAllPublished($newsnumber, 0, $restricted, $topicid);
if (is_array($sarray) && count($sarray)>0) {
$sitename = htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES);
$slogan = htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES);
$tpl->assign('channel_title', xoops_utf8_encode($sitename));
$tpl->assign('channel_link', XOOPS_URL.'/');
$tpl->assign('channel_desc', xoops_utf8_encode($slogan));
$tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
$tpl->assign('channel_webmaster', checkEmail($xoopsConfig['adminmail'],true)); // Fed up with spam
$tpl->assign('channel_editor', checkEmail($xoopsConfig['adminmail'],true)); // Fed up with spam
$tpl->assign('channel_category', htmlspecialchars($xt->topic_title(), ENT_QUOTES));
$tpl->assign('channel_generator', 'XOOPS');
$tpl->assign('channel_language', _LANGCODE);
$tpl->assign('image_url', XOOPS_URL.'/images/logo.gif');
$dimention = getimagesize(XOOPS_ROOT_PATH.'/images/logo.gif');
if (empty($dimention[0])) {
$width = 88;
} else {
$width = ($dimention[0] > 144) ? 144 : $dimention[0];
}
if (empty($dimention[1])) {
$height = 31;
} else {
$height = ($dimention[1] > 400) ? 400 : $dimention[1];
}
$tpl->assign('image_width', $width);
$tpl->assign('image_height', $height);
$count = $sarray;
foreach ($sarray as $story) {
$storytitle = htmlspecialchars($story->title(), ENT_QUOTES);
$description = htmlspecialchars($story->hometext(), ENT_QUOTES);
$tpl->append('items', array('title' => xoops_utf8_encode($storytitle), 'link' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'guid' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode($description)));
}
}
$tpl->display('db:system_rss.html', htmlspecialchars($xt->topic_title(), ENT_QUOTES));
}
else
$tpl->display('db:system_rss.html', htmlspecialchars($xt->topic_title(), ENT_QUOTES));
?>
This solves the bug in the news module.
cu