dede标签调用大全参考模板_第1页
dede标签调用大全参考模板_第2页
dede标签调用大全参考模板_第3页
dede标签调用大全参考模板_第4页
dede标签调用大全参考模板_第5页
已阅读5页,还剩43页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、dede标签调用大全 · · 关键描述调用标签: <meta name="keywords" content="dede:field name='keywords'/"><meta name="description" content="dede:field name='description' function='html2text(me)'/"> · · 模板路径调用标签: dede:field na

2、me='templeturl'/ · · 网站标题调用标签: dede:global name='cfg_webname'/ · · 栏目导航调用标签: <a href="/">首页</a></li>        dede:channel type='top' row='8' currentstyle="<li class='thisclas

3、s'><a href='typelink'>typename</a> </li>"   <li><a href='field:typelink/' target="_blank">field:typename/</a> </li>      /dede:channel · · 指定调用栏目标签: dede:onetype typeid='I

4、D'field:typename /dede:onetype · · 频道栏目调用标签: dede:channel type='self'<li><a href='field:typelink/'>field:typename/</a></li>/dede:channel 1 / 48· · 友情链接调用标签: dede:flink row='24' linktype=2/ · · 网站版权调用标签: dede:global nam

5、e='cfg_powerby'/ · · 网站备案调用标签: dede:global name='cfg_beian'/ · · 当前栏目名称标签: dede:field name='typename'/ · · 当前位置调用标签: dede:field name='position'/ · · 列表文章调用标签: dede:list pagesize='8'/dede:list · · 栏目链接调用标签: fiel

6、d:typelink function='str_replace("a ","a class=ulink ",me)'/ · · 作者链接调用标签: field:writer / · · 列表点击调用标签: field:click/ · · 列表评论调用标签: field:postnum/ · · 查阅全文调用标签: <a href="field:arcurl/">查阅全文.</a> · · 列表

7、时间调用标签: field:pubdate function="GetDateTimeMK(me)"/ · · 列表分页调用标签: dede:pagelist listsize='4' listitem='index pre pageno next end '/ · · 文章标题调用标签: dede:field name="title"/ · · 文章来源调用标签: dede:field name='source'/ · · 文

8、章作者调用标签: dede:field name='writer' / · · 文章时间调用标签: dede:field name='pubdate' function='GetDateMk(me)'/ · · 文章Tag调用标签: dede:tag type='current'/ · · 文章点击调用标签: <script src="dede:field name='phpurl'/count.php?aid=dede:field nam

9、e='ID'/&mid=dede:field name='memberid'/&view=yes" language="javascript"></script> · · 文章内容调用标签: dede:field name='body'/ · · 文章分页调用标签: dede:pagebreak/ · <a href="dede:field name='phpurl'/stow.php?arcID=de

10、de: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="

11、;#" onClick="window.print();">打印</a> · <a href="#" onClick="window.close();">关闭</a> · · 文章顶客次数标签: dede:field name='digg'/ <a href="javascript:Digg('digg',dede:field name='id'/);">顶一下</a&

12、gt; · · 上一篇下一篇标签: dede:prenext get='pre'/dede:prenext get='next'/ · · 头条推荐调用标签: dede:arclist row=1 titlelen=24 orderby=pubdate att=2 <dt> field:textlink/      <span>field:description/</span> </dt> /dede:arclist 

13、3; · 最新文章调用标签: dede:arclist row=8 titlelen=24 orderby=pubdate<li>field:textlink/</li> /dede:arclist · · 热关键字调用标签: dede:hotwords num='5' subday='30'/ · · 最新图文调用标签: dede:arclist row=4 titlelen=20 orderby=pubdate type='image.' imgwidth='1

14、52' imgheight='98'        <dd><a href="field:arcurl/"><img src="field:picname/" alt="field:title/" ></a><span><a title="field:title function='htmlspecialchars(me)'/ " href=

15、"field:arcurl /">field:title /</a></span> </dd>/dede:arclist · · 推荐文档调用标签: dede:arclist type='commend' titlelen='40' row='10' <li><a title="field:title function='htmlspecialchars(me)'/ " href="field:arcu

16、rl /">field:title /</a></li> /dede:arclist · · 随机推荐调用标签: dede:arclist type='commend' titlelen='26' orderby='rand' row='10' <li><a title="field:title function='htmlspecialchars(me)'/ " href="field:arcurl /&q

