crx349 发表于 2014-1-30 14:26:33

Discuz! X3图片投票修改 每天都可以投票


Discuz X3系统自带的投票系统,修改为让网友每天都能来投票。系统自带的投票,用户只能投票一次,这样往往网友在投票后不太容易关注这个投票结果了,没有什么积极性。

于是乎,今天早上开工,帮他完成这个理想。首先,看系统自带的投票,用户在投票完成后。投票选项消失,下面提示:你已经投票完成!那么解决的思想就是:让用户投票完成后,判断用户投票时间,如果超过1天。那么就让这个投票选项再次出现。

source/include/thread/thread_poll.php

80行的位置,新增时间判断:if……
$allowvotepolled = !in_array(($_G['uid'] ? $_G['uid'] : $_G['clientip']), $voters);
    if(empty($allowvotepolled)){
      $uidt = db::fetch_first("SELECT * FROM ".DB::table('forum_pollvoter')." where uid=".$_G['uid']."");
      if(TIMESTAMP < $uidt['dateline']+86400) $allowvotepolled = 1;
    }
source/module/forum/forum_misc.php 注销514行,重复投票提示。
/*
      
if(strexists("\t".$pollarray['voterids']."\t", "\t".$voterids."\t")) {
            
showmessage('thread_poll_voted', NULL, array(), array('login' => 1));
      
}
      
*/
页: [1]
查看完整版本: Discuz! X3图片投票修改 每天都可以投票