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

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

PHP中文网
Release: 2016-05-25 17:00:14
Original
1313 people have browsed it

跳至                                                        

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;
 
?>
Copy after login

7. [代码][PHP]代码

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

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template