17、uot;>field:title /</a></li> /dede:arclist · · 热点文档调用标签: dede:arclist orderby='click' titlelen='40' row='10' <li><a title="field:title function='htmlspecialchars(me)'/ " href="field:arcurl /">field:title /</a&

18、gt;</li>   /dede:arclist · · 相关文档调用标签: dede:likeart titlelen='24' row='10' <li><a title="field:title function='htmlspecialchars(me)'/ " href="field:arcurl /">field:title /</a></li> /dede:likeart · 

19、3; 调用图片链接标记: <a href="field:arcurl/"><img src="field:picname/" alt="field:title/" ></a> ·                           &

20、#160;       <a href='field:arcurl /'>field:image/</a> · · 调用文字链接标记: <a href="field:aucurl/" title="field:title/">field:title/</a> · <a title="field:title function='htmlspecialchars(me)'/

21、" href="field:arcurl /">field:title /</a> · · 控制字数描述标记: field:description function="cn_substr(me,100)"/. · · 调用文章tags标记: dede:tag type='current'/ · · 文章关键字与描述: dede:field name='keywords'/     

22、60;             dede:field name='description' function='html2text(me)'/ · · 栏目介绍:dede:field name='description' function='html2text(me)'/ · · 调用外部htm文件:dede:include file='head.htm'

23、ismake='yes'/ · · 搜索文章调用标签:dede:global name='keyword'/&quot;的搜索结果 - dede:global name='cfg_webname'/                  搜索&quot; dede:global name='keyword'/</span>

24、;&quot; 的结果 · · 递增序列号: field:global name=autoindex/ · · 列表隔5行加一行线: · dede:list pagesize='50'<LI><a href="field:arcurl /" title="field:title function='htmlspecialchars(me)'/"         

25、0;     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

26、($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> · · 最新 文章列表 “隔行换色” 的方法 &

27、#183; dede:arclist orderby=pubdate titlelen='26' row='10' field:global runphp='yes' name=autoindex$a="<div id='a'>"$b="<div id='b'>"if (me%2)=0) me=$a;else me=$b;/field:global <ul><li>field:title/</li></ul&g

28、t;</div>/dede:arclist · · 24小时内更新的文章时间显示为红色: · 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;el

29、se me =$b; /field:pubdate · · COPY页面内容,自动在后面加上网站信息,利于SEO · <script type="text/javascript">document.body.oncopy = function () setTimeout( function () var text = clipboardData.getData("text"); if (text) text = text + "rn本篇文章来源于 www.地址.COM 原文链接:"+locat

30、ion.href; clipboardData.setData("text", text); , 100 ) </script> · · 按时间点击文章排行榜调用标签: · 按总: dede:arclist row='24' titlelen=24 orderby=click · 按月: dede:arclist row='24' titlelen=8 orderby=click subday=30 · 按周: dede:arclist row='24' title

31、len=8 orderby=click subday=7 · 在首页调用某栏目的子栏目 · dede:channel type=sun typeid=栏目ID<a href=”field:typelink/“>field:typename/</a>/dede:channel或者dede:global name=maplist/ · · 搜索表单调用标签: <form action="dede:global name='cfg_phpurl'/search.php" name="f

32、ormsearch">      <input type="hidden" name="kwtype" value="1" />      <input name="keyword" id="keyword" type="text" class="searchtxt" />    

33、;  <select name="searchtype" id="searchtype">        <option value="titlekeyword" selected>智能模糊搜索</option>        <option value="title">仅搜索标题</option> 

34、;     </select>      <input type="image" src="dede:field name='templeturl'/images/topsearch_submit.gif" />    </form> · · 实现“文章标题-2级栏目-1级栏目-网站名”形式 · · dede:field name='ti

35、tle'/-dede:field name='position' runphp='yes'$tc="-" /分隔符$tw=$GLOBALS'cfg_list_symbol' /调用位置分隔符me=html2text(me); /去除html标签$tf=split($tw,me); /分解成数组for($ta=(count($tf)-2);$ta>=1;$ta-) /循环赋值给$tk$tk.=trim($tf$ta).$tc;$tk=substr($tk,0,-1);me=$tk; /赋值给me/dede:fiel

36、d-dede:global name='cfg_webname'/ · · 调用缩略图: <img src='dede:field name="litpic"/'> · · 发布的文章显示红色日期或加上new字或new小图片· 给近三天(或当天)发布的文章显示红色日期或加上new字或new小图片等。都是围绕pubdate做文章,写扩展的。第2、3要注意的问题是:如:"<img src='new.gif' />中不能用双引号,否则不行。如果要给当

37、天的加,把3600 * 24 * 3改为3600 * 24 即可。1、=红色的日期=field:pubdate runphp='yes' $a="<font color=red>".strftime('%m-%d',me)."</font>"$b=strftime('%m-%d',me);$ntime = time(); $day3 = 3600 * 24 * 3;if($ntime - me) < $day3) me = $a;else me =$b; /field:pubd

