论坛风格切换
  • 3297阅读
  • 2回复

[功能优化与改进]版块今日发帖作弊基数修改方案 [复制链接]

上一主题 下一主题
离线rickyleo
 

发帖
315
金币
0
威望
99
只看楼主 倒序阅读 使用道具 楼主  发表于: 2012-05-28
— 本帖被 lfyzjck 执行提前操作(2012-05-28) —
站点今日发帖数太少了吗? 所以你想构造一个虚拟的今日发帖数然后统计又没有差错吗?那么,可以通过如下修改实现各个板块的今日发帖数统计虚拟增量来实现今日发帖数作弊的效果.
首先,到数据库执行如下SQL:
  1. ALTER TABLE pw_forums ADD appendpostnum smallint(6) unsigned not null default '0';
打开template/admin/setforum.htm文件,
找到:
  1. <tr class="tr1 vt">
  2.             <td class="td1">版块横排</td>
  3.             <td class="td2"><input type="text" class="input input_wa" name="across" value="$across" /></td>
  4.             <td class="td2"><div class="help_a">版块横排(填写每排显示版块个数,0或留空表示不限制)</div></td>
  5.             <td class="td2"><div class="none_pw"><input type="checkbox" onclick="pwJsCheck(this)" name="otherforum[across]" value="1" /></div></td>
  6.         </tr>

下方添加代码:
  1. <!--今日发帖增量-->
  2.         <tr class="tr1 vt">
  3.             <td class="td1">今日发帖数增量</td>
  4.             <td class="td2"><input type="text" class="input input_wa" name="appendpostnum" value="$appendpostnum" /></td>
  5.             <td class="td2"><div class="help_a">今日发帖数增量(用于当前版块今日发帖量显示,0或留空表示不作弊)</div></td>
  6.             <td class="td2"><div class="none_pw"><input type="checkbox" onclick="pwJsCheck(this)" name="otherforum[appendpostnum]" value="1" /></div></td>
  7.         </tr>
  8.         <!--今日发帖增量-->
打开admin/setforum.php
找到:
  1. S::gp(array('vieworder','dirname','style','across','keywords','c_type'),'P');
替换成:
  1. S::gp(array('vieworder','dirname','style','across','appendpostnum','keywords','c_type'),'P');//今日发帖增量
找到:
  1. pwQuery::update('pw_forums', 'fid=:fid', array($fid), array(
  2.                     'name'        => $name,
  3.                     'vieworder'    => $vieworder,
  4.                     'dirname'    => $dirname,
  5.                     'style'        => $style,
  6.                     'across'    => $across,
  7.                     'cms'        => $cms
  8.                 ));
替换成:
  1. pwQuery::update('pw_forums', 'fid=:fid', array($fid), array(
  2.                     'name'        => $name,
  3.                     'vieworder'    => $vieworder,
  4.                     'dirname'    => $dirname,
  5.                     'style'        => $style,
  6.                     'across'    => $across,
  7.                     'appendpostnum'    =>    $appendpostnum, //今日发帖增量
  8.                     'cms'        => $cms
  9.                 ));
找到:
  1. pwQuery::update('pw_forums', 'fid=:fid', array($fid), array(
  2.                     'fup'        => $fup,            'type'        => $type,
  3.                     'name'        => $name,            'vieworder'    => $vieworder,
  4.                     'logo'        => $logo,            'keywords'    => $keywords,
  5.                     'descrip'    => $descrip,        'style'        => $style,
  6.                     'metadescrip' => $metadescrip,    'ifcms'        => $ifcms,
  7.                     'across'    => $across, 'allowhide'    => $allowhide,
  8.                     'allowsell'    => $allowsell,        'allowtype'    => $allowtype,
  9.                     'copyctrl'    => $copyctrl,        'password'    => $password,
  10.                     'viewsub'    => $viewsub,        'allowvisit'=> $allowvisit,
  11.                     'allowread'    => $allowread,        'allowpost'    => $allowpost,
  12.                     'allowrp'    => $allowrp,        'allowdownload'=> $allowdownload,
  13.                     'allowupload' => $allowupload,    'f_type'    => $f_type,
  14.                     'f_check'    => $f_check,        't_type'    => $t_type,
  15.                     'forumsell'    => $forumsell,        'cms'        => $cms,
  16.                     'ifhide'    => $ifhide,            'showsub'    => $showsub,
  17.                     'modelid'    => $modelids,        'pcid'        => $pcids,
  18.                     'actmids'    => $actmids,        'allowrob'    => $allowrob
  19.                 ));
