[轉貼]Cash Mod安裝於P.C.P的改法

Officially Approved MODs
由 phpBB Group 官方發展小組認證的 MOD!

版主: 版主管理群

版面規則
請注意!只有發表在 [2.0.x] MOD Database Releases 的外掛,才算是官方認證的外掛。
主題已鎖定
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

[轉貼]Cash Mod安裝於P.C.P的改法

文章 天霜 »

Profile Control Panel 的改法

原文章來自:
http://www.phpbb.com/phpBB/viewtopic.ph ... 211#735211

wGEric 寫:Here is what I did to get it to work.

open: templates/subSilver/profielcp/public_base_body.tpl
find:

代碼: 選擇全部

						<span class="genmed"><a href="{U_SEARCH_USER}" class="genmed">{L_SEARCH_USER_POSTS}</a></span>
						<!-- END switch_post_stat -->
					</td>
				</tr>
\n
After Add:

代碼: 選擇全部

				<!-- BEGIN cashrow -->
		<tr> 
		  <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{cashrow.CASH_NAME}:</span></td>
		  <td><table border="0"><tr><td width="50" colspan="2"><span class="gen"><b>{cashrow.CASH_AMOUNT}</b></span></td></tr><tr>
		<!-- BEGIN switch_donatedisplay -->
		<form style="{display: inline;}" action="{cashrow.S_DONATE_ACTION}" method="post"><td><span class="gen"><input type="submit" value="{cashrow.L_DONATE}" class="liteoption" /> <input type="hidden" name="member_donate" value="1" /><input type="hidden" name="cash_type" value="{cashrow.CASH_TYPE}" /><input name="donate_amount" value="0" size="5" class="post" /> / </span></td><td width="50"><span class="gen"><b>{cashrow.DONATER_CASH}</b></span></td></form>
		</tr>
		<!-- END switch_donatedisplay -->
		<!-- BEGIN switch_admindisplay -->
		<tr>
		<form style="{display: inline;}" action="{cashrow.S_ADMIN_ACTION}" method="post"><td colspan="2"><span class="gen"><input type="submit" value="{cashrow.L_ADD_CASH}" class="liteoption" /> <input type="hidden" name="admin_donate" value="1" /><input type="hidden" name="cash_type" value="{cashrow.CASH_TYPE}" /><input name="admin_amount" value="0" size="5" class="post" /></span></td></form>
		<!-- END switch_admindisplay -->
		  </tr></table></td>
		</tr>
		<!-- END cashrow -->
		<!-- BEGIN switch_exchangeon -->
		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen"></span></td>
		  <form style="{display: inline;}" action="{U_EXCHANGE}" method="post"><td><input type="submit" value="{L_EXCHANGE}" class="liteoption" /></td></form>
		</tr>
		<!-- END switch_exchangeon -->
Open: profilcp/profilcp_public_base.php
Find:

代碼: 選擇全部

if ( !empty($setmodules) ) return;
After Add:

代碼: 選擇全部

if ( !($board_config['cash_disabled']) )
{
	include($phpbb_root_path . 'includes/functions_cash.'.$phpEx);
	
	$cash_table = array();
	$indices = array();

	get_cash_table($cash_table,$indices);

	if ( isset($HTTP_POST_VARS['admin_donate']) && ($HTTP_POST_VARS['admin_donate'] == 1) )
	{
		cash_admin_donate($HTTP_GET_VARS[POST_USERS_URL],$userdata,$HTTP_POST_VARS['admin_amount'],$cash_table[$HTTP_POST_VARS['cash_type']]);
	}

	if ( isset($HTTP_POST_VARS['member_donate']) && ($HTTP_POST_VARS['member_donate'] == 1) )
	{
		cash_user_donate($HTTP_GET_VARS[POST_USERS_URL],$userdata,$HTTP_POST_VARS['donate_amount'],$cash_table[$HTTP_POST_VARS['cash_type']]);
	}
	
}
Find:

代碼: 選擇全部

	'L_CELLULAR'			=> $lang['Cellular'],
	'L_PAGER'				=> $lang['Pager'],
After add:

代碼: 選擇全部

	'L_EXCHANGE' => $lang['Exchange'],
	'U_EXCHANGE' => append_sid("exchange.$phpEx"),
Find:

代碼: 選擇全部

// page
$template->pparse('body');
Before add:

代碼: 選擇全部

$cash_count = 0;
foreach ( $cash_table AS $cash_set )
{
	if( !($board_config['cash_disable']) && (($cash_set['cash_enabled'] && $cash_set['cash_profiledisplay']) || ($userdata['user_level'] == ADMIN)) )
	{
		$template->assign_block_vars('cashrow', array(	'CASH_NAME' => (($cash_set['cash_image'])?('<img src="'.$phpbb_root_path.$cash_set['cash_imageurl'].'" />'):($cash_set['cash_name'])),
														'CASH_AMOUNT' => $view_userdata[$cash_set['cash_dbfield']],
														'CASH_TYPE' => $cash_set['cash_id'],

														'DONATER_CASH' => $userdata[$cash_set['cash_dbfield']],

														'L_DONATE' => $lang['Donate'],
														'L_ADD_CASH' => sprintf($lang['Add_cash'], $cash_set['cash_name']),

														'S_DONATE_ACTION' => append_sid("profile.$phpEx?mode=viewprofile&u=".$HTTP_GET_VARS[POST_USERS_URL]),
														'S_ADMIN_ACTION' => append_sid("profile.$phpEx?mode=viewprofile&u=".$HTTP_GET_VARS[POST_USERS_URL]))
														);
		if ( $cash_set['cash_enabled'] && $cash_set['cash_donate'] && $userdata['session_logged_in'] && ($userdata['user_id'] != $profiledata['user_id']) )
		{
			$template->assign_block_vars('cashrow.switch_donatedisplay', array());
		}
		if ( ($userdata['user_level'] == ADMIN) || (($cash_set['cash_modedit'] == 1) && ($userdata['user_level'] == MOD)) )
		{
			$template->assign_block_vars('cashrow.switch_admindisplay', array());
		}
		$cash_count++;
	}
}
if ( !$board_config['cash_disable'] && ($cash_count > 1) )
{
	$template->assign_block_vars("switch_exchangeon", array());
}
I think that is all of the changes that are needed for it to work.

It makes it so when you are viewing the persons profile their cash is also displayed.
不回答來自 私人訊息, 電子郵件, 及時通 的相關 phpBB 問題
除非是個人疏失所造成的問題

這世界還有拼命守護的價值嗎...

頭像
hgm
星球普通子民
星球普通子民
文章: 12
註冊時間: 2002-11-14 00:22

[問題]Cash Mod安裝於P.C.P後發生錯誤

文章 hgm »

安裝完後發生錯誤訊息如下
Fatal error: Call to undefined function: get_cash_table() in c:\appserv\www\tkb\profilcp\\profilcp_public_base.php on line 36

哪裡出問題
hgm

詹姆士
星球普通子民
星球普通子民
文章: 16
註冊時間: 2003-09-22 15:35

文章 詹姆士 »

我也發生同樣的問題

應該是PCP版本不同所造成的...

看看誰有1.0版改成功的可以分享囉...
這是我的園地,希望大家有空來逛逛
圖檔

主題已鎖定

回到「官方認證外掛」