文章正文页常用函数:

1.相应文章上下文调用:

{dede:prenext function="str_replace(' 下一篇:','<'.'br'.' />下一篇:

2.文章关键字TAG调用,每个关键字附带链接地址

{dede:field name='keywords' runphp='yes' }

if(!empty(@me)){

$kws = explode(' ',@me);

@me = "";

foreach($kws as $k){

@me .= "<a href='/plus/search.php?keyword=$k' target='blank'>$k</a> ";

}

@me= str_replace('+', ' ',trim(@me));

}

{/dede:field}<BR>

3.复制相应文章地址按钮

<INPUT onclick=copyToClipBoard() type=button value=复制本页文章地址,传给QQ/MSN上的好友 name=Submit width="100" height="16">

<SCRIPT language=javascript>

function copyToClipBoard(){

var clipBoardContent="";

clipBoardContent+=document.title;

clipBoardContent+="";

clipBoardContent+=this.location.href;

window.clipboardData.setData("Text",clipBoardContent);

alert("复制成功,请粘贴到你的QQ/MSN上推荐给你的好友");

</SCRIPT>

<SCRIPT>

document.body.oncopy = function () { setTimeout( function () { var text = clipboardData.getData("text"); if (text) { text = text + "\r\n参考链接:"+location.href; clipboardData.setData("text", text); } }, 100 ) }

</SCRIPT>

4.文章正文评论调用

<form action="{dede:field name='phpurl' /}/feedback.php?action=send" method="post" name="feedback">

<input type="hidden" name="arcID" value="{dede:field name="id"/}">

<input name="notuser" type="hidden" id="notuser" value="1" checked>

<><LABEL for=message>内容:</LABEL><TEXTAREA id=message onfocus=showcode() name=message></TEXTAREA></P>

<><BUTTON id=submitcomm

style="ADDING-RIGHT: 30px; PADDING-LEFT: 30px; PADDING-BOTTOM: 0px; MARGIN-LEFT: 2.8em; COLOR: #090; LINE-HEIGHT: 35px; PADDING-TOP: 0px; HEIGHT: 35px; BACKGROUND-COLOR: #ffffff" name=submitcomm type=submit value="submit">发表评论</BUTTON></P><INPUT id=itemid

type=hidden value="submit" name=itemid> </FORM>

5.调用收藏夹,添加文章到各大网站收藏夹

<!-- 添加网摘 --><STRONG><FONT color=#0e63e4>收</FONT><FONT

color=#58c600>藏</FONT><FONT color=#996699>到</FONT><FONT

color=#c00012>网</FONT><FONT color=#795f00>摘</FONT><FONT

color=#327f00>:</FONT></STRONG> <A title=Baidu搜藏

href='javascript:u=location.href;t=document.title;c%20=%20""%20+%20(window.getSelection%20? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);var url="http://cang.baidu.com/do/add?it="+encodeURIComponent(t)+"&iu="+encodeURIComponent(u)+"&dc="+encodeURIComponent(c)+"&fr=ien#nw=1";window.open(url,"_blank","scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes"); void 0'><IMG

alt=Baidu搜藏 src="/wm_img/baidu.gif" border=0></A> <A

href="javascript:window.open('http://shuqian.qq.com/post?title='+encodeURIComponent(document.title)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','width=960,height=600,left=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)"><IMG

title=QQ书签 alt=QQ书签 src="/wm_img/qq.gif" border=0></A> <A

href="javascript:location.href='http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"><IMG

alt=Google书签 src="/wm_img/google.gif" border=0></A> <A

href="javascript:location.href='http://del.icio.us/post?&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"><IMG

title=Del.icio.us alt=Del.icio.us src="/wm_img/delicious.gif" :

border=0></A> <A title=POCO网摘

href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:'')d.getSelection?d.getSelection():'');void(keyit=window.open('http://my.poco.cn/fav/storeIt.php?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&img=http://www.h-strong.com/blog/logo.gif','keyit','scrollbars=no,width=475,height=575,status=no,resizable=yes'));keyit.focus();"><IMG

alt=POCO网摘 src="/wm_img/poco.gif" border=0></A> <A title=Yahoo书签 jhref="javascript:location.href='http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title)"><IMG

alt=Yahoo书签 src="/wm_img/yahoo.gif" border=0></A> <A title=新浪

href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:'')d.getSelection?d.getSelection():'');void(vivi=window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=28&title='+escape(d.title)+'&url='+escape(d.location.href)+'&desc='+escape(t),'vivi','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes'));vivi.focus();"><IMG

alt=新浪ViVi src="/wm_img/vivi.gif" border=0></A> <A title=365Key网摘

href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:'')d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();"><IMG

alt=365Key网摘 src="/wm_img/365key.gif" border=0></A> <A title=天极网摘

