心靈大大....我參照你說的改了!!
可是...在個人資料區塊中還是無法顯示虛擬形象??
另外...請教一下,我修改該區塊後端程式-system_users.php之後,我卻找不到該插
入<script language="JavaScript" src="face_js.js"></script>的頁面,到底該\r
插入在哪個頁面的開始位置呢??
會有這個問題就是因為我看face外掛的安裝說明中,幾乎每個php檔的修改都會對
應修改一支tpl的檔案,但是BCP的區塊用的php程式的對應tpl檔我卻找不到,我看您\r
的首頁好像也有裝BCP雖然不知道是不是我用的那個bcp但是看起來差不多,您的
頁面好像就可以顯示虛擬形象的樣子,我附上我修改後的system_users.php給您\r
參考好了!!
代碼: 選擇全部
<?
/***************************************************************************
* system_user.php
* -------------------
* begin : Friday, Jan 3, 2003
* copyright : (C) CRLin
* url : http://web.dhjh.tcc.edu.tw/~gzqbyr/Hestia/
*
****************************************************************************/
/***************************************************************************
* WARNING: This script free for non-commercial uses.
****************************************************************************/
/***************************************************************************
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting
* source code which is considered copyrighted (c) material of the
* original comment or credit authors.
****************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
if( $userdata['session_logged_in'] )
{
//
// Avatar On Index MOD
//
$avatar_bcp_img = '';
if ( $userdata['user_avatar_type'] && $userdata['user_allowavatar'] )
{
switch( $userdata['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$avatar_bcp_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_REMOTE:
$avatar_bcp_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_GALLERY:
$avatar_bcp_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_FACE:
$profiledata2 = get_userdata($userdata['user_id']);
//###### begin 虛擬形象 #####
if ($profiledata2[user_gender]<=0)
{
$poster_avatar="";
//虛擬形象\r
$userface = "";
//虛擬形象\r
}
else if ($profiledata2[user_gender]==1)
{
$tempequip = '0-0-0-0-0-0-0-0-init-init-0-init-0-init-init-0-0-0-init-0-0-0-0-0-0-0'; //男性的初始值
$sex = "m";
$upid = "init";
}
else if ($profiledata2[user_gender]==2)
{
$tempequip = '0-0-0-0-0-0-0-0-initf-initf-0-initf-0-initf-initf-0-0-0-initf-0-0-0-0-0-0-0'; //女性的初始值
$sex = "f";
$upid = "initf";
}
$userwearip = '400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400';//商品的過期屬性\r
$cookiearray = split('-', $tempequip);
$weararray = split('-', $userwearip);
$sql="SELECT * FROM week9_userdata where userid = ".$profiledata2['user_id']." and dafaultuse = '1' and (face_fitherd = '$sex' or face_fitherd = 't')";
if( !($facecookie = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query week9_userdata', '', __LINE__, __FILE__, $sql);
}
while ($usercaifu = $db->sql_fetchrow($facecookie))
{
$tempi = $usercaifu[classid];
$cookiearray[$tempi] = $usercaifu[facepicid];
$face_weardate = floor($usercaifu[face_wear] - (time() - $usercaifu[buydata])/8640);
if ($face_weardate <= 0)
{
$db->sql_query("UPDATE week9_userdata SET dafaultuse = '3' WHERE userid=".$profiledata2['user_id']." and facepicid = '$usercaifu[facepicid]' and classid= '$usercaifu[classid]' and dafaultuse='1'");
if($usercaifu[classid] == 8||$usercaifu[classid]==9||$usercaifu[classid]==11||$usercaifu[classid]==13||$usercaifu[classid]==14||$usercaifu[classid]==18)
{
$userupid = $upid;
}
else
{
$userupid = "0";
}
$weararray[$tempi] = $userupid;
}
else
{
$weararray[$tempi] = $face_weardate;
}
}
$db->sql_freeresult($facecookie);
$userface = implode("-", $cookiearray);
$userwear = implode("-", $weararray);
$avatar_img = "
<!-- 虛擬形象?#125;始-->
<DIV id=Show
style=\"PADDING-RIGHT: 0px; PADDING-LEFT: 0px; LEFT: 0px; PADDING-BOTTOM: 0px; WIDTH: 140px; PADDING-TOP: 0px; POSITION: relative; TOP: 0px; HEIGHT: 226px\"></DIV>
<SCRIPT language=JavaScript>
var currface = \"$userface\";
var currwear = \"$userwear\";
start_face(0);
</SCRIPT>
<!-- 虛擬形象結束-->
";
//###### end 虛擬形象 #####
break;
}
}
//
// END: Avatar On Index MOD
//
$bcp_content = "<div align=\"center\"><br />" . $avatar_bcp_img ."<br><br>";
$bcp_content .= '<center><span style="filter: glow(color=blue,strength=3); height:13px; color:lightgreen; padding:3px; font-size : 13px"><b>' . $userdata['username'] .'</b></span><br>';
$profiledata1 = get_userdata($userdata['user_id']);
$sql = "SELECT *
FROM " . RANKS_TABLE . "
ORDER BY rank_special, rank_min";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
}
$ranksrow1 = array();
while ( $row = $db->sql_fetchrow($result) )
{
$ranksrow1[] = $row;
}
$db->sql_freeresult($result);
\r
$poster_rank1 = '';
$rank_image1 = '';
if ( $profiledata1['user_rank'] )
{
for($i = 0; $i < count($ranksrow1); $i++)
{
if ( $profiledata1['user_rank'] == $ranksrow1[$i]['rank_id'] && $ranksrow1[$i]['rank_special'] )
{
$poster_rank1 = $ranksrow1[$i]['rank_title'];
$rank_image1 = ( $ranksrow1[$i]['rank_image'] ) ? '<img src="' . $ranksrow1[$i]['rank_image'] . '" alt="' . $poster_rank1 . '" title="' . $poster_rank1 . '" border="0" /><br />' : '';
}
}
}
else
{
for($i = 0; $i < count($ranksrow1); $i++)
{
if ( $profiledata1['user_posts'] >= $ranksrow1[$i]['rank_min'] && !$ranksrow1[$i]['rank_special'] )
{
$poster_rank1 = $ranksrow1[$i]['rank_title'];
$rank_image1 = ( $ranksrow1[$i]['rank_image'] ) ? '<img src="' . $ranksrow1[$i]['rank_image'] . '" alt="' . $poster_rank1 . '" title="' . $poster_rank1 . '" border="0" /><br />' : '';
}
}
}
$bcp_content .= $poster_rank1 . '<br>' . $rank_image1 . '<br>';
$bcp_content .= $lang['Total_posts'] . ': ' . $profiledata1['user_posts'] . '<br>';
if (function_exists('get_html_translation_table'))
{
$u_search_author1 = urlencode(strtr($profiledata1['username'], array_flip(get_html_translation_table(HTML_ENTITIES))));
}
else
{
$u_search_author1 = urlencode(str_replace(array('&', '', '"', '<', '>'), array('&', "'", '"', '<', '>'), $profiledata1['username']));
}
$regdate = create_date($lang['DATE_FORMAT'], $profiledata1['user_regdate'], $board_config['board_timezone']);
$bcp_content .= $lang['Joined'] . ': ' . $regdate . '<br>';
$bcp_content .= '<a href="'.$u_login_logout.'" '.$BCP_CLASS.'>' . $lang['Logout'] . '</a><br>';
$bcp_content .= '<a href="' . append_sid("profile.$phpEx?mode=editprofile&" . $userdata['user_id']) . '" '.$BCP_CLASS.'>' . $lang['Profile'] . '</a>';
$bcp_content .= '<br><a href="' . append_sid('privmsg.'.$phpEx.'?folder=inbox') . '" '.$BCP_CLASS.'>' . $l_privmsgs_text . '</a>';
$bcp_content .= '</div><br>';
$bcp_content .= '<span ' . $BCP_CLASS . ' align="left">' . sprintf($lang['You_last_visit'], $s_last_visit) . '</span><br>';
$bcp_content .= '<br><b><span style="filter: height:13px; color:blue; padding:3px; font-size : 13px">' . $bcp_lang['Points'] . ': ' .$profiledata1['user_points'] . '</span></b>';
$bcp_content .= '<br><b><span style="filter: height:13px; color:red; padding:3px; font-size : 13px">' . $bcp_lang['Money'] . ': ' .$profiledata1['user_money'] . '</span></b>';
}
?>
看看是不是我哪裡有改錯??
另外再請教一個問題,為何我啟用我的虛擬形象後,點選會員列表,在點選其他會員\r
去檢視他的資料,顯示出來的頁面中的頭像卻是我的虛擬形象??如果關閉虛擬形
象,那個位置又會顯示出正確的被檢視會員的設定頭像;但是這樣的狀況下,該頁面\r
中其他欄位的資料又都正確的顯示出被檢視者的資料,是我哪裡改錯嗎?