兼容靜態(tài) 動(dòng)態(tài) 偽靜態(tài)
支持第一頁(yè)直接是欄目鏈接,第二頁(yè),第三頁(yè)。。。。按當(dāng)前分頁(yè)
支持在開(kāi)啟絕對(duì)路徑和沒(méi)開(kāi)啟絕對(duì)路徑不同輸出
實(shí)現(xiàn)教程
1.打開(kāi) 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());
}
}
繼續(xù)找到
獲得當(dāng)前的頁(yè)面文件的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
|
/**
* 獲得當(dāng)前欄目鏈接與當(dāng)前分頁(yè)鏈接
*
* @access public
* @return string
* @return {dede:itemcururl/}
*/ www.dede58.com
function GetItemsCurUrlDM()
{
global $cfg_basehost,$cfg_multi_site;
$purl = $this->GetCurUrl();
// 如果開(kāi)啟為靜態(tài),則對(duì)規(guī)則進(jìn)行替換
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;
}
|
列表頁(yè)模板調(diào)用標(biāo)簽寫(xiě)法
{dede:itemcururl/}

















