Quantcast
Channel: 郭黑黑念碎碎 » dedecms专题
Viewing all articles
Browse latest Browse all 2

dedecms专题的bug:DEDECMS自定义专题节点容器模板的修改

$
0
0

DEDECMS的专题功能有一个问题,就是自定义的节点容器模板不起作用,而且新增专题的时候会显示节点容器模板,但是编辑时不显示节点容器模板。解决方案如下!

1.修改\dede\templets目录下的专题编辑的模板文件spec_edit.htm

文件位于 dede\templets下面的 spec_edit.htm 文件,打开文件并找到 “单条记录的模板:” ,在第一处附近找

<tr>
<td colspan=”2″>单条记录的模板:<br/> <textarea name=”listtmp<?php echo $i?>” rows=”3″ id=”listtmp<?php echo $i?>” style=”width:60%”><?php echo $speclisttmp?></textarea></td>
</tr>

后面添加下面的代码

<tr>
<td>节点容器模板:</td>
<td colspan=”2″><input name=”notetemplet<?php echo $i?>” type=”text” id=”notetemplet<?php echo $i?>” value=”system/channel_spec_note.htm” style=”width:300″>
<input type=”button” name=”selno<?php echo $i?>” value=”浏览…” style=”width:70″ onClick=”SelectTemplets(‘form1.notetemplet<?php echo $i?>’);”></td>
</tr>

在第二处附近找

<tr>
<td colspan=”2″>单条记录的模板:<br/> <textarea name=”listtmp<?php echo $i?>” rows=”3″ id=”listtmp<?php echo $i?>” style=”width:60%”><?php echo $speclisttmp?></textarea></td>
</tr>

后面添加下面的代码

<tr>
<td>节点容器模板:</td>
<td><input id=”notetemplet<?php echo $i?>” style=”width: 300;” type=”text” name=”notetemplet<?php echo $i?>” value=”<?php echo $notetemplet?>” /><input style=”width: 70;” onClick=”SelectTemplets(‘form1.notetemplet<?php echo $i?>’);” type=”button” name=”selno<?php echo $i?>” value=”浏览…” /></td>
</tr>

接下来找到if(empty($rownum)) $rownum = 40; 在下面添加如下代码

$notetemplet = $ctag->GetAtt(‘notetemplet’);

2.修改 dede目录下的 spec_add.php、spec_edit.php文件

(1)找到 $listtmp = trim(${‘listtmp’.$i});下面添加 $notetemplet = trim(${‘notetemplet’.$i});

即将

$listtmp = trim(${‘listtmp’.$i});

修改为

$listtmp = trim(${‘listtmp’.$i});
$notetemplet = trim(${‘notetemplet’.$i});

(2)找到 $notelist .= 在标签里面添加 notetemplet=\\’$notetemplet\\’

即将

$notelist .= “{dede:specnote imgheight=\\’$imgheight\\’ imgwidth=\\’$imgwidth\\’
infolen=\\’$infolen\\’ titlelen=\\’$titlelen\\’ col=\\’$col\\’ idlist=\\’$okids\\’
name=\\’$notename\\’ noteid=\\’$noteid\\’ isauto=\’$isauto\’ rownum=\\’$rownum\\’
keywords=\\’$keywords\\’ typeid=\\’$typeid\\’  notetemplet=\\’$notetemplet\\’}
$listtmp
{/dede:specnote}\r\n”;

修改为

$notelist .= “{dede:specnote imgheight=\\’$imgheight\\’ imgwidth=\\’$imgwidth\\’
infolen=\\’$infolen\\’ titlelen=\\’$titlelen\\’ col=\\’$col\\’ idlist=\\’$okids\\’
name=\\’$notename\\’ noteid=\\’$noteid\\’ isauto=\’$isauto\’ rownum=\\’$rownum\\’
keywords=\\’$keywords\\’ typeid=\\’$ttypeid\\’ notetemplet=\\’$notetemplet\\’}
$listtmp
{/dede:specnote}\r\n”;

注意,两个文件都要修改。

3.修改 \include\taglib\channel\specialtopic.lib.php 文件

找到 $rownum = trim($ctag->GetAtt(‘rownum’)); 在下面添加如下代码

// 读取自定义的系统节点容器模板,模板必须位于 templets/system 下面。
$notetemplet = trim($ctag->GetAtt(‘notetemplet’));
if ($notetemplet)
{
$notetemplet = substr($notetemplet,strpos($notetemplet,’/')+1);
$tempStr = GetSysTemplets($notetemplet);
}
else
{
$tempStr = GetSysTemplets(“channel_spec_note.htm”);
}

到此所有的修改就完成了。


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images