主页 > 网站建设 > 建站知识 > DedeCMS上下篇标题调用缩略图的方法

DedeCMS上下篇标题调用缩略图的方法

POST TIME:2018-03-19 17:34

有时候我们需要在文章内容调用上下篇文章的缩略图,但是织梦默认没有调用上下篇文章缩略图的标签,不过我们自有办法,下面,织梦技术研究中心就教大家实现方法,首先我们需要找到并打开include下的arc.archives.class.php文件,在里面找到:

arc.money,arc.filename,

在后面添加

arc.litpic,

然后查找:

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

替换为:

if(empty($preRow['litpic'])) { $this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> "; }else{ $preimage = str_replace('/photo-img', 'http://www.dedejs.com',trim($preRow['litpic'])); $this->PreNext['pre'] = "<div class=&;photo_article_pre&;> <div class=&;pre_photo&;><a href=&;$mlink&;><img src=&;$preimage&; alt=&;上一篇:{$preRow['title']}&;></a></div> <div class=&;pre_right&;> <p>上一篇:{$preRow['title']}</p> <div class=&;photo_textlink&;>◀<a href=&;$mlink&;>浏览上一张图片</a></div> </div></div>"; }

然后查找:

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

替换为:

if(empty($nextRow['litpic'])) { $this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> "; }else{ $nextimage = str_replace('/photo-img', 'http://www.dedejs.com',trim($nextRow['litpic'])); $this->PreNext['next'] = "<div class=&;photo_article_next&;> <div class=&;pre_photo&;><a href=&;$mlink&;><img src=&;$nextimage&; alt=&;下一篇:{$nextRow['title']}&;></a></div> <div class=&;pre_right&;> <p>下一篇:{$nextRow['title']}</p> <div class=&;photo_textlink&;>▶<a href=&;$mlink&;>浏览下一张图片</a></div> </div></div>"; }

注意上面红色的网址改为你自己的。
修改完成后就可以更新全站文档了,看看效果吧!




收缩
  • 微信客服
  • 微信二维码
  • 电话咨询

  • 400-1100-266