[推薦外掛] MultiVote_Mod (複選) (Update 1.4.2)

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8451
註冊時間: 2004-04-30 01:54
來自: Taiwan

[推薦外掛] MultiVote_Mod (複選) (Update 1.4.2)

文章 心靈捕手 »

  1. 推薦一個不錯的" 複選" 投票外掛 MultiVote_Mod_v.1.4.1;
  2. lang_main.php 繁體中文化參考;
  3. 安裝( 修正) 經驗分享;
  4. 測試結果分享.
##############################################################
## MOD Title: MultiVote_Mod_v.1.4.1
##
## MOD Author: vilaras < vilaras@freemail.gr > (Theodoros Vilaras) http://users.otenet.gr/~vil1st/multivote_mod/
##
## MOD Description:
##
## Multiple choice voting in phpBB polls:
## - It's up to the user to define the number of the allowed selections.
## - Usage of 'checkboxes' instead of 'radio buttons' (when needed).
## - Users-voters are automatically notified of the max allowed choices.
## - Can set poll expiration within hours.
## - Time left to poll expiration appears when viewing poll results page.
## - Choose whether to hide results and total number of votes till poll expires or not.
## ATTENTION: Addition of 4 db table fields (columns) is required
##
##
## MOD Version: 1.4.1
##
## Installation Level: Intermediate
##
## Installation Time: 30 Minutes
##
## Files To Edit: posting.php,
## viewtopic.php,
## includes/functions_post.php,
## language/lang_english/lang_main.php,
## templates/subSilver/posting_poll_body.tpl,
## templates/subSilver/viewtopic_poll_ballot.tpl
## templates/subSilver/viewtopic_poll_result.tpl
##
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##
##
## ATTENTION: Addition of 4 table fields is REQUIRED.
## That is, either you need to have access to the db
## (either direct access or through another program,
## for example phpMyAdmin for MySQL
## (available at http://www.phpmyadmin.net/)
##
## If you do not create the required fields, then your Board is
## not going to function properly!
##
## Do NOT try to use this mod without installing the fields!
##
##############################################################
## MOD History:
##
## 2005-02-26 - Version 1.4.1
##
## - some changes according to Seleleth's instructions (thanks Seleleth!)
## - a couple of other changes of no importance
##
##
## 2004-02-23 - Version 1.4.0
##
## - some changes, according to wizzy403's instructions (thanks wizzy403!),
## mainly in posting.php, (it wouldn't record votes in some cases)
## - potential security issues were confronted with the forementioned changes
## - use <span> instead of <font> in viewtopic_poll_ballot.tpl
## - EasyMod 0.0.7 compliant
##
## 2003-10-26 - Version 1.3.3
##
## - a bug was fixed in templates/subSilver/posting_poll_body.tpl by ashtor (thanks ashtor!)
##
## 2003-6-25 - Version 1.3.2
##
## - a minor change in posting.php alterations in order to be compliant with phpBB v.2.0.5 and phpBB v.2.0.6
##
## 2003-6-15 - Version 1.3.1
##
## - minor changes in the text format in order to comply with the requirements
## - of the Mod Validator tool
##
## 2003-3-9 - Version 1.3.0
##
## - time left till poll expires visible when viewing results
## - ability to hide total no of votes till poll expires (only if hide results enabled)
## (added one more field in the db)
##
## 2003-3-7 - Version 1.2.0
##
## - (not released)
## - possible to set poll expiration within hours
## - ability to hide results till the poll expires
## (added one more field in the db)
##
## 2003-2-28 - Version 1.1.0
##
## - added one more field in the db (how many users have voted)
## (number of voters shows up in the results only for multiple choice polls)
##
## 2003-2-23 - Version 1.0.0
##
## - added files (under Acyd Burn's authorisation) in order to automate db field creation
##
## 2003-2-23 - Version 0.1.2
##
## - minnor changes in order to comply with Easy_mod_0.0.7
##
## 2003-2-22 - Version 0.1.1
##
## - formatted the db modification instructions according
## to what seems to be kind of a standard
## - changed the version numbers according to the suggested standards
##
## 2003-2-22 - Version 0.1.0
##
## - 'radio buttons' are used when only 1 choice is acceptable (without any additional text)
## - removed one line with '<tr>' from file templates/subSilver/viewtopic_poll_ballot.tpl
## (there were two identical lines, one after the other - v0.0.2 mistake)
##
## 2003-2-19 - Version 0.0.2
##
## - Formatted installation instructions according to phpBB requirements
## - Assigned number 1 as the default number of accepted sum of selections
## in file posting.php : $max_vote = '1';
## instead of : $max_vote = '';
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
根據作者的描述, 該外掛適用於 phpbb 2.0.5 ~ 2.0.13( 可能是最後的版本).
資料來源( 包含檔案下載): http://users.otenet.gr/~vil1st/multivote_mod/

