dedeCMS标签调用技巧和大全

1. 页面php方法获取字段 $refObj->Fields[‘id’];

2. 在页面上使用PHP连接数据库查询

{dede:php}$db = new DedeSql(false);$dsql = “select id,typename from nd_arctype where topid=8”;$db->Execute(‘me’,$dsql);while($arr = $db->GetArray()){ $r = $db->GetOne(“select count(id) as count from nd_archives where typeid=”.$arr[id]); $str .= “<dd><a href=’/plus/list.php?tid=$arr[id]&count=$r[count]’>$arr[typename]</a> <span class=’red’>($r[count])</span></dd></li>”; $count += $r[count];}echo “<dd>全部设计图 <span class=’red’>($count)</span></dd>”.$str;{/dede:php}

<meta name=”description” content=”{dede:field name=’description’ function=’html2text(@me)’/}”> {dede:channel type=’top’ row=’8′ currentstyle=”<li class=’thisclass’><a href=’~typelink~’>~typename~</a> </li>”} <li><a href='[field:typelink/]’ target=”_blank”>[field:typename/]</a> </li> {/dede:channel} ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– <meta name=”description” content=”{dede:field name=’description’ function=’html2text(@me)’/}”> ——————————————————————————– ——————————————————————————– ——————————————————————————– {dede:channel type=’top’ row=’8′ currentstyle=”<li class=’thisclass’><a href=’~typelink~’>~typename~</a> </li>”} <li><a href='[field:typelink/]’ target=”_blank”>[field:typename/]</a> </li> {/dede:channel} ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– [<a href=”{dede:field name=’phpurl’/}/stow.php?arcID={dede:field name=ID/}”>收藏</a>] [<a href=”{dede:field name=’phpurl’/}/recommend.php?arcID={dede:field name=ID/}”>推荐</a>] [<a href=”{dede:field name=’phpurl’/}/feedback.php?arcID={dede:field name=ID/}”>评论</a>] [<a href=”#” onClick=”window.print();”>打印</a>] [<a href=”#” onClick=”window.close();”>关闭</a>] ——————————————————————————– ——————————————————————————– ——————————————————————————– <span>[field:description/]……</span> </dt> {/dede:arclist} ——————————————————————————– ——————————————————————————– ——————————————————————————– <dd><a href=”[field:arcurl/]”><img src=”[field:picname/]” alt=”[field:title/]” ></a><span><a title=”[field:title function=’htmlspecialchars(@me)’/] ” href=”[field:arcurl /]”>[field:title /]</a></span> </dd>{/dede:arclist} ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– ——————————————————————————– 调用图片链接标记: <a href=”[field:arcurl/]”><img src=”[field:picname/]” alt=”[field:title/]” ></a> <a href='[field:arcurl /]’>[field:image/]</a> ——————————————————————————– 调用文字链接标记: <a href=”[field:aucurl/]” title=”[field:title/]”>[field:title/]</a> <a title=”[field:title function=’htmlspecialchars(@me)’/] ” href=”[field:arcurl /]”>[field:title /]</a> ——————————————————————————– 控制字数描述标记: [field:description function=”cn_substr(@me,100)”/]… ——————————————————————————– 调用文章tags标记: {dede:tag type=’current’/} ——————————————————————————– 文章关键字与描述: {dede:field name=’keywords’/} {dede:field name=’description’ function=’html2text(@me)’/} ——————————————————————————– 栏目介绍:{dede:field name=’description’ function=’html2text(@me)’/} ——————————————————————————– 调用外部htm文件:{dede:include file=’head.htm’ ismake=’yes’/} ——————————————————————————– ——————————————————————————– 递增序列号: [field:global name=autoindex/] ——————————————————————————– 列表隔5行加一行线: {dede:list pagesize=’50’} <LI><a href=”[field:arcurl /]” title=”[field:title function=’htmlspecialchars(@me)’/]” target=_blank>[field:title function=”cn_substr(@me,48)”/]</a>[field:pubdate runphp=’yes’] $a=”<font color=red>”.strftime(‘%m-%d’,@me).”</font>”; $b=strftime(‘%m-%d’,@me); $ntime = time(); $day3 = 3600 * 24; if(($ntime – @me) < $day3) @me = $a; else @me =$b; [/field:pubdate]<br> [field:global name=autoindex runphp=”yes”] if(@me%5==0)@me=”<hr />”; else @me=””; [/field:global] {/dede:list} <DIV class=”line2 m1 m3″></DIV> </LI>

到底通向了什么样的远方呢?

dedeCMS标签调用技巧和大全

相关文章:

你感兴趣的文章:

标签云: