当前位置:Gxlcms > PHP教程 > phpcms2008增加浏览次数插件

phpcms2008增加浏览次数插件

时间:2021-07-01 10:21:17 帮助过:25人阅读

phpcms2008增加浏览次数 插件
增加指定文章浏览次数,增加指定范围内的文章的浏览次数
增加指定栏目文章的浏览次数
增加公司活跃度等
还可以息定义开发其它的
  1. session_start();
  2. extract($_POST);
  3. require dirname(__FILE__).'/include/common.inc.php';
  4. $keyadmin="www.bitefu.net";
  5. if($key && $key==$keyadmin)
  6. {
  7. $_SESSION["NowKey"]=$keyadmin;
  8. }
  9. if($_SESSION["NowKey"] && $_SESSION["NowKey"]=$keyadmin){
  10. ?>
  11. }else{
  12. ?>
  13. //print_r($_POST);
  14. if(!$addnum && $submit){echo "增加值不能为空!";}
  15. if($submit && $addnum)
  16. {
  17. if($thisid){
  18. $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid`='$thisid'";
  19. }else if($idstart){
  20. $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid` >= '$idstart'";
  21. if($idend){$sql.=" and `contentid` <= '$idend'";}
  22. }else if($comid || $comstart || $comall){
  23. if($comid){
  24. $sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum." where `userid`='$comid'";
  25. }else if($comstart){
  26. $sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum." where `userid` >= '$comstart'";
  27. if($comend){$sql.=" and `userid` <='$comend'";}
  28. }else if($comall && $comall==1){
  29. $sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum;
  30. }else{$sql='';}
  31. }else if($catid){//
  32. if($catid=="all"){
  33. $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum;
  34. }else{
  35. $getid_query=mysql_query("select `contentid` from `".DB_PRE."content` where status=99 ".get_sql_catid($catid));
  36. while($rs=mysql_fetch_assoc($getid_query)){$getid[]=$rs['contentid'];}
  37. $idstr=implode(",",$getid);
  38. $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid` in ($idstr)";
  39. }
  40. }else{$sql='';}
  41. }
  42. if($sql && $submit)
  43. {
  44. mysql_query($sql);
  45. echo date("Y-m-d H:i:s")."成功执行了添加操作,共影响数据: ".mysql_affected_rows()." 条";
  46. }else if(!$sql && $submit){
  47. echo "
    输入信息有误请确认后再提交!";
  48. }
  49. ?>

人气教程排行