Home >php教程 >PHP源码 >wordpress,cos-html-cache静态化后,点击数失效问题的解决方案

wordpress,cos-html-cache静态化后,点击数失效问题的解决方案

PHP中文网
PHP中文网Original
2016-05-25 17:00:141341browse

跳至                                                        

get_var($strsql);
	if ($clicks!='') {
		$clicks = $clicks +1;
		$strout = $clicks;
		$strsql = "UPDATE wp_postmeta set meta_value=".$clicks." where meta_key = 'article_clicks' and post_id='".$postid."' ";
		$wpdb->query($strsql);
	} else {
		$strout = "1";
		$strsql = "INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES (".$postid.", 'article_clicks', '1') ";
		$wpdb->query($strsql);
	}
	  echo $clicks+1;
 
?>

                       

           

7. [代码][PHP]代码     

点击:  次",
		  },
		 function(data,status){
				if (status ==='success'){
					$("#views").text(data);
				}else{
					$("#views").text();
				}
		 });
" _ue_custom_node_="true">

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn