글내용에 이미지 태그 적용 시 그냥 소스 자체로 보여져 문의 드립니다.

글내용에 이미지 태그 적용 시 그냥 소스 자체로 보여져 문의 드립니다.

QA

글내용에 이미지 태그 적용 시 그냥 소스 자체로 보여져 문의 드립니다.

본문

2014-01-09 23;12;59.jpg

스킨 공유된 것 중에 'ai_memo'이라는 한줄메모 형식의 게시판을 사용하려고 합니다.
(죄송하게도 스킨 제작자님 닉네임이 생각나지 않아 적지 못했습니다 ㅠㅠ)
 
위 이미지처럼 img 이미지 태그를 글내용에 입력시에 이미지로 나타나게 하고 싶은데,
내용에는 그냥 소스 그대로만 보여지네요 ㅠㅠ...
 
해당 스킨의 list.skin.php 소스는 다음과 같습니다.
(이 스킨은 delete.skin.php, write_update.skin.php, list.skin.php 파일밖에는 없어요)
대체 어떤 부분을 수정해야 할지 모르겠습니다. 도와주세요 ㅠㅠ
 
 
=========== list.skin.php 소스내용 =============
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 이모티콘
function emoticon_html($str, $board_skin_path)
{
 $emo_id = "$str";
 $img_src = "<img src='$board_skin_path/emoticons/$str.gif' width='18' height='18' border='0'>";
 $str = eregi_replace($emo_id, $img_src, $str);
 return $str;
}
?>
<style>
.bbs_form  { margin:0; }
.bbs_linei { background-color:#DFDFDF; height:1px; }
.bbs_lineo { background-color:#000000; height:1px; }
.bbs_no    { background-color:#F7F7F7; height:30px; }
.bbs_fs    { color:#888888; font-size:11px; }
.bbs_ft    { border-color:#DADADE; border-style:solid; border-width:1px; }
.bbs_tt    { CURSOR:pointer; }
a.bbs:link, a.bbs:visited, a.bbs:active { text-decoration:none;}
a.bbs:hover { text-decoration:none;  color:#3366cc; }
</style>
<script language="JavaScript">
function emo_change(no) {
 if ( document.getElementById('emoticon_' + no).style.visibility == "hidden" ) {
     document.getElementById('emoticon_' + no).style.visibility = "visible" ;
    } else {
  document.getElementById('emoticon_' + no).style.visibility = "hidden" ;
 }
}
function show(no) {
 document.getElementById('emoticon_' + no).style.visibility = "visible" ;
}
function hide(no) {
 document.getElementById('emoticon_' + no).style.visibility = "hidden" ;
}
function insertSmiley(emo, no, ff){
 var skin_path = "<?=$board_skin_path?>";
 if(ff) {
  ff.mainimage.src = skin_path + "/emoticons/" + emo + ".gif";
  ff.wr_subject.value = emo;
  document.getElementById('emoticon_' + no).style.visibility = "hidden" ;
 }
}
// 글자수 제한
var char_min = parseInt(<?=$write_min?>); // 최소
var char_max = parseInt(<?=$write_max?>); // 최대
</script>
<?
if ($w == "") {
 $is_name = false;
 $is_password = false;
 if (!$member[mb_id] || ($is_admin && $w == 'u' && $member[mb_id] != $write[mb_id])) {
  $is_name = true;
     $is_password = true;
 }
 $password_required = "required";
 $content = $board[bo_insert_content];
 // 글자수 제한 설정값
 if ($is_admin)
 {
  $write_min = $write_max = 0;
 }
 else
 {
     $write_min = (int)$board[bo_write_min];
     $write_max = (int)$board[bo_write_max];
 }
 include_once("./norobot.inc.php");
}
if (!$subject) $subject = 1;
?>
<form name="ffwrite" method="post" action="javascript:fwrite_check(document.ffwrite);" enctype="multipart/form-data" autocomplete="off">
<input type=hidden name=w          value="">
<input type=hidden name=bo_table   value="<?=$bo_table?>">
<input type=hidden name=wr_id      value="">
<input type=hidden name=page       value="<?=$page?>">
<input type=hidden name=wr_subject value="<?=$subject?>">
<? if ($is_password) { ?><input type="hidden" name="wr_password"  value="<?=$norobot_str?>"><? } ?>
<? if ($is_norobot) { ?><input type="hidden" name="wr_key"  value="<?=$norobot_key?>"><? } ?>
<table width="<?=$width?>" align="center" cellpadding="5" cellspacing="0" bgcolor="#ffffe2"><tr><td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td width="60" class="bbs_tt" onClick="emo_change(0);" background="<?=$board_skin_path?>/img/emo_bg.gif" style="padding-top:3px;">
    <img name="mainimage" border="0" src="<?=$board_skin_path?>/emoticons/<?=$subject?>.gif"><br>
 <div id="emoticon_0" onClick="emo_change(0);" onmouseover="show(0);" onMouseOut="hide(0);" style="position:absolute; z-index:0; visibility:hidden; padding-top:3px; width:220; height:80;">
 <table border=0 width=100% cellpadding=2 cellspacing=0 style="background-color:white;border:1px solid #cdcdcd;">
 <?
 for($k=1; $k<=44; $k++){
  $list_emo = ($k-1) % 11;
  if(!$list_emo) echo "\n<tr>";
  echo "<td width=20><a onclick=insertSmiley('$k','0',document.ffwrite)><img src='$board_skin_path/emoticons/$k.gif' width=18 height=18 border=0></a></td>";
 }
 if(!$list_emo) echo "\n<td> </td></tr>";
 ?>
 </table>
 </div>
 </td>
 <td width="10"></td>
 <td>
  <input class="bbs_ft" name="wr_content" itemname="내용" required style="width:100%;height:23; padding:4;" value="내용을 입력해 주세요..." onFocus="clearText(this)">
 </td>
 <td width="10"></td>
 <? if ($is_name) { ?>
 <td width="80">
  <input class="bbs_ft" maxLength="20" size="13" name="wr_name" itemname="이름" required style="height:23; padding:4;" value="손님" onFocus="clearText(this)">
 </td>
 <td width="10"></td>
 <? } ?>
 <td width="30">
  <input type="image" id="btn_submit" src="<?=$board_skin_path?>/img/btn_write.gif" border="0" align="absmiddle">
 </td>
</tr>
</table>
</td></tr></table>
</form>
<br>
<table width="<?=$width?>" align="center" cellpadding="0" cellspacing="0"><tr><td>
<!-- 게시판 리스트 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan="6" class="bbs_lineo"></td></tr>
<? for ($i=0; $i<count($list); $i++) {
$list_id = $list[$i][wr_id];
?>
<a name="c_<?=$list_id?>"></a>
<tr>
 <td width="40" height="30" align="center">
  <? $emolist[$i][subject] = emoticon_html($list[$i][subject], $board_skin_path);?>
  <?=$emolist[$i][subject]?>
 </td>
 <td style="padding : 5px;">
  <?       
  echo $list[$i][reply];
  echo $list[$i][icon_reply];
  ?>
  <? $list[$i][wr_content] = conv_content($list[$i][wr_content], 0);?>
  <a href="javascript:list_box('<?=$list_id?>', 'r');" title="답변" class="bbs"><?=$list[$i][wr_content]?></a>
  <? if (($member[mb_id] && ($member[mb_id] == $list[$i][mb_id])) || $is_admin) { ?>
  <a href="javascript:list_box('<?=$list_id?>', 'u');"><img src="<?=$board_skin_path?>/img/btn_edit.gif" title="수정" border="0" align="absmiddle"></a>
  <a href="javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>';}"><img src="<?=$board_skin_path?>/img/btn_del.gif" title="삭제" border="0" align="absmiddle"></a>  
  <? } ?>
  <?=$list[$i][icon_new];?>
 </td>
 <td width="80"><?=$list[$i][name]?></td>
 <td width="60" align="center"><span class="bbs_fs"><?=$list[$i][datetime2]?></span></td>
</tr>
<tr>
 <td colspan="6" style="word-break:break-all;" class="bbs_pp">
  <img id='save_emoticon_<?=$list_id?>' style='display:none;' border="0" src="<?=$board_skin_path?>/emoticons/<?=$list[$i][subject]?>.gif">
  <input id='save_content_<?=$list_id?>' class="bbs_ft" type=text style='display:none;width:100%;height:23; padding:4;' value="<?=$list[$i][wr_content]?>">
  <span id='reply_<?=$list_id?>' style='display:none; width:100%; padding:5;'></span><!-- 답변 -->
  <span id='edit_<?=$list_id?>' style='display:none; width:100%; padding:5;'></span><!-- 수정 -->
 </td>
</tr>
<tr><td colspan="6" class="bbs_linei"></td></tr>
<? } ?>
<? if (count($list) == 0) { ?>
<tr><td height="100" align="center">게시물이 없습니다.</td></tr>
<tr><td class="bbs_linei"></td></tr>
<? } ?>
</table>

<!-- 페이지 표시 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<? if ($write_pages || $prev_part_href || $next_part_href ) { ?>
<tr>
    <td height="25" align="center" class="bbs_no">
  <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' width=50 height=20 border=0 align=absmiddle title='이전검색'></a>"; } ?>
  <?
  // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
  //echo $write_pages;
  $write_pages = str_replace("처음", "<img src='$board_skin_path/img/page_first.gif' border='0' align='absmiddle' title='처음' width='38' height='15'>", $write_pages);
  $write_pages = str_replace("이전", "<img src='$board_skin_path/img/page_prev.gif' border='0' align='absmiddle' title='이전' width='17' height='15'>", $write_pages);
  $write_pages = str_replace("다음", "<img src='$board_skin_path/img/page_next.gif' border='0' align='absmiddle' title='다음' width='17' height='15'>", $write_pages);
  $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/page_end.gif' border='0' align='absmiddle' title='맨끝' width='38' height='15'>", $write_pages);
  $write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font>", $write_pages);
  $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font>", $write_pages);
  ?>
  <?=$write_pages?>
  <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' width=50 height=20 border=0 align=absmiddle title='다음검색'></a>"; } ?>
 </td>
</tr>
<? } ?>
<tr><td class="bbs_lineo"></td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
 <td width="" height="40">
  <? if ($admin_href) { ?><a href='<?=$admin_href?>'><img src="<?=$board_skin_path?>/img/btn_admin.gif" border="0" width="55" height="20" align="absmiddle" title="관리자"></a><? } ?>
 </td>
</tr>
</table>
</td></tr></table>
<span id=list_write style='display:none; width:100%; padding:10;'>
<form name="fwrite" method="post" action="javascript:fwrite_check(document.fwrite);" enctype="multipart/form-data" autocomplete="off">
<input type=hidden name=w          value="" id="list_w">
<input type=hidden name=bo_table   value="<?=$bo_table?>">
<input type=hidden name=wr_id      value="<?=$list[$i][wr_id]?>" id="list_id">
<input type=hidden name=page       value="<?=$page?>">
<input type=hidden name=wr_subject value="<?=$subject?>">
<? if ($is_password) { ?><input type="hidden" name="wr_password"  value="<?=$norobot_str?>"><? } ?>
<? if ($is_norobot) { ?><input type="hidden" name="wr_key"  value="<?=$norobot_key?>"><? } ?>

<table width="<?=$width?>" align="center" cellpadding="5" cellspacing="0" bgcolor="#e2ecff"><tr><td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td width="60" class="bbs_tt" onClick="emo_change(1);" background="<?=$board_skin_path?>/img/emo_bg.gif" style="padding-top:3px;">
    <img id="list_image" name="mainimage" border="0" src="<?=$board_skin_path?>/emoticons/<?=$subject?>.gif"><br>
 <div id="emoticon_1" onClick="emo_change(1);" onmouseover="show(1);" onMouseOut="hide(1);" style="position:absolute; z-index:0; visibility:hidden; padding-top:3px; width:220; height:80;">
 <table border=0 width=100% cellpadding=2 cellspacing=0 style="background-color:white;border:1px solid #cdcdcd;">
 <?
 for($k=1; $k<=44; $k++){
  $list_emo = ($k-1) % 11;
  if(!$list_emo) echo "\n<tr>";
  echo "<td width=20><a onclick=insertSmiley('$k','1',document.fwrite)><img src='$board_skin_path/emoticons/$k.gif' width=18 height=18 border=0></a></td>";
 }
 if(!$list_emo) echo "\n<td> </td></tr>";
 ?>
 </table>
 </div>
 </td>
 <td width="10"></td>
 <td>
  <input class="bbs_ft" id="list_content" name="wr_content" itemname="내용" required style="width:100%;height:23; padding:4;" value="내용을 입력해 주세요..." onFocus="clearText(this)">
 </td>
 <td width="10"></td>
 <? if ($is_name) { ?>
 <td width="80">
  <input class="bbs_ft" maxLength="20" size="13" name="wr_name" itemname="이름" required style="height:23; padding:4;" value="손님" onFocus="clearText(this)">
 </td>
 <td width="10"></td>
 <? } ?>
 <td width="30">
  <input type="image" id="btn_submit" src="<?=$board_skin_path?>/img/btn_write.gif" border="0" align="absmiddle">
 </td>
</tr>
</table>
</td></tr></table>
</form>
</span>
<script language="Javascript">
function clearText(thefield){
 if (thefield.defaultValue==thefield.value) thefield.value = "";
}
function fwrite_check(f)
{
    var s = "";
 if (f.wr_content.value == "내용을 입력해 주세요..."){
  alert("내용을 입력해 주세요...")
  return;
 }
 if (s = word_filter_check(f.wr_content.value)) {
        alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
        return;
 }
    f.action = "./write_update.php";
    f.submit();
}
var old_id, new_id;
var save_html = document.getElementById('list_write').innerHTML;
function list_box(list_id, work)
{
 // 답변, 수정
    if (list_id)
    {
        if (work == 'r')
            new_id = 'reply_' + list_id;
        else
            new_id = 'edit_' + list_id;
    }
    else
        new_id = 'list_write';
 if (old_id == new_id) {
  var mode = document.getElementById(new_id).style.display;
  if (mode == 'inline')
   document.getElementById(new_id).style.display = 'none';
  else
   document.getElementById(new_id).style.display = 'inline';
 }
 else
    {
        if (old_id)
        {
            document.getElementById(old_id).style.display = 'none';
            document.getElementById(old_id).innerHTML = '';
        }
        document.getElementById(new_id).style.display = 'inline';
  document.getElementById(new_id).innerHTML = save_html;
  // 수정
        if (work == 'u')
        {
   document.getElementById('list_image').src = document.getElementById('save_emoticon_' + list_id).src;
   document.getElementById('list_content').value = document.getElementById('save_content_' + list_id).value;
        }
        document.getElementById('list_id').value = list_id;
        document.getElementById('list_w').value = work;
  old_id = new_id;
 }
}
list_box('', '');
new_id = 'list_write';
document.getElementById(new_id).style.display = 'none';
</script>
<?
if ($w == "") {
if (!$member[mb_id])
    echo "<script language='javascript' src='$g4[path]/js/md5.js'></script>\n";
// 필터
echo "<script language='javascript'> var g4_cf_filter = '$config[cf_filter],&nbsp'; </script>\n";
echo "<script language='javascript' src='$g4[path]/js/filter.js'></script>\n";
}
?>
====================================

이 질문에 댓글 쓰기 :

답변 4

<? $list[$i][wr_content] = conv_content($list[$i][wr_content], 0);?>
삭제해보심이

감사합니다 ㅠㅠ 이 소스 줄 삭제 후 덮어쓰니 거짓말처럼 이미지로 나오네요 ㅠ_ㅠ
근데 자동으로 이미지에 보더 테두리가 파란색으로 나와 보기가 싫던데 이걸 안나오게 하는 방법은 없을까요?

$list[$i][wr_content] = conv_content($list[$i][wr_content], 0); <--수정
$list[$i][wr_content] = nl2br($list[$i][wr_content]);

답변을 작성하시기 전에 로그인 해주세요.
전체 427
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT