濮阳杆衣贸易有限公司

主頁 > 網(wǎng)站建設(shè) > 建站知識(shí) > DedeCMS上下篇標(biāo)題調(diào)用縮略圖的方法

DedeCMS上下篇標(biāo)題調(diào)用縮略圖的方法

POST TIME:2018-03-19 17:34

有時(shí)候我們需要在文章內(nèi)容調(diào)用上下篇文章的縮略圖,但是織夢(mèng)默認(rèn)沒有調(diào)用上下篇文章縮略圖的標(biāo)簽,不過我們自有辦法,下面,織夢(mèng)技術(shù)研究中心就教大家實(shí)現(xiàn)方法,首先我們需要找到并打開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>"; }

注意上面紅色的網(wǎng)址改為你自己的。
修改完成后就可以更新全站文檔了,看看效果吧!




收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
平利县| 远安县| 广安市| 辛集市| 交城县| 泸水县| 喜德县| 巴东县| 五寨县| 绿春县| 怀安县| 六枝特区| 当雄县| 文化| 额尔古纳市| 高邑县| 乌兰浩特市| 清远市| 思茅市| 元氏县| 平定县| 南通市| 清流县| 广水市| 驻马店市| 休宁县| 海盐县| 鄂托克前旗| 温泉县| 普宁市| 防城港市| 东阿县| 哈尔滨市| 收藏| 太康县| 漠河县| 泸溪县| 清涧县| 新绛县| 肥西县| 佛冈县|