I'd like to customize forum_attach_block.tpl in order to visualize in the bottom of forum_attach windows: "this news item has X Views and X comments" like in news_block.tpl.
I know that the necessary code for the template is:
{L_NEWS_SUMMARY} <a href="{articles.U_VIEWS}"><b>{articles.COUNT_VIEWS}</b> {L_NEWS_VIEWS}</a> {L_NEWS_AND} <a href="{articles.U_COMMENT}"><b>{articles.COUNT_COMMENTS}</b> {L_NEWS_COMMENTS}</a>
The problem for me is: how to modify php files in order to utilize that code?
For the moment I have done this modification:
OPEN
templates/(your_template)/blocks/forum_attach_block.tpl
FIND
REPLACE WITH
OPEN
blocks/blocks_imp_forum_attach.php
FIND
AFTER ADD
templates/(your_template)/blocks/forum_attach_block.tpl
FIND
<td align="left"><span class="gensmall">{articles_fp.POSTER_CG} [ {articles_fp.TIME} ]
REPLACE WITH
<td align="left"><span class="gensmall">{articles_fp.POSTER_CG} [ {articles_fp.TIME} ] - {L_NEWS_SUMMARY} <a href="{articles.U_VIEWS}"><b>{articles.COUNT_VIEWS}</b> {L_NEWS_VIEWS}</a> {L_NEWS_AND} <a href="{articles.U_COMMENT}"><b>{articles.COUNT_COMMENTS}</b> {L_NEWS_COMMENTS}</a>.
OPEN
blocks/blocks_imp_forum_attach.php
FIND
AFTER ADD
With the last modification now I can visualize "this news item has Views and comments" but my poor php knowledge is not enough to find the way to visualize the number of views and comments.
I have tried to apply in blocks_imp_forum_attach.php new code lines like (extracted and adapted from includes/news.php)
'U_COMMENTS' => append_sid(VIEWTOPIC_MG . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']),
'U_COMMENT' => append_sid(VIEWTOPIC_MG . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']),
'U_VIEWS' => append_sid('topic_view_users.' . phpEx . '?' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']),
'U_COMMENT' => append_sid(VIEWTOPIC_MG . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']),
'U_VIEWS' => append_sid('topic_view_users.' . phpEx . '?' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']),
But I don't have a valid result...
Can anyone help me? Thanks!