diff --git a/core/components/discuss/hooks/board/getlist.php b/core/components/discuss/hooks/board/getlist.php index 80b48131..6d9286bb 100644 --- a/core/components/discuss/hooks/board/getlist.php +++ b/core/components/discuss/hooks/board/getlist.php @@ -134,11 +134,27 @@ $ph = array(); $sbl = array(); foreach ($subBoards as $subboard) { - $sb = explode(':',$subboard); - $ph['id'] = $sb[0]; - $ph['title'] = $sb[1]; + $sb = explode(':',$subboard); + $c = array( + 'id' => $sb[0]; + ); + $sb = NULL; + $sbo = NULL; - $sbl[] = $discuss->getChunk($subBoardTpl,$ph); + $ck = 'discuss/board/index/'.md5(serialize($c)); + $sb = $modx->cacheManager->get($ck); + if($sb === NULL) { + /* @var disBoard $board */ + $sbo = $modx->getObject('disBoard', $c); + if($sbo !== NULL) { + $sbo->calcLastPostPage(); + $sbo->getLastPostUrl(); + $sb = $sbo->toArray('', true, true); + $modx->cacheManager->set($ck,$sb,$modx->getOption('discuss.cache_time',null,0)); + } + } + + $sbl[] = $discuss->getChunk($subBoardTpl,$sb); } $board['subforums'] = implode($subBoardSeparator,$sbl); } diff --git a/core/components/discuss/themes/default/chunks/board/dissubforumlink.chunk.tpl b/core/components/discuss/themes/default/chunks/board/dissubforumlink.chunk.tpl index c480ebc1..1282118b 100644 --- a/core/components/discuss/themes/default/chunks/board/dissubforumlink.chunk.tpl +++ b/core/components/discuss/themes/default/chunks/board/dissubforumlink.chunk.tpl @@ -1 +1 @@ -[[+title]] \ No newline at end of file +[[+name]] \ No newline at end of file