phpcms2008增加浏览次数插件代码
2011-11-27 17:25
399 查看
<?php 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){ ?> <script language="JavaScript" src="images/js/jquery.min.js"></script> <form action="" method="post" name="form"> 选择增加类型: <hr> 指定ID: <input name="thisid" type="text" id="thisid" size="10" /> ID范围: <input name="idstart" type="text" id="idstart" size="10" /> - <input name="idend" type="text" id="idend" size="10" /> <hr /> 公司活跃 指定ID: <input name="comid" type="text" id="comid" size="10" /> ID范围: <input name="comstart" type="text" id="comstart" size="10" /> - <input name="comend" type="text" id="comend" size="10" /> 全部: <input name="comall" type="checkbox" id="comall" value="1" /> <hr /> 栏目ID: <input type="hidden" name="catid" id="catid" value="all"> <span onclick="this.style.display='none';$('#reselect_catid').show();" style="cursor:pointer;">全部 <font color="red">点击重选</font></span> <span id="reselect_catid" style="display:none;"> <span id="load_catid"></span> <a href="javascript:category_reload();">重选</a> </span><script type="text/javascript"> function category_load(id) { $.get('load.php', { field: 'catid', id: id }, function(data){ $('#load_catid').append(data); }); } function category_reload() { $('#load_catid').html(''); category_load(0); } category_load(0); </script> <hr> 增加值:<input name="addnum" type="text" size="10" value="<?=$addnum;?>"/>【必填】 <input type="submit" name="submit" value="提交" /> </form> <?php }else{ ?> <form id="form1" name="form1" method="post" action=""> KEY:<input type="text" name="key" /> <input type="submit" name="checkkey" value="提交" /> </form> <? }?> <?php //print_r($_POST); if(!$addnum && $submit){echo "<span style='color:red'>增加值不能为空!</span>";} 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` <= '$idend'";} }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` <='$comend'";} }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 " <span style='color:red'>输入信息有误请确认后再提交!</span>"; } ?>
相关文章推荐
- 网页浏览次数统计jsp代码
- Eclipse增加CSS插件_代码高亮_自动补全-方法
- php统计静态html页面浏览访问次数代码
- 文章浏览增加次数
- 使用wp-postview插件统计文章浏览次数
- ecshop给文章页增加一个浏览次数
- [chrome插件分享] gitlab-tree 更方便的浏览Gitlab上的代码
- 规定时间内,将浏览次数增加且只增加一次
- 可能是迄今为止最好的 GitHub 代码浏览插件
- 可能是迄今为止最好的GitHub代码浏览插件--赞
- WordPress非插件添加文章浏览次数统计功能
- php浏览次数累加代码
- 文章浏览增加次数
- 不用插件 WordPress 显示文章浏览次数
- css插件--Eclipse增加CSS插件-代码高亮-自动补全
- 网页浏览次数统计jsp代码及jsp总结
- WordPress非插件添加文章浏览次数统计功能
- WordPress非插件添加文章浏览次数统计功能
- kingcms 修改浏览次数 修改阅读次数 增加浏览、阅读次数 方法
- Linux VIM增加代码浏览功能