38、ate2、=红色的(new)=field:pubdate runphp='yes'$aa=strftime('%m-%d',me);$ntime = time();$tagtime = me;$day3 = 3600 * 24 * 3;if($tagtime > $ntime-$day3) me = "<font color='red'>(new)</font>"else me = $aa;/field:pubdate3、=加new.gif小图片=field:pubdate runphp='

39、;yes'$aa=strftime('%m-%d',me);$ntime = time();$tagtime = me;$day3 = 3600 * 24 * 3;if($tagtime > $ntime-$day3) me = "<img src='new.gif' />".$aa;else me = $aa;/field:pubdate · · 一种很酷的时间效果 · field:pubdate runphp="yes"   

40、0;           if(time()-me)<(60*60*24)me=' <font color="#ff6600">'.strftime("%H:%M",me).'</FONT>'               else me=strftime(&

41、quot;%m-%d",me);                           /field:pubdate · · DEDE seo小技巧 加个百度搜索本篇文章 · 【<a href="javascript:" onclick='window.open(&q

42、uot; name="title" /&q2=&q3=&q4=&rn=10&lm=0&ct=1&ft=&q5=&q6=你的网址")' target="_top" title="在百度搜索“dede:field name="title" /”相关内容"><font color=red>在百度搜索更多繁体字</font></a>】· 把你的网址改一下,不加http,演示: 文章页

43、或者· 【<a href="javascript:" onclick='window.open(" name="title" /")' target="_top" title="在百度搜索“dede:field name="title" /”相关内容"><font color=red>搜索舞步</font></a>】· · 调用tag: dede:field name='ke

44、ywords' runphp='yes' if(!empty(me)$kws = explode(' ',me);me = ""foreach($kws as $k)me .= "<a href='/tag.php?/$k/'>$k</a> "me= str_replace('+', ' ',trim(me);/dede:field 专题调用dede:arclist row=10 orderby=rand type='spec.'

45、;<li><a href="field:filename function='str_replace("index.html","",me)'/" target="_blank"><STRONG>field:title function=' ( strlen("me")>16 ? cn_substr("me",16): "me" ) '/</STRONG></a&g

46、t; </li>/dede:arclist企业调用dede:sql sql="SELECT m.ID,m.type,m.userid,m.matt,c.id,nameFROM dede_member mleft join dede_member_cominfo c on m.ID = c.idwhere m.type = 1 and m.matt = 1LIMIT 0 , 10"<dd><span class="name"><a href='field:global name='cfg_cmspa

47、th'/member/?field:userid/'>field:comname/</a></span></dd>/dede:sql真正采集热门Tags,刷新一次变换一次 模板代码: dede:tag row='10' sort='month' <a class="tag" href='field:link/'>field:tagname/ </a> /dede:tag <script language="javascript&q

48、uot;> <!- var tag_a=document.getElementsByTagName("a"); for( i in tag_a) var offset=6; var num=4; if(tag_ai.className="tag") var rnd=Math.ceil(num+offset)*Math.random(); if(rnd>offset) tag_ai.className="tag"+(rnd-offset); /-> </script> CSS代码: .tag1 col

49、or:#339900;font-weight:bold; .tag2 color:#e65730; .tag3 color:#00b9da; .tag4 color:#FE3981;font-weight:bold;font-size:14px;更换标签方式: 默认调用的是当月热门标签,如果换想其他的可以:任何系统页面调用会员积分排行: dede:sql sql="Select id,userid,uname,scores From dede_member order by scores desc limit 0,10"<dd><span class=&q

50、uot;name"><a href='field:global name='cfg_cmspath'/member/?field:userid/'>field:uname/</a></span><span class="jifen">积分field:scores/</span></dd>/dede:sql<!-问答系统->调用dede:ask row='10'<li><span class="gpcl

51、ass"><a href="field:typeurl/">field:tidname/</a></span><span class="gptlink"><a href="field:url/">field:title/</a></span></li>/dede:ask列表页调用TAG标签的两种方法 dedecms默认在列表是无法调用tag标签的,经过各位版主们的帮助,现给大家提供出种方法方法1:在列表需要的位置加入下列代码

52、field:id runphp=yes$tsql = new DedeSql(false);$tags = ''$tsql->SetQuery("Select i.tagname From dede_tag_list t left join dede_tag_index i on i.id=t.tid where t.aid='me'");$tsql->Execute('t');while($row = $tsql->GetArray('t',MYSQL_ASSOC)$tags .= &quo

53、t;<a href='/tag.php?/".urlencode($row'tagname')."'>".$row'tagname'."</a>" me=$tags;/field:id 方法2:在inc_functions.php文件里加入function listtag($aid)$tsql = new DedeSql(false);$tags = ''$tsql->SetQuery("Select i.tagname From dede_

54、tag_list t left join dede_tag_index i on i.id=t.tid where t.aid='$aid'");$tsql->Execute('t');while($row = $tsql->GetArray('t',MYSQL_ASSOC)$tags .= "<a href='/tag.php?/".urlencode($row'tagname')."'>".$row'tagname'.&q

55、uot;</a>"return $tags;然后在列表页相应位置加入field:ID function="listtag(me)"/标记去除html field:title function='htmlspecialchars(me)'/ 主要使用在FLASH以及<a>中,是了了去除标签中的HTML元素,比如<b></b>等,如果不使用此标签,则会导致HTML代码显示在页面中。 使用方法<a title="field:title function='htmlspecialcha

56、rs(me)'/ " href="field:arcurl /">field:title /</a> 或者 <a href="field:arcurl /" ><img src='field:litpic/' alt="field:title function='htmlspecialchars(me)'/" border='0' width='' height=''></a> 图片:

57、 1: <a href='field:arcurl /'><img src='field:litpic/' border='0' width='' height=''></a>2: field:imglink /3: <a href='field:arcurl /'> field:image/</a>field:imglink /与<a href='field:arcurl /'>field:image/<

58、/a> 是完全等价的,只不过后者更灵活一点,可以在 <a>中添加 title=""即<a href='field:arcurl /' title="field:title function='htmlspecialchars(me)'/ ">field:image/</a><a href='field:arcurl /'><img src='field:litpic/' border='0' width='&

59、#39; height=''></a>则更为灵活,不仅可以添加title="",还可以添加 alt="",但是虽然灵活了,缺少了图片的宽度和高度的控制,所以要在CSS中控制图片的大小,适合对CSS有一点了解的人。栏目: 1: <a href='field:typeurl /'>field:typename /</a>2:field:typelink / 二者是相等的,只不过是前者更灵活一点 连接: 1: <a href='field:arcurl /'>

60、field:title /</a>2:field:textlink /两者是相等的,前者比后者更灵活,可以增加titie="" 在这里应该注意的是,title长度的问题,Dedecms数据库中最大长度为80字节,40汉字宽度,另外,arclist标签里面如果不设置titlelen的值,则默认取值为30字符,15汉字宽度 所以除了在使用titlelen控制标题长度,还可以使用另外一种方法来控制标题长度 设置titlelen="80"<a href="field:arcurl /" title="field:t

61、itle function='htmlspecialchars(me)'/">field:title function="cn_substr(me,30)"/</a>这种格式的好处是,title=""中为完整标题,即鼠标停留显示完整标题,function="cn_substr(me,40)"作用是截取40字符宽度,20汉宽度。点击: field:click/ field:click runphp="yes" if(me>1000)me='<font c

62、olor="#ff0000">me</font>' else me=me; /field:click超过1000点击的,显示红色简介: 1: field:info /2: field:description /3: field:info function="cn_substr(me,120)"/4: field:description function="cn_substr(me,120)"/两种是相等的,简介长度有两种控制方式,一种是infolen="" 控制,如果infolen无参数,

63、则默认为250 另外一种是使用function="cn_substr(me,120)"控制 120为所取字符宽度,日期: field:pubdate /效果 1:field:pubdate runphp="yes" if(time()-me)<(60*60*24)me=' <font color="#ff6600">'.strftime("%H:%M",me).'</FONT>' else me=strftime("%m-%d",me

64、); /field:pubdate效果 2:24内发布的文章日期显示红色field:pubdate runphp="yes" if(time()-me)<(60*60*24)me=' <font color="#ff6600">'.strftime("%m-%d",me).'</FONT>' else me=strftime("%m-%d",me); /field:pubdate field:pubdate function='strftime(

65、"%Y-%m-%d %H:%M:%S",me)'/ 2008-11-01 11:11:52 field:pubdate function='strftime("%y-%m-%d %H:%M:%S",me)'/ 08-11-01 11:11:52 field:pubdate function='strftime("%m-%d %H:%M:%S",me)'/ 11-01 11:14:20 field:pubdate function='strftime("%m-%d %H:%M&q

66、uot;,me)'/ 11-01 11:14 field:pubdate function='strftime("%y-%m-%d",me)'/ 08-11-01 field:pubdate function='strftime("%y年%m月%d日",me)'/ 08年11月01日 field:pubdate function='strftime("%Y年%m月%d日 %H点%M分%S秒",me)'/ 2008年11月01日 11点17分36秒 field:pubdate fu

67、nction='strftime("%b %d, %Y",me)'/ Nov 01, 2008 field:pubdate function='strftime("%A on %b %d, %Y, %X : %Z",me)'/ Saturday on Nov 01, 2008, 11:21:06 : 中国标准时间 %a 星期几的缩写。 %A 星期几的全名。 %b 月份名称的缩写。 %B 月份名称的全名。 %c 本地端日期时间较佳表示字符串。 %d 用数字表示本月的第几天 (范围为 00 至 31)。 %H 用24小时制数字

68、表示小时数 (范围为 00 至 23)。 %I 用12小时制数字表示小时数 (范围为 01 至 12)。 %j 以数字表示当年度的第几天 (范围为001至 366)。 %m 月份的数字 (范围由 1 至 12)。 %M 分钟。 %p 以 'AM' 或 'PM' 表示本地端时间。 %S 秒数。 %U 数字表示为本年度的第几周,第一个星期由第一个周日开始。 %W 数字表示为本年度的第几周,第一个星期由第一个周一开始。 %w 用数字表示本周的第几天 ( 0 为周日)。 %x 不含时间的日期表示法。 %X 不含日期的时间表示法。 %y 二位数字表示年份 (范围由 00

69、至 99)。%Y 完整的年份数字表示,即四位数。 %Z 时区或名称缩写。 % % 字符。评论: field:postnum/ 作者: field:writer /dede:arclist【Arclist 标记】这个标记是DedeCms最常用的一个标记,也叫自由列表标记,其中 hotart、coolart、likeart、artlist、imglist、imginfolist、specart、autolist 这些标记都是由这个标记所定义的不同属性延伸出来的别名标记。功能说明:获取指定的文档列表适用范围:封面模板、列表模板、文档模板基本语法:dede:arclist typeid='&#

70、39; row='' col='' titlelen='' infolen=''imgwidth='' imgheight='' listtype='' orderby='' keyword=''底层模板(InnerText)/dede:arclist属性说明:1 typeid='' 表示栏目ID,在列表模板和档案模板中一般不需要指定,在封面模板中允许用","分开表示多个栏目;2 row='' 表示返

71、回文档列表总数;3 col='' 表示分多少列显示(默认为单列);4 titlelen='' 表示标题长度;5 infolen='' 表示内容简介长度;6 imgwidth='' 表示缩略图宽度;7 imgheight='' 表示缩略图高度;8 type='' 表示档案类型,其中空值、不使用这个属性或type='all'时为普通文档 § type='commend'时,表示推荐文档,等同于 dede:coolart/dede:coolart§ ty

72、pe='image'时,表示必须含有缩略图片的文档,等同于dede:imglist/dede:imglist、dede:imginfolist/dede:imginfolist§ type='spec'时,表示专题,等同于标记dede:specart/dede:specart以上属性值可以联合使用,如: type='commend image' 表示推荐的图片文档9 orderby='' 表示排序方式,默认值是 senddate 按发布时间排列。§ orderby='hot' 或 orderby

73、='click' 表示按点击数排列§ orderby='pubdate' 按出版时间排列(即是前台允许更改的时间值)§ orderby='sortrank' 按文章的新排序级别排序(如果你想使用置顶文章则使用这个属性)§ orderby='id' 按文章ID排序§ orderby='postnum' 按文章评论次数排序§ orderby='rank' 随机获得指定条件的文档列表10 orderway='' 值为 desc 或 asc ,指定排序方式是降序还是顺向排序,默认为降序。11 keyword='' 表示含有指定关键字的文档列表,多个关键字用","分开12 channelid='' 表示特定的频道模型ID,内置的频道:专题(-1)、文章(1)、图集(2)、Flash(4)、软件(3)13 limit='起始,结束' 表示限定的记录范围,row属性必须等于"结

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论