회원 사진이 첨부되지 않는다면 다른 이미지로 대체 방법 질문 입니다. 정보
회원 사진이 첨부되지 않는다면 다른 이미지로 대체 방법 질문 입니다.본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 :
<?
$tmp_name = "";
if($view[mb_id] && !$board[bo_use_sideview]) {
if ($config[cf_use_member_icon]) {
$mb_dir = substr($view[mb_id],0,2);
$icon_file = "$g4[path]/data/member/$mb_dir/{$view[mb_id]}.gif";
if (file_exists($icon_file)) {
$icon_width = 40;
$icon_height = 40;
$tmp_name = "<img src='$icon_file' width='$icon_width' height='$icon_height' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}
}
}
?><?=$tmp_name?>
현재 이런 방식으로서, 회원아이콘을 불러오고 있습니다.
근데 회원 사진이 없는 경우 그냥 빈 공간으로 남아 있어서...
이곳에 제가 추가한 이미지를 넣어주고 싶습니다.
noimage.gif 같은걸로요. 근데 워낙 기초 지식이 없어서...
어디줄에 어떻게 넣어야할지 모르겠습니다.
ㅠ 도움을 부탁드리겠습니다.
오류 주소 :
<?
$tmp_name = "";
if($view[mb_id] && !$board[bo_use_sideview]) {
if ($config[cf_use_member_icon]) {
$mb_dir = substr($view[mb_id],0,2);
$icon_file = "$g4[path]/data/member/$mb_dir/{$view[mb_id]}.gif";
if (file_exists($icon_file)) {
$icon_width = 40;
$icon_height = 40;
$tmp_name = "<img src='$icon_file' width='$icon_width' height='$icon_height' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}
}
}
?><?=$tmp_name?>
현재 이런 방식으로서, 회원아이콘을 불러오고 있습니다.
근데 회원 사진이 없는 경우 그냥 빈 공간으로 남아 있어서...
이곳에 제가 추가한 이미지를 넣어주고 싶습니다.
noimage.gif 같은걸로요. 근데 워낙 기초 지식이 없어서...
어디줄에 어떻게 넣어야할지 모르겠습니다.
ㅠ 도움을 부탁드리겠습니다.
댓글 전체
<?
$tmp_name = "";
if($view[mb_id] && !$board[bo_use_sideview]) {
if ($config[cf_use_member_icon]) {
$mb_dir = substr($view[mb_id],0,2);
$icon_file = "$g4[path]/data/member/$mb_dir/{$view[mb_id]}.gif";
if (file_exists($icon_file)) {
$icon_width = 40;
$icon_height = 40;
$tmp_name = "<img src='$icon_file' width='$icon_width' height='$icon_height' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}else{
$tmp_name = "<img src='noimage경로' width='100' height='100' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}
}
}
?>
이렇게 넣어주세요
$tmp_name = "";
if($view[mb_id] && !$board[bo_use_sideview]) {
if ($config[cf_use_member_icon]) {
$mb_dir = substr($view[mb_id],0,2);
$icon_file = "$g4[path]/data/member/$mb_dir/{$view[mb_id]}.gif";
if (file_exists($icon_file)) {
$icon_width = 40;
$icon_height = 40;
$tmp_name = "<img src='$icon_file' width='$icon_width' height='$icon_height' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}else{
$tmp_name = "<img src='noimage경로' width='100' height='100' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}
}
}
?>
이렇게 넣어주세요
<?
$tmp_name = "";
if($list[$i][mb_id] && !$board[bo_use_sideview]) {
if ($config[cf_use_member_icon]) {
$mb_dir = substr($list[$i][mb_id],0,2);
$icon_file = "$g4[path]/data/member/$mb_dir/{$list[$i][mb_id]}.gif";
if (file_exists($icon_file)) {
$icon_width = 60;
$icon_height = 80;
$tmp_name = "<img src='$icon_file' width='$icon_width' height='$icon_height' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}else{
$tmp_name = "<img src='{$board_skin_path}/img/noimage.png' width='60' height='80' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}
}//cf_use_member_icon
}//bo_use_sideview
?>
이렇게 되었지만...기존의 회원아이콘은 나오고
noimage 부분은 출력이 되지 않습니다.
$tmp_name = "";
if($list[$i][mb_id] && !$board[bo_use_sideview]) {
if ($config[cf_use_member_icon]) {
$mb_dir = substr($list[$i][mb_id],0,2);
$icon_file = "$g4[path]/data/member/$mb_dir/{$list[$i][mb_id]}.gif";
if (file_exists($icon_file)) {
$icon_width = 60;
$icon_height = 80;
$tmp_name = "<img src='$icon_file' width='$icon_width' height='$icon_height' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}else{
$tmp_name = "<img src='{$board_skin_path}/img/noimage.png' width='60' height='80' align='absmiddle' border='0' style='border:1px solid #ddd;'>";
}
}//cf_use_member_icon
}//bo_use_sideview
?>
이렇게 되었지만...기존의 회원아이콘은 나오고
noimage 부분은 출력이 되지 않습니다.
우와~ 귀한 정보 공유해주셔서 감사합니다~
넓은 마인드님이 최고이시죠...진짜 많이 배운것 같아요