프로필 이미지 코드 수정
This commit is contained in:
+19
-17
@@ -3298,32 +3298,34 @@ function check_write_token($bo_table)
|
||||
}
|
||||
|
||||
function get_member_profile_img($mb_id='', $width='', $height='', $alt='profile_image', $title=''){
|
||||
global $is_member, $member;
|
||||
global $member;
|
||||
|
||||
if( ! $is_member ) return '';
|
||||
|
||||
if( !$mb_id ) $mb_id = $member['mb_id'];
|
||||
|
||||
static $cache = array();
|
||||
static $no_profile_cache = '';
|
||||
static $member_cache = array();
|
||||
|
||||
$src = '';
|
||||
if( isset($cache[$mb_id]) ){
|
||||
$src = $cache[$mb_id];
|
||||
} else {
|
||||
// 프로필 이미지가 없을때 기본 이미지
|
||||
$no_profile_img = (defined('G5_THEME_NO_PROFILE_IMG') && G5_THEME_NO_PROFILE_IMG) ? G5_THEME_NO_PROFILE_IMG : G5_NO_PROFILE_IMG;
|
||||
$tmp = array();
|
||||
preg_match( '/src="([^"]*)"/i', $foo, $tmp );
|
||||
$src = isset($tmp[1]) ? $tmp[1] : G5_IMG_URL.'/no_profile.gif';
|
||||
|
||||
if( $mb_id ){
|
||||
if( $mb_id ){
|
||||
if( isset($member_cache[$mb_id]) ){
|
||||
$src = $member_cache[$mb_id];
|
||||
} else {
|
||||
$member_img = G5_DATA_PATH.'/member_image/'.substr($mb_id,0,2).'/'.$mb_id.'.gif';
|
||||
if (is_file($member_img)) {
|
||||
$src = str_replace(G5_DATA_PATH, G5_DATA_URL, $member_img);
|
||||
$member_cache[$mb_id] = $src = str_replace(G5_DATA_PATH, G5_DATA_URL, $member_img);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cache[$mb_id] = $src;
|
||||
if( !$src ){
|
||||
if( !empty($no_profile_cache) ){
|
||||
$src = $no_profile_cache;
|
||||
} else {
|
||||
// 프로필 이미지가 없을때 기본 이미지
|
||||
$no_profile_img = (defined('G5_THEME_NO_PROFILE_IMG') && G5_THEME_NO_PROFILE_IMG) ? G5_THEME_NO_PROFILE_IMG : G5_NO_PROFILE_IMG;
|
||||
$tmp = array();
|
||||
preg_match( '/src="([^"]*)"/i', $foo, $tmp );
|
||||
$no_profile_cache = $src = isset($tmp[1]) ? $tmp[1] : G5_IMG_URL.'/no_profile.gif';
|
||||
}
|
||||
}
|
||||
|
||||
if( $src ){
|
||||
|
||||
@@ -11,7 +11,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$outlogin_skin_url.'/style.css">'
|
||||
<h2>나의 회원정보</h2>
|
||||
<div id="ol_after_hd">
|
||||
<span class="profile_img">
|
||||
<?php echo get_member_profile_img(); ?>
|
||||
<?php echo get_member_profile_img($member['mb_id']); ?>
|
||||
<a href="<?php echo G5_BBS_URL ?>/member_confirm.php?url=register_form.php" id="ol_after_info" title="정보수정">정보수정</a>
|
||||
</span>
|
||||
<strong><?php echo $nick ?>님</strong>
|
||||
|
||||
@@ -10,7 +10,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<h1 id="win_title"><?php echo $mb_nick ?>님의 프로필</h1>
|
||||
<div class="profile_name">
|
||||
<span class="my_profile_img">
|
||||
<?php echo get_member_profile_img(); ?>
|
||||
<?php echo get_member_profile_img($mb['mb_id']); ?>
|
||||
</span>
|
||||
<?php echo $mb_nick ?>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$outlogin_skin_url.'/style.css">'
|
||||
<header id="ol_after_hd">
|
||||
<h2>나의 회원정보</h2>
|
||||
<span class="profile_img">
|
||||
<?php echo get_member_profile_img(); ?>
|
||||
<?php echo get_member_profile_img($member['mb_id']); ?>
|
||||
<a href="<?php echo G5_BBS_URL ?>/member_confirm.php?url=register_form.php" id="ol_after_info" title="정보수정"><i class="fa fa-cog" aria-hidden="true"></i><span class="sound_only">정보수정</span></a>
|
||||
</span>
|
||||
<strong><?php echo $nick ?>님</strong>
|
||||
|
||||
@@ -11,7 +11,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$outlogin_skin_url.'/style.css">'
|
||||
<h2>나의 회원정보</h2>
|
||||
<div id="ol_after_hd">
|
||||
<span class="profile_img">
|
||||
<?php echo get_member_profile_img(); ?>
|
||||
<?php echo get_member_profile_img($member['mb_id']); ?>
|
||||
<a href="<?php echo G5_BBS_URL ?>/member_confirm.php?url=register_form.php" id="ol_after_info" title="정보수정">정보수정</a>
|
||||
</span>
|
||||
<strong><?php echo $nick ?>님</strong>
|
||||
|
||||
@@ -10,7 +10,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<h1 id="win_title"><?php echo $mb_nick ?>님의 프로필</h1>
|
||||
<div class="profile_name">
|
||||
<span class="my_profile_img">
|
||||
<?php echo get_member_profile_img(); ?>
|
||||
<?php echo get_member_profile_img($mb['mb_id']); ?>
|
||||
</span>
|
||||
<?php echo $mb_nick ?>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$outlogin_skin_url.'/style.css">'
|
||||
<header id="ol_after_hd">
|
||||
<h2>나의 회원정보</h2>
|
||||
<span class="profile_img">
|
||||
<?php echo get_member_profile_img(); ?>
|
||||
<?php echo get_member_profile_img($member['mb_id']); ?>
|
||||
<a href="<?php echo G5_BBS_URL ?>/member_confirm.php?url=register_form.php" id="ol_after_info" title="정보수정"><i class="fa fa-cog" aria-hidden="true"></i><span class="sound_only">정보수정</span></a>
|
||||
</span>
|
||||
<strong><?php echo $nick ?>님</strong>
|
||||
|
||||
Reference in New Issue
Block a user