dede发表文章里自动生成的关键词代码是什么?

2024-12-18 16:06:35
推荐回答(1个)
回答1:

require_once (dirname(__FILE__) . "/include/common.inc.php");
?>




<?php echo $cfg_webname ?> – 关键词列表



>


//生成关键字列表
require_once(DEDEINC."/arc.archives.class.php");
require_once(DEDEINC."/channelunit.func.php");
$dsql->Query("rs","select id from `#@__arctiny` where arcrank > -1 order by id desc");
while ($rs=$dsql->GetArray("rs")){ //循环出记录
$arcid=$rs[id];
$row = $dsql->GetOne("Select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,
tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
from `#@__archives` arc left join `#@__arctype` tp on arc.typeid=tp.id
where arc.id=$arcid and arc.arcrank > -1 ");
if($row){
$url = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
$row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
//echo "print_r
",print_r($row),"
";
$keywords=explode(",", $row['keywords']);
if($keywords){$keywords[0]="".$keywords[0].""; }
echo "

[".$row['typename'].'] '.$row['title'];
foreach($keywords as $keyword ){
echo " – "."$keyword";
}
echo "


";
}}
?>