Home  >  Article  >  Backend Development  >  phpcms2008 increase the number of views plug-in

phpcms2008 increase the number of views plug-in

WBOY
WBOYOriginal
2016-07-25 09:08:411102browse
phpcms2008 increase the number of views plug-in
Increase the number of views of the specified article and increase the number of views of the articles within the specified range
Increase the number of views of articles in specified columns
Increase company activity, etc.
You can also define and develop other
  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. 选择增加类型:


  12. 指定ID:

  13. ID范围:
  14. -

  15. 公司活跃
    指定ID:

  16. ID范围:
  17. -

  18. 全部:

  19. 栏目ID:
  20. 全部 点击重选
  21. 重选



  22. 增加值:【必填】

  23. }else{
  24. ?>
  25. KEY:
  26. //print_r($_POST);
  27. if(!$addnum && $submit){echo "增加值不能为空!";}
  28. if($submit && $addnum)
  29. {
  30. if($thisid){
  31. $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid`='$thisid'";
  32. }else if($idstart){
  33. $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid` >= '$idstart'";
  34. if($idend){$sql.=" and `contentid` <= '$idend'";}
  35. }else if($comid || $comstart || $comall){
  36. if($comid){
  37. $sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum." where `userid`='$comid'";
  38. }else if($comstart){
  39. $sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum." where `userid` >= '$comstart'";
  40. if($comend){$sql.=" and `userid` <='$comend'";}
  41. }else if($comall && $comall==1){
  42. $sql="update `".DB_PRE."member_info` set `logintimes` = `logintimes` + ".$addnum;
  43. }else{$sql='';}
  44. }else if($catid){//
  45. if($catid=="all"){
  46. $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum;
  47. }else{
  48. $getid_query=mysql_query("select `contentid` from `".DB_PRE."content` where status=99 ".get_sql_catid($catid));
  49. while($rs=mysql_fetch_assoc($getid_query)){$getid[]=$rs['contentid'];}
  50. $idstr=implode(",",$getid);
  51. $sql="update `".DB_PRE."content_count` set `hits` = `hits` + ".$addnum." where `contentid` in ($idstr)";
  52. }
  53. }else{$sql='';}
  54. }
  55. if($sql && $submit)
  56. {
  57. mysql_query($sql);
  58. echo date("Y-m-d H:i:s")."成功执行了添加操作,共影响数据: ".mysql_affected_rows()." 条";
  59. }else if(!$sql && $submit){
  60. echo "
    输入信息有误请确认后再提交!";
  61. }
  62. ?>
复制代码


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