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

首頁 > CMS > 織夢DEDE > 正文

織夢列表頁獲取當前鏈接和當前分頁鏈接

2024-07-12 09:00:19
字體:
來源:轉載
供稿:網友

兼容靜態 動態 偽靜態

支持第一頁直接是欄目鏈接,第二頁,第三頁。。。。按當前分頁

支持在開啟絕對路徑和沒開啟絕對路徑不同輸出

 

實現教程

1.打開 include/arc.listview.class.php 找到

else if($PageNo!=1 && $ctag->GetName()=='field' && $ctag->GetAtt('display')!='')

在它的上面加入

else if($ctag->GetName()=="itemcururl")

{

    if($ismake==0)

    {

        $this->dtp->Assign($tagid,$this->GetItemsCurUrlDM());

    }

    else

    {

        $this->dtp->Assign($tagid,$this->GetItemsCurUrlST());

    }

}

 

繼續找到

獲得當前的頁面文件的url

在它的注釋上面加入

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
 *  獲得當前欄目鏈接與當前分頁鏈接
 *
 * @access    public
 * @return    string
 * @return    {dede:itemcururl/}
 */ www.CUOxin.com織夢模板
function GetItemsCurUrlDM()
{
global $cfg_basehost,$cfg_multi_site;
$purl = $this->GetCurUrl();
    // 如果開啟為靜態,則對規則進行替換
    if($cfg_rewrite == 'Y')
    {
        $nowurls = preg_replace("/-/", ".php?", $purl);
        $nowurls = explode("?", $nowurls);
        $purl = $nowurls[0];
    }
if($this->PageNo==1)
{
$geturl = "tid=".$this->TypeID;
$purl .= '?'.$geturl;
}
else
{
$geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
$purl .= '?'.$geturl."PageNo=".$this->PageNo;
}
$cururl = ($cfg_multi_site=='Y') ? $purl : $cfg_basehost.$purl;
return $cururl;
}
function GetItemsCurUrlST()
{
global $cfg_basehost;
    $tnamerule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);
    $tnamerule = preg_replace("/^(.*)///", '', $tnamerule);
$cfg_basehost = preg_replace('#/$#','',$cfg_basehost);
$tnamerule = MfTypedir($this->Fields['typedir']).'/'.$tnamerule;
if($this->PageNo==1)
{
$purl = MfTypedir($this->Fields['typedir']).'/';
}
else
{
$purl = str_replace("{page}",$this->PageNo,$tnamerule);
}
$cururl = ($cfg_multi_site=='Y') ? $purl : $cfg_basehost.$purl;
return $cururl;
}

 

列表頁模板調用標簽寫法

{dede:itemcururl/}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 左权县| 延庆县| 永昌县| 柘荣县| 新蔡县| 西丰县| 上杭县| 瑞昌市| 白银市| 丹江口市| 彭州市| 恩施市| 阿拉善右旗| 兴隆县| 霍山县| 克山县| 墨玉县| 江门市| 安溪县| 西城区| 丹阳市| 自治县| 辽中县| 娄烦县| 射洪县| 古田县| 兴安县| 乌海市| 平凉市| 马边| 乐东| 大埔区| 靖州| 南岸区| 林州市| 板桥市| 崇阳县| 灯塔市| 成都市| 佛山市| 青冈县|