原来只能调用普通标题 - 标题-作者- 时间
很多朋友 希望 【主题分类】【板块名称】-标题-作者-时间 的调用方式
这里给出解决办法
第一步:修改source\class\block\block_thread。php
找到
- while($data = DB::fetch($query)) {
- $_G['thread'][$data['tid']] = $data;
- if($style['getpic'] && $data['attachment']=='2') {
- $pic = $this->getpic($data['tid']);
- $data['attachment'] = $pic['attachment'];
- $data['remote'] = $pic['remote'];
- }
复制代码替换为
- while($data = DB::fetch($query)) {
- $_G['thread'][$data['tid']] = $data;
- if($style['getpic'] && $data['attachment']=='2') {
- $pic = $this->getpic($data['tid']);
- $data['attachment'] = $pic['attachment'];
- $data['remote'] = $pic['remote'];
- }
- $bankuaii = "SELECT name FROM ".DB::table('forum_forum')." WHERE fid='$data[fid]' ";
- $bkname = mysql_query($bankuaii);
- $rows=mysql_fetch_assoc($bkname);
-
- $zhutii = "SELECT name FROM ".DB::table('forum_threadclass')." WHERE typeid='$data[typeid]' ";
- $ztname = mysql_query($zhutii);
- $rowss=mysql_fetch_assoc($ztname);
复制代码找到
- $list[] = array(
-
- 'id' => $data['tid'],
- 'idtype' => 'tid',
- 'title' => cutstr(str_replace('\\\'', ''', addslashes($data['subject'])), $titlelength),
- 'url' => 'forum.php?mod=viewthread&tid='.$data['tid'].($viewmod ? '&from=portal' : ''),
- 'pic' => $data['attachment'] ? 'forum/'.$data['attachment'] : STATICURL.'image/common/nophoto.gif',
- 'picflag' => $data['attachment'] ? ($data['remote'] ? '2' : '1') : '0',
- 'summary' => $style['getsummary'] ? $this->getthread($data['tid'], $summarylength) : '',
- 'fields' => array(
复制代码替换为
- $list[] = array(
-
- 'id' => $data['tid'],
- 'idtype' => 'tid',
- 'title' => cutstr(str_replace('\\\'', ''', addslashes($data['subject'])), $titlelength),
- 'url' => 'forum.php?mod=viewthread&tid='.$data['tid'].($viewmod ? '&from=portal' : ''),
- 'pic' => $data['attachment'] ? 'forum/'.$data['attachment'] : STATICURL.'image/common/nophoto.gif',
- 'picflag' => $data['attachment'] ? ($data['remote'] ? '2' : '1') : '0',
- 'summary' => $style['getsummary'] ? $this->getthread($data['tid'], $summarylength) : '',
- 'fields' => array(
- 'zhuti' => $rowss['name'],
-
- 'bankuai' => $rows['name'],
复制代码第二步:修改source\include\portal\portal_blockclass.php
找到
- $blockclass = array(
- 'forum' => array(
- 'name' => lang('blockclass', 'blockclass_forum'),
- 'subs' => array(
- 'forum_thread' => array(
- 'name' => lang('blockclass', 'blockclass_forum_thread'),
- 'fields' => array(
复制代码替换为
- $blockclass = array(
- 'forum' => array(
- 'name' => lang('blockclass', 'blockclass_forum'),
- 'subs' => array(
- 'forum_thread' => array(
- 'name' => lang('blockclass', 'blockclass_forum_thread'),
- 'fields' => array(
- 'zhuti' => array('name' => lang('blockclass', 'blockclass_thread_field_zhuti'),'formtype' => 'text', 'datatype' => 'string'),
- 'bankuai' => array('name' => lang('blockclass', 'blockclass_thread_field_bankuai'),'formtype' => 'text', 'datatype' => 'string'),
复制代码第三步:修改source\language\lang_blockclass.php
找到
- 'blockclass_forum_thread' => '帖子类',
复制代码在下面添加
- 'blockclass_thread_field_zhuti' => '主题分类',
- 'blockclass_thread_field_bankuai' => '板块名称',
复制代码第四布:登录后台 门户 模块样式 添加样式 选择帖子类
就看到 2个新的标签了 一个是 主题分类{zhuti} 一个是 板块名称{bankuai}
第五步:前台调用的时候 选择样式 为你新建的样式 就看到效果了
刚研究X 欢迎批评指证 近期将做 不同板块不同自定义风格 。。。。。。
官方不做这些 只能自己动手了 这些东西 原来DZ版本都有的 现在X 都没有了 不知道 为什么。。。。。。。。