여분필드로 추가한 게시판내용이 수정시 계속 사라지네요. 정보
여분필드로 추가한 게시판내용이 수정시 계속 사라지네요.본문
여분필드를 추가한후 여분필드를 이용해서 게시판내용부분을 하나더 만들고 있습니다.
기존 게시판(wr_content?)과 여분필드로 추가한 다른 입력사항에는 별다른 문제가 없는데..
유독 게시판부분( wr_content ) 소스를 복사하여 하나더 만든 부분은 내용을 입력하면 view.skin.php에 보여지긴 하는데 자동줄바꿈이 안되고, 수정하기를 누르면 이전내용이 모두 없어져 버리네요.
도움좀 부탁드립니다..
아래는 관련된 내용들입니다.
write.skin.php의 상단 php부분입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if ($is_dhtml_editor) {
include_once("$g4[path]/lib/cheditor4.lib.php");
echo "<script src='$g4[cheditor4_path]/cheditor.js'></script>";
echo cheditor1('wr_content', '100%', '250');
}
?>
----------------------------------------------------------------------------------------
write.skin.php에서 여분필드(wr_51)로 textarea 의 내용을 입력하는 부분입니다.
<tr>
<td class='write_head2'>수술방법및 수술내용</td>
<td colspan='3' class='write_td2'>
<? if ($is_dhtml_editor) { ?>
<?=cheditor2('wr_content', $wr_51);?>
<? } else { ?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width=50% align=left valign=bottom>
<span style="cursor: pointer;" onclick="textarea_decrease('wr_content', 10);"><img src="<?=$board_skin_path?>/img/up.gif"></span>
<span style="cursor: pointer;" onclick="textarea_original('wr_content', 10);"><img src="<?=$board_skin_path?>/img/start.gif"></span>
<span style="cursor: pointer;" onclick="textarea_increase('wr_content', 10);"><img src="<?=$board_skin_path?>/img/down.gif"></span></td>
<td width=50% align=right><? if ($write_min || $write_max) { ?><span id=char_count></span>글자<?}?></td>
</tr>
</table>
<textarea id="wr_51" class='wbox' name="wr_51" value="<?=$write['wr_51']?>" style='width:100%; margin-bottom:5px; word-break:break-all;' rows=10 itemname="내용"
<? if ($write_min || $write_max) { ?>onkeyup="check_byte('wr_51', 'char_count');"<?}?>></textarea>
<? if ($write_min || $write_max) { ?><script language="javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
<? } ?>
</td>
</tr>
----------------------------------------------------------------------------------------
아래가 write_update.skin.php 부분이구요.
<?
$sql_p = " wr_51= '$wr_51' ";
if ($w == "" || $w == "u" || $w == "r") {
$sql = " update $write_table set $sql_p where wr_id = '$wr_id' ";
sql_query($sql);
}
else if ($w == "u") {
$sql = " update $write_table set $sql_p where wr_id = '$wr[wr_id]' ";
sql_query($sql);
}
?>
----------------------------------------------------------------------------------------
아래가 view_updatd.skin.php에서 출력하는 부분입니다.
<div style='padding-top:5px; width:100%'>
<!-- 상세정보 타이틀 img -->
<div style='float:left; width:100%; margin:3px 0px 5px 10px;'><img src="<?=$board_skin_path?>/img/tit_write-03.gif" width="51" height="14"></div>
<table id='view_content' align='center' cellpadding='0' cellspacing='0' border='2' style="border-collapse:collapse;" bordercolor="#555">
<tr>
<td height="100" style="word-break:break-all; padding:10px 10px 5px 10px;">
<!-- //----- {gblist.skin.php 에서 지정한 이미지갯수만큼 뷰화면에서 한줄로 출력 } ----// -->
<?
$n = $view[wr_2]; // 한줄당 출력 이미지수
if ($n > (count($view[file])-1)) {
$i_count = (count($view[file])-1); //원본이미지수가 적으면 적은갯수를..
}
else {
$i_count = $n; //원본이미지수가 많으면 설정갯수를..
}
if ($i_count > 0) {
$wid = (int)($board[bo_image_width]/$i_count); //게시판환경설정->'이미지폭크기'를 갖고 나눈다
$board[bo_image_width] = $wid; //자동이미지폭 조정을 위해 다시 넘겨준다..
$wid = (int)(1/$n*100);
}
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0 style='table-layout:fixed'>";
echo "<tr>";
for ($i=0; $i<=count($view[file]); $i++) {
if (($view[file][$i][view]) && $i>0 && ($i%$n == 0)) {
echo "</tr><tr>";
}
if ($view[file][$i][view]) {
echo "<td align='center' valign='top' style='word-break:break-all'>";
echo "<div style='overflow-x:hidden; width:; height:; padding:0px;'>";
echo $view[file][$i][view];
echo "</div>";
echo "<br>". $view[file][$i][content]; // 이미지 설명글 {게시판 환경설정에서 체크}
}
}
// 부족한 <td> 갯수 맞추는 작업
if ((count($view[file])-1) % $n != 0) {
$td_cnt = $n - ((count($view[file])-1)%$n);
for ($t=0; $t<$td_cnt; $t++) {
echo "<td> </td>";
}
}
echo "</tr></table>";
//echo "<br>";
?>
<!-- //------------- 여기까지 -------------------------------------// -->
<!-- 내용 출력 -->
<span id="writeContents"><?=$view[wr_51];?></span>
<?//echo $view[rich_content]; // 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
</table>
</div>
---------------------------------------------------------------------------------------
부탁드립니다~
기존 게시판(wr_content?)과 여분필드로 추가한 다른 입력사항에는 별다른 문제가 없는데..
유독 게시판부분( wr_content ) 소스를 복사하여 하나더 만든 부분은 내용을 입력하면 view.skin.php에 보여지긴 하는데 자동줄바꿈이 안되고, 수정하기를 누르면 이전내용이 모두 없어져 버리네요.
도움좀 부탁드립니다..
아래는 관련된 내용들입니다.
write.skin.php의 상단 php부분입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if ($is_dhtml_editor) {
include_once("$g4[path]/lib/cheditor4.lib.php");
echo "<script src='$g4[cheditor4_path]/cheditor.js'></script>";
echo cheditor1('wr_content', '100%', '250');
}
?>
----------------------------------------------------------------------------------------
write.skin.php에서 여분필드(wr_51)로 textarea 의 내용을 입력하는 부분입니다.
<tr>
<td class='write_head2'>수술방법및 수술내용</td>
<td colspan='3' class='write_td2'>
<? if ($is_dhtml_editor) { ?>
<?=cheditor2('wr_content', $wr_51);?>
<? } else { ?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width=50% align=left valign=bottom>
<span style="cursor: pointer;" onclick="textarea_decrease('wr_content', 10);"><img src="<?=$board_skin_path?>/img/up.gif"></span>
<span style="cursor: pointer;" onclick="textarea_original('wr_content', 10);"><img src="<?=$board_skin_path?>/img/start.gif"></span>
<span style="cursor: pointer;" onclick="textarea_increase('wr_content', 10);"><img src="<?=$board_skin_path?>/img/down.gif"></span></td>
<td width=50% align=right><? if ($write_min || $write_max) { ?><span id=char_count></span>글자<?}?></td>
</tr>
</table>
<textarea id="wr_51" class='wbox' name="wr_51" value="<?=$write['wr_51']?>" style='width:100%; margin-bottom:5px; word-break:break-all;' rows=10 itemname="내용"
<? if ($write_min || $write_max) { ?>onkeyup="check_byte('wr_51', 'char_count');"<?}?>></textarea>
<? if ($write_min || $write_max) { ?><script language="javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
<? } ?>
</td>
</tr>
----------------------------------------------------------------------------------------
아래가 write_update.skin.php 부분이구요.
<?
$sql_p = " wr_51= '$wr_51' ";
if ($w == "" || $w == "u" || $w == "r") {
$sql = " update $write_table set $sql_p where wr_id = '$wr_id' ";
sql_query($sql);
}
else if ($w == "u") {
$sql = " update $write_table set $sql_p where wr_id = '$wr[wr_id]' ";
sql_query($sql);
}
?>
----------------------------------------------------------------------------------------
아래가 view_updatd.skin.php에서 출력하는 부분입니다.
<div style='padding-top:5px; width:100%'>
<!-- 상세정보 타이틀 img -->
<div style='float:left; width:100%; margin:3px 0px 5px 10px;'><img src="<?=$board_skin_path?>/img/tit_write-03.gif" width="51" height="14"></div>
<table id='view_content' align='center' cellpadding='0' cellspacing='0' border='2' style="border-collapse:collapse;" bordercolor="#555">
<tr>
<td height="100" style="word-break:break-all; padding:10px 10px 5px 10px;">
<!-- //----- {gblist.skin.php 에서 지정한 이미지갯수만큼 뷰화면에서 한줄로 출력 } ----// -->
<?
$n = $view[wr_2]; // 한줄당 출력 이미지수
if ($n > (count($view[file])-1)) {
$i_count = (count($view[file])-1); //원본이미지수가 적으면 적은갯수를..
}
else {
$i_count = $n; //원본이미지수가 많으면 설정갯수를..
}
if ($i_count > 0) {
$wid = (int)($board[bo_image_width]/$i_count); //게시판환경설정->'이미지폭크기'를 갖고 나눈다
$board[bo_image_width] = $wid; //자동이미지폭 조정을 위해 다시 넘겨준다..
$wid = (int)(1/$n*100);
}
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0 style='table-layout:fixed'>";
echo "<tr>";
for ($i=0; $i<=count($view[file]); $i++) {
if (($view[file][$i][view]) && $i>0 && ($i%$n == 0)) {
echo "</tr><tr>";
}
if ($view[file][$i][view]) {
echo "<td align='center' valign='top' style='word-break:break-all'>";
echo "<div style='overflow-x:hidden; width:; height:; padding:0px;'>";
echo $view[file][$i][view];
echo "</div>";
echo "<br>". $view[file][$i][content]; // 이미지 설명글 {게시판 환경설정에서 체크}
}
}
// 부족한 <td> 갯수 맞추는 작업
if ((count($view[file])-1) % $n != 0) {
$td_cnt = $n - ((count($view[file])-1)%$n);
for ($t=0; $t<$td_cnt; $t++) {
echo "<td> </td>";
}
}
echo "</tr></table>";
//echo "<br>";
?>
<!-- //------------- 여기까지 -------------------------------------// -->
<!-- 내용 출력 -->
<span id="writeContents"><?=$view[wr_51];?></span>
<?//echo $view[rich_content]; // 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
</table>
</div>
---------------------------------------------------------------------------------------
부탁드립니다~
댓글 전체

일단 디비에 여분필 51에 값이 있나 phpmyadin 체크 해 보시고요
write.skin.php 에서
<textarea id="wr_51" class='wbox' name="wr_51" value="<?=$write['wr_51']?>" style='width:100%; margin-bottom:5px; word-break:break-all;' rows=10 itemname="내용"
<? if ($write_min || $write_max) { ?>onkeyup="check_byte('wr_51', 'char_count');"<?}?>></textarea>
<? if ($write_min || $write_max) { ?><script language="javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
저기 위에중
check_byte('wr_content', 'char_count'); 되어 있는걸
=> check_byte('wr_51', 'char_count'); 되어 있는걸
wr_51 로 해보심이..
write.skin.php 에서
<textarea id="wr_51" class='wbox' name="wr_51" value="<?=$write['wr_51']?>" style='width:100%; margin-bottom:5px; word-break:break-all;' rows=10 itemname="내용"
<? if ($write_min || $write_max) { ?>onkeyup="check_byte('wr_51', 'char_count');"<?}?>></textarea>
<? if ($write_min || $write_max) { ?><script language="javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
저기 위에중
check_byte('wr_content', 'char_count'); 되어 있는걸
=> check_byte('wr_51', 'char_count'); 되어 있는걸
wr_51 로 해보심이..