国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

織夢dedecms調用頂級欄目名稱和URL鏈接

2024-07-12 09:12:06
字體:
來源:轉載
供稿:網友
織夢dedecms調用頂級欄目名稱和URL鏈接。
問題: 
 
在2級欄目頁面單獨調用該欄目的頂級欄目名稱! 
 
方法思路: 
 
{dede:type}
<a href="[field:typelink /]">[field:typename /]</a> 
{/dede:type}
標簽的基礎上進行修改。
 
調用方法:
{dede:type2}
<a href="[field:typelink /]">[field:typename /]</a> 
{/dede:type2}
 
新標簽放置位置:
/include/taglib/type2.lib.php保存為type2.lib.php標簽就可以使用<?php/* vim: set expandtab tabstop=4 shiftwidth=4: */// +----------------------------------------------------------------------+// | PHP version 5                                                        |// +----------------------------------------------------------------------+// | Copyright (c) 1997-2004 The PHP Group                                |// +----------------------------------------------------------------------+// | This source file is subject to version 3.0 of the PHP license,       |// | that is bundled with this package in the file LICENSE, and is        |// | available through the world-wide-web at the following url:           |// | http://www.php.net/license/3_0.txt.                                  |// | If you did not receive a copy of the PHP license and are unable to   |// | obtain it through the world-wide-web, please send a note to          |// | license@php.net so we can mail you a copy immediately.               |// +----------------------------------------------------------------------+// | Authors: Original Author <author@example.com>                        |// |          Your Name <you@example.com>                                 |// +----------------------------------------------------------------------+//// $Id:$if (!defined('DEDEINC')) exit('Request Error!');function lib_type2(&$ctag, &$refObj) {    global $dsql, $envs;    $attlist = 'typeid|0';    FillAttsDefault($ctag->CAttribute->Items, $attlist);    extract($ctag->CAttribute->Items, EXTR_SKIP);    $innertext = trim($ctag->GetInnerText());    if ($typeid == 0) {        $typeid = (isset($refObj->TypeLink->TypeInfos['topid']) ? $refObj->TypeLink->TypeInfos['topid'] : $envs['typeid']);//echo "ssssssssss1".$refObj->TypeLink->TypeInfos['topid'];//echo "ssssssssss2".$envs['typeid']; exit;    }//echo "typeid:".$typeid; exit;//lyy 如果topid==0 就是頂級分類,取當前記錄if($refObj->TypeLink->TypeInfos['topid']==0){$typeid=$refObj->TypeLink->TypeInfos['id'];}//echo "typeid:".$typeid; exit;    if (empty($typeid)) return ''; $row = $dsql->GetOne("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath                           FROM `dede_arctype` WHERE id='$typeid'");    if (!is_array($row)) return '';    if (trim($innertext) == '') $innertext = GetSysTemplets("part_type_list.htm");    $dtp = new DedeTagParse();    $dtp->SetNameSpace('field', '[', ']');    $dtp->LoadSource($innertext);    if (!is_array($dtp->CTags)) {        unset($dtp);        return '';    } else {//lyy 以下getTypeUrl($row[topid]錯的,換成 $row['id'] echo  $row['id']."sssss";exit;        $row['typelink'] = GetTypeUrl($row['id'], MfTypedir($row['typedir']) , $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['siteurl'], $row['sitepath']);//print_r($row);exit;        foreach ($dtp->CTags as $tagid => $ctag) {            if (isset($row[$ctag->GetName() ])) $dtp->Assign($tagid, $row[$ctag->GetName() ]);        }        $revalue = $dtp->GetResult();        unset($dtp);        return $revalue;    }} ?> 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 嘉鱼县| 定兴县| 闵行区| 昌黎县| 芦溪县| 顺义区| 石棉县| 南宫市| 卢氏县| 手游| 东乌珠穆沁旗| 个旧市| 抚远县| 高陵县| 同江市| 曲沃县| 彰化县| 且末县| 嵩明县| 普兰县| 博乐市| 讷河市| 岑巩县| 法库县| 自贡市| 天台县| 南川市| 台安县| 闸北区| 白山市| 南安市| 罗田县| 贵州省| 宜黄县| 青浦区| 韩城市| 江孜县| 原平市| 建瓯市| 长乐市| 巴塘县|