EMLOG
<? 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 collection details' target='_ Blank '>Baidu has included, details</a>"; }else{ echo "<a style=\"color:red;\ "Rel=" external nofollow "title=" Click to submit for inclusion, thank you\ " target=\"_ blank\" href=\" http://zhanzhang.baidu.com/sitesubmit/index?sitename= $url ">Baidu not included, submit</a>"; } } ?>
<? php echo logurl($logid); ?>
WordPress
//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 is 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!" 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>'; } }
<? php baidu_ record(); ?>
Typecho
/*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 Baidu has included it return 1; } else { return -1; } }
<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