【原创整理】织梦dedecms仿站调用代码大全

★★★★★★★★★★★★首页★★★★★★★★★★★★


关键描述调用标签: <meta name="description" content="{dede:global.cfg_description/}" />
                   <meta name="keywords" content="{dede:global.cfg_keywords/}" />


模板路径调用标签: {dede:field name='templeturl'/}


网站标题调用标签: {dede:global.cfg_webname/}


栏目导航调用标签: <a href="/">首页</a></li>
{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}


指定调用栏目标签: {dede:onetype typeid='ID'}[field:typename /]{/dede:onetype}


频道栏目调用标签: {dede:channel type='self'}<li><a href='[field:typelink/]'>[field:typename/]</a></li>{/dede:channel}


友情链接调用标签: {dede:flink row='24'/}


网站版权调用标签: {dede:global name='cfg_powerby'/}


网站备案调用标签: {dede:global name='cfg_beian'/}


头版头条调用标签:      
      {dede:arclist flag='h' limit='0,1' infolen='230'}
        带连接的标题:<a href="[field:arcurl/]">[field:title/]</a>
        描述和全文链:[field:infos /]...<a href="[field:arcurl/]">[查看全文]</a>
        {/dede:arclist}


头版最新文章调用:
        {dede:arclist row=14 titlelen=32 noflag='h'}
        带连接的标题:<li><a href="[field:arcurl/]">[field:title/]</a></li>
        {/dede:arclist}


织梦dedecms文章列表标签中在标题前加数字序列号:[field:global runphp='yes' name=autoindex][/field:global]


指定栏目调用带时间:{dede:arclist row='10' titlelen='24' orderby='pubdate' typeid='X' idlist=''}
        带连接的标题:[field:textlink/]
        时间:[field:pubdate function=MyDate('m-d',@me)/]
                   {/dede:arclist}


指定栏目调用带栏目名称:{dede:arclist row='10' titlelen='24' orderby='pubdate' typeid='X' idlist=''}
        带连接的栏目名称:[field:typelink/] 
        带连接的标题:[field:textlink/]
{/dede:arclist}




带图片的内容调用:{dede:arclist row='1' titlelen='24' orderby='pubdate' typeid='X' idlist=''}
        带连接的图片:[field:imglink/]
        带连接的标题:<a href="[field:filename/]">[field:title/]</a>
        描述:[field:info/]
        查看全文: <a href="[field:arcurl/]">[查看全文]</a>
                {/dede:arclist}


循环调用标签展示: {dede:channelartlist}
        带链接的栏目名称<a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a>
        {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}
{/dede:channelartlist}


带title属性的列表:
        {dede:arclist titlelen='30' }
        <a href="[field:arcurl/]" target="_blank" title="[field:fulltitle/]"><img alt="悍将传世ol" src="[field:litpic/]"></a>
        {/dede:arclist}
————————————————————————————————————————————————
★★★★★★★★★★★★列表★★★★★★★★★★★★


列表频道专用SEO标题:{dede:field.seotitle /}


列表标题调用标签: {dede:field.title/}_{dede:global.cfg_webname/}


列表页关键词描述: 
<meta name="keywords" content="{dede:field name='keywords'/}" />
<meta name="description" content="{dede:field name='description' function='html2text(@me)'/}" />


当前栏目名称标签: {dede:field name='typename'/}  
带连接的栏目名称:<a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a>


当前位置调用标签: {dede:field name='position'/}


列表调用标签: 


{dede:list pagesize='10'}
                列表图片:[field:array runphp='yes']@me = (empty(@me['litpic']) ? "" : "<a href='{@me['arcurl']}' class='preview'><img src='{@me['litpic']}'/></a>"); [/field:array]
        带连接的栏目名称:[field:typelink/] 
        带连接的文章标题:<a href="[field:arcurl/]" class="title">[field:title/]</a>
                    日期:[field:pubdate function="GetDateTimeMK(@me)"/] 
                    点击:[field:click/] 
                    好评:[field:scores/]
                    描述:[field:description/]... 
        {/dede:list}


