phpwind二次开发之简单phpwind更改帖子浏览率
时间:2011-03-21 来源:小寒子
有人问道这个问题,其实,phpwind更改帖子浏览率非常简单的
代码在read.php里面约368行:
    //更新帖子点击
    if (!$db_hithour) {
    //$db->update(‘UPDATE pw_threads SET hits=hits+1 WHERE tid=’.S::sqlEscape($tid));
    pwQuery::update(‘pw_threads’, ‘tid=:tid’, array($tid), null, array(PW_EXPR=>array(‘hits=hits+1′)));
    } else {
    pwCache::setData(D_P.’data/bbscache/hits.txt’,$tid.”\t”, false, ‘ab’);
    }
  
改为:
    //更新帖子点击
    if (!$db_hithour) {
    //$db->update(‘UPDATE pw_threads SET hits=hits+1 WHERE tid=’.S::sqlEscape($tid));
    //pwQuery::update(‘pw_threads’, ‘tid=:tid’, array($tid), null, array(PW_EXPR=>array(‘hits=hits+1′)));
  
//start
合肥网产品中心$hittmp = rand(2,10);
pwQuery::update(‘pw_threads’, ‘tid=:tid’, array($tid), null, array(PW_EXPR=>array(“hits=hits+$hittmp”)));
unset($hittmp); // 消除变量。
    //end
    } else {
    pwCache::setData(D_P.’data/bbscache/hits.txt’,$tid.”\t”, false, ‘ab’);
    }
  
  
  来源:合肥网产品中心    http://lab.wehefei.com










