第 1 頁 (共 3 頁)
[問題]評分系統加錢
發表於 : 2003-12-06 02:42
由 依夢兒
問題外掛:Rating system(評分系統)
參考連結:
http://www.phpbb.com/phpBB/viewtopic.php?t=46456
使用版本:phpBB 2.0.6
網站位置:見個人資料
狀況描述:
不知道有沒有人裝過這一支評分系統外掛??
看起來還不錯,設計的很完整,各方面都考量到了。
請教各位有沒辦法將它修改成評分加錢,例如每得到一顆星就增加發文者多少錢??
不一定要弄什麼後台控制,只要能夠作出這個效果就好了。
請各位賜教了。

發表於 : 2003-12-08 01:03
由 天霜
請問大大有沒有中文語系檔
記得yuan大大 有說過
他也中意這個外掛 我會向他提議這個功能地 
發表於 : 2003-12-08 01:44
由 依夢兒
我自己有試著翻譯,但是還沒有全部翻譯完,只有翻譯一部份。
因為後台端的部份只有我(管理員)才看得到,所以那一部份我打算跳過不翻了。
而且這支外掛有一些名詞翻成中文還是很難理解,要實際操作一陣子才知道它的意思....
如果你還是需要的話,待我翻譯的差不多,我再提供給你。
發表於 : 2004-02-25 16:14
由 拭銀布
請教一下依夢兒大大!!
我本身為您站內的會員。
貴站評分系統運作已可加錢,請問該如何改出相同效果。
(該不會是手動加錢吧=.=a)
發表於 : 2004-02-25 17:05
由 依夢兒
拭銀布 寫:貴站評分系統運作已可加錢,請問該如何改出相同效果。
(該不會是手動加錢吧=.=a)
修改方法是 yuan 兄在他的論壇上提供的。
不過我太久沒上去,剛剛上去一看,版面變了樣,之前的文章也不見了....
我再想辦法看看能不能從我目前的檔案中找出修改辦法。
發表於 : 2004-02-25 17:26
由 依夢兒
嗚~找到了,原來的論壇還在,只是網址換了。XD
以下是 for user_money 和 user_points 的修改方式。
如果你是安裝 Cash Mod 且擁有二個或二個以上的貨幣,希望被評分後所有貨幣都會增加,請參考下一篇回覆。
改出來了,只會加一次不會扣錢,加的額度依rating後台設定的評分標準裡面所用的points的額度而定
代碼: 選擇全部
#
#------[ SQL ]------
#這行請酌參,除非你什麼貨幣都沒有才要加,不然下面的程式會出錯\r
ALTER TABLE phpbb_users ADD user_points int(11) NOT NULL default '0';
#
#------[ OPEN ]------
#
rating.php
#
#------[ FIND ]------
#
$sql = 'INSERT INTO '.RATING_TABLE.' (user_id, post_id, option_id, rating_time) VALUES ('.$userdata['user_id'].', '.$p.', '.$new_rating.', UNIX_TIMESTAMP(NOW()))';
#
#------[ BEFORE, ADD ]------
#
if ( $new_rating > 0)
{
$sql = 'SELECT points FROM '.RATING_OPTION_TABLE.' WHERE option_id = '.$new_rating;
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not get rating points", "", __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$rating_points = $row['points'];
}
$sql = 'SELECT poster_id FROM phpbb_posts WHERE post_id = '.$p;
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not get user information", "", __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$userid = $row['poster_id'];
}
$sql = "UPDATE ".USERS_TABLE." SET user_points = user_points + " . $rating_points . " WHERE user_id = " . $userid;
if( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, "Could not update user points", "", __LINE__, __FILE__, $sql);
}
}
我大概說明一下
第一個$sql是取得評分者所選的評分項目所配的points額度\r
第二個$sql是取得被評分者的id
第三個$sql是給予被評分者的獎金
發表於 : 2004-02-25 17:27
由 依夢兒
至於怎麼改成配合cash(因為我沒裝,所以只能用想像的)
代碼: 選擇全部
$sql = "UPDATE ".USERS_TABLE." SET user_points = user_points + " . $rating_points . " WHERE user_id = " . $userid;
if( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, "Could not update user points", "", __LINE__, __FILE__, $sql);
}
將上面這段的改成下面這段\r
然後,你要找到cash自行增加貨幣種類的資料表代入cash_table在此假設該資料表就是cash_table,裡面有二個欄位name及date
代碼: 選擇全部
$sql = "SELECT * FROM ".CASH_TABLE;
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query cash data', '', __LINE__, __FILE__, $sql);
}
$cashlist = $db->sql_numrows($result);
$cash_row = array();
while ($row = $db->sql_fetchrow($result))
{
$cash_row[] = $row;
}
for ($i = 0; $i < $cashlist; $i++)
{
// 假設自行發行的貨幣名稱在資料表裡面的欄位叫 name
$sql = "UPDATE ".USERS_TABLE." SET user_".$cash_row[$i]['name']." = user_".$cash_row[$i]['name']." + " . $rating_points . " WHERE user_id = " . $userid;
if( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, "Could not update user points", "", __LINE__, __FILE__, $sql);
}
}
這樣所有自行發行的貨幣都會增加
發表於 : 2004-02-25 17:38
由 依夢兒
補充說明,雖然我安裝的是 Cash Mod ,但是貨幣值設為 user_points ,
而且我的論壇有二種貨幣,我只希望讓某一種貨幣在評分後被增加,而不是讓所有貨幣被增加。
所以我是參考第一篇進行修改。
又,評分系統目前和公告置頂分區 2.x 版的相容性很差。
如果你的 phpBB 是 Plus 版,或是你有安裝公告置頂分區 2.x 版,請不要安裝評分系統。
發表於 : 2004-02-25 21:07
由 shihchieh
依夢兒 寫:補充說明,雖然我安裝的是 Cash Mod ,但是貨幣值設為 user_points ,
而且我的論壇有二種貨幣,我只希望讓某一種貨幣在評分後被增加,而不是讓所有貨幣被增加。
所以我是參考第一篇進行修改。
又,評分系統目前和公告置頂分區 2.x 版的相容性很差。
如果你的 phpBB 是 Plus 版,或是你有安裝公告置頂分區 2.x 版,請不要安裝評分系統。
嗯~除非你的plus的文章區分外掛沒有升級(沒有使用topic_list_body),如果有的話最好是不要安裝評分,否則只有移除一路可走,我的情況是安裝後約2週左右會發生不明的錯誤~
原作者也沒有對這個問題回應,也許是沒空吧~很久沒更新版本了
發表於 : 2004-02-26 06:13
由 拭銀布
非常感激依夢兒大大跟yuan大大的賜教!!
依夢兒 寫:補充說明,雖然我安裝的是 Cash Mod ,但是貨幣值設為 user_points ,
而且我的論壇有二種貨幣,我只希望讓某一種貨幣在評分後被增加,而不是讓所有貨幣被增加。
所以我是參考第一篇進行修改。
我也是只想讓一種幣值增加。
我的幣值預設為user_money,只要將第一種方法的預設值user_points改為\r
我的預設值,意思是一樣的嗎??
yuan 寫:嗯~除非你的plus的文章區分外掛沒有升級(沒有使用topic_list_body),如果有的話最好是不要安裝評分
幸好我使用的是phpbb2.06、而Split topic 是 1.05的,應該不會有影響吧??
另外還有一個小小請求!!能否提供中文語系檔..
我英文程度不是很好看得有點吃力.....

