自拍亚洲一区欧美另类,亚洲成人影院,亚洲午夜久久久久妓女影院,最近中文字幕高清中文字幕无,亚洲熟妇av一区二区三区漫画

互聯(lián)網(wǎng)知識(shí)

精準(zhǔn)傳達(dá) ? 價(jià)值共享

洞悉互聯(lián)網(wǎng)前沿資訊,探尋網(wǎng)站營(yíng)銷規(guī)律

織夢(mèng)后臺(tái)文檔主動(dòng)百度推送熊掌推送批量推送

作者:狐靈科技 | 2019-10-05 22:58 |點(diǎn)擊:

百度主動(dòng)推送(實(shí)時(shí))可以縮短百度爬蟲(chóng)發(fā)現(xiàn)您站點(diǎn)新鏈接的時(shí)間,使新發(fā)布的頁(yè)面可以在第一時(shí)間被百度收錄

織夢(mèng)程序我們可以在后臺(tái)添加文檔完成那一刻即時(shí)主動(dòng)推送到百度或熊掌,也可以在后臺(tái)文檔列表里批量推送

最終效果



織夢(mèng)百度主動(dòng)推送教程

1、織夢(mèng)網(wǎng)站后臺(tái)-系統(tǒng)-基本參數(shù),添加新變量,如果變量值未填寫(xiě)或者為空將不推送


變量名稱  : cfg_baidu_push

參數(shù)說(shuō)明:百度推送接口

變量值:登錄你的百度平臺(tái) https://ziyuan.baidu.com 獲取接口調(diào)用地址
 

如圖,注意你的站點(diǎn)域名要對(duì)應(yīng)上

添加好變量是這樣的

2、打開(kāi) /dede(后臺(tái)目錄)/inc/inc_archives_functions.php 在文件最末尾插入

 



 

  1. /**
     * 百度主動(dòng)推送
     */
    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(" ", $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;'>推送鏈接與百度綁定站點(diǎn)不一致</font> " : "";
    $not_valid = isset($result['not_valid'][0]) ? " <font style='color:#f00;'>推送鏈接不合法</font> " : "";
    return $not_same_site . $not_valid . '百度主動(dòng)推送成功 '.$result['success'].' 條!當(dāng)天剩余 '.$result['remain'].' 條可推送!'.$artlist;
    }else{
    return '百度主動(dòng)推送失敗,錯(cuò)誤碼:'.$result['error'].'<a href="https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title12" target="_blank">詳情</a>';
    }
    }
    return "沒(méi)有數(shù)據(jù)被推送!";
    }
    }

3、找到后臺(tái)文檔發(fā)布程序PHP文件

  • 普通文章】模型的是
  • /dede/article_add.php
  • 圖片集】模型的是
  • /dede/album_add.php
  • 軟件】模型的是
  • /dede/soft_add.php
  • 商品/自定義模型】模型的是
  • /dede/archives_add.php
根據(jù)你的需要在對(duì)應(yīng)的php文件中找到

//返回成功信息

在它上面加入

  1. if(!empty($cfg_baidu_push))
    {
    $backurl .= "<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".baidu_push($arcID)."</p>";
    }


繼續(xù)找到

line-height:36px;height:36px

改成

line-height:36px;

 

修改完后如圖這樣

至此,織夢(mèng)發(fā)布文檔主動(dòng)推送到百度功能完成。

需要做熊掌主動(dòng)推送(實(shí)時(shí))的小伙伴往下看

 

織夢(mèng)熊掌主動(dòng)推送教程

1、織夢(mèng)網(wǎng)站后臺(tái)-系統(tǒng)-基本參數(shù),添加新變量,如果變量值未填寫(xiě)或者為空將不推送


變量名稱:cfg_xiong_push

參數(shù)說(shuō)明:熊掌推送接口

變量值:登錄你的百度平臺(tái) https://ziyuan.baidu.com/ydzq/ 獲取接口調(diào)用地址

 

如圖,天級(jí)收錄和周級(jí)收錄都可以

注意你的站點(diǎn)域名已綁定上熊掌id

添加好變量是這樣的

