QQ在线咨询在线咨询帮做网络积累了丰富的项目经验,聚集了一批资深专业人才,售后服务一流,内业好评不断,是一家专业的网站建设服务商。微信:专业的网站建设服务商。微信:网站建设地图 | 城市分站

织梦后台重复文档检测结果显示id导出文档url链接

时间:2021-06-02 23:21:02作者:网站建设工程师来源:帮做网络浏览量:0

导  读:织梦后台重复文档检测结果显示id和url,方便记录查看和删除后提交到百度删除死链...

织梦后台重复文档检测结果显示id和url,方便记录查看和删除后提交到百度删除死链

实现教程

1、打开 /dede/templets/article_result_same.htm 找到,大概在114行

<?php echo $row['title']; ?>
  • 1

在它下面加入

( <?php echo $row['id']; ?> ) ( <?php $arcrow=GetOneArchive($row['id']);echo $arcrow['arcurl']; ?> ) <input name="arcIds" type="checkbox" id="arcId" value="<?php echo $row['id'];?>" style="display:none;" checked />
  • 1

继续找到129行左右的

(共有 <?php echo $allarc; ?> 篇重复标题的文档!)
  • 1

在它上面加入

<input type='button' name='bt4' value='导出全部链接' onclick='expArc()' />&nbsp;
<script>
function expArc(){
	var qstr="";
	if(document.form2.arcId.value) return document.form2.arcId.value;
	for(i=0;i<document.form2.arcId.length;i++)
	{
		if(document.form2.arcId[i].checked)
		{
			if(qstr=="")
				qstr=document.form2.arcId[i].value;
			else
				qstr=qstr+"`"+document.form2.arcId[i].value;
		}
	}
	document.form2.titles.value = qstr;
	document.form2.dopost.value = 'export';
	document.form2.submit();
}
</script>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

如图

2、打开 /dede/article_test_same.php 找到

COUNT(title) AS dd,title
  • 1

改成

COUNT(title) AS dd,title,id
  • 1

如图

继续找到大概在30行

//删除选中的内容(只保留一条)
  • 1

在它上面加入

else if($dopost=='export')
{
	if(empty($titles))
    {
        header("Content-Type: text/html; charset={$cfg_ver_lang}");
		echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\">\r\n";
        echo "没有指定导出的文档!";
        exit();
    }
	if(isset($cfg_basehost) && $cfg_basehost != '/')
	{
		$domain = $cfg_basehost;
	}
	else
	{
		if(isset($_SERVER['HTTPS']) && ('1' == $_SERVER['HTTPS'] || 'on' == strtolower($_SERVER['HTTPS']))){
			$SERVER_PORT = 'https://';
		}elseif(isset($_SERVER['SERVER_PORT']) && ('443' == $_SERVER['SERVER_PORT'] )) {
			$SERVER_PORT = 'https://';
		}else{
			$SERVER_PORT = 'http://';
		}
		$domain = $SERVER_PORT . $_SERVER['HTTP_HOST'];
	}
	$content = "";
	$ids = split('`',$titles);
	foreach($ids as $id)
    {
        $arcrow = GetOneArchive($id);
		$content .= $domain . str_replace($domain, '', $arcrow['arcurl']) . "\r\n";
    }
	Header("Content-type:application/octet-stream");
	Header("Accept-Ranges:bytes");
	header("Content-Disposition:attachment;filename=badlink.txt");
	header("Expires:0");
	header("Cache-Control:must-revalidate,post-check=0,pre-check=0 ");
	header("Pragma:public");
	echo $content;
	exit();
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40

完成


转载请注明出处:网站首页> 知识学堂 > dedecms仿站 > 织梦后台重复文档检测结果显示id导出文档url链接


继续阅读相关文章