Baidu, 360, Sogou, and a series of Chinese search engines all know that Baidu is the most commonly used! Use the following code to open the article to see whether Baidu has included the article.
Just check the article collection, not SEO, the effect can see this site!

EMLOG

1. Open the module.php file under the theme, and add the following code to the corresponding location

 <? php //Determine whether the content page is included by Baidu function checkBaiduInclude($url){ $url=' http://www.baidu.com/s?wd= '.$ url; $curl=curl_init(); curl_setopt($curl,CURLOPT_URL,$url); curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); $rs=curl_exec($curl); curl_close($curl); if(! Strpos ($rs, 'not found'){ return 1; }else{ return 0; } } function logurl($id){ $url=Url::log($id); if(checkBaiduInclude($url)==1){ echo "<a rel='external nofollow' href=' http://www.baidu.com/s?wd= $url 'title='Click to view the included details' target='_blank'>Baidu has included, details</a>"; }else{ Echo "<a style=" color: red;  "rel=" external nofollow  "title=" Click to submit, thank you!  "Target=" _blank  "href=" http://zhanzhang.baidu.com/sitesubmit/index?sitename= $url  ">Baidu not included, submit</a>"; } } ?>

2. Open the echo_log.php file under the theme, and add the mount point to the location to be displayed

 <? php echo logurl($logid); ?>

WordPress

1. Open the functions.php file under the theme, and add the following code to the bottom?> front

 //Determine whether the content page is included by Baidu function baidu_check($url, $post_id){ $baidu_record = get_post_meta($post_id,'baidu_record',true); if( $baidu_record !=  1){ $url=' http://www.baidu.com/s?wd= '.$ url; $curl=curl_init(); curl_setopt($curl,CURLOPT_URL,$url); curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); $rs=curl_exec($curl); curl_close($curl); if(! Strpos ($rs, 'The URL was not found. You can directly access')&&! Strpos ($rs, 'Sorry, and'){ update_post_meta($post_id, 'baidu_record', 1) || add_post_meta($post_id, 'baidu_record', 1, true); return 1; } else { return 0; } } else { return 1; } } function baidu_record() { global $wpdb; $post_id = ( null === $post_id ) ?  get_the_ID() : $post_id; if(baidu_check(get_permalink($post_id), $post_id ) == 1) { Echo '<a target="_blank" title="Click to view the collection details" rel="external nofollow" rel="external nofollow" target="_blank" href=“ https://www.9ywk.com/wp-content/themes/begin/go.php?url=aHR0cDovL3d3dy5iYWlkdS5jb20vcz93ZD0nLmdldF90aGVfdGl0bGUoKS4n ">Baidu has included, details</a>'; } else { echo '<a style="color:red; "Rel=" external nofollow "title=" Click to submit for inclusion! " target="_blank" rel="external nofollow" target="_blank" href=" https://www.9ywk.com/wp-content/themes/begin/go.php?url=aHR0cDovL3poYW56aGFuZy5iYWlkdS5jb20vc2l0ZXN1Ym1pdC9pbmRleD9zaXRlbmFtZT0nLmdldF9wZXJtYWxpbmsoKS4n ">Baidu has not included, submit</a>'; } }

2. Open the single.php file under the theme, and add the mount point to the location to be displayed

 <? php baidu_record(); ?>

Typecho

1. Open the functions.php file under the theme, and add the following code to the bottom?> front

 /*Whether the typecho article is included by Baidu*/ function baidu_record() { $url='http://'.$_ SERVER['HTTP_HOST'].$_ SERVER['REQUEST_URI']; if(checkBaidu($url)==1) {echo "<a rel='external nofollow' href=' http://www.baidu.com/s?wd= $url 'target='_blank'>Included, details</a>"; } else {echo "<a target=\"_blank\"  href=\" http://zhanzhang.baidu.com/sitesubmit/index?sitename= $url  ">Not included, click Submit</a>";} } function checkBaidu($url) { $url = ' http://www.baidu.com/s?wd= ' .  urlencode($url); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl,  CURLOPT_RETURNTRANSFER, 1); $rs = curl_exec($curl); curl_close($curl); if (! Strpos ($rs, 'not found') {//Not found indicates that it has been included by Baidu return 1; } else { return -1; } }

2. Add the mount to the position to be displayed in the appropriate position in the post. php of the article page under the theme

 <span>Baidu included:<? php echo baidu_record() ?></ span>

  • The code comes from the network, and the typecho effect can be seen at the bottom of this site
End