欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

dedecms

當(dāng)前位置:主頁 > CMS教程 > dedecms >

織夢一個(gè)標(biāo)簽獲取當(dāng)前鏈接地址url支持動(dòng)態(tài)、靜態(tài)、偽靜態(tài)輸出當(dāng)前鏈接url

來源:本站原創(chuàng)|時(shí)間:2021-08-05|欄目:dedecms|點(diǎn)擊: 次

織夢獲取當(dāng)前鏈接url網(wǎng)上有很多教程,但是要么只支持動(dòng)態(tài)下正常使用,要么只支持內(nèi)容頁使用
 
一個(gè)標(biāo)簽,可用于任意模板下使用
 
支持動(dòng)態(tài)/靜態(tài)/偽靜態(tài) 輸出當(dāng)前url
 
支持首頁/列表頁/列表分頁/內(nèi)容頁/內(nèi)容頁分頁
 
 
 
實(shí)現(xiàn)教程
 
1、獲取內(nèi)容頁當(dāng)前Url 或者 內(nèi)容頁分頁Url
 
打開 /include/arc.archives.class.php 找到
 
$this->NowPage = $pageNo;
 
在它上面加入
 
$ArcArr = GetOneArchive($this->ArcID);
 
$arcurl = $ArcArr['arcurl'];
 
 
 
繼續(xù)找到
 
$this->Fields[$this->SplitPageField] = $this->SplitFields[$pageNo - 1];
 
在它上面加入
 
if($ismake==1)
 
{
 
if($pageNo>1)
 
{
 
$pagebreak = str_replace($this->NameFirst, $this->NameFirst."_".$pageNo, $arcurl);
 
}
 
}
 
else
 
{
 
if($pageNo>1) $pagebreak = "&pageno=".$pageNo;
 
if($cfg_rewrite == 'Y')
 
{
 
$pagebreak = str_replace(".php?aid=", "-", $arcurl);
 
$pagebreak =  preg_replace("#&pageno=(d+)#i", '-.html', $pagebreak);
 
}
 
$pagebreak = $arcurl.$pagebreak;
 
}
 
2、獲取列表頁當(dāng)前Url 或者 列表頁分頁Url
 
打開 /include/arc.listview.class.php 找到
 
//替換第二頁后的內(nèi)容
 
在它上面加入
 
$this->Fields['itemcururl'] = $this->GetItemsCurUrl($PageNo);
 
 
 
繼續(xù)找到
 
function GetCurUrl()
 
在它上面加入
 
function GetItemsCurUrl($PageNo)
 
{
 
global $cfg_basehost;
 
if($this->TypeLink->TypeInfos['isdefault']==-1)
 
{
 
$purl = $this->GetCurUrl();
 
if($cfg_rewrite == 'Y')
 
{
 
$nowurls = preg_replace("/-/", ".php?", $purl);
 
$nowurls = explode("?", $nowurls);
 
$purl = $nowurls[0];
 
}
 
if($PageNo==1)
 
{
 
$geturl = "tid=".$this->TypeID;
 
$purl .= '?'.$geturl;
 
}
 
else
 
{
 
$geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
 
$purl .= '?'.$geturl."PageNo=".$PageNo;
 
}
 
}
 
else
 
{
 
$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($PageNo==1)
 
{
 
$purl = MfTypedir($this->Fields['typedir']).'/';
 
}
 
else
 
{
 
$purl = str_replace("{page}",$PageNo,$tnamerule);
 
}
 
}
 
return $purl;
 
}
 
 
 
還需要打開 /include/arc.partview.class.php 找到
 
$this->Fields['title'] = $this->TypeLink->GetPositionLink(false);
 
在它下面加入
 
$this->Fields['itemcururl'] = $this->TypeLink->GetOneTypeUrl($this->TypeLink->TypeInfos);
 
前臺(tái)模板標(biāo)簽調(diào)用
 
{dede:field.itemcururl runphp=yes}global $cfg_basehost;@me = (@me == '' ? "{$cfg_basehost}" : "{$cfg_basehost}@me");{/dede:field.itemcururl}
 

上一篇:織夢復(fù)制網(wǎng)站文章內(nèi)容自動(dòng)加版權(quán)代碼教程

欄    目:dedecms

下一篇:織夢添加一個(gè)函數(shù),實(shí)現(xiàn)任意字段調(diào)用

本文標(biāo)題:織夢一個(gè)標(biāo)簽獲取當(dāng)前鏈接地址url支持動(dòng)態(tài)、靜態(tài)、偽靜態(tài)輸出當(dāng)前鏈接url

本文地址:http://mengdiqiu.com.cn/a1/dedecms/14140.html

更多dedecms

您可能感興趣的文章

閱讀排行

本欄相關(guān)

隨機(jī)閱讀

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有