재질문 : 이모티콘 출력문제 정보
재질문 : 이모티콘 출력문제
본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : http://onuri.nanzoa.com/bbs/board.php?bo_table=01_5&wr_id=311&page=0&sca=&sfl=&stx=&spt=0&page=0&cwin=#c_312
게시판 댓글을 달면 이모티콘이 [http://onuri.nanzoa.com/img/emoticon/22.gif] 이렇게 표시됩니다.
왜? 그런가요 ?
오류 주소 : http://onuri.nanzoa.com/bbs/board.php?bo_table=01_5&wr_id=311&page=0&sca=&sfl=&stx=&spt=0&page=0&cwin=#c_312
게시판 댓글을 달면 이모티콘이 [http://onuri.nanzoa.com/img/emoticon/22.gif] 이렇게 표시됩니다.
왜? 그런가요 ?
댓글 전체
TOGETHER 님 감사합니다만 해결이 안되는군요.
view_comment.skin.php 소스 중 일부입니다.
<div style='line-height:20px; padding:7px; word-break:break-all;'>
<?
if (strstr($list[$i][wr_option], "secret")) echo "<span style='color:#ff6600;'>*</span> ";
$str = $list[$i][content];
if (strstr($list[$i][wr_option], "secret"))
$str = "<span class='small' style='color:#ff6600;'>$str</span>";
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
echo $str;
?>
</div>
view_comment.skin.php 소스 중 일부입니다.
<div style='line-height:20px; padding:7px; word-break:break-all;'>
<?
if (strstr($list[$i][wr_option], "secret")) echo "<span style='color:#ff6600;'>*</span> ";
$str = $list[$i][content];
if (strstr($list[$i][wr_option], "secret"))
$str = "<span class='small' style='color:#ff6600;'>$str</span>";
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
echo $str;
?>
</div>
최신버전을 수정하지 않은 상태로 기본 베이직스킨사용으로 작성시 이모티콘이 정상출력됩니다....
아마도 관련부분을 손보신 곳은 없으신지 살펴보시는게 좋을듯 합니다.
도움을 드리지 못해 죄송합니다.
해당 스킨이나 view_comment.php등등등
아마도 관련부분을 손보신 곳은 없으신지 살펴보시는게 좋을듯 합니다.
도움을 드리지 못해 죄송합니다.
해당 스킨이나 view_comment.php등등등
베이직 오리지날 게시판을 선택해도 마찬가지입니다.
1. view_comment.skin.php 소스 중 이모티콘링크부분
<a href="javascript:win_open('<?=$g4['bbs_path']?>/emoticon.php','emoticon','width=470,height=300,scrollbars=yes');" style="font-size:8pt; font-family:dotum;color:#aaaaaa">이모티콘</a>
2. view_comment.skin.php 소스 중 이모티콘 출력부분
<div style='line-height:20px; padding:7px; word-break:break-all;'>
<?
if (strstr($list[$i][wr_option], "secret")) echo "<span style='color:#ff6600;'>*</span> ";
$str = $list[$i][content];
if (strstr($list[$i][wr_option], "secret"))
$str = "<span class='small' style='color:#ff6600;'>$str</span>";
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
echo $str;
?>
</div>
3. bbs/emoticon.php
<?
$g4_path = ".";
include_once("$g4_path/_common.php");
$g4['title'] = "이모티콘 선택";
include_once("$g4[path]/head.sub.php");
?>
<script type='text/javascript'>
function add(img)
{
opener.document.getElementById("wr_content").value += "\n[" + img + "]\n";
self.close();
}
</script>
<style type="text/css">
#e_box{float:left;}
.e_list{margin:10px;}
</style>
<body style="overflow-x:hidden; overflow-y:auto">
<div id="e_box">
<?for($i=1; $i<=105; $i++){?>
<a href="javascript:add('<?=$g4['url']?>/img/emoticon/<?=$i?>.gif');"><img src="<?=$g4['url']?>/img/emoticon/<?=$i?>.gif" border="0" class="e_list"></a>
<?}?>
</div>
<?
include_once("$g4[path]/tail.sub.php");
?>
<a href="javascript:win_open('<?=$g4['bbs_path']?>/emoticon.php','emoticon','width=470,height=300,scrollbars=yes');" style="font-size:8pt; font-family:dotum;color:#aaaaaa">이모티콘</a>
2. view_comment.skin.php 소스 중 이모티콘 출력부분
<div style='line-height:20px; padding:7px; word-break:break-all;'>
<?
if (strstr($list[$i][wr_option], "secret")) echo "<span style='color:#ff6600;'>*</span> ";
$str = $list[$i][content];
if (strstr($list[$i][wr_option], "secret"))
$str = "<span class='small' style='color:#ff6600;'>$str</span>";
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
echo $str;
?>
</div>
3. bbs/emoticon.php
<?
$g4_path = ".";
include_once("$g4_path/_common.php");
$g4['title'] = "이모티콘 선택";
include_once("$g4[path]/head.sub.php");
?>
<script type='text/javascript'>
function add(img)
{
opener.document.getElementById("wr_content").value += "\n[" + img + "]\n";
self.close();
}
</script>
<style type="text/css">
#e_box{float:left;}
.e_list{margin:10px;}
</style>
<body style="overflow-x:hidden; overflow-y:auto">
<div id="e_box">
<?for($i=1; $i<=105; $i++){?>
<a href="javascript:add('<?=$g4['url']?>/img/emoticon/<?=$i?>.gif');"><img src="<?=$g4['url']?>/img/emoticon/<?=$i?>.gif" border="0" class="e_list"></a>
<?}?>
</div>
<?
include_once("$g4[path]/tail.sub.php");
?>
디비에서 해당부분의 저장상태를 한번 체크해 보세요...
디비에
출력도
라면 어딘가에서 문제가.....ㅠ.ㅠ
정상적이라면 디비에
로되고
출력은 이미지가 정상적으로 출력되어야 합니다.
덧붙여 원질문 링크에서 댓글에 글작성시 줄바꿈기능도 되지 않는것으로 보아 뭔가....ㅠ.ㅠ
디비에

출력도

정상적이라면 디비에

출력은 이미지가 정상적으로 출력되어야 합니다.
덧붙여 원질문 링크에서 댓글에 글작성시 줄바꿈기능도 되지 않는것으로 보아 뭔가....ㅠ.ㅠ
디비에도 똑 깉이 저장이 되어 있습니다.
테스트임
출력도
테스트임
테스트임

출력도
테스트임

하나 더 살펴보셔야 할것이 현재 링크된 곳에 댓글 작성시
(작성예) - 줄바꿈부분
우리나라 대한민국
(출력)
우리나라 대한민국
즉, 줄바꿈이 되지 않습니다. 출력부분을 손본곳이 없는지 체크해 보세요....
(작성예) - 줄바꿈부분

우리나라 대한민국
(출력)

즉, 줄바꿈이 되지 않습니다. 출력부분을 손본곳이 없는지 체크해 보세요....
view.skin.php 에 view_comment.skin.php 에서 쓰인 $str 변수가 있길래 ...
수정하였으나 마찬가지입니다.
제목자르기
<?
$strr = iconv("UTF-8","euc-kr//IGNORE", $view[wr_subject]);
$strr = cut_str($strr, 80,'.....');
$strr = iconv("euc-kr","UTF-8//IGNORE", $strr);
?>
<?=$strr?>
수정하였으나 마찬가지입니다.
제목자르기
<?
$strr = iconv("UTF-8","euc-kr//IGNORE", $view[wr_subject]);
$strr = cut_str($strr, 80,'.....');
$strr = iconv("euc-kr","UTF-8//IGNORE", $strr);
?>
<?=$strr?>
bbs/view_comment.php 내용입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
@include_once("$board_skin_path/view_comment.head.skin.php");
// 자동등록방지
include_once ("./norobot.inc.php");
$list = array();
$is_comment_write = false;
if ($member[mb_level] >= $board[bo_comment_level])
$is_comment_write = true;
// 코멘트 출력
//$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
//$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
//튜닝
$select_sql = " wr_id, mb_id, wr_name ";
if ($board[bo_use_sideview]) {
$select_sql .= " ,wr_password, wr_email, wr_homepage ";
}
$select_sql .= " , wr_option, wr_content, wr_trackback, wr_datetime, wr_ip, wr_comment_reply ";
$sql = " select $select_sql from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = $row;
//$list[$i][name] = get_sideview($row[mb_id], cut_str($row[wr_name], 20, ''), $row[wr_email], $row[wr_homepage]);
$tmp_name = get_text(cut_str($row[wr_name], $config[cf_cut_name])); // 설정된 자리수 만큼만 이름 출력
if ($board[bo_use_sideview])
$list[$i][name] = get_sideview($row[mb_id], $tmp_name, $row[wr_email], $row[wr_homepage]);
else
$list[$i][name] = "<span class='".($row[mb_id]?'member':'guest')."'>$tmp_name</span>";
// 공백없이 연속 입력한 문자 자르기 (way 보드 참고. way.co.kr)
//$list[$i][content] = eregi_replace("[^ \n<>]{130}", "\\0\n", $row[wr_content]);
$list[$i][content] = $list[$i][content1]= "비밀글 입니다.";
if (!strstr($row[wr_option], "secret") ||
$is_admin ||
($write[mb_id]==$member[mb_id] && $member[mb_id]) ||
($row[mb_id]==$member[mb_id] && $member[mb_id])) {
$list[$i][content1] = $row[wr_content];
//$list[$i][content] = conv_content($row[wr_content], 0, 'wr_content');
$list[$i][content] = get_text($row[wr_content]);
$list[$i][content] = search_font($stx, $list[$i][content]);
}
$list[$i][trackback] = url_auto_link($row[wr_trackback]);
$list[$i][datetime] = substr($row[wr_datetime],2,14);
// 관리자가 아니라면 중간 IP 주소를 감춘후 보여줍니다.
$list[$i][ip] = $row[wr_ip];
if (!$is_admin)
$list[$i][ip] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $row[wr_ip]);
$list[$i][is_reply] = false;
$list[$i][is_edit] = false;
$list[$i][is_del] = false;
if ($is_comment_write || $is_admin)
{
if ($member[mb_id])
{
if ($row[mb_id] == $member[mb_id] || $is_admin)
{
$list[$i][del_link] = "./delete_comment.php?bo_table=$bo_table&comment_id=$row[wr_id]&cwin=$cwin&page=$page".$qstr;
$list[$i][is_edit] = true;
$list[$i][is_del] = true;
}
}
else
{
if (!$row[mb_id]) {
$list[$i][del_link] = "./password.php?w=x&bo_table=$bo_table&comment_id=$row[wr_id]&cwin=$cwin&page=$page".$qstr;
$list[$i][is_del] = true;
}
}
if (strlen($row[wr_comment_reply]) < 5)
$list[$i][is_reply] = true;
}
// 05.05.22
// 답변있는 코멘트는 수정, 삭제 불가
if ($i > 0 && !$is_admin)
{
if ($row[wr_comment_reply])
{
$tmp_comment_reply = substr($row[wr_comment_reply], 0, strlen($row[wr_comment_reply]) - 1);
if ($tmp_comment_reply == $list[$i-1][wr_comment_reply])
{
$list[$i-1][is_edit] = false;
$list[$i-1][is_del] = false;
}
}
}
}
// 코멘트수 제한 설정값
if ($is_admin)
{
$comment_min = $comment_max = 0;
}
else
{
$comment_min = (int)$board[bo_comment_min];
$comment_max = (int)$board[bo_comment_max];
}
include_once("$board_skin_path/view_comment.skin.php");
// 필터
echo "<script type='text/javascript'> var g4_cf_filter = '$config[cf_filter]'; </script>\n";
echo "<script type='text/javascript' src='$g4[path]/js/filter.js'></script>\n";
if (!$member[mb_id]) // 비회원일 경우에만
echo "<script type='text/javascript' src='$g4[path]/js/md5.js'></script>\n";
@include_once("$board_skin_path/view_comment.tail.skin.php");
?>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
@include_once("$board_skin_path/view_comment.head.skin.php");
// 자동등록방지
include_once ("./norobot.inc.php");
$list = array();
$is_comment_write = false;
if ($member[mb_level] >= $board[bo_comment_level])
$is_comment_write = true;
// 코멘트 출력
//$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
//$sql = " select * from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
//튜닝
$select_sql = " wr_id, mb_id, wr_name ";
if ($board[bo_use_sideview]) {
$select_sql .= " ,wr_password, wr_email, wr_homepage ";
}
$select_sql .= " , wr_option, wr_content, wr_trackback, wr_datetime, wr_ip, wr_comment_reply ";
$sql = " select $select_sql from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = $row;
//$list[$i][name] = get_sideview($row[mb_id], cut_str($row[wr_name], 20, ''), $row[wr_email], $row[wr_homepage]);
$tmp_name = get_text(cut_str($row[wr_name], $config[cf_cut_name])); // 설정된 자리수 만큼만 이름 출력
if ($board[bo_use_sideview])
$list[$i][name] = get_sideview($row[mb_id], $tmp_name, $row[wr_email], $row[wr_homepage]);
else
$list[$i][name] = "<span class='".($row[mb_id]?'member':'guest')."'>$tmp_name</span>";
// 공백없이 연속 입력한 문자 자르기 (way 보드 참고. way.co.kr)
//$list[$i][content] = eregi_replace("[^ \n<>]{130}", "\\0\n", $row[wr_content]);
$list[$i][content] = $list[$i][content1]= "비밀글 입니다.";
if (!strstr($row[wr_option], "secret") ||
$is_admin ||
($write[mb_id]==$member[mb_id] && $member[mb_id]) ||
($row[mb_id]==$member[mb_id] && $member[mb_id])) {
$list[$i][content1] = $row[wr_content];
//$list[$i][content] = conv_content($row[wr_content], 0, 'wr_content');
$list[$i][content] = get_text($row[wr_content]);
$list[$i][content] = search_font($stx, $list[$i][content]);
}
$list[$i][trackback] = url_auto_link($row[wr_trackback]);
$list[$i][datetime] = substr($row[wr_datetime],2,14);
// 관리자가 아니라면 중간 IP 주소를 감춘후 보여줍니다.
$list[$i][ip] = $row[wr_ip];
if (!$is_admin)
$list[$i][ip] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $row[wr_ip]);
$list[$i][is_reply] = false;
$list[$i][is_edit] = false;
$list[$i][is_del] = false;
if ($is_comment_write || $is_admin)
{
if ($member[mb_id])
{
if ($row[mb_id] == $member[mb_id] || $is_admin)
{
$list[$i][del_link] = "./delete_comment.php?bo_table=$bo_table&comment_id=$row[wr_id]&cwin=$cwin&page=$page".$qstr;
$list[$i][is_edit] = true;
$list[$i][is_del] = true;
}
}
else
{
if (!$row[mb_id]) {
$list[$i][del_link] = "./password.php?w=x&bo_table=$bo_table&comment_id=$row[wr_id]&cwin=$cwin&page=$page".$qstr;
$list[$i][is_del] = true;
}
}
if (strlen($row[wr_comment_reply]) < 5)
$list[$i][is_reply] = true;
}
// 05.05.22
// 답변있는 코멘트는 수정, 삭제 불가
if ($i > 0 && !$is_admin)
{
if ($row[wr_comment_reply])
{
$tmp_comment_reply = substr($row[wr_comment_reply], 0, strlen($row[wr_comment_reply]) - 1);
if ($tmp_comment_reply == $list[$i-1][wr_comment_reply])
{
$list[$i-1][is_edit] = false;
$list[$i-1][is_del] = false;
}
}
}
}
// 코멘트수 제한 설정값
if ($is_admin)
{
$comment_min = $comment_max = 0;
}
else
{
$comment_min = (int)$board[bo_comment_min];
$comment_max = (int)$board[bo_comment_max];
}
include_once("$board_skin_path/view_comment.skin.php");
// 필터
echo "<script type='text/javascript'> var g4_cf_filter = '$config[cf_filter]'; </script>\n";
echo "<script type='text/javascript' src='$g4[path]/js/filter.js'></script>\n";
if (!$member[mb_id]) // 비회원일 경우에만
echo "<script type='text/javascript' src='$g4[path]/js/md5.js'></script>\n";
@include_once("$board_skin_path/view_comment.tail.skin.php");
?>
소스 중간부분..// 공백없이 연속 입력한 문자 자르기 (way 보드 참고. way.co.kr)
//$list[$i][content] = eregi_replace("[^ \n<>]{130}", "\\0\n", $row[wr_content]);
$list[$i][content] = $list[$i][content1]= "비밀글 입니다.";
if (!strstr($row[wr_option], "secret") ||
$is_admin ||
($write[mb_id]==$member[mb_id] && $member[mb_id]) ||
($row[mb_id]==$member[mb_id] && $member[mb_id])) {
$list[$i][content1] = $row[wr_content];
//$list[$i][content] = conv_content($row[wr_content], 0, 'wr_content');
$list[$i][content] = get_text($row[wr_content]);
$list[$i][content] = search_font($stx, $list[$i][content]);
}
에서
//$list[$i][content] = conv_content($row[wr_content], 0, 'wr_content');
$list[$i][content] = get_text($row[wr_content]);
를
$list[$i][content] = conv_content($row[wr_content], 0, 'wr_content');
//$list[$i][content] = get_text($row[wr_content]);
로 바꾸어 보세요...ㅠ.ㅠ
그리고 해당 게시판 스킨을 기본 배포되는 베이직으로 바꾸어 보시고요......
//$list[$i][content] = eregi_replace("[^ \n<>]{130}", "\\0\n", $row[wr_content]);
$list[$i][content] = $list[$i][content1]= "비밀글 입니다.";
if (!strstr($row[wr_option], "secret") ||
$is_admin ||
($write[mb_id]==$member[mb_id] && $member[mb_id]) ||
($row[mb_id]==$member[mb_id] && $member[mb_id])) {
$list[$i][content1] = $row[wr_content];
//$list[$i][content] = conv_content($row[wr_content], 0, 'wr_content');
$list[$i][content] = get_text($row[wr_content]);
$list[$i][content] = search_font($stx, $list[$i][content]);
}
에서
//$list[$i][content] = conv_content($row[wr_content], 0, 'wr_content');
$list[$i][content] = get_text($row[wr_content]);
를
$list[$i][content] = conv_content($row[wr_content], 0, 'wr_content');
//$list[$i][content] = get_text($row[wr_content]);
로 바꾸어 보세요...ㅠ.ㅠ
그리고 해당 게시판 스킨을 기본 배포되는 베이직으로 바꾸어 보시고요......
감사합니다. 한방에 해결되었음을 보고합니다. ㅠㅠㅠ
수고하셨습니다....^^