discuz

推荐列表 站点导航

当前位置:首页 > 建站教程 > discuz >

Discuz!论坛教程之DIY调用主题标签TAG修改方法

来源:网络整理  作者:网络  发布时间:2020-12-08 09:47
很多站长希望在DIY的时候调用主题标签TAG,Discuz!默认是不支持调用TAG的,本文介绍如何修改DIY源码实现我们所需要的...

  很多站长希望在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);    再搜索 [php] view plain copy  'fields' => array(    在下方添加    [php] view plain copy  'keywords' => $keywords,    后台,工具,更新DIY模块缓存,然后正常使用帖子模块即可发现可以使用{keywords}调用主题标签了

相关热词: 标签 调用 discuz 教程 方法

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://www.juheyunku.com/jz/discuz/1376.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

Discuz!论坛教程之DIY调用主题标签TAG修改方法

2020-12-08 编辑:网络

  很多站长希望在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);    再搜索 [php] view plain copy  'fields' => array(    在下方添加    [php] view plain copy  'keywords' => $keywords,    后台,工具,更新DIY模块缓存,然后正常使用帖子模块即可发现可以使用{keywords}调用主题标签了

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://www.juheyunku.com/jz/discuz/1376.shtml

相关文章

风云图片

推荐阅读

返回discuz频道首页