百度MIP改造:MIPHTML规范打开移动站点模板1.修改开头为:<!DOCTYPEhtml>2.第二句改为:<htmlmip>3.<head>必须完全小写4.修改编码声明:必须是utf-8<metacharset="UTF-8">5.head中加入:<metaname="viewport"content="width=device-width,minimum-scale=1,initial-scale=1">6.加入css样式<linkrel="stylesheet"type="text/css"href="https://mipcache.bdstatic.com/static/v1/mip.css">7.head加入对应的移动页面,如果没有对应直接写当前页面<linkrel="standardhtml"href="https://www.baidu.com">8.Body改造,<body>必须是小写9.加入js<scriptsrc="https://mipcache.bdstatic.com/static/mipmain-v0.0.1.js"></script>10.页面中常用的html代码有些需要修改,而有些禁止使用,页面中的资源尽量使用相对地址11.一些特定的js功能需要查看https://www.mipengine.org/doc/2-tech/1-mip-html.html12.做好后检查代码规范:https://www.mipengine.org/validator/validate
mysql是我们经常用到的数据库,也时常由于某些原因我们把它卸载了,但是经常会因为一些原因没有卸载干净,让别的软件使用出现了问题,这里收集了一些mysql卸载的方式,合集在一起,以备不时之需。1.传统的卸载方式,直接控制面板卸载2.删除C盘的一些mysql残留——(C:\DocumentsandSettings\AllUsers.WINDOWS\ApplicationData或C:/DocumentsandSettings/AllUsers/ApplicationData)3.停止mysql服务运行“regedit”文件,如图,打开注册表删除注册表数据,通过regedit,删除以下几个文件【也可以在注册表里搜索mysql】:HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQLHKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQLHKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQLHKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services一般服务会以相同的名字(名字通常是MySQL)在这里显4.删除C盘下的“C:\ProgramData\MySQL”所以文件当然可能mysql还残留了很多东西,我们一概有关mysql字眼的都删除掉(但是自己知道有用的东西别删除了)。然后windows特效药——重启。
Windows搭建SVN服务器和客户端,有个非常好用的软件组合VisualSVN+TortoiseSVN。它们都是免费的,VisualSVN集成了Subversion和Apache,通过点点鼠标就可以非常方便的搭建SVN服务器。现在VisualSVN下载后在Windows2003下安装会提示:TheminimunoperatingsystemrequirementsisWindowsVistaorWindowsServer2008。TortoiseSVN在Windows2003上回提示:TortoisSVN1.XXXrequiresWindowsVistaorlater。出现这个提示怎么办呢?原因是现在VisualSVN3.x版本已经移除了对XP和Windows2003的支持,如果在Windows2003下使用,需要安装2.7.X版本(下载地址:https://www.visualsvn.com/server/download/2.7/)。TortoiseSVN1.9.x也移除了对XP和Windows2003的支持,在Windows2003下使用,必须选择2.8.X的版本(下载地址:https://sourceforge.net/projects/tortoisesvn/files/)点击下载
<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的文件,快放到自己服务器上吧。
有很多时候,我们手机访问pc站会跳到手机站,但是有时候手机想访问pc站,却没有办法,其实很简单,在pc站跳转代码下加入以下代码<scripttype="text/javascript">try{varurlhash=window.location.hash;if(!urlhash.match("fromapp")){if((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i))){window.location="http://wap.ccnucanada.com";}}}catch(err){}</script>在手机站添加链接,到pc站的#fromapp这样pc站就不会往手机站跳转了。
给织梦添加复制文档的功能步骤如下:一、打开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