查阅全文调用标签: <a href="[field:arcurl/]">查阅全文...</a>


列表时间调用标签: [field:pubdate function="GetDateTimeMK(@me)"/]


列表分页调用标签: {dede:pagelist listitem="info,index,end,pre,next,pageno,option" listsize="5"/}




循环调用子栏目:
 {dede:channelartlist}


   <a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a>


      {dede:arclist row='1' titlelen='24' infolen='100'  type='image.'}
      [field:imglink/] 
        <a href="[field:filename/]">[field:title/]</a>
      [field:info/]....<a href="[field:filename/]" >[详细]</a>
      {/dede:arclist}


      {dede:arclist titlelen='40' row='4'}
        <a href="[field:arcurl /]">[field:title /]</a>
      {/dede:arclist}


 {/dede:channelartlist}


————————————————————————————————————————————————
★★★★★★★★★★★★内容★★★★★★★★★★★★


内容标题调用标签: {dede:field.title/}_{dede:global.cfg_webname/}  
内容页关键词描述: 
<meta name="keywords" content="{dede:field.keywords/}" />
<meta name="description" content="{dede:field.description function='html2text(@me)'/}" />


当前栏目名称标签: {dede:field name='typename'/} 


当前位置调用标签: {dede:field name='position'/}


文章标题调用标签: {dede:field name="title"/}  {dede:field.title/}


文章导读(文章描述):{dede:field.description runphp='yes'}
                if(@me<>'' )@me = '<div class="info"><strong>导读:</strong>'.@me.'</div>';
               {/dede:field.description}


文章内容调用标签: {dede:field name='body'/} 


文章点击调用标签: <script src="{dede:field name='phpurl'/}/count.php?view=yes&aid={dede:field name='id'/}&mid={dede:field name='mid'/}" type='text/javascript' language="javascript"></script>


文章来源调用标签: {dede:field name='source'/}


文章作者调用标签: {dede:field name='writer' /}


文章时间调用标签: {dede:field name='pubdate' function='GetDateMk(@me)'/}


文章Tag调用标签:  {dede:tag row=8 sort="week"}<a href="[field:link/]" >[field:tag /]</a>{/dede:tag}


上一篇下一篇标签:  {dede:prenext get='pre'/}     {dede:prenext get='next'/}
{dede:field name='arcurl'/}
————————————————————————————————————————————————
★★★★★★★★★★★★常用★★★★★★★★★★★★


最新文章调用标签: {dede:arclist row=8 titlelen=24 orderby=pubdate}
                   <li>[field:textlink/]</li>
                   {/dede:arclist}


   推荐文档调用标签: 
{dede:arclist type='commend' titlelen='40' row='3'} 
 <li><a title="[field:title function='htmlspecialchars(@me)'/] " href="[field:arcurl /]">[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></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}


调用公共头部和底部:{dede:include filename="head.htm"/}  {dede:include filename="footer.htm"/}




————————————————————————————————————————————————
★★★★★★★★★★★★其他★★★★★★★★★★★★


头条推荐调用标签: {dede:arclist row=1 titlelen=24 orderby=pubdate att=2} <dt> [field:textlink/]
<span>[field:description/]……</span> </dt> {/dede:arclist}
--------------------------------------------------------------------------------
热关键字调用标签: {dede:hotwords num='5' subday='30'/}
--------------------------------------------------------------------------------
最新图文调用标签: {dede:arclist row=4 titlelen=20 orderby=pubdate type='image.' imgwidth='152' imgheight='98'}
<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}
--------------------------------------------------------------------------------
调用指定栏目图片文章标题:{dede:arclist row='2' titlelen='24' orderby='pubdate' typeid='X' idlist='' col='2'}


<table border="0" cellpadding="0" cellspacing="2" width="98%">
   <tbody><tr><td align="center">[field:imglink/]</td></tr>
   <tr><td align="center">[field:textlink/]</td></tr>
</tbody></table>


{/dede:arclist}