替换成:
  1. pwQuery::update('pw_forums', 'fid=:fid', array($fid), array(
  2.                     'fup'        => $fup,            'type'        => $type,
  3.                     'name'        => $name,            'vieworder'    => $vieworder,
  4.                     'logo'        => $logo,            'keywords'    => $keywords,
  5.                     'descrip'    => $descrip,        'style'        => $style,
  6.                     'metadescrip' => $metadescrip,    'ifcms'        => $ifcms,
  7.                     'across'    => $across,            'appendpostnum'    =>    $appendpostnum,//今日发帖增量
  8.                     'allowhide'    => $allowhide,
  9.                     'allowsell'    => $allowsell,        'allowtype'    => $allowtype,
  10.                     'copyctrl'    => $copyctrl,        'password'    => $password,
  11.                     'viewsub'    => $viewsub,        'allowvisit'=> $allowvisit,
  12.                     'allowread'    => $allowread,        'allowpost'    => $allowpost,
  13.                     'allowrp'    => $allowrp,        'allowdownload'=> $allowdownload,
  14.                     'allowupload' => $allowupload,    'f_type'    => $f_type,
  15.                     'f_check'    => $f_check,        't_type'    => $t_type,
  16.                     'forumsell'    => $forumsell,        'cms'        => $cms,
  17.                     'ifhide'    => $ifhide,            'showsub'    => $showsub,
  18.                     'modelid'    => $modelids,        'pcid'        => $pcids,
  19.                     'actmids'    => $actmids,        'allowrob'    => $allowrob
  20.                 ));

打开index.php文件
找到:
  1. $tposts += $forums['tpost'];
替换成:
  1. $tposts += ($forums['tpost'] + $forums['appendpostnum']); //今日发帖增量
  2.         $forums['tpost'] = $forums['tpost'] + $forums['appendpostnum']; //今日发帖增量
找到:
  1. $query = $db->query("SELECT f.fid,f.name,f.type,f.childid,f.fup,f.logo,f.descrip,f.metadescrip,f.forumadmin,f.across,f.allowhtm,f.password,f.allowvisit,f.showsub,f.ifcms,fd.tpost,fd.topic,fd.article,fd.subtopic,fd.top1,fd.lastpost FROM pw_forums f LEFT JOIN pw_forumdata fd USING(fid) WHERE f.ifsub='0' AND f.ifcms!=2 $sqlwhere ORDER BY f.vieworder");
替换成:
  1. $query = $db->query("SELECT f.fid,f.name,f.type,f.childid,f.fup,f.logo,f.descrip,f.metadescrip,f.forumadmin,f.across,f.appendpostnum,f.allowhtm,f.password,f.allowvisit,f.showsub,f.ifcms,fd.tpost,fd.topic,fd.article,fd.subtopic,fd.top1,fd.lastpost FROM pw_forums f LEFT JOIN pw_forumdata fd USING(fid) WHERE f.ifsub='0' AND f.ifcms!=2 $sqlwhere ORDER BY f.vieworder");
打开thread.php文件
找到:
  1. !$forumset['commend'] && $foruminfo['commend'] = null;
下方添加代码:
  1. $foruminfo['tpost'] = $foruminfo['tpost'] + $foruminfo['appendpostnum']; //今日发帖增量
修改完成!
这样就能在后台板块管理地方设置一个今日发帖数增量值,在前台站点的今日总发帖数,板块的今日发帖数都会将这个增量值统计进去,细分到每个板块哦.这个值是虚拟的只供显示今日发帖数而已,实际发帖数还是遵照日常的发帖数计算















1条评分bug优化分+2
云天河 bug优化分 +2 给你个好评哦亲~ 2012-05-29
离线lfyzjck

发帖
22
金币
0
威望
1
只看该作者 沙发  发表于: 2012-05-28
顶一下,顺便测试
离线chlqjmlz

发帖
6
金币
0
威望
4
只看该作者 板凳  发表于: 2012-10-19
低!价!出!售+雅马哈2千,豪爵1千-本田2千-嘉陵1千-等摩~托
温馨提示:需要购车的朋友请联系,13519213038订车电话。也可以上 QQ, 1131985003 空间相册选好车,再电话联系我购买。QQ不做为聊天工具。
品牌摩`托车:雅马哈、铃木、福禧、巧格、迅鹰、豪爵、钻豹、钱江、五羊本田、新大州本田、川崎、宝马等各款摩托车和等各款跑车,百分百原装配置,九成新以上,车况良好,质量绝对可靠。带有保修卡,合格证,在购车日起半个月内只要不是人为损坏 可退款或换车。交易爽快的朋友可赠送进口赛车服、头盔、手套、防盗器、雨具等配件。让你以最低的价格买最好的车!欢迎来电订购!
承诺一:信息真实、可靠,如有假冒,假一罚十!
承诺二:坚决抵制销售翻新车!坚持诚信为本的销售原则!
承诺三:在购车日起半个月内 只要不是人为损坏 可退款或换车。
希望你不要抱着玩玩的态度随意要求 看车 送车,诚心购买请订购
快速回复
限100 字节
如果您在写长篇帖子又不马上发表,建议存为草稿
 
提到某人:
选择好友
上一个 下一个