>  기사  >  백엔드 개발  >  phpcms2008增加浏览次数插件

phpcms2008增加浏览次数插件

WBOY
WBOY원래의
2016-07-25 09:08:411046검색
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. 选择增加类型:


  12. 指定ID:

  13. ID范围:
  14. -

  15. 公司活跃
    指定ID:

  16. ID范围:
  17. -

  18. 全部:

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



  22. 增加值:【必填】

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


성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.