write.skin.php 와 view.skin.php '내용'폼의 크기가 다를 때 정보
write.skin.php 와 view.skin.php '내용'폼의 크기가 다를 때본문
게시물에 그림과 글이 같이 있는 경우
보통 write.skin.php에서는
그림이 위에 있고 내용이 그 아래로 들어가게 되있잖아요
근데 저는 그림 바로 옆에 내용(단순 텍스트가 아니라 표 형태로) 오도록 수정을 했습니다.
그래서 write.skin.php에서 '내용' 입력폼의 크기와 write.skin.php보여지는 크기가 다릅니다.
문제는 write.skin.php에서 입력한 내용이 많이 길어졌을때
view.skin.php에서는 테이블 크기보다 길어지면 다음 줄로 넘어가는 것이 아니라
표가 사정없이 오른쪽으로 늘어나서 전체 홈페이지 가로 크기를 넘어가는 것입니다.
글자수를 제한 하는 것이 아니라
테이블 크기에 맞춰 알아서 줄바꿈 할 수 있게 하려면 어떻게 해야 하나요...?
-----------------------------------------------------------------------------------------------------------------------
<view.skin.php>
<?
if (!defined("_GNUBOARD_")) exit; //
?><head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<!-- 내용시작 -->
<table width="<?=$width?>" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- 링크 -->
<?
ob_start();
?>
<table width='100%' cellpadding=0 cellspacing=0 border=0>
<tr height=35>
<td width=75%>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_modify.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_del.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_nogood.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('$scrap_href');\"><img src='$board_skin_path/img/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
</tr>
</table>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
<!-- 제목, 글쓴이, 날짜, 조회, 추천, 비추천 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height=2 bgcolor="#0A7299"></td>
</tr>
<tr>
<td height=30 style="padding:5px 0 5px 0;">
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td style='word-break:break-all; height:28px;'> <b><font color="#FF6600"><?=cut_hangul_last(get_text($view[wr_subject]))?></font></b>
<font color="#BABABA">-</font>
<font style="font:normal 11px ; color:#BABABA;">조회수 :</font><font style="font:normal 11px tahoma; color:#BABABA;"> <?=$view[wr_hit]?> </font>
<? if ($is_good) { ?><font style="font:normal 11px ; color:#BABABA;">추천</font>
:<font style="font:normal 11px tahoma; color:#BABABA;"> <?=$view[wr_good]?> <?}?></font>
<? if ($is_nogood) { ?><font style="font:normal 11px ; color:#BABABA;">비추천</font>
:<font style="font:normal 11px tahoma; color:#BABABA;"> <?=$view[wr_nogood]?> <?}?></font>
<? if ($trackback_url) { ?><?}?></td>
</tr>
<tr>
<td height=3 style="background:url(<?=$board_skin_path?>/img/title_bg.gif) repeat-x;">
</td>
</tr>
</table></td>
</tr>
<tr>
<td height=150>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td valign="top"> <!--이미지-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="1" >
<table border="0" cellspacing="0" cellpadding="0" width=306>
<tr>
<td align=center> <?
// 파일
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view];
}
?></td>
</tr>
</table>
</td>
<td width="20"></td>
<td>
<table border="0" width="100%" cellpadding="2">
<!--소제목
<TR><TD colspan=3><img src="<?=$board_skin_path?>/img/board00_t.gif"></td></tr>
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><td colspan=3 heigh=10></td> </tr>
-->
<tr><!-- 제품명-->
<td width="70" height=30 align=center><img src="<?=$board_skin_path?>/img/board01_t_name.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td width='290'><font color="#0A7299"><?=$view[subject]?></font></td>
</tr>
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><!-- 분류-->
<td width="70" height=30 align=center><img src="<?=$board_skin_path?>/img/board03_t_branch.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td><font color="#666666"><? if ($is_category) { echo ($category_name ? "$view[ca_name]" : ""); } ?>
</font></td>
</tr>
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><!-- 기본정보-->
<td width="70" height=50 align=center><img src="<?=$board_skin_path?>/img/board06_t_basic.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td>
<table cellpadding=0 cellspacing=0>
<tr><td valign=top><font color="#666666"><?=$view[wr_1]?></font></td></tr>
<tr><td valign=top><font color="#666666"><?=$view[wr_2]?></font></td></tr>
<tr><td valign=top><font color="#666666"><?=$view[wr_3]?></font></td></tr>
</table>
</td>
</tr>
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><!-- 상세정보-->
<td width="70" height=50 align=center><img src="<?=$board_skin_path?>/img/board07_t_detail.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td>
<table border=0 cellpadding=0>
<tr> <!-- 내용 출력 -->
<td><?=$view[content];?><?//echo $view[rich_content]; // 과 같은 코드를 사용할 경우?></xml></xmp></font>
</td>
</tr>
</table>
</td>
</tr>
<!-- 필드 필요하면 추가
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr>
<td width="70" height=30 bgcolor=#F9f9f9 align=center>기 타 3</td>
<td width='10'><font color=#eeeeee>|</font></td>
<td><font color="#666666"><?=$view[wr_5]?></font></td>
</tr>
-->
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><!-- 기타-->
<td width="70" height=50 align=center><img src="<?=$board_skin_path?>/img/board05_t_etc.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td>
<table cellpadding=0 cellspacing=0>
<tr><td valign=top><font color="#666666"><?=$view[wr_4]?></font></td></tr>
<tr><td valign=top><font color="#666666"><?=$view[wr_5]?></font></td></tr>
<tr><td valign=top><font color="#666666"><?=$view[wr_6]?></font></td></tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table></td></tr>
<tr>
<td> <br><br></td>
</tr>
<? if ($is_signature) { echo "<tr><td align='center' style='border-bottom:1px solid #E7E7E7; padding:5px 0;'>$signature</td></tr>"; } // 서명 출력 ?>
</table><br>
<?
// 코멘트 입출력
include_once("./view_comment.php");
?>
<?=$link_buttons?>
</td>
</tr>
</table><br>
<script language="JavaScript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href=link;
}
</script>
<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"></script>
<script language="JavaScript">
window.onload=function() {
resizeBoardImage(<?=(int)$board[bo_image_width]?>);
drawFont();
}
</script>
<!-- 게시글 보기 끝 -->
보통 write.skin.php에서는
그림이 위에 있고 내용이 그 아래로 들어가게 되있잖아요
근데 저는 그림 바로 옆에 내용(단순 텍스트가 아니라 표 형태로) 오도록 수정을 했습니다.
그래서 write.skin.php에서 '내용' 입력폼의 크기와 write.skin.php보여지는 크기가 다릅니다.
문제는 write.skin.php에서 입력한 내용이 많이 길어졌을때
view.skin.php에서는 테이블 크기보다 길어지면 다음 줄로 넘어가는 것이 아니라
표가 사정없이 오른쪽으로 늘어나서 전체 홈페이지 가로 크기를 넘어가는 것입니다.
글자수를 제한 하는 것이 아니라
테이블 크기에 맞춰 알아서 줄바꿈 할 수 있게 하려면 어떻게 해야 하나요...?
-----------------------------------------------------------------------------------------------------------------------
<view.skin.php>
<?
if (!defined("_GNUBOARD_")) exit; //
?><head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<!-- 내용시작 -->
<table width="<?=$width?>" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- 링크 -->
<?
ob_start();
?>
<table width='100%' cellpadding=0 cellspacing=0 border=0>
<tr height=35>
<td width=75%>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_modify.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_del.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_nogood.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('$scrap_href');\"><img src='$board_skin_path/img/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
</tr>
</table>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
<!-- 제목, 글쓴이, 날짜, 조회, 추천, 비추천 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height=2 bgcolor="#0A7299"></td>
</tr>
<tr>
<td height=30 style="padding:5px 0 5px 0;">
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td style='word-break:break-all; height:28px;'> <b><font color="#FF6600"><?=cut_hangul_last(get_text($view[wr_subject]))?></font></b>
<font color="#BABABA">-</font>
<font style="font:normal 11px ; color:#BABABA;">조회수 :</font><font style="font:normal 11px tahoma; color:#BABABA;"> <?=$view[wr_hit]?> </font>
<? if ($is_good) { ?><font style="font:normal 11px ; color:#BABABA;">추천</font>
:<font style="font:normal 11px tahoma; color:#BABABA;"> <?=$view[wr_good]?> <?}?></font>
<? if ($is_nogood) { ?><font style="font:normal 11px ; color:#BABABA;">비추천</font>
:<font style="font:normal 11px tahoma; color:#BABABA;"> <?=$view[wr_nogood]?> <?}?></font>
<? if ($trackback_url) { ?><?}?></td>
</tr>
<tr>
<td height=3 style="background:url(<?=$board_skin_path?>/img/title_bg.gif) repeat-x;">
</td>
</tr>
</table></td>
</tr>
<tr>
<td height=150>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td valign="top"> <!--이미지-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="1" >
<table border="0" cellspacing="0" cellpadding="0" width=306>
<tr>
<td align=center> <?
// 파일
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view];
}
?></td>
</tr>
</table>
</td>
<td width="20"></td>
<td>
<table border="0" width="100%" cellpadding="2">
<!--소제목
<TR><TD colspan=3><img src="<?=$board_skin_path?>/img/board00_t.gif"></td></tr>
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><td colspan=3 heigh=10></td> </tr>
-->
<tr><!-- 제품명-->
<td width="70" height=30 align=center><img src="<?=$board_skin_path?>/img/board01_t_name.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td width='290'><font color="#0A7299"><?=$view[subject]?></font></td>
</tr>
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><!-- 분류-->
<td width="70" height=30 align=center><img src="<?=$board_skin_path?>/img/board03_t_branch.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td><font color="#666666"><? if ($is_category) { echo ($category_name ? "$view[ca_name]" : ""); } ?>
</font></td>
</tr>
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><!-- 기본정보-->
<td width="70" height=50 align=center><img src="<?=$board_skin_path?>/img/board06_t_basic.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td>
<table cellpadding=0 cellspacing=0>
<tr><td valign=top><font color="#666666"><?=$view[wr_1]?></font></td></tr>
<tr><td valign=top><font color="#666666"><?=$view[wr_2]?></font></td></tr>
<tr><td valign=top><font color="#666666"><?=$view[wr_3]?></font></td></tr>
</table>
</td>
</tr>
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><!-- 상세정보-->
<td width="70" height=50 align=center><img src="<?=$board_skin_path?>/img/board07_t_detail.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td>
<table border=0 cellpadding=0>
<tr> <!-- 내용 출력 -->
<td><?=$view[content];?><?//echo $view[rich_content]; // 과 같은 코드를 사용할 경우?></xml></xmp></font>
</td>
</tr>
</table>
</td>
</tr>
<!-- 필드 필요하면 추가
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr>
<td width="70" height=30 bgcolor=#F9f9f9 align=center>기 타 3</td>
<td width='10'><font color=#eeeeee>|</font></td>
<td><font color="#666666"><?=$view[wr_5]?></font></td>
</tr>
-->
<tr><td colspan=3 heigh=1 bgcolor=#eeeeee></td></tr>
<tr><!-- 기타-->
<td width="70" height=50 align=center><img src="<?=$board_skin_path?>/img/board05_t_etc.gif"></td>
<td width='10'><font color=#eeeeee>|</font></td>
<td>
<table cellpadding=0 cellspacing=0>
<tr><td valign=top><font color="#666666"><?=$view[wr_4]?></font></td></tr>
<tr><td valign=top><font color="#666666"><?=$view[wr_5]?></font></td></tr>
<tr><td valign=top><font color="#666666"><?=$view[wr_6]?></font></td></tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table></td></tr>
<tr>
<td> <br><br></td>
</tr>
<? if ($is_signature) { echo "<tr><td align='center' style='border-bottom:1px solid #E7E7E7; padding:5px 0;'>$signature</td></tr>"; } // 서명 출력 ?>
</table><br>
<?
// 코멘트 입출력
include_once("./view_comment.php");
?>
<?=$link_buttons?>
</td>
</tr>
</table><br>
<script language="JavaScript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href=link;
}
</script>
<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"?>"></script>
<script language="JavaScript">
window.onload=function() {
resizeBoardImage(<?=(int)$board[bo_image_width]?>);
drawFont();
}
</script>
<!-- 게시글 보기 끝 -->
댓글 전체