TypechoJoeTheme

Dcr163的博客

统计

dede:arclist标签添加只读带有缩略图的文章dedecms

2018-10-28
/
0 评论
/
904 阅读
/
正在检测是否收录...
10/28

相信有不小小伙伴都需要在使用dede:arclist文章列表标签的时候只需要调用带有缩略图的文章,反正作者我是没有看到系统自带这个选项,所以就手动添加了一个只读取带有缩略图的文章选项,下面修改代码开始

修改文件:include/taglib/arclist.lib.php
一、

        在

$stype = $ctag->GetAtt ( 'stype' );

下两行添加

$isthumb = $ctag->GetAtt( 'isthumb' );  // isthumb 是否只取含有缩略图的文

在 

$tagid, $pagesize, $isweight, $stype

后添加

,$isthumb

        二、

修改函数 lib_arclistDone() 在末尾添加多一个参数 : $litpic=''

        三、
        在

$orwhere = " WHERE $orwhere ";

下方新增

//xj 181027 只取带缩略图的文章 s

if( $litpic && $orwhere ){

        $litpicWhere = " AND arc.litpic<>'' ";

        $orwhere .= $litpicWhere;

    }

    //xj 181027 只取带缩略图的文章 e

        

WHERE arc.id in($idlist) $ordersql    

替换成

WHERE arc.id in($idlist) $litpicWhere $ordersql



以上操作就是,修改后台程序;
现在在前台模板调用:

dede:arclist orderby='pubdate' row="9" orderway='desc' isthumb='1'}
   
{/dede:arclist}


只需要添加isthumb="1" 即可只读取带缩略图的文章了,这样就小小的修改了下arclist标签

朗读
赞(0)
版权属于:

Dcr163的博客

本文链接:

http://dcr163.cn/190.html(转载时请注明本文出处及文章链接)

评论 (0)

人生倒计时

今日已经过去小时
这周已经过去
本月已经过去
今年已经过去个月

最新回复

  1. slot mpo terbaru
    2025-02-08
  2. Sherry Stockdill
    2025-01-28
  3. slot demo
    2025-01-13
  4. 陌天
    2025-01-09
  5. Kerrie Bostick
    2024-12-28

标签云