Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Customization Of Forum_attach_block.tpl 
 
Hi everybody!

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.

 forum_attach_1

I know that the necessary code for the template is:

Code: [Download] [Hide] [Select]
{L_NEWS_SUMMARY}&nbsp;<a href="{articles.U_VIEWS}"><b>{articles.COUNT_VIEWS}</b>&nbsp;{L_NEWS_VIEWS}</a>&nbsp;{L_NEWS_AND}&nbsp;<a href="{articles.U_COMMENT}"><b>{articles.COUNT_COMMENTS}</b>&nbsp;{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
Code: [Download] [Hide] [Select]
<td align="left"><span class="gensmall">{articles_fp.POSTER_CG}&nbsp;[ {articles_fp.TIME} ]

REPLACE WITH

Code: [Download] [Hide] [Select]
<td align="left"><span class="gensmall">{articles_fp.POSTER_CG}&nbsp;[ {articles_fp.TIME} ] - {L_NEWS_SUMMARY}&nbsp;<a href="{articles.U_VIEWS}"><b>{articles.COUNT_VIEWS}</b>&nbsp;{L_NEWS_VIEWS}</a>&nbsp;{L_NEWS_AND}&nbsp;<a href="{articles.U_COMMENT}"><b>{articles.COUNT_COMMENTS}</b>&nbsp;{L_NEWS_COMMENTS}</a>.


OPEN

blocks/blocks_imp_forum_attach.php

FIND
Code: [Download] [Hide] [Select]
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],

AFTER ADD
Code: [Download] [Hide] [Select]
'L_NEWS_SUMMARY' => $lang['News_Summary'],
'L_NEWS_VIEWS' => $lang['News_Views'],
'L_NEWS_AND' => $lang['News_And'],
'L_NEWS_COMMENTS' => $lang['News_Comments'],


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)

Code: [Download] [Hide] [Select]
'U_COMMENTS' => append_sid(VIEWTOPIC_MG . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']),
'U_COMMENT' => append_sid(VIEWTOPIC_MG . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&amp;' . 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!
 



 
raphael10Send private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Customization Of Forum_attach_block.tpl 
 
Walking through IP php pages and trying to understand the code logic I have found the follow solution for my question!

Here all modifications that I have made:

OPEN

templates/(your_template)/blocks/forum_attach_block.tpl


FIND
Code: [Download] [Hide] [Select]
<td align="left"><span class="gensmall">&nbsp;{articles_fp.POSTER_CG}&nbsp;[ {articles_fp.TIME} ]</span>

REPLACE WITH

Code: [Download] [Hide] [Select]
<td align="left"><span class="gensmall">{articles_fp.POSTER_CG}&nbsp;[ {articles_fp.TIME} ] - {L_NEWS_SUMMARY}&nbsp;<a href="{articles_fp.U_VIEWS}"><b>{articles_fp.COUNT_VIEWS}</b>&nbsp;{L_NEWS_VIEWS}</a>&nbsp;{L_NEWS_AND}&nbsp;<a href="{articles_fp.U_COMMENTS}"><b>{articles_fp.REPLIES}</b>&nbsp;{L_NEWS_COMMENTS}</a>.</span>


OPEN

blocks/blocks_imp_forum_attach.php

FIND
Code: [Download] [Hide] [Select]
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],

AFTER, ADD
Code: [Download] [Hide] [Select]
'L_NEWS_SUMMARY' => $lang['News_Summary'],
'L_NEWS_VIEWS' => $lang['News_Views'],
'L_NEWS_AND' => $lang['News_And'],
'L_NEWS_COMMENTS' => $lang['News_Comments'],

FIND
Code: [Download] [Hide] [Select]
'REPLIES' => $fetchposts[$i]['topic_replies'],

AFTER, ADD
Code: [Download] [Hide] [Select]
                'COUNT_VIEWS' => $fetchposts[$i]['topic_views'],
                'U_COMMENTS' => append_sid(VIEWTOPIC_MG . '?' . POST_FORUM_URL . '=' . $fetchposts[$i]['forum_id'] . '&amp;' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']),
                'U_VIEWS' => append_sid('topic_view_users.' . $phpEx . '?' . POST_TOPIC_URL . '=' . $fetchposts[$i]['topic_id']),


OPEN

fetchposts.php

FIND
Code: [Download] [Hide] [Select]
t.topic_replies,

IN-LINE AFTER, ADD
Code: [Download] [Hide] [Select]
t.topic_views,

There are three occurrances and I have put the code after all of them (I don't know if it was strictly necessary)

FIND
Code: [Download] [Hide] [Select]
$posts[$i]['topic_replies'] = $row['topic_replies'];

AFTER, ADD
Code: [Download] [Hide] [Select]
$posts[$i]['topic_views'] = $row['topic_views'];

There are two occurrances.

---------------

After all those modifications... the template was functioning correctly!!!!        

 forum_attach_block_success
 



 
raphael10Send private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Customization Of Forum_attach_block.tpl 
 
Added to customization section... thanks for sharing.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron