冠富商务通中文社区

 找回密码
 立即注册
查看: 9|回复: 0
打印 上一主题 下一主题
收起左侧

[建站经验] 【phpcms标签模板专题】-phpcms标签模板及专题模板的制作

[复制链接]
跳转到指定楼层
楼主
发表于 2017-10-29 03:12:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
关键字描述:模板 制作 专题 标签 table width=100% border=0 align=center cellpadding=1 cellspacing=1
{loop $articles $i $article}
{if $i%$cols==0} tr {/if}
td height=20 width={$width}
{$article[img]} {if $showcatname}{$article[catname]}{/if} a href={$article[url]} title={$article[alt]} target={$target} class=tag_title_link{$article[title]}/a
{if $showhits}({$article[hits]}){/if}
{if $showauthor}[作者:{$article[author]}]{/if}
{if $article[showcommentlink]}nbsp;a href={PHPCMS_PATH}comment/?item=articleiditemid={$article[articleid]} target=_blankspan class=color_red评/span/a{/if}
{if $datetype}[span class=tag_date{$article[adddate]}/span]{/if}
{if $descriptionlen}br/span class=tag_descriptionnbsp;nbsp;nbsp;nbsp;{$article[description]}/span{/if}
/td
{if $i%$cols==($cols-1)}/tr{/if}
{/loop}
/table

{if $pages}
div class=pages{$pages}/div
{/if} 这个里面
{loop $articles $i $article}是一个循环,我们要关注的就是这个循环里面的内容
{if $i%$cols==0} tr {/if} 我们在标签里面设定的参数,显示几列,根据这个来控制标签的显示
{$article[img]} 文章的图片,显示精华,置顶,还是普通文章
{if $showcatname}{$article[catname]}{/if} 所属栏目

{$article[url]} 文章路径

{$article[title]} 文章标题
{if $showhits}({$article[hits]}){/if} 点击数
{if $showauthor}[作者:{$article[author]}]{/if} 作者
{if $article[showcommentlink]} a href={PHPCMS_PATH}comment/?item=articleiditemid={$article[articleid]} target=_blankspan class=color_red评/span/a{/if} 评论连接
{if $datetype}[span class=tag_date{$article[adddate]}/span]{/if} 添加时间
{if $descriptionlen}br/span class=tag_description {$article[description]}/span{/if} 描述说明

如果我们要实现时间的靠右对齐,那么我们可以把这个模板改成

CODE: [Copy to clipboard] table width=100% border=0 align=center cellpadding=1 cellspacing=1
{loop $articles $i $article}
            上一页12 下一页 阅读全文
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|关于我们|申请友链|Archiver|手机版|拘留所|冠富商务通

GMT+8, 2026-3-29 00:38 , Processed in 0.090005 second(s), 17 queries , Wincache On.

Powered by HCMS Version 2.0

© 2008-05-14 guanfu.net.cn

快速回复 返回顶部 返回列表