学做网站培训课程介绍

当前位置:

Dedecms仿站常用的标签汇总

Dedecms仿站过程中会使用到一些常用的调用标签,以下是学做网站论坛汇总的Dedecms仿站常用的标签,方便建站和仿站时使用。

系统基本参数调用调用方式:{dede:global.cfg_description/}
站点网址:{dede:global. cfg_basehost/}
网站名称: {dede:global. cfg_webname/}
站点默认关键字: {dede:global. cfg_keywords/}
站点描述: {dede:global. cfg_description/}
网站版权信息: {dede:global. cfg_powerby/}
网站备案号: {dede:global. cfg_beian/}

1.首页 head 区域标签
Index.htm 页面
Title 区域:{dede:global.cfg_webname/} 关键字:{dede:global.cfg_keywords/}
描述:{dede:global.cfg_description/}

2.列表页 head 区域标签
List_article.htm 页面
Title 区域:{dede:field.title/}_{dede:global.cfg_webname/} 关键字:{dede:field name='keywords'/}
描述:{dede:field name='description' function='html2text(@me)'/}

3.内容页 head 区域标签
Article_article.htm 页面
Title 区域:{dede:field.title/}_{dede:global.cfg_webname/} 关键字:{dede:field.keywords/}
描述:{dede:field.description function='html2text(@me)'/}

4、arclist标签:基础的文章调用标签


{dede:arclist limit='0,1' row='10' titlelen=28 typeid='2' channelid='3' addfields='officialurl'} <li><a href="[field:arcurl/]" title="[field:fulltitle/]">[field:title/]</a></li> {/dede:arclist}

5.日期调用标签


[field:pubdate function="MyDate('Y-m-d',@me)"/] [field:pubdate function="MyDate('m-d',@me)"/]

6.调用文章内容并屏蔽html


[field:id runphp='yes'] $aid = @me; $row = $GLOBALS['dsql']->GetOne("Select body From `_addonarticle` where aid='$aid' "); @me = cn_substr(html2text("{$row['body']}"),820); [/field:id]

7.dede布尔值判断,这个是根据客户要求给浮动广告加一个后台显示控制开关时候所做


{dede:php} if(preg_match("#Y#", $cfg_open)) { echo ' <div class="customer" id="followDiv"> <div class="float_close"><span onClick="followDiv.style.visibility=\'hidden\'">close</span> </div> <div class="float_ad"><img src="'.$cfg_cmspath.'/templets/default/images/ads.gif" /></div> </div> '; } {/dede:php}

8.内容页调用字段的时候包含div,这个是从小游戏站里看到的


{dede:field.control runphp='yes'}if(empty(@me)) @me = '';else @me = ' <div class="detail_gamekey"> <ul> <li>'.@me.'</li> </ul> </div> ';{/dede:field.control}

9.根据时间进行判断


[field:endtime runphp="yes"] if(time()> @me){@me='已结束';} else {@me='进行中';} [/field:endtime]

10.dede图集内容页调用所有缩略图


{dede:productimagelist} <li><a href="javascript:ChangePic('[field:imgsrc/]', '#bigpicimg');" title="[field:text/]" rel="facebox"><img src="[field:imgsrc/]" width="120" height="90" /></a></li> {/dede:productimagelist}

11.标签如何限制字数 ,dede 里的所有标记都支持这样使用函数的


[field:description function='cn_substr(@me,80)'/]

12.去掉<li>和</li>


function="(str_replace(array('<li>','</li>'),'',@me))"

13.部分SQL语句
替换作者


update dede_archives set writer='新作者名称' WHERE writer='旧作者名称';

来源替换


update dede_archives set source='新来源' where source='旧来源';

批量替换某个字段变量(例子:把所有点击设置为1)


update dede_archives set click = '1';

也可以按制定栏目


update dede_archives set click='1' where typeid=栏目ID;

或者范围内替换


update dede_archives set click='1' where typeid between 开始栏目ID and 结束栏目ID;

查找(删除)标题含有某些字符 查找:


select * from dede_archives where title like "%字符%"; 删除:delete * from dede_archives where title like "%字符%";

替换标题中的指定字符


update dede_archives set title=replace(title,'旧字符',' 新字符');

删除标题中的某些字符


update dede_archives set title=replace(title,'旧字符',' ');

只替换某个栏目内文章标题的某个字符


update dede_archives set title=replace(title,'旧字符',' 新字符') where typeid=栏目ID;

11.批量移动文章(同时运行3条) 例:把栏目10的文章全部移动到栏目1


update dede_archives set typeid=1 where typeid =10; update dede_addonarticle set typeid=1 where typeid =10; update dede_arctiny set typeid=1 where typeid =10;

14.批量替换文章模型中内容部分图片链接路径.


update dede_addonarticle set body=replace(body,'src="http://baidu.com/img/','src="http://baidu.com/p_w_picpath/');

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

相关教程

  • 很多朋友在使用织梦程序做网站的过程中,或者在DEDECMS织梦搬家中,难免需要添加一些测试文章用于测试网站功能模板等,还有些人朋友网站改版需要变更
  • Wordpress与dedecms是二款国内使用量最大的建网站程序,都可以用来制作各类型网站。下面是Wordpress与dedecms程序的不同点: 1、wordpres
  • 仿站长网admin5主题模板 图文教程 (17798 次浏览)
    这是一款模板站长网admin5的wordpress主题模板,这个模板综合了门户和企业网站所有特点,内容特别丰富,而且有大量的广告位可供站长放广告图片,实现网站
  • 什么是仿站 视频教程 (1190238 次浏览)
    仿站是针对目标网站进行仿制。仿站主要从页面风格进行仿制。我们已经知道获得静态网页的2种方法,再让我们回顾一下:1、网页设计师设计效
  • 常用的HTML标签有哪些 (136158 次浏览)
    什么是HTML标签HTML 标记标签通常被称为 HTML 标签 (HTML tag)。HTML标签即是网页浏览器识别符,就像一个人名字张三、李四代表人的姓名一样。这里说
  • 建站常用软件有哪些 视频教程附件下载 (1192843 次浏览)
    做网站过程中需要使用一些建站软件,帮助我们来开发网站。其中网站制作特别常见的一个工具就是dreamweaver,简称DW。DW软件有几个版本型号,如特别经
  • html 标签有哪些特点刚刚接触超文本,遇到的最大的障碍就是一些用“<”和“>”括起来的句子,我们称它为标签,是用来分割和标记文本的元素,以形
  • 百度蜘蛛IP220.181.19.* 百度蜘蛛159.226.50.* 百度蜘蛛202.108.11.* 百度蜘蛛202.108.22.* 百度蜘蛛202.108.23.* 百度蜘蛛202.108.249
  • 在wordpress模板制作时,我们需要根据不同的情况,进行页面的判断来显示不同的内容。下面是自己做网站论坛把wordpress模板制作教程中常用判断代码汇总