1 頁 (共 1 頁)

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

發表於 : 2003-12-03 16:29
天霜
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.

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

發表於 : 2003-12-25 17:34
hgm
安裝完後發生錯誤訊息如下
Fatal error: Call to undefined function: get_cash_table() in c:\appserv\www\tkb\profilcp\\profilcp_public_base.php on line 36

哪裡出問題

發表於 : 2003-12-26 14:46
詹姆士
我也發生同樣的問題

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

看看誰有1.0版改成功的可以分享囉...