href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:'')d.getSelection?d.getSelection():'');void(yesky=window.open('http://hot.yesky.com/dp.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&st=2','yesky','scrollbars=no,width=400,height=480,left=75,top=20,status=no,resizable=yes'));yesky.focus();"><IMG alt=天极网摘 src="/wm_img/yesky.gif" border=0></A> <A title=和讯网摘

href="javascript:t=document.title;u=location.href;e=document.selection?(document.selection.type!='None'?document.selection.createRange().text:'')document.getSelection?document.getSelection():'');void(open('http://bookmark.hexun.com/post.aspx?title='+escape(t)+'&url='+escape(u)+'&excerpt='+escape(e),'HexunBookmark','scrollbars=no,width=600,height=450,left=80,top=80,status=no,resizable=yes'));"><IMG

alt=和讯网摘 src="/wm_img/hexun.gif" border=0></A> <A

href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:'')d.getSelection?d.getSelection():'');void(live=window.open('https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url='+escape(d.location.href)+'&title='+escape(d.title)+'&top=1','live','scrollbars=no,status=no,resizable=yes'));live.focus();"><IMG

alt="Windows Live" src="/wm_img/live.gif" border=0></A> <A

# m8 O* S9 j2 f+ l2 @: U$ N$ ~3 y4 B5 m) `' U

title=鼠标选中部分作为描述,提交到diglog.com

onclick="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:'')d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.diglog.com/submit.aspx?title='+escape(d.title)+'&url='+escape(d.location.href)+'&description='+escape(t),'keyit','scrollbars=yes,width=500,height=500,left=65,top=20,status=no,resizable=yes'));keyit.focus();"

href="javascript://"><IMG alt="提交新发现,Dig it" src="/wm_img/digit.gif"

border=0></A> <!-- 添加网摘结束 --><INPUT onclick=javascript:window.external.addFavorite(window.location.href,document.title) type=button value=" 加入收藏夹 " name=add>

其他调用:

<!------------------------------------站内新闻调用------------------------------------>

<UL class=***>

{dede:mynews row='7' titlelen='30'}

<LI><a href="[field:arcurl /]" target=_blank>[field:title /]</a></LI>

{/dede:mynews}

</UL>

<!------------------------------------圈子调用------------------------------------>

{dede:group row="8" orderby='threads'}

[field:groupname/]

{/dede:group}

<!------------------------------------友情链接调用------------------------------------>"

图片调用:{dede:flink type='image' row='1' col='9' titlelen='22'/}

文字调用:{dede:flink type='text' row='2' col='9' titlelen='24'/}

[<!------------------------------------热门TAG调用------------------------------------>

{dede:hotwords num='20' subday='30'/}

<!------------------------------------获取Phpwind论坛的最新主题贴子调用------------------------------------>

{dede:loop table='pw_threads' sort='tid' row='8' if=''}<br>

<a href="/bbs/read.php?tid=[field:tid/]"> ·[field:subject function="cn_substr('@me',30)"/]

([field:lastpost function="date('m-d H:M','@me')"/])</a> <br/>

{dede:loop}

-----------------------------------文章图片幻灯片显示------------------------------------>

<script language='javascript'>

linkarr = new Array();

picarr = new Array();

textarr = new Array();

var focus_width=240;

var focus_height=180;

var text_height=24;

var pics = "";

var links = "";

var texts = "";

var swf_height = focus_height+text_height;

var defJpeg = "{dede:global name='cfg_phpurl'/}/img/jpeg.jpg";

{dede:arclist type='image' att='3' row='5' function='FormatScript(@me)'}

linkarr[[field:global name=autoindex/]] = "[field:arcurl/]

picarr[[field:global name=autoindex/]] = "[field:picname/]

textarr[[field:global name=autoindex/]] = "[field:title/]";

{/dede:arclist}

for(i=1;i<picarr.length;i++){

if(picarr.indexOf("jpg")==-1 && picarr.indexOf("JPG")==-1) picarr = defJpeg;

if(pics=="") pics = picarr;

else pics += "|"+picarr;

}

for(i=1;i<linkarr.length;i++)

if(links=="") links = linkarr;

else links += "|"+linkarr;

}

for(i=1;i<textarr.length;i++){

if(texts=="") texts = textarr;

else texts += "|"+textarr;

}

