织梦插件织梦CMS百度收录查询及批量推送未收录插件

织梦百度收录查询插件说明

1.支持gbk和utf8编码2种程序

2.支持分批查询收录情况,无畏大量文章数据

3.支持指定栏目查询收录情况

4.支持关键字查询收录情况

5.支持1个或多个文档查询

6.支持提交链接给百度和熊掌号(天级和周级)

7、支持查询指定时间段文档查询并一键推送百度

8、注意:PHP必须开启了curl扩展

www.jumaniu/15248/

插件2.0更新日志

1、增加熊掌号天级及熊掌号周级推送                                              2019.10.14

2、增加时间查询输出全部文章,可以一键推送百度                          2019.10.14

3、插件集成自动添加推送接口变量无须手动添加                             2019.10.14

需要批量推送未收录的,这里要修改下

1、打开 /dede(后台目录)/inc/inc_archives_functions.php 在文件末尾插入

/**
 * 百度主动推送
 */
function baidu_push($id="",$qstr="")
{
global $cfg_multi_site,$cfg_basehost,$cfg_baidu_push;
if(!empty($id) && !empty($cfg_baidu_push))
{
if( !empty($id) && empty($qstr) ) $qstr = $id;
if($qstr=='')
{
exit();
}
$qstrs = explode('`',$qstr);
$cfg_domain = $cfg_multi_site == 'N' ? $cfg_basehost : '';
$urls = array();
$i = 0;
foreach($qstrs as $aid)
{
$i++;
$arcrow = GetOneArchive($aid);
$url = $cfg_domain.$arcrow['arcurl'];
$urls[] = $url;
$artlist .= $url."<br />";
}
if($i>1) $artlist = "";
if(!empty($urls)){
$ch = curl_init();
$options =  array(
CURLOPT_URL => trim($cfg_baidu_push),
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);
curl_close($ch);
$result = json_decode($result, true);
if(isset($result['success'])){
$not_same_site = isset($result['not_same_site'][0]) ? " <font style='color:#f00;'>推送链接与百度绑定站点不一致</font> " : "";
$not_valid = isset($result['not_valid'][0]) ? " <font style='color:#f00;'>推送链接不合法</font> " : "";
return $not_same_site . $not_valid . '百度主动推送成功 '.$result['success'].' 条!当天剩余 '.$result['remain'].' 条可推送!'.$artlist;
}else{
return '百度主动推送失败,错误码:'.$result['error'].'<a href="https://ziyuan.baidu/college/courseinfo?id=267&page=2#h2_article_title12" rel="external nofollow"  target="_blank">详情</a>';
}
}
return "没有数据被推送!";
}
}
/**
 * 熊掌周级主动推送
 */
function xiong_push($id="",$qstr="")
{
global $cfg_multi_site,$cfg_basehost,$cfg_xiong_push;
if(!empty($id) && !empty($cfg_xiong_push))
{
if( !empty($id) && empty($qstr) ) $qstr = $id;
if($qstr=='')
{
exit();
}
$qstrs = explode('`',$qstr);
$cfg_domain = $cfg_multi_site == 'N' ? $cfg_basehost : '';
$urls = array();
$i = 0;
foreach($qstrs as $aid)
{
$i++;
$arcrow = GetOneArchive($aid);
$url = $cfg_domain.$arcrow['arcurl'];
$urls[] = $url;
$artlist .= $url."<br />";
}
if($i>1) $artlist = "";
if(!empty($urls)){
$ch = curl_init();
$options =  array(
CURLOPT_URL => trim($cfg_xiong_push),
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);
curl_close($ch);
$result = json_decode($result, true);
if(isset($result['error'])){
return '熊掌主动推送失败,错误码:'.$result['error'].' message:'.$result['message'];
}else{
$not_same_site = isset($result['not_same_site'][0]) ? " <font style='color:#f00;'>推送链接与熊掌绑定站点不一致</font> " : "";
$not_valid = isset($result['not_valid'][0]) ? " <font style='color:#f00;'>推送链接不合法</font> " : "";
return $not_same_site . $not_valid . '熊掌主动推送成功 '.$result['success_batch'].$result['success_realtime'].' 条!当天剩余 '.$result['remain_batch'].$result['remain_realtime'].' 条可推送!'.$artlist;
}
}
return "没有数据被推送!";
}
}
/**
 * 熊掌天级主动推送
 */
function xiong_day_push($id="",$qstr="")
{
global $cfg_multi_site,$cfg_basehost,$cfg_xiong_day_push;
if(!empty($id) && !empty($cfg_xiong_day_push))
{
if( !empty($id) && empty($qstr) ) $qstr = $id;
if($qstr=='')
{
exit();
}
$qstrs = explode('`',$qstr);
$cfg_domain = $cfg_multi_site == 'N' ? $cfg_basehost : '';
$urls = array();
$i = 0;
foreach($qstrs as $aid)
{
$i++;
$arcrow = GetOneArchive($aid);
$url = $cfg_domain.$arcrow['arcurl'];
$urls[] = $url;
$artlist .= $url."<br />";
}
if($i>1) $artlist = "";
if(!empty($urls)){
$ch = curl_init();
$options =  array(
CURLOPT_URL => trim($cfg_xiong_day_push),
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);
curl_close($ch);
$result = json_decode($result, true);
if(isset($result['error'])){
return '熊掌主动推送失败,错误码:'.$result['error'].' message:'.$result['message'];
}else{
$not_same_site = isset($result['not_same_site'][0]) ? " <font style='color:#f00;'>推送链接与熊掌绑定站点不一致</font> " : "";
$not_valid = isset($result['not_valid'][0]) ? " <font style='color:#f00;'>推送链接不合法</font> " : "";
return $not_same_site . $not_valid . '熊掌主动推送成功 '.$result['success_batch'].$result['success_realtime'].' 条!当天剩余 '.$result['remain_batch'].$result['remain_realtime'].' 条可推送!'.$artlist;
}
}
return "没有数据被推送!";
}
}

2、打开 织梦后台目录/dede/archives_do.php 找到末尾一行的

?>

在它上面加入 

else if($dopost=='baidu_push')
{
    if( !empty($aid) && empty($qstr) ) $qstr = $aid;
    if($qstr=='')
    {
        ShowMsg('参数无效!',$ENV_GOBACK_URL);
        exit();
    }
    require_once(DEDEADMIN.'/inc/inc_archives_functions.php');
    $result = baidu_push($qstr);
    ShowMsg($result,$ENV_GOBACK_URL,0,5000);
    exit();
}
else if($dopost=='xiong_push')
{
    if( !empty($aid) && empty($qstr) ) $qstr = $aid;
    if($qstr=='')
    {
        ShowMsg('参数无效!',$ENV_GOBACK_URL);
        exit();
    }
    require_once(DEDEADMIN.'/inc/inc_archives_functions.php');
    $result = xiong_push($qstr);
    ShowMsg($result,$ENV_GOBACK_URL,0,5000);
    exit();
}
else if($dopost=='xiong_day_push')
{
    if( !empty($aid) && empty($qstr) ) $qstr = $aid;
    if($qstr=='')
    {
        ShowMsg('参数无效!',$ENV_GOBACK_URL);
        exit();
    }
    require_once(DEDEADMIN.'/inc/inc_archives_functions.php');
    $result = xiong_day_push($qstr);
    ShowMsg($result,$ENV_GOBACK_URL,0,5000);
    exit();
}

更多推荐

织梦插件织梦CMS百度收录查询及批量推送未收录插件