<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

dedecms织梦相关专题的调用方法

时间:2020-12-16

dedecms织梦相关专题的调用方法 。

在需要调用相关专题的地方添加:dede标签{dede:field.keywords function=’getlikespc(@me)’/} 
 
include/extend.func.php 文件中添加:
 
/*author:织梦的鱼
*function:检索和当前页面关键字相同的专题页面
*time:2011.07.08
*/
function getlikespc($keywords=0)
{
global $cfg_basehost,$dsql;
$key = array();
$key = explode(“,”,$keywords);
$likesql;
$len =count($key);
for($i=0;$i<$len;$i++){
$now = $len-$i;
if($now==1){
$likesql .= “keywords like ‘%”.$key[$i].”%’ “;
}else{
$likesql .= “keywords like ‘%”.$key[$i].”%’ or “;
}
}//关键字分割检索,拼接 查询语句
$getsql = “SELECT * from  idea_archives where idea_archives.channel=’-1′ and $likesql order by  idea_archives.id “;//查询与该文章关键字相同的专题
//echo $getsql;
$toback;
$dsql->Execute(“m”,$getsql);
while($row = $dsql->GetObject(‘m’))
{
$title = $row->title;//专题标题
$id = $row->id;//专题ID
$toback = “<a href=’”.$cfg_basehost.”/special/arc-”.$id.”.html’ >”.$title.”</a>”;
}
return $toback;//返回文章链接
}
 
专题列表样式可修改$toback的样式
0
首页
案例
关于
联系