当我们转移网站,或者更改数据库,又或者升级的时候,dede经常会出现下面请看1.加不了文章,发文章提示“无法获得主键,因此无法进行后续操作!”2.修改不了基本参数3.基本参数显示空白,但可以修改参数当这种问题同时出现或者单个问题出现的话,是非常头疼的问题,因为以上几个问题,百度和谷歌都没有很好的回答,大部分解决方法几乎是无效的。所以研究了下,如果出现以上问题,其实原因如下:1.加不了文章,修改不了基本参数——数据库转移过程中的改名有关,重新导入数据库,用帝国备份王之类的方法或sql等2.基本参数显示空白,但可以修改参数——php版本问题,php5.4运行低版本dede导致的,高版本dede不受影响,解决方法是换低版本的php,或者换高版本的dede,或者修改低版本的dede代码,修改代码过程百度到处都是。由于没有亲测,所以这里就不多说。遇到类似问题,无非检查以下问题:1.php版本对不对2.mysql数据对不对3.网站文件权限对不对4.数据库文件权限对不对
<scriptsrc="http://siteapp.baidu.com/static/webappservice/uaredirect.js"type="text/javascript"></script><scripttype="text/javascript">uaredirect("http://www.hack001.com/wap/");</script>这段代码相信很多人都会用,就是判断是不是移动端,如果是就跳转到对应的移动设备页面,但是今天发现百度的siteapp.baidu.com,尽然打不开了,这将导致很多使用该代码的站点都会受影响,如果站点正在进行推广,估计移动端流量将全部废掉了,损失相当的大,所以有时候百度也是靠不住的,重要js还是要放到本地的靠谱,下面是uaredirect.js的文件,快放到自己服务器上吧。
给织梦添加复制文档的功能步骤如下:一、打开templets下的content_list.htm找到这一行:<ahref="javascript:;"onClick="moveArc(event,this,<?phpecho(empty($channelid)?0:$channelid);?>)"class="coolbg"> 移动 </a>在这一行的下方添加:<ahref="javascript:;"onClick="copyArc(event,this,<?phpecho(empty($channelid)?0:$channelid);?>);"class="coolbg"> 复制 </a>二、打开dede/js/list.js找到moveArc这个函数functionmoveArc(e,obj,cid){varqstr=getCheckboxItem();if(qstr==''){alert('必须选择一个或多个文档!');return;}LoadQuickDiv(e,'archives_do.php?dopost=moveArchives&qstr='+qstr+'&channelid='+cid+'&rnd='+Math.random(),'moveArchives','450px','180px');ChangeFullDiv('show');}然后在下方添加copyArc这个函数functioncopyArc(e,obj,cid){varqstr=getCheckboxItem();if(qstr==''){alert('必须选择一个或多个文档!');return;}LoadQuickDiv(e,'archives_do.php?dopost=copyArchives&qstr='+qstr+'&channelid='+cid+'&rnd='+Math.random(),'copyArchives','450px','180px');ChangeFullDiv('show');}三、打开dede/archives_do.php找到elseif($dopost=='moveArchives'){这句代码然后在这个大括弧结尾处也就是在433行左右添加如下代码:/*-----------------------------functioncopyArchives(){}------------------------------*/elseif($dopost=='copyArchives'){CheckPurview('sys_ArcBatch');if(empty($totype)){require_once(DEDEINC.'/typelink.class.php');if(!empty($aid)&&empty($qstr))$qstr=$aid;AjaxHead();$channelid=empty($channelid)?0:$channelid;$tl=newTypeLink($aid);$typeOptions=$tl->GetOptionArray(0,$admin_catalogs,$channelid);$typeOptions="<selectname='totype'style='width:90%'><optionvalue='0'>请选择复制到的位置...</option>\r\n$typeOptions</select>";//输出AJAX可移动窗体$divname='copyArchives';echo"<divclass='title'onmousemove=\"DropMoveHand('{$divname}',225);\"onmousedown=\"DropStartHand();\"onmouseup=\"DropStopHand();\">\r\n";echo"<divclass='titLeft'>复制文档</div>\r\n";echo"<divclass='titRight'><imgsrc='images/ico-close.gif'style='cursor:pointer;'onclick='HideObj(\"{$divname}\");ChangeFullDiv(\"hide\");'alt='关闭'title='关闭'/></div>\r\n";echo"</div>\r\n";echo"<formname='quickeditform'action='archives_do.php'method='post'>\r\n";echo"<inputtype='hidden'name='dopost'value='{$dopost}'/>\r\n";echo"<inputtype='hidden'name='qstr'value='{$qstr}'/>\r\n";echo"<tablewidth='100%'style='margin-top:6px;z-index:9000;'>\r\n";?><trheight='28'><tdwidth="80"class='bline'> 目标栏目:</td><tdclass='bline'><?phpecho$typeOptions;?></td></tr><trheight='32'><tdwidth="80"class='bline'> 文档ID:</td><tdclass='bline'><inputtype='text'name='tmpids'value="<?phpecho$qstr;?>"style='width:310px;overflow:hidden;'/><br/>复制到的目标栏目必须和选定的文档频道类型一致,否则程序会自动勿略不符合的文档。</td></tr><trheight='32'><tdcolspan='2'align='center'style='padding-top:12px'><inputname="imageField"type="image"src="images/button_ok.gif"width="60"height="22"class="np"border="0"style="cursor:pointer"/> <imgsrc="images/button_back.gif"width="60"height="22"border="0"onclick='HideObj("<?phpecho$divname;?>");ChangeFullDiv("hide");'style="cursor:pointer"/></td></td></tr></table></form><?php//AJAX窗体结束}else{$totype=preg_replace("#[^0-9]#",'',$totype);$typeInfos=$dsql->GetOne("SELECTtp.channeltype,tp.ispart,tp.channeltype,ch.maintable,ch.addtable,ch.issystemFROM`me_arctype`tpLEFTJOIN`me_channeltype`chonch.id=tp.channeltypeWHEREtp.id='$totype'");$idtype="id";if(!is_array($typeInfos)){ShowMsg('参数错误!','-1');exit();}if($typeInfos['ispart']!=0){ShowMsg('文档保存的栏目必须为最终列表栏目!','-1');exit();}if(empty($typeInfos['addtable'])){$typeInfos['maintable']='me_archives';}//增加单表模型判断if($typeInfos['issystem']==-1){$typeInfos['maintable']=$typeInfos['addtable'];$idtype="aid";}$arcids=preg_replace("#[^0-9,]#",'',preg_replace("#`#",',',$qstr));$arc='';$j=0;$okids=array();$dsql->SetQuery("SELECT{$idtype},typeidFROM`{$typeInfos['maintable']}`WHERE{$idtype}in($arcids)ANDchannel='{$typeInfos['channeltype']}'");$dsql->Execute();while($row=$dsql->GetArray()){if($row['typeid']!=$totype){$dsql->ExecuteNoneQuery("insertintome_arctiny(typeid,typeid2,arcrank,channel,senddate,sortrank,mid)selecttypeid,typeid2,arcrank,channel,senddate,sortrank,midfromme_arctinywhereid='{$row[$idtype]}'");$xid=$dsql->GetLastID();$dsql->ExecuteNoneQuery("insertinto`{$typeInfos['maintable']}`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,keywords,lastpost,scores,goodpost,badpost,voteid,notpost,description,filename,dutyadmin,tackid,mtype,weight)selectcasewhenid>'0'then'$xid'else''end,casewhentypeid>'0'then'$totype'else''end,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,keywords,lastpost,scores,goodpost,badpost,voteid,notpost,description,filename,dutyadmin,tackid,mtype,weightfrom`{$typeInfos['maintable']}`WHEREid='{$row[$idtype]}'");$dsql->ExecuteNoneQuery("insertinto`{$typeInfos['addtable']}`(aid,typeid,body,redirecturl,templet,userip,bigpic)selectcasewhenaid>'0'then'$xid'else''end,$totype,body,redirecturl,templet,userip,bigpicfrom`{$typeInfos['addtable']}`WHEREaid='{$row[$idtype]}'");$okids[]=$row[$idtype];$j++;}}//更新HTMLforeach($okidsas$aid){$arc=newArchives($aid);$arc->MakeHtml();}ShowMsg("成功复制$j个文档!",$ENV_GOBACK_URL);exit();}}注意最后一个步骤的me_要换成自己的后缀转自:http://www.zgguan.com/zsfx/php/574.html
经常看到一些页面,打开后QQ窗口弹出,也没在意,没啥技术含量,就是js实现打开链接,然后链接引用应用,所以一直也没去理会它,但是想到这个方式还是比较不错的,说不定以后会用的上,于是找了个类似网站提取js并解密后,放在下面,需要的时候直接复制可用,免得要找的时候又找不到。varqq_chat=true;functionPlayJsAdPopWin(){if(qq_chat){popwin=window.location.href='tencent://message/?uin=251323708&Site=在线咨询&Menu=yes'}};setTimeout("PlayJsAdPopWin()",8000);
<styletype="text/css">#gongao{width:1000px;height:30px;overflow:hidden;line-height:30px;font-size:13px;font-family:'宋体';background:#DDE5ED;color:#0C77CF;font-weight:bold;}#gongao#scroll_begin,#gongao#scroll_end{display:inline}</style><scripttype="text/javascript">functionScrollImgLeft(){varspeed=50;varscroll_begin=document.getElementById("scroll_begin");varscroll_end=document.getElementById("scroll_end");varscroll_div=document.getElementById("scroll_div");scroll_end.innerHTML=scroll_begin.innerHTML;functionMarquee(){if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)scroll_div.scrollLeft-=scroll_begin.offsetWidth;elsescroll_div.scrollLeft++;}varMyMar=setInterval(Marquee,speed);scroll_div.onmouseover=function(){clearInterval(MyMar);}scroll_div.onmouseout=function(){MyMar=setInterval(Marquee,speed);}}</script><divid="gongao"><divstyle="width:900px;height:30px;margin:0auto;white-space:nowrap;overflow:hidden;"id="scroll_div"class="scroll_div"><divid="scroll_begin">${affiche.content}${affiche.content}${affiche.content}${affiche.content}${affiche.content}${affiche.content}</div><divid="scroll_end"></div></div><scripttype="text/javascript">ScrollImgLeft();</script></div>