在dedecms系统后台,分别设置了三处地方,如下: 1、我copy了普通文章模型,增加了一个字段。允许投稿,级别为注册会员,组别不限制 2、新建一个栏目,内容模型为此模型,且允许投稿 3、在系统设置->基本参数->会员设置中“是否开放会员对自定义模型投稿:”选择了“是” 测试,注册一个会员,系统模型的栏目都可以投稿,无法选择到(就是不显示)自定义模型的栏目 解决方法: 先找到你自定义频道的ID,比如是17,在/member/目录下复制一个article_add.php并重命名这个文件为article_add1.php,打开编辑它,找到第7行$channelid=isset($channelid)&&is_numeric($channelid)?$channelid:1;把最后的1改成17,即可,再编辑member/templets/下的menu.php,把投稿的连接指向article_add1.php即可,同理其他的模型也可以这么增加上面转录的,但是其中有个错误。$channelid=isset($channelid)&&is_numeric($channelid)?$channelid:1;后面的1不应改成channelid,而是应该改成自定义模型的ID,其他的都基本正确。
使用dede调用随机文章可以很好的利于SEO优化。因为随机文章可以使得你的首页或者其他页面可以每次打开都不一样。这样蜘蛛就会认为你是每次都更新的。那么下面是随机文章标签的使用方法:{dede:arclistorderby='rank'}[field:textlink/]{/dede:arclist}还有一种(这一种,每一篇文章都会不一样的随机,比较好):<divclass="commendmt1"><dlclass="tboxlight"><dtclass='light'><strong>随机推荐</strong></dt><ddclass='light'><ulclass="c1ico2">{dede:arclisttitlelen=44row='55'tagid='suijituijian'pagesize='11'orderby=rand}<liclass='dotline'>[<ahref="[field:typelink/]"style="color:#338800">[field:typename/]</a>]<ahref="[field:arcurl/]">[field:title/]</a></li>{/dede:arclist}</ul><divclass="c_page">{dede:arcpagelisttagid='suijituijian'/}</div></dd></dl></div>
Dedecmschannel标签指定typeid时currentstyle无效的修复办法123{dede:channeltype='son'row='8'currentstyle="<li><ahref='~typelink~'class='thisclass'>~typename~</a></li>"}<li><ahref='[field:typelink/]'>[field:typename/]</a></li>{/dede:channel}这种调用方式currentstyle有效但是:123{dede:channeltype='son'row='8'typeid=1currentstyle="<li><ahref='~typelink~'class='thisclass'>~typename~</a></li>"}<li><ahref='[field:typelink/]'>[field:typename/]</a></li>{/dede:channel}这种调用方式currentstyle就无效了论坛里有人说用把typeid=xxx改成channelid=1,简直是无稽之谈。完美解决办法:修改include/taglib/channel.lib.php1if(($row['id']==$typeid||($topid==$row['id']&&$type=='top'))&&$currentstyle!='')改成1if(($row['id']==$refObj->TypeLink->TypeInfos['id']||($topid==$row['id']&&$type=='top'))&&$currentstyle!='')转自:http://www.zhimengba.com/jsjc/180.html
调用指定子栏目:{dede:channelartlisttypeid='2'type='son'}{dede:type}<ahref="[field:typelink/]">[field:typename/]</a>{/dede:type}{/dede:channelartlist}调用指定栏目:{dede:typetypeid='1'}<ahref="[field:typelink/]">[field:typename/]</a>{/dede:type}sql调用指定栏目及子栏目:{dede:sqlsql="SELECTtypename,typedir,defaultnameFROMdede_arctypewherereID=1ORDERBYsortrankASC"}◇<ahref="[field:typedirfunction='str_replace("{cmspath}","",@me)'/]/[field:defaultname/]">[field:typename/]</a><br/>{/dede:sql}
<spanid="tiao">3</span><ahref="javascript:countDown"></a>乐猪网,秒后自动跳转……<metahttp-equiv=refreshcontent=3;url='/search/billsearch.jsp'</ul><!--脚本开始--><scriptlanguage="javascript"type="">functioncountDown(secs){tiao.innerText=secs;if(--secs>0)setTimeout("countDown("+secs+")",1000);}countDown(3);</script><!--脚本结束-->按钮式:<INPUTname="pclog"type="button"value="GO"onClick="location.href='http://www.hack001.com/'">链接式:<ahref="javascript:history.go(-1)">返回上一步</a><ahref="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>直接跳转式:<script>window.location.href='http://www.hack001.com';</script>开新窗口:<ahref="javascript:"onClick="window.open('http://www.hack001.com/','','height=500,width=611,scrollbars=yes,status=yes')">网络营销师</a>JS跳转页面参考代码第一种:<scriptlanguage="javascript"type="text/javascript">window.location.href="login.jsp?backurl="+window.location.href;</script>第二种:<scriptlanguage="javascript">alert("返回");window.history.back(-1);</script>第三种:<scriptlanguage="javascript">window.navigate("top.jsp");</script>第四种:<scriptlanguage="JavaScript">self.location='top.htm';</script>第五种:<scriptlanguage="javascript">alert("非法访问!");top.location='xx.jsp';</script>=====javascript中弹出选择框跳转到其他页面=====<scriptlanguage="javascript"><!--functionlogout(){if(confirm("你确定要注销身份吗?是-选择确定,否-选择取消")){window.location.href="logout.asp?act=logout"}}--></script>=====javascript中弹出提示框跳转到其他页面=====<scriptlanguage="javascript"><!--functionlogout(){alert("你确定要注销身份吗?");window.location.href="logout.asp?act=logout"}--></script>如果想像<a>标记的target='_blank'弹出一个新页面,可以使用:window.open(url);
其实这个功能在dede默认的模板上就有。1.首先需要加载一个ajax的js文件进来<scriptlanguage="javascript"type="text/javascript"src="/include/dedeajax2.js"></script>2.然后加载一个函数<scriptlanguage="javascript"type="text/javascript"><!--functionCheckLogin(){vartaget_obj=document.getElementByIdx_x_x('_userlogin');myajax=newDedeAjax(taget_obj,false,false,'','','');myajax.SendGet2("/member/ajax_loginsta.php");DedeXHTTP=null;}--></script>3.第三步是添加一个id为_userlogin的html标签,如<spanid="i_userlogin"></span>5.最后一步就是需要修改一下/member/ajax_loginsta.php文件里面的内容了。。。需要什么样子的,就用css样式修改了,这就得看你的了.======================================以上来自:http://www.cnblogs.com/mlj322/archive/2011/12/26/2302502.html我的方法:1.从默认模板里面直接抽出上面要用的2个js,然后打开/member/ajax_loginsta.php改样式