修改教程开始
1、后台-系统-SQL命令行工具-执行
ALTER TABLE `dede_tagindex` ADD `maketime` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',ADD `tagdir` CHAR( 60 ) NOT NULL DEFAULT ''
2、\include\taglib\tag.lib.php 找到
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
改成
$row['link'] = $cfg_cmsurl."/tag/".urlencode(strtolower(Getpinyin($row['keyword']))).".html";
6、\include\helpers\archive.helper.php 找到
function InsertOneTag($tag, $aid) { global $typeid,$arcrank,$dsql; $tag = trim($tag); if($tag == '') { return ''; } if(empty($typeid)) { $typeid = 0; } if(empty($arcrank)) { $arcrank = 0; } $rs = false; ......
在它的下面加入
$tagdir = Getpinyin($tag);
继续找到
$rs = $dsql->ExecuteNoneQuery(" INSERT INTO `dede_tagindex`(`tag`,`typeid`,`count`,`total`,`weekcc`,`monthcc`,`weekup`,`monthup`,`addtime`) VALUES('$tag','$typeid','0','1','0','0','$addtime','$addtime','$addtime'); ");
改成
$rs = $dsql->ExecuteNoneQuery(" INSERT INTO `dede_tagindex`(`tag`,`typeid`,`count`,`total`,`weekcc`,`monthcc`,`weekup`,`monthup`,`addtime`,`tagdir`) VALUES('$tag','$typeid','0','1','0','0','$addtime','$addtime','$addtime','$tagdir'); ");
7.找到arc.taglist.class.php
//读取Tag信息 if($this->Tag!='') { $this->TagInfos = $this->dsql->GetOne("Select * From `axcms_tagindex` where tag like '{$this->Tag}' "); if(!is_array($this->TagInfos)) { $fullsearch = $GLOBALS['cfg_phpurl']."/search.php?keyword=".$this->Tag."&searchtype=titlekeyword"; $msg = "系统无此标签,可能已经移除!<br /><br />你还可以尝试通过搜索程序去搜索这个关键字:<a href='$fullsearch'>前往搜索>></a>"; ShowMsg($msg,"-1"); exit(); } }
其中mysql语句修改为:
$this->TagInfos = $this->dsql->GetOne("Select * From `axcms_tagindex` where tagdir='{$this->Tag}' ");
tag标签写法
HTML
{dede:tag row='20' sort='new' getall='0'}<a href="[field:link/]">[field:tag /]</a>{/dede:tag}
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