參考的來源都附在下面\r
相關文章:
1.Cash MOD 下載
http://www.phpbb.com/phpBB/catdb.php?mo ... &id=853980
2.Cash MOD 中文化
http://phpbb-tw.net/phpbb/viewtopic.php?t=20848
總共八組更改,請視您的情況使用\r
一、CashMod 不能兌換的修正 (建議安裝)
二、美化顯示資料和中文修正 (建議安裝)
三、防止編輯文章賺取金錢\r
四、如果在viewprofile裡面沒有看到貨幣\r
五、如果在viewtopic裡面沒有看到貨幣\r
六、Points MOD 或 Visual Money 的轉移方式
七、貸款的人不能給別人錢在Cash mod中的修正 (有裝貸款功能者建議安裝)
八、和其他MOD衝突到而無法使用的狀況
以下為本文開始
一、CashMod 不能兌換的修正
來源:phpbb.com 的 Tellur
打開cash.php
尋找
代碼: 選擇全部
//========================================[ Exchange Code ]===========================
//
代碼: 選擇全部
//
//========================================[ Exchange Code ]===========================
//
case "exchange":
default:
//
// Load templates
//
$template->set_filenames(array(
'body' => 'cash_exchange.tpl')
);
//
// Output page header
//
$page_title = $lang['Exchange'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$sql = "SELECT * FROM " . CASH_EXCHANGE_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain exchange information", '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, $lang['Exchange_lack_of_currencies']);
}
$exchange_data = array();
do
{
$exchange_data[$row['ex_cash_id1']][$row['ex_cash_id2']] = 1;
}
while ( $row = $db->sql_fetchrow($result) );
if ( isset($HTTP_POST_VARS['exchange']) &&
isset($HTTP_POST_VARS['from_id']) &&
is_numeric($HTTP_POST_VARS['from_id']) &&
isset($HTTP_POST_VARS['to_id']) &&
is_numeric($HTTP_POST_VARS['to_id']) &&
isset($HTTP_POST_VARS['convert_amount']) &&
is_numeric($HTTP_POST_VARS['convert_amount']) )
{
$from_id = intval($HTTP_POST_VARS['from_id']);
$to_id = intval($HTTP_POST_VARS['to_id']);
$convert_amount = cash_floatval($HTTP_POST_VARS['convert_amount']);
if ( ($to_id != $from_id) && $cash->currency_exists($to_id) && $cash->currency_exists($from_id) && isset($exchange_data[$from_id]) && is_array($exchange_data[$from_id]) && isset($exchange_data[$from_id][$to_id]) && $cash->currencies[$from_id]->mask(CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) && $cash->currencies[$to_id]->mask(CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) )
{
if ( $convert_amount < 0 )
{
qs($from_id,$to_id);
$convert_amount = -$convert_amount;
}
$c_cur_from = $cash->currency($from_id);
$c_cur_to = $cash->currency($to_id);
$exchanger = new cash_user($userdata['user_id'],$userdata);
if ( $exchanger->has($c_cur_from->id(),$convert_amount) )
{
$converted_amount = (($convert_amount/$c_cur_from->data('cash_exchange'))*$c_cur_to->data('cash_exchange'));
$exchanger->remove_by_id_array(array($c_cur_from->id() => $convert_amount));
$exchanger->give_by_id_array(array($c_cur_to->id() => $converted_amount));
}
}
}
$template->assign_vars(array(
'S_EXCHANGE_ACTION' => append_sid("cash.$phpEx?mode=exchange"),
'S_HIDDEN_FIELDS' => '<input type="hidden" name="exchange" value="1" />',
'L_EXCHANGE' => $lang['Exchange'],
'L_FROM' => $lang['From'],
'L_TO' => $lang['To'],
'L_CONVERT' => $lang['Convert'],
'L_SELECT_ONE' => $lang['Select_one'],
'L_SUBMIT' => $lang['Submit'],
'L_RESET' => $lang['Reset'])
);
$max_columns_per_row = 3;
$columnwidth = intval(floor(100/$max_columns_per_row));
$bresenham = 0;
$numrows = intval(ceil(count($indices)/$max_columns_per_row));
$i = 0;
while ( $c_cur = &$cash->currency_next($cm_i,CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) )
{
$template->assign_block_vars("cashrow",array(
'CASH_ID' => $c_cur->id(),
'CASH_NAME' => $c_cur->name(true))
);
if ( (($i * $numrows) / $cash->currency_count(CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE)) >= $bresenham )
{
$bresenham++;
$template->assign_block_vars("rowrow",array());
}
$headercash = $c_cur->display($userdata[$c_cur->db()]);
$template->assign_block_vars("rowrow.cashtable",array( 'CASH_ID' => $c_cur->id(),
'CASH_NAME' => $c_cur->name(),
'HEADER' => $lang['You_have'] . " " . $headercash,
'ONE_WORTH' => sprintf($lang['One_worth'],$c_cur->name()),
'NO_EXCHANGE' => sprintf($lang['Cannot_exchange'],$c_cur->name()))
);
$exchangecount = 0;
if ( isset($exchange_data[$c_cur->id()]) && count($exchange_data[$c_cur->id()]) )
{
$template->assign_block_vars("rowrow.cashtable.switch_exon",array());
while ( $c_cur_j = &$cash->currency_next($cm_j,CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) )
{
if ( ($c_cur->id() != $c_cur_j->id()) && isset($exchange_data[$c_cur->id()]) && isset($exchange_data[$c_cur->id()][$c_cur_j->id()]) )
{
$ratio = floor(($c_cur_j->data('cash_exchange')/$c_cur->data('cash_exchange'))*1000)/1000;
$template->assign_block_vars("rowrow.cashtable.switch_exon.exchangeitem",array( 'EXCHANGE' => $c_cur_j->display($ratio)));
}
}
}
else
{
$template->assign_block_vars("rowrow.cashtable.switch_exoff",array());
}
$i++;
}
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
break;
}
?>
GeniusKiKi 寫:一、檢視個人資料時貨幣名稱沒有排列整齊這是在貨幣名稱的冒號後面多加一個空白代碼: 選擇全部
打開:templates/subSilver/cash_viewprofile.tpl 尋找:<span class="gen">{cashrow.CASH_NAME}:</span> 改成:<span class="gen">{cashrow.CASH_NAME}: </span>
這樣跟其他的東西顯示起來才一致才不會歪掉
二、將兌換控制台裡面錯誤的字改掉這是修改原本兌換時會出現“來自”及“收件人”代碼: 選擇全部
打開:language/lang_chinese_traditional_taiwan/lang_cash.php 尋找:$lang['Exchange'] = '兌換'; 新增:$lang['Exchange_from'] = '從'; $lang['Exchange_to'] = '兌換成'; 打開:cash.php 尋找:'L_FROM' => $lang['From'], 'L_TO' => $lang['To'], 替換:'L_FROM' => $lang['Exchange_from'], 'L_TO' => $lang['Exchange_to'], 打開:admin/cash_exchange.php 尋找:'L_TO' => ucwords($lang['To']), 'L_FROM' => ucwords($lang['From']), 替換:'L_TO' => $lang['Exchange_to'], 'L_FROM' => $lang['Exchange_from'],
修改為正確的中文用字
garibaldi 寫:"版區權限"中文字顯示有問題
代碼: 選擇全部
打開:admin/cash_forums.php 尋找: 'L_ON' => ucwords(strtolower($lang['ON'])), 'L_OFF' => ucwords(strtolower($lang['OFF']))) 替換: 'L_ON' => $lang['ON'], 'L_OFF' => $lang['OFF'])
三、防止編輯文章賺取金錢\rgaribaldi 寫:"貨幣設定"中的"複製貨幣資料"的顯示問題希望我不是在"重新發明輪子"...代碼: 選擇全部
開啟:language/lang_chinese_traditional_taiwan/lang_cash.php 尋找:$lang['Cash_copy_currency'] = '複製貨幣資料'; 新增: $lang['Cash_copy_from'] = '從'; $lang['Cash_copy_to'] = '複製到'; 開啟:admin/cash_currencies.php 尋找: "L_FROM" => ucwords($lang['From']), "L_TO" => ucwords($lang['To']), 改成 "L_FROM" => $lang['Cash_copy_from'], "L_TO" => $lang['Cash_copy_to'],
四、如果在viewprofile裡面沒有看到貨幣\r天霜 寫:詳細設定中的XX可獲得的金額保持原始值\r
發現到如果回覆文章後 再去編輯文章
如果什麼都沒改 就送出 則不會加錢\r
但如果多個幾個字 就會加錢\r
則這樣會被有心人惡搞
所以照以下改 不管他編輯幾次 都不會再加錢了
每篇回文可獲得的金額
每篇發文可獲得金額最大值\r
只要以上這個兩個數值都一樣 這樣就不會被惡搞
五、如果在viewtopic裡面沒有看到貨幣\r依夢兒 寫:這一段加在 profile_view_body.tpl 的部份,好像真的有問題。
因為我在 phpBB 2.0.6 上安裝,的確也是有這樣的狀況,就是貨幣顯示不出來。
重點是 Cash Mod 2.2.1 是我 2.0.6 上第一支安裝的外掛,所以問題應該不是和什麼外掛衝突到了....
我自己的解決辦法如下:
將:
覆蓋為:代碼: 選擇全部
{CASH}
也就是直接把 cash_viewprofile.tpl 的內容貼到 profile_view_body.tpl 內。代碼: 選擇全部
<!-- BEGIN cashrow --> <tr> <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{cashrow.CASH_NAME}:</span></td> <td><span class="gen"><b>{cashrow.CASH_AMOUNT}</b></span></td> \n</tr> <!-- END cashrow --> <!-- BEGIN switch_cashlinkson --> <tr> <td valign="middle" align="right" nowrap="nowrap"></span> <td><span class="gen"> <!-- BEGIN cashlinks --> [ <a href="{switch_cashlinkson.cashlinks.U_LINK}" class="genmed">{switch_cashlinkson.cashlinks.L_NAME}</a> ] <!-- END cashlinks --> </span></td> </tr> <!-- END switch_cashlinkson -->
六、Points MOD 或 Visual Money 的轉移方式天霜 寫: 那就以此類推試試看這樣改 會不會成功代碼: 選擇全部
# #-----[ OPEN 打開 ]---------------------------------------------------- # templates/subSilver/viewtopic_body.tpl # #-----[ FIND 尋找 ]---------------------------------------------------- # {postrow.CASH} # #-----[ REPLACE WITH 替換 ]-------------------------------------------- # <!-- BEGIN cashrow --> {cashrow.CASH_DISPLAY}<br /> <!-- END cashrow --> <!-- BEGIN cashlinks --> [ <a href="{cashlinks.U_LINK}" class="genmed">{cashlinks.L_NAME}</a> ]<br /> <!-- END cashlinks --> # #-----[ SAVE/CLOSE ALL FILES 儲存並且關閉所有檔案 ]-------------------- # # EoM # 外掛結束
七、貸款的人不能給別人錢在Cash mod中的修正ernie 寫:依照官方站的說明,在SQL裡面進行:
如果你之前安裝的是(發表在竹貓的)虛擬貨幣,請不要刪除原來的user_money,執行以下SQL如果裝的是積分,請不要刪除原來的user_points,執行以下SQL:代碼: 選擇全部
INSERT INTO phpbb_cash (cash_dbfield, cash_name) VALUES ('user_money', '[color=red]貨幣名稱[/color]')
紅色的貨幣名稱可以自行修改,例如竹貓幣,雷克斯幣,金幣....代碼: 選擇全部
INSERT INTO phpbb_cash (cash_dbfield, cash_name) VALUES ('user_points', '[color=red]貨幣名稱[/color]')
八、和其他MOD衝突到而無法使用的狀況sonic33200 寫:開啟:includes/classes_cash.php
尋找:取代成:代碼: 選擇全部
if ( $cash->currency_count(CURRENCY_ENABLED | CURRENCY_DONATE,$forum_id) && ($userdata['user_id'] != $postdata['user_id']) && $userdata['session_logged_in'] )
存檔~上傳~~完成!!代碼: 選擇全部
if ( $cash->currency_count(CURRENCY_ENABLED | CURRENCY_DONATE,$forum_id) && ($userdata['user_id'] != $postdata['user_id']) && ( $userdata['user_loan'] < 1 ) && $userdata['session_logged_in'] )
小弟的程式功力非常差,如有修改的不好的地方請見諒與多多指教
這邊也特別感謝 ernie 大大提供的原始修改方式,讓小弟受用不盡
才能進而修改出其他版本~
來源:phpbb.com 的 Remix_88
如果在後台出現以下東西,而且不能發文章等等:
代碼: 選擇全部
Error retrieving cash data
DEBUG MODE
SQL Error : 1146 Table 'table[color=red].cash[/color]' doesn't exist
SELECT * FROM cash ORDER BY cash_order ASC
Line : 657
File : includes/functions_cash.php
如果出現此狀況是和其他MOD衝突到了,作以下修改:
代碼: 選擇全部
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_cash.php
#
#-----[ FIND ]------------------------------------------
#
# 應該是第75行
if ( !empty($setmodules) )
{
include($phpbb_root_path . 'includes/functions_cash.'.$phpEx);
$menu = array();
admin_menu($menu);
#
#-----[ REPLACE, WITH ]------------------------------------------
#
if ( !empty($setmodules) )
{
$phpbb_root_path = "./../";
include($phpbb_root_path . 'config.'.$phpEx);
include($phpbb_root_path . 'includes/functions_cash.'.$phpEx);
$menu = array();
admin_menu($menu);