織夢DEDE列表分頁如何轉換英文
找include/arc.listview.class.php進行修改
先說一下調用方法:
調用方法:
{dede:pagelist listsize='5'/}
{dede:pagelist pagelang='en' listsize='5'/}
pagelang:en為英文,否則為中文,默認語言中文
修改arc.listview.class.php文件如下:
/**
* 獲取靜態的分頁列表
*
* @access public
* @param string $list_len 列表寬度
* @param string $list_len 列表樣式
* @return string
*/
function GetPageListST($list_len,$listitem="index,end,pre,next,pageno")
{
if($pagelang='en'){
$uahome=" Home ";
$uaprevious=" Previous ";
$uanext=" Next ";
$ualastpage=" Last Page ";
$uapage=" Page ";
$uatotal=" Total ";
$uarecords=" Records. ";
$uaarticle=" Article ";
}else{
$uahome="首頁";
$uaprevious="上一頁";
$uanext="下一頁";
$ualastpage="末頁";
$uapage="頁";
$uatotal="共";
$uarecords="條記錄";
$uaarticle="條";
}
$prepage = $nextpage = '';
$prepagenum = $this->PageNo-1;
$nextpagenum = $this->PageNo+1;
if($list_len=='' || preg_match("/[^0-9]/", $list_len))
{
$list_len=3;
}
$totalpage = ceil($this->TotalResult/$this->PageSize);
if($totalpage<=1 && $this->TotalResult>0)
{
return "<li><span class=\"pageinfo\">$uatotal <strong>1</strong>$uapage<strong>".$this->TotalResult."</strong>$uarecords</span></li>\r\n";
}
if($this->TotalResult == 0)
{
return "<li><span class=\"pageinfo\">$uatotal <strong>0</strong>$uapage<strong>".$this->TotalResult."</strong>$uarecords</span></li>\r\n";
}
$purl = $this->GetCurUrl();
$maininfo = "<li><span class=\"pageinfo\">$uatotal <strong>{$totalpage}</strong>$uapage<strong>".$this->TotalResult."</strong>$uaarticle</span></li>\r\n";
$tnamerule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);
$tnamerule = preg_replace("/^(.*)\//", '', $tnamerule);
//獲得上一頁和主頁的鏈接
if($this->PageNo != 1)
{
$prepage.="<li><a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>$uaprevious</a></li>\r\n";
$indexpage="<li><a href='".str_replace("{page}",1,$tnamerule)."'>$uahome</a></li>\r\n";
}
else
{
$indexpage="<li>$uahome</li>\r\n";
}
//下一頁,未頁的鏈接
if($this->PageNo!=$totalpage && $totalpage>1)
{
$nextpage.="<li><a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>$uanext</a></li>\r\n";
$endpage="<li><a href='".str_replace("{page}",$totalpage,$tnamerule)."'>$ualastpage</a></li>\r\n";
}
else
{
$endpage="<li>$ualastpage</li>\r\n";
}
調用效果如圖:

以上就是關于【織夢DEDE列表分頁如何轉換英文】的文章內容,如果您還想了解更多關于網站建設與網絡推廣的相關文章,請繼續查看【織夢教程】欄目的其它文章
來源theround.com.cn廣州明行威,致力于中小企業網絡營銷推廣、整體外包運營(網站建設、SEM、SEO等)、企業SEO內訓、信息流廣告運營
歡迎交流 加微信13430336474 廣州張楷

上一篇:織夢用channel時noself='yes'無子欄目時不調用頂級欄目的解決方法 下一篇:織夢網站后臺增加復制文章文檔到其他欄目的功能