4
OK, another try. I modified the code a little:
function b_ams_topicsnav_show($options) {
include_once XOOPS_ROOT_PATH."/modules/AMS/class/class.newstopic.php";
include_once XOOPS_ROOT_PATH."/modules/AMS/class/class.newsstory.php";
global $xoopsDB, $xoopsUser;
$block = array();
$article_counts = [u]AmsStory::countPublishedByTopic()[/u];
$topics = AmsTopic::getAllTopics($options[0]);
$count = 1;
foreach ($topics as $topic) {
$block['topics'][] = array('id' => $topic->topic_id, 'title' => $topic->topic_title(), 'count' => $count, 'articlecount' => $article_counts[$topicid]);
$count++;
}
return $block;
}
and now it shows allways a
2 (two), but there are definitly more articles in the topics. How must i change the code so that it shows the right count of articles by topic?
migoe