phpcms列表显示图片
文章描述:
phpcms列表显示缩略图片

模板
代码替换:
{pc:content action="lists" catid="$catid" num="5" order="id DESC" page="$page"}
        <ul class="list lh24 f14">
            {loop $data $r}
            <li class="item">
                <div class="lf">
                    <div class="thumb lf">
                        <a href="{$r[url]}" title="catid={$r[catid]}" target="_blank"{title_style($r[style])}>
                        {if $r[thumb]}
                        <img src="{$r[thumb]}" class="img"/>
                        {else}
                        {/if}
                        </a>
                    </div>
                    <div class="title lf">
                        ·<a href="{$r[url]}" title="catid={$r[catid]}" target="_blank"{title_style($r[style])}>{$r[title]}</a>
                    </div>
                </div>
                <span class="rt">{date('Y-m-d H:i:s',$r[inputtime])}</span></li>
            {if $n%5==0}<li class="bk20 hr"></li>{/if}
            {/loop}
        </ul>
        <div id="pages" class="text-c">{$pages}</div>
{/pc}样式
在header.html新增
<link href="{CSS_PATH}style.css" rel="stylesheet" type="text/css" />
style.css
.item{ overflow: hidden; padding: 10px 0; border-bottom: 1px solid #eee; }
.item .thumb .img{width: 35px;}
.item .title{margin-top: 5px; }

发布时间:2021/12/23 
                
            
发表评论