--------------------------------------------------------------------------------
图文混合编排调用:
{dede:arclist row='1' titlelen='24'  typeid='X' infolen='72'} 
[field:imglink/] *<a href='[field:arcurl /]'>[field:image/]</a>*<a href="[field:arcurl/]"><img src="[field:picname/]" alt="[field:title/]" ></a>
[field:textlink/]*<a href="[field:arcurl /]">[field:title /]</a>
[field:info/]....<a href="[field:filename/]" >[详细]</a>
{/dede:arclist}
————————————
{dede:arclist row='6' titlelen='36'  typeid='X' }
<li>·<a href="[field:filename/]">[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 /]">[field:title /]</a></li> {/dede:arclist}
--------------------------------------------------------------------------------
调用图片链接标记: 第一种 :<a href="[field:arcurl/]"><
 src="[field:picname/]" alt="[field:title/]" ></a>
第二种:[field:imglink/]
--------------------------------------------------------------------------------
调用文章tags标记: {dede:tag type='current'/}
--------------------------------------------------------------------------------
栏目介绍:{dede:field name='description' function='html2text(@me)'/}
--------------------------------------------------------------------------------
调用外部htm文件:{dede:include file='head.htm' ismake='yes'/}
--------------------------------------------------------------------------------
搜索文章调用标签:{dede:global name='keyword'/}&quot;的搜索结果 - {dede:global name='cfg_webname'/} 搜索&quot; {dede:global name='keyword'/}</span>&quot; 的结果
--------------------------------------------------------------------------------
递增序列号: [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>
--------------------------------------------------------------------------------
最新 文章列表 “隔行换色” 的方法
{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>
</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;
else @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 + "\r\n本篇文章来源于 www.地址.COM 原文链接:"+location.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' titlelen=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="formsearch">
<input type="hidden" name="kwtype" value="1" />
<input name="keyword" id="keyword" type="text" class="searchtxt" />
<select name="searchtype" id="searchtype">
<option value="titlekeyword" selected>智能模糊搜索</option>
<option value="title">仅搜索标题</option>
</select>
<input type="image" src="{dede:field name='templeturl'/}/images/topsearch_submit.gif" />
</form>
--------------------------------------------------------------------------------
实现“文章标题-2级栏目-1级栏目-网站名”形式
{dede:field name='title'/}-{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:field}-{dede:global name='cfg_webname'/}
--------------------------------------------------------------------------------
调用缩略图: <img src='{dede:field name="litpic"/}'>
--------------------------------------------------------------------------------
发布的文章显示红色日期或加上new字或new小图片
给近三天(或当天)发布的文章显示红色日期或加上new字或new小图片等。
都是围绕pubdate做文章,写扩展的。
第2、3要注意的问题是:如:"<img src='new.gif' />中不能用双引号,否则不行。
如果要给当天的加,把 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:pubdate]
2、==========红色的(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:pubdate]
3、==========加new.gif小图片========
[field:pubdate runphp='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"]
if((time()-@me)<(60*60*24)){@me=' <font color="#ff6600">'.strftime("%H:%M",@me).'</FONT>';}
else {@me=strftime("%m-%d",@me);}
[/field:pubdate]
--------------------------------------------------------------------------------
DEDE seo小技巧 加个百度搜索本篇文章
【<a href="javascript:" οnclick='window.open("http://www.baidu.com/s?q1={dede:field name="title" /}&q2=&q3=&q4=&rn=10&lm=0&ct=1&ft=&q5=& amp;q6=你的网址")' target="_top" title="在百度搜索“{dede:field name="title" /}”相关内容"><font color=red>在百度搜索更多繁体字</font></a>】
把你的网址改一下,不加http,演示:http://ftz.zzyo.com 文章页
或者
【<a href="javascript:" οnclick='window.open("http://www.baidu.com/baidu?word={dede:field name="title" /}")' target="_top" title="在百度搜索“{dede:field name="title" /}”相关内容"><font color=red>搜索舞步</font></a>】
--------------------------------------------------------------------------------


调用tag: {dede:field name='keywords' 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}
--------------------------------------------------------------------------------
真正采集热门Tags,刷新一次变换一次
模板代码:
{dede:tag row='10' sort='month' }
<a class="tag" href='[field:link/]'>[field:tagname/] </a>
{/dede:tag}
<script language="javascript">
<!--
var tag_a=document.getElementsByTagName_r("a");
for( i in tag_a){
var offset=6;
var num=4;
if(tag_a[i].className=="tag"){
var rnd=Math.ceil((num+offset)*Math.random());
if(rnd>offset){
tag_a[i].className="tag"+(rnd-offset);
}
}
}
//-->
</script>
CSS代码:
.tag1 { color:#339900;font-weight:bold;}
.tag2 { color:#e65730;}
.tag3 { color:#00b9da;}
.tag4 { color:#FE3981;font-weight:bold;font-size:14px;}
更换标签方式:
默认调用的是当月热门标签,如果换想其他的可以:
--------------------------------------------------------------------------------
最新标签
{dede:tag row='30' sort='new'}<a href='[field:link/]'>[field:highlight/]([field:result/])</a> {/dede:tag}
--------------------------------------------------------------------------------
当月热门标签
{dede:tag row='30' sort='month'}<a href='[field:link/]'>[field:tagname/]([field:result/])</a>
{/dede:tag}
--------------------------------------------------------------------------------
随机标签
{dede:tag row='60' sort='rand'}<a href='[field:link/]'>[field:highlight/]([field:result/])</a> {/dede:tag}
--------------------------------------------------------------------------------
任何系统页面调用会员积分排行:
{dede:sql sql="Select id,userid,uname,scores From dede_member order by scores desc limit 0,10"}
<dd><span class="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="gpclass">[<a href="[field:typeurl/]">[field:tidname/]</a>]</span>
<span class="gptlink"><a href="[field:url/]">[field:title/]</a></span>
</li>
{/dede:ask}
--------------------------------------------------------------------------------
企业调用
{dede:sql sql="SELECT m.ID,m.type,m.userid,m.matt,c.id,c.comname
FROM dede_member m
left join dede_member_cominfo c on m.ID = c.id
where m.type = 1 and m.matt = 1
LIMIT 0 , 10"}
<dd><span class="name"><a href='[field:global name='cfg_cmspath'/]/member/?[field:userid/]/'>[field:comname/]</a>
</span></dd>
{/dede:sql}
--------------------------------------------------------------------------------
专题调用
{dede:arclist row=10 orderby=rand type='spec.'}
<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> </li>
{/dede:arclist}
--------------------------------------------------------------------------------
列表页调用TAG标签的两种方法
dedecms默认在列表是无法调用tag标签的,经过各位版主们的帮助,现给大家提供出种方法
方法1:
在列表需要的位置加入下列代码
[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 .= "<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_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']."</a>";
}
return $tags;
}
然后在列表页相应位置加入
[field:ID function="listtag(@me)"/]标记
--------------------------------------------------------------------------------
{dede:arclist typeid='' row='' col='' titlelen='' infolen=''
imgwidth='' imgheight='' listtype='' orderby='' keyword=''}
--------------------------------------------------------------------------------
去除html
[field:title function='htmlspecialchars(@me)'/]
主要使用在FLASH以及<a>中,是了了去除标签中的HTML元素,比如<b></b>等,如果不使用此标签,则会导致HTML代码显示在页面中。


使用方法:
<a title="[field:title function='htmlspecialchars(@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>
-------------------------------------------------------------------------------
图片:
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/]</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='' height=''></a>
则更为灵活,不仅可以添加title="",还可以添加 alt="",但是虽然灵活了,缺少了图片的宽度和高度的控制,所以要在CSS中控制图片的大小,适合对CSS有一点了解的人。
-------------------------------------------------------------------------------
栏目:
1: <a href='[field:typeurl /]'>[field:typename /]</a>
2:[field:typelink /]     二者是相等的,只不过是前者更灵活一点
-------------------------------------------------------------------------------
连接和链接中的标题:
1: <a href='[field:arcurl /]'>[field:title /]</a>
2:[field:textlink /]
两者是相等的,前者比后者更灵活,可以增加titie="" 在这里应该注意的是,title长度的问题,Dedecms数据库中最大长度为80字节,40汉字宽度,另外,arclist标签里面如果不设置titlelen的值,则默认取值为30字符,15汉字宽度
所以除了在使用titlelen控制标题长度,还可以使用另外一种方法来控制标题长度
设置titlelen="80"
<a href="[field:arcurl /]" title="[field:title function='htmlspecialchars(@me)'/]">[field:title function="cn_substr(@me,40)"/]</a>
这种格式的好处是,title=""中为完整标题,即鼠标停留显示完整标题,function="cn_substr(@me,40)"作用是截取40字符宽度,20汉宽度。
-------------------------------------------------------------------------------
点击:
[field:click/]
[field:click runphp="yes"]
if(@me>1000)@me='<font color="#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无参数,则默认为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);}
[/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("%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",@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 function='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小时制数字表示小时数 (范围为 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 至 99)。


%Y 完整的年份数字表示,即四位数。
%Z 时区或名称缩写。
%% % 字符。
-------------------------------------------------------------------------------
评论:
[field:postnum/]


作者: [field:writer /]
-------------------------------------------------------------------------------








http://apps.hi.baidu.com/share/detail/15819521 织梦 首页列表单独调用 图文混排列表 
-------------------------------------------------------------------------------
有些时候我们在制作模板的需要在文章标题前面加上序列号,可以通过织梦自带的autoindex属性来实现,实现方法很简单,只需要在序号递增的地方加上 这段代码就行,[field:global runphp='yes' name=autoindex][/field:global] ,完整代码如下。


可以通过 autoindex 属性实现更多高级的功能,大家可以搜索一下autoindex的用法了解更多。


         <ul >
                        {dede:arclist row=’5′  titlelen=’30′ }
                        <li><em>[field:global runphp='yes' name=autoindex][/field:global]</em><a href=’[field:arcurl/]‘  title=”[field:fulltitle/]” >[field:title/]</a><cite>[field:pubdate function="MyDate('m-d',@me)"/]</cite></li>
                        {/dede:arclist}
         </ul>


-------------------------------------------------------------------------------


主导航
<div id="nav">
   <div id="menu" class="menu">


<ul>


<li><a href="{dede:global.cfg_cmsurl/}/">网站首页</a></li>


{dede:channel type='top' row='8'}
                  <li><a href="[field:typeurl/]">[field:typename/]</a></li>{/dede:channel}





</ul>
            </div>
 </div>




副导航
<div id="nav2">
                <div class="top4a"><strong><a href="/xgnza/">主栏目</a></strong>


<p><a href="/yw/">子栏目</a> <a href="/zx/">子栏目</a><br />


<a href="/xydx/">子栏目</a> <a href="/xgnza/xyyc/">子栏目</a> </p>


</div>
</div>


               <div class="top4">
            
               {dede:channelartlist typeid = '9,10,11'}  获取当前频道的下级栏目的内容列表标签

                <div class="top4a"><strong><a href='{dede:field name='typeurl'/}' >{dede:field name='typename'/}</a></strong> 


{dede:channel type='son'}<p><a href="[field:typeurl /]">[field:typename /]</a></p>{/dede:channel}  获取栏目列表标签


</div>
               {/dede:channelartlist}


      </div>







            {dede:channelartlist typeid = '9,10,11,19,20'}获取当前频道的下级栏目的内容列表标签
<a href='{dede:field name='typeurl'/}' target="_blank"><b>{dede:field name='typename'/}</b></a>
              {dede:arclist  flag='p'  row='1' col='1'imgwidth='138' imgheight='106' }
  <p><a href='[field:arcurl/]'>  <img src="[field:litpic/]" align="left" /></a></p>
              {/dede:arclist}
 <ul>
              {dede:arclist  flag='c'  row='4' col='1' titlelen='30'  orderby='pubdate'}
 <li>·<a href='[field:arcurl/]' target="_blank">[field:title/]</a></li>
              {/dede:arclist}
              </ul>
<div id="tj">
            {dede:channel type='son'} 获取栏目列表标签
             <a href="[field:typeurl /]"> [field:typename /]</a>
            {/dede:channel}
            </div>
          {/dede:channelartlist}



  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值