發表於 : 2004-02-28 00:12
由 拭銀布
感激兩位大大!!外掛架設成功且運作正常!!
另有一惑尚請指導:
關於後台等級累積評分圖示的設定我有點搞不太清楚。
假設我預設置像依夢兒大大站內評分等級一樣...
http://morningmusumenet.net/phpbb/viewt ... 383#151383
應該如何設置??真的有點看不懂........
發表於 : 2004-02-28 02:31
由 依夢兒
拭銀布 寫:我的幣值預設為user_money,只要將第一種方法的預設值user_points改為\r
我的預設值,意思是一樣的嗎??
是的。
拭銀布 寫:另外還有一個小小請求!!能否提供中文語系檔..
我英文程度不是很好看得有點吃力.....

lang_main.php 的部份:
代碼: 選擇全部
// RATING MOD
$lang['Rating'] = '評語';
$lang['No_rating'] = '尚未評分';
$lang['Ratings_by'] = '檢視%s評分的所有文章';
$lang['Rated_posts_by'] = '檢視%s的優質文章';
$lang['Latest_ratings'] = '最近被評分的文章';
$lang['Highest_ranked_topics'] = '優質主題百大排行';
$lang['Highest_ranked_posts'] = '優質文章百大排行';
$lang['Highest_ranked_posters'] = '優秀作者百大排行';
至於 lang_rating.php 中有關於後台的部份我懶得翻了。XD
代碼: 選擇全部
<?php
/***************************************************************************
* lang_rating.php v1.1.0
* -------------------
* begin : Friday, Jan 17, 2003
* copyright : (C) 2002 Web Centre Ltd
* email : phpbb@mywebcommunities.com
*
***************************************************************************/
$lang['Rating_page_title'] = '進行評分';
$lang['Die_rate_private'] = 'You cannot rate posts in private forums';
$lang['Die_login_to_rate'] = 'This post is in a forum restricted to registered members. You must be logged in to access the rating information.';
$lang['Die_rate_only_first'] = 'You can only rate the first post in each topic';
$lang['User_suspended'] = 'Ratings for this user have been suspended by the administrator';
$lang['Cannot_rate_own'] = '您無法為自己的文章進行評分';
$lang['Not_yet_rated'] = '這一篇文章尚未被評分';
$lang['Rating_anon_user'] = 'Registered user';
$lang['Must_be_logged_to_rate'] = 'You must be logged in to rate this post';
$lang['Days_registered_before_rating'] = 'You need to have been registered for %s before you can rate posts';
$lang['Posts_before_rating'] = 'You need to have made %s before you can rate other posts';
$lang['User_rating_limit'] = 'You have already rated %s by this user in the last 24 hours, which is the limit set by the administrator';
$lang['Daily_rating_limit'] = 'You have already rated %s in the last 24 hours, which is the limit set by the administrator';
$lang['Already_rated'] = '您已經評分了這一篇文章';
$lang['No_rating_permission_post'] = 'You do not have permission to rate this post';
$lang['No_rating_permission'] = 'You do not have permission to rate posts';
$lang['Your_rating'] = '您可以評分這一篇文章';
$lang['Rating_visible'] = '您的評分將會公開';
$lang['Rating_visible_forced'] = 'NOTE: Anonymous ratings are no longer allowed. If you click the button, all your ratings will be visible to others';
$lang['Rate_anonymously'] = 'Rate anonymously (applies to all your ratings)';
$lang['Return_to_post'] = 'Return to post';
$lang['Close_window'] = 'Close window';
$lang['Poster_rank'] = '等級';
$lang['Topic_rank'] = '本篇主題共得';
$lang['Post_rank'] = '本篇文章共得';
$lang['Rated_by'] = '評分人';
$lang['Rated_on'] = '時間';
$lang['No_rating'] = '尚未評分';
$lang['Unrated'] = '尚未評分';
$lang['No_rank'] = 'No rank';
$lang['Rating_sample_post'] = '最近被評分的文章';
$lang['Topic_starter'] = '發表人';
$lang['Rating_deactivated'] = 'Sorry, the rating system is de-activated at present';
$lang['No_ratings'] = '尚未評分';
$lang['Total_points'] = '累積評分';
$lang['Average_points'] = 'Average points';
$lang['Rate_it'] = '給予評分';
$lang['Rating_config_gen'] = 'General configuration';
$lang['Rating_overview_text'] = '<b>Overview</b>: Users can rate each post individually, by selecting from a range of "rating options", each of which carries a certain point value. The overall rank for each post is calculated by totalling (or averaging) all the individual rating points for that post, and assigning a rank from the "Totals table". Overall ranks for topics and users are also derived in this way (i.e. all ratings of posts in a particular topic / by a particular user).';
$lang['Rating_settings_title'] = 'Overall settings for your rating system';
$lang['Rating_settings_text'] = '<b>Rate first post only</b>: Only allow first post in each topic to be rated<br />
<b>Min. post count</b>: Number of posts a user must make before being able to rate<br />
<b>Min. days registered</b>: Days that must elapse after user registers before being able to rate<br />
<b>Weighting method</b>: If activated, a user can only select from those rating options where their own count (e.g. post count) equals or exceeds the figure in the "weighting threshold" column (see table below)<br />
<b>Max daily ratings</b>: Limit total number ratings a user can make in any 24 hour period<br />
<b>Max daily ratings per user</b>: Limit number of times that a user can rate posts by the same poster in any 24 hour period<br />
<b>Allow users to hide name</b>: Allow user to appear as anonymous in list of who rated a post<br />
<b>Overall rating method</b>: Whether rating totals are based on sum or average of all individual rating points';
$lang['Rating_options'] = 'Rating options';
$lang['Points'] = 'Points';
$lang['Rating_label'] = 'Label';
$lang['Weighting_threshold'] = 'Weighting threshold';
$lang['Rating_who'] = 'Who';
$lang['Rating_used'] = 'Used';
$lang['Rating_delete'] = 'Delete';
$lang['Rating_update'] = 'Update';
$lang['Rating_update_config'] = 'Update configuration';
$lang['Rating_add'] = 'Add';
$lang['Rating_option_title'] = 'Determines range of ratings a user can assign to a post';
$lang['Rating_option_text'] = '<b>Points</b>: Used to calculate total ratings for posts, topics and users<br />
<b>Weighting threshold</b>: See "Weighting Method" in general configuration<br />
<b>Who</b>: Used to restrict options based on user status<br />
<b>Used</b>: Number of times an option has been selected to date<br />';
$lang['Rating_ranks'] = 'Representation of post and topic ranks';
$lang['User_ranks_title'] = 'Representation of user ranks';
$lang['Board_rank'] = 'Board rank';
$lang['Rating_applies_to'] = 'Applies to';
$lang['Rating_sum'] = 'Sum';
$lang['Rating_average'] = 'Average';
$lang['Rating_max'] = 'Maximum';
$lang['Rating_icon'] = 'Icon';
$lang['Rating_rank_title'] = 'How overall ranks are calculated and presented';
$lang['Rating_rank_text'] = '<b>Average</b>: The average of all individual ratings is calculated, and the rank with the <b>nearest</b> "Average" figure being selected<br />
<b>Sum</b>: All individual ratings are totalled, and out of those ranks where this total <b>equals or exceeds</b> the "Sum threshold", the rank with the highest sum threshold is selected';
$lang['Rating_admin_page_title'] = 'Rating system configuration';
$lang['Must_be_an_integer'] = 'must be an integer';
$lang['Invalid_point_value'] = 'Points value must be an integer between -127 and 128';
$lang['Invalid_threshold_value'] = 'Threshold value must be an integer between 0 and 30000';
$lang['Invalid_average_threshold'] = 'Average threshold must be an integer between -127 and 128';
$lang['Invalid_sum_threshold'] = 'Sum threshold must be an integer between -2000000000 and 2000000000';
$lang['Weighting_method_posts'] = 'Post count';
$lang['Rating_user_type_all'] = 'All users';
$lang['Rating_user_type_mods'] = 'All moderators';
$lang['Rating_user_type_forum'] = 'Forum moderators';
$lang['Rating_user_type_admin'] = 'Admin only';
$lang['Rating_remove_confirm'] = 'Existing ratings will be removed. Are you sure you want to delete this option?';
$lang['Rating_recalc_confirm'] = 'Existing ratings will be recalculated. Are you sure you want to delete this rank?';
$lang['Rating_admin_errors'] = 'There were some problems with the information you submitted. Please read the messages below, make the necessary changes and re-submit:';
$lang['As_rated_by'] = 'as rated by';
$lang['As_rated_by_you'] = '檢視您評分的所有文章';
$lang['Ratings_posts_by'] = '的優質文章';
$lang['Ratings_posts_by_you'] = 'your posts';
$lang['Recalc_text'] = 'Some actions may require you to manually recalculate the ratings e.g. deletion of rated posts. To do this, click on the button below';
$lang['Recalc_button'] = 'Recalculate all ratings';
$lang['Recalc_confirm'] = 'Are you sure? This may take some time on large boards';
$lang['Ratedby_hidden'] = 'The administrator has chosen to hide the names of who rated which posts';
$lang['Rating_screen_type'] = '分類';
$lang['Rating_in'] = '於'; // As in "posts IN this forum"
$lang['Rating_all_forums'] = '所有版面';
$lang['Rating_make_neutral'] = 'Be neutral towards ratings by %s';
$lang['Rating_is_neutral'] = 'You are currently neutral towards ratings by %s';
$lang['Rating_make_buddy'] = 'Favour ratings by %s';
$lang['Rating_is_buddy'] = 'You are currently favouring ratings by %s';
$lang['Rating_buddy'] = 'Your ratings are currently favoured by %s';
$lang['Rating_ignored'] = 'Your ratings are currently ignored by %s';
$lang['Rating_make_ignored'] = 'Ignore ratings by %s' ;
$lang['Rating_is_ignored'] = 'You are currently ignoring ratings by %s';
$lang['Rating_bias'] = '偏好';
$lang['Rating_bias_off'] = '偏好設定尚未啟用';
$lang['Rating_bias_loggedoff'] = 'You must be logged in to use the bias system for ratings';
$lang['Rating_all_but_ignore'] = 'All but my \'ignores\'';
$lang['Rating_everyone'] = '所有會員';
$lang['Rating_buddies_only'] = 'My buddies only';
$lang['Rating_include_by'] = '顯示評分';
$lang['Rating_yourself'] = '個人';
$lang['Rating_bias_prompt'] = 'Bias prompted by';
$lang['Rating_bias_when'] = 'When';
$lang['Rating_current'] = 'Current rating';
$lang['Rating_buddies_only'] = 'Buddies only';
$lang['Rating_ignores_only'] = 'Ignores only';
$lang['Rating_post_removed'] = 'a post that no longer exists';
$lang['Rating_this_post'] = 'this post';
$lang['Rating_this_user'] = 'this user';
$lang['Rating_of'] = 'Rating of';
$lang['Rating_awarded_to'] = 'awarded to';
$lang['Rating_my_bias_title'] = 'My bias towards ratings by other users';
$lang['Rating_their_bias_title'] = 'Bias by other users towards my ratings';
$lang['Rating_no_bias'] = 'No bias at present';
?>
拭銀布 寫:關於後台等級累積評分圖示的設定我有點搞不太清楚。
圖示請放到 phpBB 底下的 /mods/rating/images/ 資料夾內。
設定請參考:
http://home.pchome.com.tw/mysite/paulho ... stem_1.gif
http://home.pchome.com.tw/mysite/paulho ... stem_2.gif
發表於 : 2004-02-28 09:52
由 拭銀布
非常感謝魔王幫忙...........
啊.....

