Discuz!修改論壇的投票數(shù)據(jù)的方法
來源:程序員人生 發(fā)布時(shí)間:2014-04-09 09:56:58 閱讀次數(shù):3861次
在數(shù)據(jù)庫中找到 xxx_polloptions表。里面列出的就是你的投票選項(xiàng)。
其中:tid 是該投票貼的id
votes 是投票總數(shù)
polloption 是投票選項(xiàng)title
voterids 參與投票人的id
如果嫌一個(gè)一個(gè)打voterids數(shù)值比較麻煩 可以找到論壇根目錄下的forumdata/templates/1_1_viewthread_poll.tpl.php文件。將其中的代碼刪掉即可(還得確定你寫的id是否正確。否則頁面上的總統(tǒng)計(jì)人數(shù)還是和votes 總投票數(shù)不符合):
<div class="pollinfo">
<? if($multiple) { ?><strong>多選投票</strong><? if($maxchoices) { ?>: ( 最多可選 <?=$maxchoices?> 項(xiàng) )<? } } else { ?><strong>單選投票</strong><? } if($visiblepoll && $allowvote) { ?> , 投票后結(jié)果可見<? } ?>, 共有 <?=$voterscount?> 人參與投票
<? if(!$visiblepoll && ($overt || $adminid == 1)) { ?>
<a href="misc.php?action=viewvote&tid=<?=$tid?>" onclick="showWindow('viewvote', this.href);doane(event);">查看投票參與人</a>
<? } ?>
</div>
補(bǔ)充: 另外將模板下面的viewthread_poll.htm一段代碼刪掉:
<div class="pollinfo">
<!--{if $multiple}--><strong>{lang poll_multiple}{lang thread_poll}</strong><!--{if $maxchoices}-->: ( {lang poll_more_than} )<!--{/if}--><!--{else}--><strong>{lang poll_single}{lang thread_poll}</strong><!--{/if}--><!--{if $visiblepoll && $allowvote}--> , {lang poll_after_result}<!--{/if}-->, {lang poll_voterscount}
<!--{if !$visiblepoll && ($overt || $adminid == 1)}-->
<a href="misc.php?action=viewvote&tid=$tid" onclick="showWindow('viewvote', this.href);doane(event);">{lang poll_view_voters}</a>
<!--{/if}-->
</div>
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對(duì)您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈(zèng)