phpcms2008增加浏览次数 插件
增加指定文章浏览次数,增加指定范围内的文章的浏览次数
增加指定栏目文章的浏览次数
增加公司活跃度等
还可以息定义开发其它的
-
session_start();
- extract($_POST);
- require dirname(__FILE__).'/include/common.inc.php';
- $keyadmin="www.bitefu.net";
- if($key && $key==$keyadmin)
- {
- $_SESSION["NowKey"]=$keyadmin;
- }
- if($_SESSION["NowKey"] && $_SESSION["NowKey"]=$keyadmin){
- ?>
-
-
}else{
- ?>
- }?>
-
-
//print_r($_POST);
- if(!$addnum && $submit){echo "增加值不能为空!";}
- if($submit && $addnum)
- {
- if($thisid){
- $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid`='$thisid'";
- }else if($idstart){
- $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid` >= '$idstart'";
- if($idend){$sql.=" and `contentid` }else if($comid || $comstart || $comall){
- if($comid){
- $sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum." where `userid`='$comid'";
- }else if($comstart){
- $sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum." where `userid` >= '$comstart'";
- if($comend){$sql.=" and `userid` }else if($comall && $comall==1){
- $sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum;
- }else{$sql='';}
- }else if($catid){//
- if($catid=="all"){
- $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum;
- }else{
- $getid_query=mysql_query("select `contentid` from `".DB_PRE."content` where status=99 ".get_sql_catid($catid));
- while($rs=mysql_fetch_assoc($getid_query)){$getid[]=$rs['contentid'];}
- $idstr=implode(",",$getid);
- $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid` in ($idstr)";
- }
- }else{$sql='';}
- }
- if($sql && $submit)
- {
- mysql_query($sql);
- echo date("Y-m-d H:i:s")."成功执行了添加操作,共影响数据: ".mysql_affected_rows()." 条";
- }else if(!$sql && $submit){
- echo "
输入信息有误请确认后再提交!";
- }
- ?>
复制代码
|