加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > CMS系统 > Dedecms > 正文

织梦dedecms副栏目名称和链接调用

发布时间:2020-12-14 04:45:13 所属栏目:Dedecms 来源:网络整理
导读:织梦副栏目名称和链接调用方法,打开?includeextend.func.php?在最下面加入 /** * 获取副栏目链接和名称 * * @access public * @param string $typeid2 副栏目id * @param string $result 输出 * @return string */if(!function_exists('GetTypeid2')){ fu

织梦副栏目名称和链接调用方法,打开?includeextend.func.php?在最下面加入

/**
 *  获取副栏目链接和名称
 *
 * @access    public
 * @param     string  $typeid2         副栏目id
 * @param     string  $result         输出
 * @return    string
 */
if(!function_exists('GetTypeid2'))
{
         function GetTypeid2($typeid2)
         {
                   global $dsql;
                   $result = '';
                   $query = "SELECT * FROM `dede_arctype` WHERE id IN($typeid2) AND ishidden<>1 ORDER BY FIELD(id,$typeid2)";
                   $dsql->Execute('t',$query);
                   while($row = $dsql->GetArray('t'))
                   {
                            $typeurl = GetOneTypeUrlA($row);
                            $result.= ($result=='' ? "
						

?

列表页?调用标签写法

[field:typeid2 function=GetTypeid2(@me)/]

内容页?调用标签写法

{dede:field.typeid2 function=GetTypeid2(@me)/}

首页?调用标签

还需要打开?/include/taglib/arclist.lib.php?找到

if($CrossID=='') $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).')';

?

改成

if($CrossID=='') $orwheres[] = " (arc.typeid in (".GetSonIds($typeid).") or arc.typeid2 in (".GetSonIds($typeid).") or CONCAT( ',',arc.typeid2,' ) LIKE '%,".$typeid.",%' )";

继续找到

else $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).','.$CrossID.')';

改成

else $orwheres[] = " (arc.typeid in (".GetSonIds($typeid).",".$CrossID.") or arc.typeid2 in (".GetSonIds($typeid).",".$CrossID.") or CONCAT( ',%')";

这样才可以在首页调用副栏目,标签写法是

[field:typeid2 function=GetTypeid2(@me)/]


(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读