很多站长希望在DIY的时候调用主题标签TAG,Discuz!默认是不支持调用TAG的,本文介绍如何修改DIY源码实现我们所需要的功能:修改文件:source/class/block/forum/block_thread.php搜索todayposts = arr
很多站长希望在DIY的时候调用主题标签TAG,Discuz!默认是不支持调用TAG的,本文介绍如何修改DIY源码实现我们所需要的功能:
修改文件:source/class/block/forum/block_thread.php
搜索
[php] view plain copy
- 'todayposts' => array('name' => lang('blockclass', 'blockclass_thread_field_todayposts'), 'formtype' => 'text', 'datatype' => 'int'),
[php] view plain copy
- 'keywords' => array('name' => "主题标签", 'formtype' => 'text', 'datatype' => 'string'),
[php] view plain copy
- if($style['getsummary']) {
- $threadtids[$data['posttableid']][] = $data['tid'];
- }
[php] view plain copy
- $TAGs = DB::result_first("select tags from ".DB::table("forum_post")." where first=1 and tid=".$data['tid']);
- $tags = explode("\t",$tags);
- $keywords = '';
- foreach($tags as $tag){
- $array = explode(",",$tag);
- if($array[1])
- $keywords .= '<a title="'.$array[1].'" href="misc.php?mod=tag&id='.$array[0].'" target="_blank">'.$array[1].'</a>,';
- }
- $keywords = substr($keywords,0,-1);
[php] view plain copy
- $tags = DB::result_first("select tags from ".DB::table("forum_post")." where first=1 and tid=".$data['tid']);
- $tags = explode("\t",$tags);
- $keywords = '';
- foreach($tags as $tag){
- $array = explode(",",$tag);
- if($array[1])
- $keywords .= $array[1].',';
- }
- $keywords = substr($keywords,0,-1);
- 'fields' => array(
[php] view plain copy
- 'keywords' => $keywords,
注:相关教程知识阅读请移步到Discuz教程频道。
转载请说明出处
知优网 » Discuz!论坛教程之DIY调用主题标签TAG修改方法
知优网 » Discuz!论坛教程之DIY调用主题标签TAG修改方法