Dedecms上下篇的样式修改

网站的文章页基本都设置上下篇的链接,为了用户的友好跳转和推广传递。

下面则是dedecms的上下篇调用标签

{dede:prenext get='pre'/}
{dede:prenext get='next'/}

以下修改,将上一篇下一篇只调用URL地址。

找到include目录下的这个文件:arc.archives.class.php

找到这几行:

$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
$this->PreNext['pre'] = "上一篇:没有了";
$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
$this->PreNext['next'] = "下一篇:没有了 ";

分别替换为以下几行:

$this->PreNext['pre'] = "$mlink";
$this->PreNext['pre'] = "javascript:window.alert('上一篇:没有了');";
$this->PreNext['next'] = "$mlink";
$this->PreNext['next'] = "javascript:window.alert('下一篇:没有了');";

以上是文章内容模型的上一篇下一篇调用标签。图集模型的修改地方如下:

找到这几行:

*$this->PreNext['preimg'] = "<a href='$mlink'><img src="{$preRow['litpic']}" target='_blank'>

模板在调用的时候,都会有限制字数的要求,以免字数过多影响显示效果。

编辑打开include/arc.archives.class.php文件找到:

查找:$this->PreNext['pre'] = "上一篇:{$preRow['title']} ";

在这一行上面加上以下代码

$preRow['title']=cn_substr($preRow['title'],30);//最多显示15个汉字
 
查找:$this->PreNext['next'] = "下一篇:{$nextRow['title']} ";

 

posted @ 2019-08-13 17:22  紫云传芳  阅读(519)  评论(0)    收藏  举报