lang_main.php 繁體中文化參考:

代碼: 選擇全部

#
#-----[ OPEN ]---------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_main.php

#
#-----[ FIND ]---------------------------------------------
#
$lang['Total_votes'] = '總投票數';

#
#-----[ REPLACE WITH ]---------------------------------------------
#
$lang['Total_votes'] = '總投票數: ';
$lang['Voted_show'] = '投票人數: '; // it means :  users that voted  (the number of voters will follow)
$lang['Results_after'] = '投票截止後, 投票結果是可以看得見的.';
$lang['Poll_expires'] = '投票截止還有 ';
$lang['Poll_expiredyes'] = '- 投票已經截止 -'; 
$lang['Poll_noexpire'] = '[ 這個投票沒有截止期限 ]'; 
$lang['Minutes'] = '分';

#
#-----[ FIND ]---------------------------------------------
#
$lang['Delete_poll'] = '刪除票選活動';

#
#-----[ AFTER, ADD ]---------------------------------------------
#
$lang['Max_vote'] = '最大投票數';
$lang['Max_vote_explain'] = '<br>[ 輸入 1 或是空白, 表示只允許一個選擇. ]';
$lang['Max_voting_1_explain'] = '您最多只可以選擇 ';
$lang['Max_voting_2_explain'] = ' 個答案';
$lang['Max_voting_3_explain'] = '(超過限制的選擇, 將被忽略.)';
$lang['Vhide'] = '隱藏';
$lang['Hide_vote'] = '投票結果';
$lang['Tothide_vote'] = '總投票數';
$lang['Hide_vote_explain'] = '<br>[ 隱藏, 直到投票截止. ]';

#
#----[ FIND ]-----
# ( 此部分修改, 是為了讓語意更通順而已)
$lang['Hours'] = '小時內';

#
#-----[ REPLACE WITH ]-----
#
$lang['Hours'] = '小時';
安裝( 修正) 經驗分享:

如果, 您已經有安裝其他關於[票選]的外掛的話,
那麼在新增 $sql 的值, 的過程要特別小心;

另外, 如果您已經有安裝 Admin_Voting_Mod 的話,
那麼必須再加以修正, 否則會有" 重複" 投票的問題發生.
資料來源: http://www.phpbb.com/phpBB/viewtopic.ph ... 335#461335

修正情形如下:

代碼: 選擇全部

#
#-----[ Open ]-----
#
posting.php 

#
#-----[ Find ]-----
# (假如您已經安裝 MultiVote_Mod)

      $sql = "SELECT vd.vote_id, vd.vote_max    
         FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr 
         WHERE vd.topic_id = $topic_id 
            AND vr.vote_id = vd.vote_id 
            AND vr.vote_option_id = $vote_option_id 
         GROUP BY vd.vote_id"; 

#
#-----[ Before Add ]-----
#  
      $vote_option_id_tmp = $vote_option_id; 


#
#-----[ Find ]-----
# (假如您已經安裝 Admin_Voting_Mod) 
         $sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip, vote_cast) 
            VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip', $vote_option_id)"; 

#
#-----[ Inline Find ]-----
#
$vote_option_id 

#
#-----[ Inline Change to ]-----
#
$vote_option_id_tmp 
資料來源: http://www.phpbb.com/phpBB/viewtopic.ph ... 798#507798
參考連結: http://218.161.28.134/phpbb2/viewtopic.php?t=13429

測試結果分享:

Multi_Vote_Mod 與 Admin_Voting_Mod 並無法相容.

Admin_Voting_Mod 會失效=>
無論是單選或複選, 只能紀錄誰投過票, 無法紀錄詳細投票情形.