document.write('<object

classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0

width="'+ focus_width +'" height="'+ swf_height +'">');

document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="{dede:global name='cfg_templeturl'/}/img/slide.swf">');

document.write('<param name="quality" value="high"><param name="bgcolor" value="#ffffff">');

document.write('<param name="menu" value="false"><param name=wmode value="opaque">');

document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+;

texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');

document.write('<embed src="{dede:global name='cfg_templeturl'/}/img/slide.swf" )

wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+

focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high"

width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain"

type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />')

document.write('</object>'

</script>

[转自:http://ml365.iteye.com/blog/839466]

dede各种运用[转]的更多相关文章

  1. 织梦多语言站点,{dede:include filename=''/}引入问题

    织梦模板include插入非模板目录文件出现"无法在这个位置找到"错误的解决办法 以下是dede V55_UTF8 查dede include标签手册 (3) include 引入 ...

  2. dede织梦批量导入关键词

    在后台替换对应的文件件即可. 注意:如果你的关键字长度超过16个字符的话,需要更改 dede 中 keywords 表中的keyword 字段字符长度 article_keywords_main.ph ...

  3. dede织梦cms-dede:autochannel标签

    按排序位置的获取单个栏目的链接信息 >>dede>> {dede:autochannel partsort='' typeid=''}{/dede:autochannel} & ...

  4. dede 简略标题调用标签

    一.简略标题调用标签: 1.{dede:field.shorttitle/} 不可以在{dede:arclist}标签中套用,一般放在网页titile处; 2.[field:shorttitle/] ...

  5. DEDE 常用的调用方法

    DEDE织梦常用的调用常规调用: 网站名称调用:<title>{dede:global.cfg_webname/}</title> 网站关键词调用:<meta name= ...

  6. 如何去掉dede列表推荐时标题被加粗

    dede在列表推荐文章默认为加粗不清楚的可以看图: 那个加黑的是默认的.如果你不想要被加黑,可以做如下改动.在include里找到文件:arc.listview.class.php查找并删除(注释掉也 ...

  7. 如何让{dede:channel}有子栏目显示子栏目,无子栏目不显示同级栏目

    我们在使用织梦系统制作网站时经常会遇到网站栏目较多,显示当前栏目下的二级与三级栏目时,使用栏目嵌套标签,但是当三级栏目为空时,会显示同级栏目.从用户体验角度出发,常理情况下也是需要空白的,即二级栏目下 ...

  8. dede 调用原图的路径

    步骤:1修改include/extend.func.php 添加如下代码: //取原图地址function bigimg($str_pic){$str_houzhi=substr($str_pic,- ...

  9. dede首页调用顶级栏目单页内容(如:关于我们)

    1.调用内容方法,调用描述同理: {dede:channel type="top" row=1} [field:array runphp='yes'] global $dsql; ...

  10. dede在php7上空白

    最近想看一本小说,想采集回来看,结果发现除了dedecms支持php7.0,其他主流cms基本上都不支持php7.0 在本地win7上调试了一遍,没有问题,放到linux服务器上的时候,发现打开任何页 ...

随机推荐

  1. MySQL性能优化之max_connections配置参数浅析

    这篇文章主要介绍了MySQL性能优化之max_connections配置参数浅析,本文着重讲解了3种配置max_connections参数的方法,需要的朋友可以参考下 MySQL的max_connec ...

  2. hdu1058丑数(优先队列、暴力打表)

    hdu1058 题意:当一个数只有2.3.5.7这四种质因数时(也可以一种都没有或只有其中几种),这个数就是丑数,输出第 n 个丑数是多少: 其实并没有发现hdu把这道题放在 dp 专题里的意图,我的 ...

  3. Java static block static constructor , static field

    http://stackoverflow.com/questions/7121213/singleton-instantiation http://docs.oracle.com/javase/spe ...

  4. UMDH

    1. 什么是UMDH UMDH=User Mode dump heap.把进程的堆dump下来.包括堆栈信息.UMDH是WinDbg附带的一个工具. 2. 下载安装 WinDbg.完事后在WinDbg ...

  5. css应对已有class和特殊class的冲突

    类之间是没有优先级的,当需要应用特殊样式时,可以先删除通用class后增加特殊class

  6. Win10系统下安装Tensorflow

    TensorFlow是谷歌基于DistBelief进行研发的第二代人工智能学习系统,具备良好的灵活性和拓展性. 过去TensorFlow只支持Linux和Mac OS,而没有提供windows的支持. ...

  7. 4.Nexus按项目类型分配不同的工厂来发布不同的项目

    在[3.发布Maven项目到nexus中]配置了把项目发布到nexus中的方法但是有时候,一个公司会有很多项目[crm,oa,erp]等等的项目.如果把这些项目全部都放到releases或者snaps ...

  8. 在同步中调用异步方法[.net 4.5]

    using System; using System.Threading; using System.Threading.Tasks; namespace Microsoft.AspNet.Ident ...

  9. API、ABI区别

    http://blog.csdn.net/xinghun_4/article/details/7905298 应用程序二进制接口(ABI-Application Binary Interface)定义 ...

  10. MySQL之选择字段数据类型

    MySQL支持的数据类型很多,选择正确的数据类型对于 获得高性能至关重要.在选择时有个简单的原则有助于做出更好的选择. 简单的原则: A.通常最小的是最好的 因为这样可以用更少的磁盘.内容.CPU缓存 ...