第 1 頁 (共 1 頁)
[問題] 水怪RPG資料顯示問題
發表於 : 2005-09-11 02:28
由 風鈴兒
請問各位大大~
我想把水怪RPG的資料顯示(如下)拿掉不在viewtopic顯示,但想在會員的個人資料(profile)顯示出來,請問須要怎樣修改才能在個人資料(profile)顯示出來呢?
代碼: 選擇全部
職 照: xxx
等 級: xxx
H P: xxx / xxx
M P: xxx / xxx
經驗值: xxx / xxx
攻擊力: xxx
防禦力: xxx
?#93; 力: xxx
速 度: xxx
發表於 : 2005-09-11 02:37
由 233062306
代碼: 選擇全部
#
#-----[ 修改結束,存檔 ]-------------------------------------------------------------
#-----[ 打?#125; ]-----------------------------------------------------------------------
#
viewtopic.php
#
#-----[ 尋找這一段 ]-----------------------------------------------------------------
#
$sql = "SELECT u.username, u.user_id
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id
#
#-----[ 在 $sql = "SELECT 後面尋找 ]-------------------------------------------------
#
u.user_allowsmile
#
#-----[ 之後, ?#91;上 ]-----------------------------------------------------------------
#
,u.user_robfail, u.rpg_level, u.rpg_cur_hp, u.rpg_max_hp, u.rpg_cur_mp, u.rpg_max_mp, u.rpg_cur_exp, u.rpg_max_exp, u.rpg_attack, u.rpg_defense, u.rpg_magic, u.rpg_speed, u.rpg_medals
#
#-----[ 尋找 ]-----------------------------------------------------------------------
#
//
// Again this will be handled by the templating
// code at some point
#
#-----[ 之前, ?#91;上 ]-----------------------------------------------------------------
#
$rpgstatus = '<table width="142" cellpadding="0" cellspacing="0" border="0" class="bodyline">' .
'<tr><td width="35%"><span class="gensmall">職 照:</span></td><td><span class="gensmall">' . $postrow[$i]['rpg_medals'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">等 級:</span></td><td><span class="gensmall">' . $postrow[$i]['rpg_level'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">H P:</span></td><td><span class="gensmall">' . $postrow[$i]['rpg_cur_hp'] . ' / ' . $postrow[$i]['rpg_max_hp'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">M P:</span></td><td><span class="gensmall">' . $postrow[$i]['rpg_cur_mp'] . ' / ' . $postrow[$i]['rpg_max_mp'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">經驗值:</span></td><td><span class="gensmall">' . $postrow[$i]['rpg_cur_exp'] . ' / ' . $postrow[$i]['rpg_max_exp'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">攻擊力:</span></td><td><span class="gensmall">' . $postrow[$i]['rpg_attack'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">防禦力:</span></td><td><span class="gensmall">' . $postrow[$i]['rpg_defense'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">?#93; 力:</span></td><td><span class="gensmall">' . $postrow[$i]['rpg_magic'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">速 度:</span></td><td><span class="gensmall">' . $postrow[$i]['rpg_speed'] . '</span></td></tr></table>';
#
#-----[ 尋找 ]-----------------------------------------------------------------------
#
'EDITED_MESSAGE' => $l_edited_by,
#
#-----[ 之後, ?#91;上 ]-----------------------------------------------------------------
#
'POSTER_RPG' => $rpgstatus,
#
代碼: 選擇全部
#-----[ 打?#125; ]-----------------------------------------------------------------------
#
templates/{YOUR_THEME}/viewtopic_body.tpl
#
#-----[ 尋找 ]-----------------------------------------------------------------------
#
{postrow.POSTER_FROM}</span><br /></td>
#
#-----[ 覆蓋為 ]---------------------------------------------------------------------
#
{postrow.POSTER_FROM}</span><br />{postrow.POSTER_RPG}</td>
刪除上面的...
我以前也有做過....
可能記錯><
希望沒有教錯吧= =
如果錯了.....對不起啦....
如果連搶劫失敗的圖都消失的話\r
代碼: 選擇全部
#
#-----[ 尋找 ]-----------------------------------------------------------------------
#
//
// Define the little post icon
#
#-----[ 之前, ?#91;上 ]-----------------------------------------------------------------
#
if ($postrow[$i]['user_robfail'] > 0)
{
$poster_avatar .= '<br />';
$robid = floor(($postrow[$i]['user_robfail'] - 1) / 4);
$robcnt = (($postrow[$i]['user_robfail'] - 1) % 4) + 1;
if ($robid <= 7)
{
for ($j=0; $j < $robcnt; $j++)
{
$poster_avatar .= '<img src="images/rob' . $robid . '.gif" />';
}
}
else
{
$poster_avatar .= '<center><img src="images/rob7.gif" />× ' . ($postrow[$i]['user_robfail'] - 28) . '</center>';
}
$poster_avatar .= '<br /><span class="gensmall">笨!失敗的搶匪</span>';
}
profile讓我測試一下....
我不太肯定
不如你說說在porfile哪個部分加....
發表於 : 2005-09-11 02:41
由 風鈴兒
麻煩233062306大大,thx^^
請問有方法可將這些資料顯示在個人資料(profile)呢?
發表於 : 2005-09-11 02:44
由 233062306
風鈴兒 寫:麻煩233062306大大,thx^^
請問有方法可將這些資料顯示在個人資料(profile)呢?
有有有@@
把我剛才貼的code修改一部份~
之後貼上profile.php and profile_view_body.tpl
但我未試過做...
所以要試得好小心....
發表於 : 2005-09-11 02:49
由 風鈴兒
233062306 寫:風鈴兒 寫:麻煩233062306大大,thx^^
請問有方法可將這些資料顯示在個人資料(profile)呢?
有有有@@
把我剛才貼的code修改一部份~
之後貼上profile.php and profile_view_body.tpl
但我未試過做...
所以要試得好小心....
\r
這樣我試試看^^
發表於 : 2005-09-11 10:18
由 心靈捕手
風鈴兒 寫:233062306 寫:風鈴兒 寫:麻煩233062306大大,thx^^
請問有方法可將這些資料顯示在個人資料(profile)呢?
有有有@@
把我剛才貼的code修改一部份~
之後貼上profile.php and profile_view_body.tpl
但我未試過做...
所以要試得好小心....
這樣我試試看^^
依照經驗, 應該是要修改
includes/usercp_viewprofile.php
templates/YOUR_THEME/profile_view_body.tpl
舉例: 在檢視個人資料頁面, 加入"
水怪等級"
代碼: 選擇全部
#
#-----[ Open ]-----
#
includes/usercp_viewprofile.php
#
#-----[ Find ]-----
#
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
#
#-----[ After, Add ]-----
#
'RPG_LEVEL' => $profiledata['rpg_level'],
#
#-----[ Open ]-----
#
templates/YOUR_THEME/profile_view_body.tpl
#
#-----[ Find ]-----
# ps. 請自行調整位置\r
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
<td> <b><span class="gen">{INTERESTS}</span></b></td>
</tr>
#
#-----[ After, Add ]-----
#
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">水怪等級: </span></td>
<td><span class="postbody"><b>{RPG_LEVEL}</b></span></td>
</tr>
餘此類推!
ps.
您先試試看!
如果抓不到" $profiledata['rpg_level']"
那麼可能要在 usercp_viewprofile.php 新增 'rpg_level'
發表於 : 2005-09-12 02:10
由 風鈴兒
先謝謝心靈捕手大大^^
試後再向大大報告

發表於 : 2005-09-12 02:59
由 風鈴兒
報告大大~
試驗完畢!成功了!!
我用這段只會顯示出是多小等級,其他資訊就不出來...
代碼: 選擇全部
'RPG_LEVEL' => $profiledata['rpg_level'],
所以我試試把includes/usercp_viewprofile.php部分這樣改就成功了^^
代碼: 選擇全部
#
#-----[ Find ]-----
#
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
#
#-----[ After, Add ]-----
#
'RPG_LEVEL' => $rpgstatus = '<table width="142" cellpadding="0" cellspacing="0" border="0" class="bodyline">' .
'<tr><td width="35%"><span class="gensmall">職 照:</span></td><td><span class="gensmall">' . $profiledata['rpg_medals'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">等 級:</span></td><td><span class="gensmall">' . $profiledata['rpg_level'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">H P:</span></td><td><span class="gensmall">' . $profiledata['rpg_cur_hp'] . ' / ' . $profiledata['rpg_max_hp'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">M P:</span></td><td><span class="gensmall">' . $profiledata['rpg_cur_mp'] . ' / ' . $profiledata['rpg_max_mp'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">經驗值:</span></td><td><span class="gensmall">' . $profiledata['rpg_cur_exp'] . ' / ' . $profiledata['rpg_max_exp'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">攻擊力:</span></td><td><span class="gensmall">' . $profiledata['rpg_attack'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">防禦力:</span></td><td><span class="gensmall">' . $profiledata['rpg_defense'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">?#93; 力:</span></td><td><span class="gensmall">' . $profiledata['rpg_magic'] . '</span></td></tr>' .
'<tr><td><span class="gensmall">速 度:</span></td><td><span class="gensmall">' . $profiledata['rpg_speed'] . '</span></td></tr></table>',