參考連結:
http://218.161.28.134/phpbb2/viewtopic.php?t=13429
http://218.161.28.134/phpbb2/viewtopic.php?t=13561
http://218.161.28.134/phpbb2/viewtopic.php?t=13560
http://www.erdrron.com/phpBB2/viewtopic ... 4337#14337
最後由 心靈捕手 於 2007-10-31 11:23 編輯,總共編輯了 2 次。
施比受有福,歡迎來信賜教,謝謝 & 再見!
祝福您 好運 ^_^
歡迎加入★★心靈捕手★★ :: 討論區!!
http://wang5555.hopto.org/phpBB3/
p.s. 奉老婆之命:在晚上十一點前,得關機睡覺!!!
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8451
註冊時間: 2004-04-30 01:54
來自: Taiwan

[分享] 升級 1.4.2 成功經驗

文章 心靈捕手 »

1.4.2 版檔頭說明:

代碼: 選擇全部

############################################################## 
## MOD Title: MultiVote_Mod_v.1.4.2
##
## MOD Author: 	vilaras < vilaras@freemail.gr > (Theodoros Vilaras)	http://users.otenet.gr/~vil1st/multivote_mod/
##
## MOD Description: 
##
##		Multiple choice voting in phpBB polls:
##			- It's up to the user to define the number of the allowed selections. 
##			- Usage of 'checkboxes' instead of 'radio buttons' (when needed).
##			- Users-voters are automatically notified of the max allowed choices.
##			- Can set poll expiration within hours.
##			- Time left to poll expiration appears when viewing poll results page.
##			- Choose whether to hide results and total number of votes till poll expires or not.
##		ATTENTION: Addition of 4 db table fields (columns) is required
##
##
## MOD Version: 	1.4.2
##
## Installation Level: Intermediate 
##
## Installation Time: 30 Minutes 
##
## Files To Edit:		posting.php, 
##				viewtopic.php,
##				includes/functions_post.php,
##				language/lang_english/lang_main.php, 
##				templates/subSilver/posting_poll_body.tpl,
##				templates/subSilver/viewtopic_poll_ballot.tpl
##				templates/subSilver/viewtopic_poll_result.tpl
##
## Included Files: 	n/a
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
##
##
##
##	ATTENTION: 	Addition of 4 table fields is REQUIRED.
##				That is, either you need to have access to the db 
##				(either direct access or through another program,
##		 		for example phpMyAdmin for MySQL
##				(available at http://www.phpmyadmin.net/)
##
##			If you do not create the required fields, then your Board is
##				not going to function properly!
##
##			Do NOT try to use this mod without installing the fields!
##
############################################################## 
##	MOD History:
##		
##		2005-09-09 - Version 1.4.2
##		
##			- a minnor correction by Pachat     (thanks Pachat!)
##			  (won't show anymore the upper limit of votes if it is equal to the number of options)
##
根據作者的描述, 該外掛適用於 phpbb 2.0.5 ~ 2.0.20 (可能是最後的版本).
資料來源( 包含檔案下載): http://users.otenet.gr/~vil1st/multivote_mod/

1.4.1 升級 1.4.2:
#
#-----[ OPEN ]-----
#
viewtopic.php
#
#-----[ FIND ]-----
#

代碼: 選擇全部

if ( $max_vote > 1 )
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

				
if ( ( $max_vote > 1 ) && ( $max_vote < $vote_options ) )
#
#-----[ SAVE & CLOSE ]------
#

修正參考:
如果您升級到 1.4.2 時, 建立票選主題, 發生了問題,
那麼以下的修改, 提供您參考:
(ps. 此處外掛原始碼, 在 1.4.1 時, 已經存在)
#
#-----[ OPEN ]-----
#
includes/functions_post.php

#
#-----[ FIND ]-----
#

代碼: 選擇全部

		$$max_vote = (isset($max_vote)) ? max(0, intval($max_vote)) : 0;
		$$hide_vote = (isset($hide_vote)) ? max(0, intval($hide_vote)) : 0;
		$$tothide_vote = (isset($tothide_vote)) ? max(0, intval($tothide_vote)) : 0;
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

		$max_vote = (isset($max_vote)) ? max(0, intval($max_vote)) : 0;
		$hide_vote = (isset($hide_vote)) ? max(0, intval($hide_vote)) : 0;
		$tothide_vote = (isset($tothide_vote)) ? max(0, intval($tothide_vote)) : 0;
#
#-----[ SAVE & CLOSE ]-----
#
施比受有福,歡迎來信賜教,謝謝 & 再見!
祝福您 好運 ^_^
歡迎加入★★心靈捕手★★ :: 討論區!!
http://wang5555.hopto.org/phpBB3/
p.s. 奉老婆之命:在晚上十一點前,得關機睡覺!!!
主題已鎖定

回到「非官方認證外掛」