FineCMS标签list功能介绍与简单例子
action 支持cache,category,linkage,related tags,sql,table,form,member,module, search order 排序,例如: order=id_desc,userid_desc,默认desc排序,可以省掉_desc 升序是asc。 on 其他表的字段(非join表的自段),必须与join成对出现,否则join失效,例如:join=member on=userid。 thumb 值等于1的时候,显示有缩略图的文档;等于0的时候,显示无缩略图的文档 举个例子,取出新闻模型中,所以带缩略图的列表,并且按点击排序,限制为数量6 缩略图存储位置在 attachement_1表中要取出文件名,只能join attachment_1表,1表示站点1,on关键字表示,使用news.thumb=attachment_1.id的字段关联,num=6转换成sql语句就是limit 0,6 {list action=module module=news thumb=1 join=attachment_1 on=thumb,id order=hits num=6 } <?php // print_r($t);?> <div class="cpzx"> <table width="210" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="160" background="{THEME_PATH}lqjxc/images/picbg2.jpg" align="center"> <a href="{$t.url}" target="_blank" [if {isurl}=1]target="_blank"[end if]> <img src="/uploadfile/{$t.attachment}" width="194" height="145" border="0" /></a> </td> </tr> <tr> <td height="30" align="center"> <a href="{$t.url}" target="_blank" title="{$t.title}">{dr_strcut($t.title, 22)}</a> </td> </tr> </table> </div> {/list} 生成sql的语句可以在finecms/dayrui/libraries/template.php中case "module"中最后可以查看
查看解压密码