源码

方法一:后台找到/dede/templets/diy_main.htm查找:<ahref="../plus/diy.php?action=list&diyid={dede:field.diyid/}"target="_blank"><imgsrc='images/gtk-tmp.png'title='预览'alt='预览'/>前台预览</a>在后面加上:&nbsp;|&nbsp;<ahref='diy_list.php?action=excel&diyid={dede:field.diyid/}'target="_blank">导出表单Excel</a>修改/dede/diy_list.php,在其中搜索:$action=isset($action)&&in_array($action,array('post','list','edit','check','delete'))?$action:'';修改为:$action=isset($action)&&in_array($action,array('post','list','edit','check','delete','excel'))?$action:'';再找到:else{showmsg('未定义操作',"-1");}在它前面添加:elseif($action=='excel'){ob_end_clean();//清除缓冲区,避免乱码header("Content-type:application/vnd.ms-excel");header("Content-Disposition:attachment;filename={$diy->name}_".date("Y-m-d").".xls");print(chr(0xEF).chr(0xBB).chr(0xBF));//清除bom$fieldlist=$diy->getFieldList();echo"<table><tr>";foreach($fieldlistas$field=>$fielddata){echo"<th>{$fielddata[0]}</th>";}echo"<th>状态</th>";echo"</tr>";$sql="SELECT*FROM{$diy->table}ORDERBYidDESC";$dsql->SetQuery($sql);$dsql->Execute('t');while($arr=$dsql->GetArray('t')){echo"<tr>";foreach($fieldlistas$key=>$field){echo"<td>".$arr[$key]."</td>";}$status=$arr['ifcheck']==1?'已审核':'未审核';echo"<td>".$status."</td>";echo"</tr>";}echo"</table>";}方法二,较麻烦,未亲测:1.首先在后台找到/dede/templets/diy_main.htm,查找:<ahref="../plus/diy.php?action=list&diyid={dede:field.diyid/}"target="_blank"><imgsrc='images/gtk-tmp.png'title='预览'alt='预览'/>前台预览</a>在后面加上:&nbsp;|&nbsp;<ahref="../plus/diy.php?action=daochu&diyid={dede:field.diyid/}"target="_blank">导出为EXCEL</a>2、核心内容修改plus/diy.php$action=isset($action)&&in_array($action,array('post','list','view'))?$action:'post';替换成:$action=isset($action)&&in_array($action,array('post','list','view','daochu'))?$action:'post';3、再在plus/diy.php最后一行下面新加代码:elseif($action=='daochu'){ob_end_clean();//清除缓冲区,避免乱码header("Content-type:application/vnd.ms-excel;");Header("Content-Disposition:attachment;filename={$diy->table}_".date("Y-m-d").".xls");print(chr(0xEF).chr(0xBB).chr(0xBF));//清除bom$query="desc`{$diy->table}`";$res=mysql_query($query);echo"<table><tr>";//导出表头(也就是表中拥有的字段)while($row=mysql_fetch_array($res)){$t_field[]=$row['Field'];//Field中的F要大写,否则没有结果/*echo"<th>".$row['Field']."</th>";*/if($row['Field']=='id'){echo"<th>ID</th>";}elseif($row['Field']=='gsm'){echo"<th>公司名</th>";}elseif($row['Field']=='xm'){echo"<th>姓名</th>";}elseif($row['Field']=='sj'){echo"<th>手机号码</th>";}elseif($row['Field']=='yx'){echo"<th>电子邮箱</th>";}else{echo"<th></th>";}}echo"</tr>";//导出数据$sql="select*from`{$diy->table}`";$res=mysql_query($sql);while($row=mysql_fetch_array($res)){echo"<tr>";foreach($t_fieldas$f_key){echo"<td>".$row[$f_key]."</td>";}echo"</tr>";}echo"</table>";}原文地址:https://blog.csdn.net/jklgfgdsr/article/details/79311950

源码

1.新增变量百度站长平台token:cfg_badutoken网站域名:cfg_baiduhost2.打开:/dede/article_add.php搜索:$artUrl=MakeArt($arcID,true,true,$isremote);if($artUrl==''){$artUrl=$cfg_phpurl."/view.php?aid=$arcID";}在下面加入:else{$urls[]='http://'.$cfg_baiduhost.'/'.$artUrl;$api='http://data.zz.baidu.com/urls?site='.$cfg_baiduhost.'&token='.$cfg_badutoken;$ch=curl_init();$options=array(CURLOPT_URL=>$api,CURLOPT_POST=>true,CURLOPT_RETURNTRANSFER=>true,CURLOPT_POSTFIELDS=>implode("\n",$urls),CURLOPT_HTTPHEADER=>array('Content-Type:text/plain'),);curl_setopt_array($ch,$options);$result=curl_exec($ch);}搜索:<ahref='catalog_do.php?cid=$typeid&dopost=listArchives'><u>已发布文章管理</u></a>在下面加入:<u>百度提交返回".$result."</u>&nbsp;&nbsp;打开:/dede/article_edit.php搜索:$artUrl=MakeArt($arcID,true,true,$isremote);if($artUrl==''){$artUrl=$cfg_phpurl."/view.php?aid=$arcID";}在下面加入:else{$urls[]='http://'.$cfg_baiduhost.'/'.$artUrl;$api='http://data.zz.baidu.com/update?site='.$cfg_baiduhost.'&token='.$cfg_badutoken;$ch=curl_init();$options=array(CURLOPT_URL=>$api,CURLOPT_POST=>true,CURLOPT_RETURNTRANSFER=>true,CURLOPT_POSTFIELDS=>implode("\n",$urls),CURLOPT_HTTPHEADER=>array('Content-Type:text/plain'),);curl_setopt_array($ch,$options);$result=curl_exec($ch);}搜索:<ahref='catalog_do.php?cid=$typeid&dopost=listArchives'><u>管理文章</u></a>在下面加入:<u>百度提交返回".$result."</u>&nbsp;&nbsp;完成,最后附加个百度自动推送代码,只需要把以下js做到每个页面的html中即可,自动推送和主动推送可以同时使用,进行互补。<script>(function(){varbp=document.createElement('script');varcurProtocol=window.location.protocol.split(':')[0];if(curProtocol==='https'){bp.src='https://zz.bdstatic.com/linksubmit/push.js';}else{bp.src='http://push.zhanzhang.baidu.com/push.js';}vars=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(bp,s);})();</script>

2019-5-10 572 0
源码

开启自动内链:1.后台-采集-文档关键词维护添加关键词及链接2.后台-系统基本参数-核心设置关键字替换选是3.后台-系统基本参数-其他选项文档内容同一关键词替换次数(0为全部替换):设置1修复内链重复代码错误,如dede和dedecms,容易出现a链接重叠导致代码错误。参考官方帮助:http://help.dedecms.com/install-use/apply/2012/0828/2319.html5.7版本(版本信息:V5.7SP2正式版(2018-01-09))1.找到include/arc.archives.class.php这个文件2.大概在2500行左右,有这样一行代码$string=str_replace('\"','"',$string);在这行代码下方加入以下代码uasort($words,create_function('$a,$b','returnstrlen($a)>strlen($b);'));意思是先替换比较短的词,然后再匹配替换长的词。这样就不会出现代码重叠的错误了。具体情况由于dede更新会经常变化,而且dede在处理这个问题又夹杂着php版本判断问题,导致网上很多方法都是无效的,如果以上处理后还是错误建议尝试在arc.archives.class.php搜索5.5.0,替换为7.5.0,如果问题还是存在建议搜索网络中“dede自动内链,文档关键词维护重叠错误”等关键词查找php版本解决方案。或见http://www.hack001.com/post/454最后备注一个文档关键词维护批量删除的sql语句:Deletefromdede_keywordsWHEREaid>=1andaid<=1000;意思是删除掉文档关键词中id大于1小于1000的所有文档关键词,数值可以根据自己的需要来修改全部清空:Deletefromdede_keywords如果要删除搜索词,也是上面语句,表名为:dede_search_keywords