dedecms的一些技巧:
1.判断当前页面是否是首页:
{dede:geturl runphp='yes'}$cu = GetCurUrl();if ( $cu == '/' || $cu == '/index.php' ) { @me = 'current';}{/dede:geturl} include/common.inc.php文档默认的命名规则:$art_shortname = $cfg_df_ext = '.html'$cfg_df_namerule = '{typedir}/{Y}{M}{D}'.$cfg_df_ext; {dede:php}print_r($refObj->Fields);{/dede:php}//dedecms来调用9个企业会员
{dede:sql sql='SELECT * from dede_member where mytype="企业" order by mid limit 0,9'}<a href=../member/index.php?uid=[field:userid/] target='_blank'>[field:uname]</a>{/dede:sql} <div class="listbox">{dede:channelartlist}<dl class="tbox"><dt><strong><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></strong><span class="more"><a href="{dede:field name='typeurl'/}">更多...</a></span></dt><dd><ul class="d1 ico3">{dede:arclist titlelen='60' row='8'}<li><span>[field:pubdate function="MyDate('m-d',@me)"/]</span><a href="[field:arcurl /]">[field:title/]</a></li>{/dede:arclist}</ul></dd></dl>{/dede:channelartlist}</div> 如何获取某篇文章内容的几种方法:1.使用SQL{dede:sql sql='Select body from `dede_addonarticle` where aid=146'}[field:body/]{/dede:sql}2.使用article,用idlist获取,aid是没用的,在首页要记得获取typeid,用addfields='body'来直接使用[field:body/]
{dede:arclist typeid='49' idlist='146' addfields='body' channelid='1'}<section class="recommend"><header class="header"><h2><a href="[field:arcurl/]">[field:title/]</a></h2><a href="[field:arcurl/]" class="more" title="更多..">More</a></header><div class="counter">[field:body/]</div></section>{/dede:arclist} 3.混搭{dede:arclist typeid='48' limit='0,10'}<li><time class="date">[field:id runphp='yes']$aid = @me;$row = $GLOBALS['dsql']->GetOne("Select artivitydate From `dede_addonarticle20` where aid='$aid'");@me = "{$row['artivitydate']}";[/field:id]</time><a href="[field:arcurl/]" title="详情">[field:title/]</a></li>{/dede:arclist}dedecms输出下载链接:
http://www.cnblogs.com/Byrd/archive/2011/08/04/2127684.html输出的界面添加的三天内的内容是带有new和红色:
http://www.jiaock.com/cms/dedecms/2012/1203/228.html