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 included 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