给Dedecms文章列表分页标题加上序号

给Dedecms文章列表分页标题加上序号,第1张

给Dedecms文章列表分页标题加上序号 为dedecms文章分页标题加上序号,烈火网提醒:本教程只在dedecms5.1版本下测试通过,如果您想在其它版本试验,请先备份原文件
改模板文件inc_archives_view.php就OK了 

演示:http://www.fatu8.com/360x640/200909/26-339_8.html 
代码如下: 
//循环生成HTML文件 
else 
{ 
for($i=1;$i<=$this->TotalPage;$i++) 
{ 
$tempTitle=$this->Fields['title'];//临时存储一个标题副本 
if($i>1) 
{ 
$truefilename = $this->GetTruePath().$fileFirst."_".$i.".".$this->ShortName; 

//为分页标题加上序号。2009.2.13 
$this->Fields['title'] = $this->Fields['title'].'('.$i.')';//在标题后面多加个序号 
} 
else 
{ 
$truefilename = $this->GetTruePath().$filename; 
} 
$this->ParseDMFields($i,1); 
$this->dtp->SaveTo($truefilename); 
$this->Fields['title']=$tempTitle;//生成html,还原标题 
} 
} 


列表页的标题也有办法了 
{dede:field.title/}_第{dede:pagelist listsize='0' listitem='pageno' function='html2text(@me)'/}页 

用{dede:pagelist listsize='0' listitem='pageno' function='html2text(@me)'/}可以调用第几页那个数字。。哈哈 
完美了 
改模板文件list_article.htm就OK了

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/3008922.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-09-27
下一篇 2022-09-27

发表评论

登录后才能评论

评论列表(0条)

保存