2、打開(kāi) /dede(后臺(tái)目錄)/inc/inc_archives_functions.php 在文件最末尾插入

 



 

  1. /**
     * 熊掌主動(dòng)推送
     */
    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(" ", $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 '熊掌主動(dòng)推送失敗,錯(cuò)誤碼:'.$result['error'].' message:'.$result['message'];
    }else{
    $not_same_site = isset($result['not_same_site'][0]) ? " <font style='color:#f00;'>推送鏈接與熊掌綁定站點(diǎn)不一致</font> " : "";
    $not_valid = isset($result['not_valid'][0]) ? " <font style='color:#f00;'>推送鏈接不合法</font> " : "";
    return $not_same_site . $not_valid . '熊掌主動(dòng)推送成功 '.$result['success_batch'].$result['success_realtime'].' 條!當(dāng)天剩余 '.$result['remain_batch'].$result['remain_realtime'].' 條可推送!'.$artlist;
    }
    }
    return "沒(méi)有數(shù)據(jù)被推送!";
    }
    }

 

3、找到后臺(tái)文檔發(fā)布程序PHP文件

  • 普通文章】模型的是
  • /dede/article_add.php
  • 圖片集】模型的是
  • /dede/album_add.php
  • 軟件】模型的是
  • /dede/soft_add.php
  • 商品/自定義模型】模型的是
  • /dede/archives_add.php

根據(jù)你的需要在對(duì)應(yīng)的php文件中找到

//返回成功信息
在它上面加入

  1. if(!empty($cfg_xiong_push))
    {
    $backurl .= "<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".xiong_push($arcID)."</p>";
    }


繼續(xù)找到,如果你前面已經(jīng)刪除過(guò)height:36px,可以跳過(guò)這一步



line-height:36px;height:36px

改成

line-height:36px;


修改完后如圖這樣

至此,織夢(mèng)發(fā)布文檔主動(dòng)推送到熊掌功能完成。

需要批量推送的小伙伴請(qǐng)繼續(xù)往下看

 

織夢(mèng)后臺(tái)文檔列表添加批量推送至百度/推送至熊掌

效果如圖

批量推送實(shí)現(xiàn)教程

在加入批量之前必須完成上面的【織夢(mèng)百度主動(dòng)推送教程】第1、第2步 和 【織夢(mèng)熊掌主動(dòng)推送教程】第1、第2步,否則以下教程無(wú)效

1、打開(kāi) /dede/templets/content_list.htm (軟件模型和自定義模型是 /dede/templets/content_i_list.htm) 找到


  1. 刪除屬性

這一行,在它下面添加



  1. <a href="javascript:baidu_push(0)" class="coolbg">&nbsp;推送至百度&nbsp;</a>
    <a href="javascript:xiong_push(0)" class="coolbg">&nbsp;推送至熊掌&nbsp;</a>
    <script type="text/javascript">
    function baidu_push(aid)
    {
    var qstr=getCheckboxItem();
    if(aid==0) aid = getOneItem();
    location="archives_do.php?aid="+aid+"&dopost=baidu_push&qstr="+qstr;
    }
    function xiong_push(aid)
    {
    var qstr=getCheckboxItem();
    if(aid==0) aid = getOneItem();
    location="archives_do.php?aid="+aid+"&dopost=xiong_push&qstr="+qstr;
    }
    </script>


2、打開(kāi) /dede/archives_do.php 找到末尾一行的  ?>


在它上面加入


  1. else if($dopost=='baidu_push')
    {
        if( !empty($aid) && empty($qstr) ) $qstr = $aid;
        
        if($qstr=='')
        {
            ShowMsg('參數(shù)無(wú)效!',$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('參數(shù)無(wú)效!',$ENV_GOBACK_URL);
            exit();
        }
        require_once(DEDEADMIN.'/inc/inc_archives_functions.php');
        $result = xiong_push($qstr);
        ShowMsg($result,$ENV_GOBACK_URL,0,5000);
        exit();
    }

批量推送教程完成。

文章來(lái)自:https://www.dedehtml.com/notes/dede-baiduxiong-push.html

如沒(méi)特殊注明,文章均為狐靈科技原創(chuàng),轉(zhuǎn)載請(qǐng)注明?? "織夢(mèng)后臺(tái)文檔主動(dòng)百度推送熊掌推送批量推送
多一份免費(fèi)策劃方案,總有益處。

請(qǐng)直接添加技術(shù)總監(jiān)微信聯(lián)系咨詢

網(wǎng)站設(shè)計(jì) 品牌營(yíng)銷

多一份參考,總有益處

聯(lián)系狐靈科技,免費(fèi)獲得專屬《策劃方案》及報(bào)價(jià)

咨詢相關(guān)問(wèn)題或預(yù)約面談,可以通過(guò)以下方式與我們聯(lián)系

業(yè)務(wù)熱線:15082661954 / 大客戶專線:15523356218