程序目录source\module\forum\forum_viewthread.php
搜索$post['relateitem']改为- if($post['tags']) {
- $post['relateitem'] = getrelateitem($post['tags'], $post['tid'], $_G['setting']['relatenum'], $_G['setting']['relatetime']);
- foreach($post['relateitem'] as $k=>$img)
- {
- $threada= C::t('forum_attachment')->fetch_all_by_id('tid', $img['tid'], 'aid');
- $threadaid = reset($threada);
- $threadpic = C::t('forum_attachment_n')->fetch_by_aid_uid($threadaid['tableid'], $threadaid['aid'], $thread['authorid']);
- $thread['pic'] = $threadpic['attachment'];
- $post['relateitem'][$k]['img'] = 'data/attachment/forum/'.$thread['pic'];
- }
- }
复制代码 模板目录\template\default 或 当前使用模板\forum\viewthread_node.htm- <!--{if $post['relateitem']}-->
- <div class="mtw mbw">
- <h3 class="pbm mbm bbda">{lang related_thread}</h3>
- <ul class="xl xl2 cl">
- <!--{loop $post['relateitem'] $var}-->
- <li>• <a href="forum.php?mod=viewthread&tid=$var[tid]" title="$var[subject]" target="_blank">
- <img src="$var[img]" height="252" width="175" alt="$var[subject]" >$var[subject]</a>
- </li>
- <!--{/loop}-->
- </ul>
- </div>
- <!--{/if}-->
复制代码 调用标签 $var[img] |