Hi again Rames,
This one eluded me for a while too--Upon further inspection, it seemed to me that putting in the code from templates/rt/suppFiles.tpl (i.e. all the code in between the foreach tags) into templates/issue/issue.tpl should work (without having to modify issueHandler.inc.php). As you probably also found, it doesn't--Until you change lines 75 and 201 in issueHandler.inc.php from
- Code: Select all
$publishedArticles = &$publishedArticleDao->getPublishedArticlesInSections($issue->getIssueId(), true);
to
- Code: Select all
$publishedArticles = &$publishedArticleDao->getPublishedArticlesInSections($issue->getIssueId());
There may be a good reason why the getPublishedArticlesInSections() function fetches the 'simple' section object, but I suspect its just to save memory and you're safe making the mod.
As for the comments, unfortunately I think you'll still have to hack away at issueHandler.inc.php, since theres no way to just get an article's comments from the article object. One way to approach this is to make an array of arrays in IssueHandler, containing an article's ID and the count of how many comments it has, pass it to the template, then search the array from the template. Here's an example--I'm not sure how well it will work, and also it will only get the number of root comments (not any comments on comments).
- Code: Select all
$commentDao = &DAORegistry::getDAO('CommentDAO');
$articleInfo = array();
$publishedArticlesTemp = &$publishedArticleDao->getPublishedArticles($issue->getIssueId(), null, true);
foreach ($publishedArticlesTemp as $publishedArticle) {
$commentSize = sizeof($commentDao->getRootCommentsByArticleId($publishedArticle->getArticleId()));
array_push($articleInfo, array($publishedArticle->getArticleId(), $commentSize));
}
$templateMgr->assign_by_ref('articleInfo', $articleInfo);
You'll have to put it in both the setupIssueTemplate() and current() functions in IssueHandler. I'll leave you implement it in issue.tpl

Hope that helps,
Matt