這裡不是熱舞站厚......忘了....
感激依大大

發表於 : 2004-05-25 00:49
由 依夢兒
最近想改進一下評分系統加錢的方式,有一些關於程式的寫法,請教各位。
我現在想要增加的是,評分的時候,系統會先檢查一下這一篇文章目前已經獲得多少評分。
由於我是設定每評一分,作者就會獲得一元的獎金,也就是 1:1 。
現在我想要變成,如果該篇文章的累計評分未滿十分,管理員給予評分的時候,系統會依照原來的設計作加錢的動作。
但是如果累計評分已滿十分(或是超過十分,例如十二分),管理員給予評分的時候,評分照樣累計上去,但是系統不再加錢。
簡單的說,就是每一篇文章的評分可以無限累計上去,有多少版面管理員評分,你就可以獲得多少分。
但是每一篇文章因為被評分而獲得的獎金上限最多為十元就是了。
舉例:
情況一:某 A 發表一篇文章,目前已累計評分四分,現在我評分,加三分,該篇文章的累計評分成為七分,同時系統加贈他三元獎金。
情況二:某 B 發表一篇文章,目前已累計評分七分,現在我評分,加四分,該篇文章的累計評分成為十一分。
但是由於該篇文章的累計評分突破十分了,所以原本系統應該加贈他四元獎金,修正為三元。
情況三:某 C 發表一篇文章,目前已累計評分十分,現在我評分,加四分,該篇文章的累計評分成為十四分。
但是由於該篇文章的累計評分突破十分了,所以原本系統應該加贈他四元獎金,修正為不給獎金。
不清楚程式要怎麼寫,好像是 if $current_rating > 和 = 10 的話 ,有關加錢的那一段程式就不予運作。
原來 yuan 兄提供的加錢修改方式請參考:
http://phpbb-tw.net/phpbb/viewtopic.php?p=137497#137497
有勞各位學長指教了。^^"
發表於 : 2004-05-28 10:21
由 .::藍色的天空::.
要改的我可以幫你....
不過你是否用Post rate 這個MOD?