<tt id="6hvjo"><rt id="6hvjo"><menuitem id="6hvjo"></menuitem></rt></tt>

<i id="6hvjo"></i>
<i id="6hvjo"></i>

<u id="6hvjo"><video id="6hvjo"></video></u>

<i id="6hvjo"></i>

加入vip [簽到送金幣]
注冊 登錄 QQ登錄
織夢無憂,用心做好源碼!7年品牌,值得信賴! 織夢無憂,個個精品,寧缺毋濫!每月購買不少于3000元精品源碼免費分享,早開通,早享受!終身會員臨時大促,只需要128元!新會員開通,直接進入會員中心--購買會員--直接開通即可。

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

摘要: 織夢列表頁獲取當前鏈接和當前分頁鏈接 功能描述 兼容靜態 動態 偽靜態 支持第一頁直接是欄目鏈接,第二頁,第三頁。。。。按當前分頁 支持在開啟絕對路徑和沒開啟絕對路徑不同輸出 實現教程 1.打開 include/arc.listview.class.php 找到 else if($PageNo!=1

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

功能描述

  • 兼容靜態 動態 偽靜態
  • 支持第一頁直接是欄目鏈接,第二頁,第三頁。。。。按當前分頁
  • 支持在開啟絕對路徑和沒開啟絕對路徑不同輸出

實現教程

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

在它的注釋上面加入

/**
 *  獲得當前欄目鏈接與當前分頁鏈接
 *
 * @access    public
 * @return    string
 * @return    {dede:itemcururl/}
 */
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/}

本文鏈接:http://www.amshui.com//dedecmsjiaocheng/chengxukaifa/182929.html

版權聲明:本站資源均來自互聯網或會員發布,如果侵犯了您的權益請與我們聯系,我們將在24小時內刪除!謝謝!

公眾號二維碼

微信公眾號

//自動推送 被客人玩站不起

<tt id="6hvjo"><rt id="6hvjo"><menuitem id="6hvjo"></menuitem></rt></tt>

<i id="6hvjo"></i>
<i id="6hvjo"></i>

<u id="6hvjo"><video id="6hvjo"></video></u>

<i id="6hvjo"></i>