FAQ계시판, 도와주세요 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

FAQ계시판, 도와주세요 정보

FAQ계시판, 도와주세요

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 : http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=135843&sca=&sfl=wr_subject%7C%7Cwr_content&stx=faq

위의 junxgrinder님의 FAQ게시판스킨을 약간 개조를 사용하려 하는데, 현재 몇가지 문제가 있어서, 고수님들께 엿줘보려고저 합니다.

1. 글쓰기에서 에디터가 뜨지 않습니다. html쓰기도 안되구요. 게시판설정에서는 체크는 하였습니다.
2. 내용보기에서, 줄바꾸기가 안됩니다.
3. 첨부파일 다운로드가 안됩니다. 첨부파일을 클릭하면, "잘못된 접급입니다"라는 창이 뜹니다.

아래는 list.skin.php 소스입니다. 어디가 잘못된건지 알려주세요....@_@

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 10;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
if(!$board['bo_use_list_content'])
alert("관리자 모드 목록에서 내용보기를 체크해주세요");

$table_head = "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='27'>";
$table_tail = "</td></tr><tr><td  height='1' style='border-bottom:1px dotted #b9c695;'></td></tr></table>";
?>
<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"></script>
<table width="100%" align=center cellpadding=0 cellspacing=0>
<tr><td>
 <table border=0 width="100%" cellspacing="0" cellpadding="0">
<tr height="25">
    <td width="50%">
        <form name="fcategory" method="get" style="margin:0; padding:0;">
        <? if ($is_category) { ?>
        <select name=sca onchange="location='<?=$category_location?>'+this.value;">
        <option value=''>전체</option>
        <?=$category_option?>
        </select>
        <? } ?>
        </form>
    </td>
    <td align="right">
        <img src="<?=$board_skin_path?>/img/icon_total.gif" align=absmiddle>
        <span style="color:#888888; font-weight:bold;">Total <?=number_format($total_count)?></span>
        <? if ($rss_href) { ?><a href='<?=$rss_href?>'><img src='<?=$board_skin_path?>/img/btn_rss.gif' border=0 align=absmiddle></a><?}?>
        <? if ($admin_href) { ?><a href="<?=$admin_href?>"><img src="<?=$board_skin_path?>/img/btn_admin.gif" border="0" align="absmiddle" title="관리자"></a><?}?>    </td>
</tr>
<tr><td height=5></td></tr>
</table>       
 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height=8>
   
    <div style="border-top:2px solid #b9c695; border-bottom:2px solid #b9c695; height:34px;">
    <table width=100% height="34" border=0 cellpadding=0 cellspacing=0 style="font-weight:bold; color:#666666;">
      <tr>
        <td width="10%" align="center" valign="middle">번호</td>
        <td width="80%" align="center" valign="middle">각종 공증/인증 등 수속안내</td>
        <td width="10%" align="center" valign="middle"></a></td>
      </tr>
    </table>
    </div>
    </td>
  </tr>
  <tr>
    <td height=5></td>
  </tr>
</table>

<!-- 제목 과 내용-->
<form name="fboardlist" method="post" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl"  value="<?=$sfl?>">
<input type="hidden" name="stx"  value="<?=$stx?>">
<input type="hidden" name="spt"  value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw"  value="">
 <? for ($i=0; $i<count($list); $i++) { ?>  
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
              <table width=100% height="34" border=0  cellpadding=0 cellspacing=0>
                <tr>
                  <td width=10% align="center">
                  <!-- 제목 -->
  <?
if ($wr_id == $list[$i][wr_id]) // 현재위치
            echo "<span style='font:bold 11px tahoma; color:#E15916;'>{$list[$i][num]}</span>";
        else
            echo "<span style='font:normal 11px tahoma; color:#B3B3B3;'>{$list[$i][num]}</span>";
        ?>
        </td>
                  <td width="67%" align="left">
                    &nbsp;
                    <? if ($is_checkbox) { ?>
                  <input type=checkbox ondblclick="if (this.checked) all_checked(true); else all_checked(false);" name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? } ?> <? if ($is_category && $list[$i][ca_name]) {echo "<span class=small><font color=gray>[<a href='{$list[$i][ca_name_href]}'>{$list[$i][ca_name]}</a>]</font></span> ";} ?> <a onclick=view(<?=$list[$i][wr_id]?>) style='cursor:hand'><?=$list[$i][subject]?></a></td>
  <? if (($member[mb_id] && ($member[mb_id] == $write[mb_id])) || $is_admin) { ?>
                  <td width="6%" align="right" ><a href="<?=$write_href?>&w=u&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>">수정</a></td>
                  <td width="6%" align="right" ><a href="javascript:del('./delete.php?bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=');">삭제</a></td>
                  <? } ?>
                </tr>
                <tr>
                  <td colspan="4" height="1" bgcolor="#b9c695"></td>
                </tr>
              </table>           
             
              <!-- 내용 -->
              <div id="view_<?=$list[$i][wr_id]?>" style="display:none">
<?
// 파일 정보 불러오기
$file = get_file($bo_table, $list[$i][wr_id]);
?>

  <table cellspacing=0 cellpadding=0 width=100% height="30" border=0 bgcolor="#ffffff">
              <tr>
              <td style="padding:10px; border-bottom:1px solid #b9c695; line-height:1.5;">
                <?
// 링크
for ($j=1; $j<=$g4[link_count]; $j++) {
    if ($list[$i][link][$j]) {
      $link = cut_str($list[$i][link][$j], 70);
      echo $table_head;
echo "<span style=\"color:#888; font-size:11px;\">관련링크&nbsp;&nbsp;</span>";
        echo " <img src='$board_skin_path/img/icon_link.gif' align=absmiddle>";
        echo "<a href='".$list[$i][link_href][$j]."' target=_blank>";
        echo "&nbsp;<span style=\"color:#888;\">".$link."</span></a>";
        echo "&nbsp;<span style=\"color:#888; font-size:11px;\">".$list[$i][link_hit][$j]."회 연결</span>";
        echo $table_tail;
    }
}

// 파일
for($j=0; $j<$file["count"]; $j++){
if(!$file[$j][image_type]){
echo $table_head;
echo "<span style=\"color:#888; font-size:11px;\">첨부파일&nbsp;&nbsp;</span>";
echo "<img src='$board_skin_path/img/icon_file.gif' align='absmiddle'>";
echo "&nbsp;<a href=\"javascript:file_download('".$file[$j][href]."', '".$file[$j][source]."');\">";
echo "<span style=\"color:#888;\">".$file[$j][source]."</span></a>";
echo "&nbsp;&nbsp;&nbsp;<span style=\"color:#888888; font-size:11px;\">DATE:".$file[$j][datetime]."</span>";
echo "&nbsp;&nbsp;&nbsp;<span style=\"color:#888888; font-size:11px;\">".$file[$j][download]."회 다운로드</span>";
echo $table_tail;
}
if($j == $file["count"]-1)
echo "<div style='height:10px;'></div>";
}

//이미지
    for($j=0; $j<$file["count"]; $j++){
if($file[$j][image_type]){
echo $file[$j][view]."<br>";
}
}

// 내용
echo preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='image_window(this)' style='cursor:pointer;' \\2 \\3", $list[$i]['content']);
?>
      </td>
              </tr>
              </table>
      </div>
                </td>
    </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height=5><img src="<?=$board_skin_path?>/img/5px.gif" width="5" height="5" /></td>
</tr>
</table>
<? } ?>
<? if (count($list) == 0) {
echo "<table width=100% border=0 cellspacing=0 cellpadding=0>";
echo "<tr>";
echo "<td width=11></td>";
echo " <td></td>";
echo "<td width=11></td>";
echo "</tr>";
echo " <tr>";
echo "<td></td>";
echo "<td  style=padding-right: 5px; padding-left: 5px;><div align=center><br>죄송합니다 찾으시는 게시물이 없습니다</div></td>";
echo "<td></td>";
echo "</tr>";
echo "<tr>";
echo "<td></td>";
echo "<td><div align=center><img src=$board_skin_path/img/box_10.gif width=1 height=11></div></td>";
echo "<td></td>";
echo "</tr>";
echo "<tr>";
echo "<td height=10 colspan=3></td>";
echo "</tr>";
echo "</table>";
; }
?>
</form>

<!-- 페이지 -->
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height=5></td>
        </tr>
  </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">

        <tr>
          <td align="center" valign="middle">
    <!-- 페이지 -->
    <? if($board['bo_page_rows'] < $total_count){  ?>
<div style="text-align:center; line-height:30px; clear:both; margin:5px 0 10px 0; padding:5px 0; font-family:gulim;">
    <? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/page_search_prev.gif' border=0 align=absmiddle title='이전검색'></a>"; } ?>
   
<?
    // 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
    //echo $write_pages;
    $write_pages = str_replace("처음", "<img src='$board_skin_path/img/page_begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
    $write_pages = str_replace("이전", "<img src='$board_skin_path/img/page_prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
    $write_pages = str_replace("다음", "<img src='$board_skin_path/img/page_next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
    $write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/page_end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
    $write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><span style=\"color:#B3B3B3; font-size:12px;\">$1</span></b>", $write_pages);
    $write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><span style=\"color:#4D6185; font-size:12px; text-decoration:underline;\">$1</span></b>", $write_pages);
    ?>
    <?=$write_pages?>
    <? if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/page_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
</div>
<? } ?>
<!-- 검색
        <table width="100%" height="35" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="f1f1f1">
          <tr>
            <td align="right">

            <div style="text-align:center;">
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca      value="<?=$sca?>">
<select name=sfl style="background-color:#ffffff; border:1px solid #7f9db9; height:21px;">
    <option value='wr_subject'>질문</option>
    <option value='wr_content'>답변</option>
    <option value='wr_subject||wr_content'>질문+답변</option>

</select>
<input name=stx maxlength=15 itemname="검색어" required value='<?=$stx?>' style="width:204px; background-color:#ffffff; border:1px solid #7f9db9; height:21px;">
<input type=image src="<?=$board_skin_path?>/img/btn_search.gif" border=0 align=absmiddle>
<input type=radio name=sop value=and>and
<input type=radio name=sop value=or>or

</form>
</div>
            </td>
            </tr>
        </table>-->
        <div style="height:1px; line-height:1px; font-size:1px; background-color:#eee; clear:both;">&nbsp;</div>
<div style="height:1px; line-height:1px; font-size:1px; background-color:#ddd; clear:both;">&nbsp;</div>
          </td>
        </tr>
        <tr>        </tr>
      </table>
<div style="clear:both; margin-top:7px; height:31px;">
    <!-- 버튼 -->
    <div style="float:left;">
    <? if ($list_href) { ?>
    <a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border="0" align=absmiddle></a>
    <? } ?>
    <? if ($is_checkbox) { ?>
    <a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" border="0" align=absmiddle></a>
    <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" border="0" align=absmiddle></a>
    <a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" border="0" align=absmiddle></a>
    <? } ?>
    </div>

    <div style="float:right;">
    <? if ($write_href) { ?><a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border="0"></a><? } ?>
    </div>
</div>
</td></tr></table>

<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">

if ("<?=$sca?>") document.fcategory.sca.value = "<?=$sca?>";
if ("<?=$stx?>") {
    document.fsearch.sfl.value = "<?=$sfl?>";
    document.fsearch.sop.value = "<?=$sop?>";
}
</script>

<? if ($is_checkbox) { ?>
<script language="JavaScript">
function all_checked(sw)
{
    var f = document.fboardlist;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]")
            f.elements[i].checked = sw;
    }
}

function check_confirm(str)
{
    var f = document.fboardlist;
    var chk_count = 0;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
            chk_count++;
    }

    if (!chk_count) {
        alert(str + "할 게시물을 하나 이상 선택하세요.");
        return false;
    }
    return true;
}

// 선택한 게시물 삭제
function select_delete()
{
    var f = document.fboardlist;

    str = "삭제";
    if (!check_confirm(str))
        return;

    if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
        return;

    f.action = "./delete_all.php";
    f.submit();
}

// 선택한 게시물 복사 및 이동
function select_copy(sw)
{
    var f = document.fboardlist;

    if (sw == "copy")
        str = "복사";
    else
        str = "이동";
                     
    if (!check_confirm(str))
        return;

    var sub_win = window.open("", "move", "left=50, top=50, width=396, height=550, scrollbars=1");

    f.sw.value = sw;
    f.target = "move";
    f.action = "./move.php";
    f.submit();
}
</script>
<? } ?>

<!-- 펼쳐지는 스크립트-->
<script>
var old_i; // 전에 클릭했던 글의 번호값 저장
function view(i) { // 답변 표시여부 조정하는 js함수
if (old_i==i) {
var mode=document.getElementById('view_'+i).style.display;
if (mode=='inline'){
return_size(i);
}else{
re_size(i);
}
}
else {
if (old_i){
return_size(old_i);
}
re_size(i);
}
old_i=i;

}
function re_size(j)
{
document.getElementById('view_'+j).style.display='inline';
//이미지 리사이즈
resizeBoardImage(<?=(int)$board['bo_image_width']?>);
    drawFont();
}

function return_size(j)
{
// 이미지를 원래 사이즈로 되돌린다
var target = document.getElementsByName('target_resize_image[]');
if (target.length) {
        for(i=0; i<target.length; i++) {
if(target[i].tmp_width && target[i].tmp_height) {
target[i].width = target[i].tmp_width;
                target[i].height = target[i].tmp_height;
}
}
//원래 사이즈로 변형이 잘 않되서 검사후 다시 될때 까지...
l = target.length-1;
if(target[l].width == target[l].tmp_width){
document.getElementById('view_'+j).style.display='none';
}else{
return_size(j);
}
}else{
document.getElementById('view_'+j).style.display='none';
}
}

//게시물 번호가 존재하면 레이어를 연다
<?
if($v_id){
?>
var v_id = <?=$v_id?>;
<?
}else{
?>
var v_id;
<?
}
?>
if(v_id)
//view()를 직접 불러 들이면 이미지 리사이즈가 않된다..ㅜ.ㅡ
document.onload=setTimeout("view(v_id)", 0);
</script>

아래는 write.skin.php 소스입니다. 어디가 잘못된건지 알려주세요....@_@
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

?>
<div style="height:14px; line-height:1px; font-size:1px;">&nbsp;</div>

<style type="text/css">
.write_head { height:30px; text-align:center; color:#8492A0; }
.field { border:1px solid #ccc; }
</style>

<script language="javascript">
// 글자수 제한
var char_min = parseInt(<?=$write_min?>); // 최소
var char_max = parseInt(<?=$write_max?>); // 최대
</script>

<form name="fwrite" method="post" action="javascript:fwrite_check(document.fwrite);" enctype="multipart/form-data" style="margin:0px;">
<input type=hidden name=null>
<input type=hidden name=w        value="<?=$w?>">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=wr_id    value="<?=$wr_id?>">
<input type=hidden name=sca      value="<?=$sca?>">
<input type=hidden name=sfl      value="<?=$sfl?>">
<input type=hidden name=stx      value="<?=$stx?>">
<input type=hidden name=spt      value="<?=$spt?>">
<input type=hidden name=sst      value="<?=$sst?>">
<input type=hidden name=sod      value="<?=$sod?>">
<input type=hidden name=page    value="<?=$page?>">

<table width="100%" align=center cellpadding=0 cellspacing=0>
  <tr><td>


<div style="border:1px solid #ddd; height:34px; background:url(<?=$board_skin_path?>/img/title_bg.gif) repeat-x;">
<div style="font-weight:bold; font-size:14px; margin:7px 0 0 10px;">:: <?=$title_msg?> ::</div>
</div>
<div style="height:3px; background:url(<?=$board_skin_path?>/img/title_shadow.gif) repeat-x; line-height:1px; font-size:1px;"></div>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
<colgroup width=90>
<colgroup width=''>
<tr><td colspan="2" style="background:url(<?=$board_skin_path?>/img/title_bg.gif) repeat-x; height:3px;"></td></tr>
<? if ($is_name) { ?>
<tr>
    <td class=write_head>이 름</td>
    <td><input class='field' maxlength=20 size=15 name=wr_name itemname="이름" required value="<?=$name?>"></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<? if ($is_password) { ?>
<tr>
    <td class=write_head>패스워드</td>
    <td><input class='field' type=password maxlength=20 size=15 name=wr_password itemname="패스워드" <?=$password_required?>></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<? if ($is_email) { ?>
<tr>
    <td class=write_head>이메일</td>
    <td><input class='field' maxlength=100 size=50 name=wr_email email itemname="이메일" value="<?=$email?>"></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<? if ($is_homepage) { ?>
<tr>
    <td class=write_head>홈페이지</td>
    <td><input class='field' size=50 name=wr_homepage itemname="홈페이지" value="<?=$homepage?>"></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<?
$option = "";
$option_hidden = "";
if ($is_notice || $is_html || $is_secret || $is_mail) {
    $option = "";
    if ($is_notice) {
        $option .= "<input type=checkbox name=notice value='1' $notice_checked>공지&nbsp;";
    }

    if ($is_html) {
        if ($is_dhtml_editor) {
            $option_hidden .= "<input type=hidden value='html1' name='html'>";
        } else {
            $option .= "<input onclick='html_auto_br(this);' type=checkbox value='$html_value' name='html' $html_checked><span class=w_title>html</span>&nbsp;";
        }
    }

    if ($is_secret) {
        if ($is_admin || $is_secret==1) {
            $option .= "<input type=checkbox value='secret' name='secret' $secret_checked><span class=w_title>비밀글</span>&nbsp;";
        } else {
            $option_hidden .= "<input type=hidden value='secret' name='secret'>";
        }
    }
   
    if ($is_mail) {
        $option .= "<input type=checkbox value='mail' name='mail' $recv_email_checked>답변메일받기&nbsp;";
    }
}

echo $option_hidden;
if ($option) {
?>
<tr>
    <td class=write_head>옵 션</td>
    <td><?=$option?></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<? if ($is_category) { ?>
<tr>
    <td class=write_head>분 류</td>
    <td><select name=ca_name required itemname="분류"><option value="">선택하세요<?=$category_option?></select></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<tr>
    <td class=write_head>질 문</td>
    <td><input class="field" style="width:99%;" name=wr_subject id="wr_subject" itemname="제목" required value="<?=$subject?>"></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<tr>
    <td class=write_head style='padding-left:20px;'>답변</td>
    <td style='padding:5 0 5 0;'>
        <? if (!$is_dhtml_editor) { ?>
        <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/btn_up.gif"></span>
                <span style="cursor: pointer;" onclick="textarea_original('wr_content', 10);"><img src="<?=$board_skin_path?>/img/btn_init.gif"></span>
                <span style="cursor: pointer;" onclick="textarea_increase('wr_content', 10);"><img src="<?=$board_skin_path?>/img/btn_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_content" name="wr_content" class=tx style='width:99%; word-break:break-all;' rows=15 itemname="내용" required
        <? if ($is_dhtml_editor) echo ' geditor '; ?>
        <? if ($write_min || $write_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?>><?=$content?></textarea>
        <? if ($write_min || $write_max) { ?><script language="javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
        </td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#dddddd></td></tr>

<? if ($is_link) { ?>
<? for ($i=1; $i<=$g4[link_count]; $i++) { ?>
<tr>
    <td class=write_head>링크 #<?=$i?></td>
    <td><input type='text' class='field' size=50 name='wr_link<?=$i?>' itemname='링크 #<?=$i?>' value='<?=$write["wr_link{$i}"]?>'></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>
<? } ?>

<? if ($is_file) { ?>
<tr>
    <td class=write_head>
        <table cellpadding=0 cellspacing=0>
        <tr>
            <td class=write_head style="padding-top:10px; line-height:20px;">
                파일첨부<br>
                <span onclick="add_file();" style="cursor:pointer;"><img src="<?=$board_skin_path?>/img/btn_file_add.gif"></span>
                <span onclick="del_file();" style="cursor:pointer;"><img src="<?=$board_skin_path?>/img/btn_file_minus.gif"></span>
            </td>
        </tr>
        </table>
    </td>
    <td style='padding:5 0 5 0;'><table id="variableFiles" cellpadding=0 cellspacing=0></table><?// print_r2($file); ?>
        <script language="JavaScript">
        var flen = 0;
        function add_file(delete_code)
        {
            var upload_count = <?=(int)$board[bo_upload_count]?>;
            if (upload_count && flen >= upload_count)
            {
                alert("이 게시판은 "+upload_count+"개 까지만 파일 업로드가 가능합니다.");
                return;
            }

            var objTbl;
            var objRow;
            var objCell;
            if (document.getElementById)
                objTbl = document.getElementById("variableFiles");
            else
                objTbl = document.all["variableFiles"];

            objRow = objTbl.insertRow(objTbl.rows.length);
            objCell = objRow.insertCell(0);

            objCell.innerHTML = "<input type='file' class='field' name='bf_file[]' title='파일 용량 <?=$upload_max_filesize?> 이하만 업로드 가능'>";
            if (delete_code)
                objCell.innerHTML += delete_code;
            else
            {
                <? if ($is_file_content) { ?>
                objCell.innerHTML += "<br><input type='text' class='field' size=50 name='bf_content[]' title='업로드 이미지 파일에 해당 되는 내용을 입력하세요.'>";
                <? } ?>
                ;
            }

            flen++;
        }

        <?=$file_script; //수정시에 필요한 스크립트?>

        function del_file()
        {
            // file_length 이하로는 필드가 삭제되지 않아야 합니다.
            var file_length = <?=(int)$file_length?>;
            var objTbl = document.getElementById("variableFiles");
            if (objTbl.rows.length - 1 > file_length)
            {
                objTbl.deleteRow(objTbl.rows.length - 1);
                flen--;
            }
        }
        </script></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<? if ($is_trackback) { ?>
<tr>
    <td class=write_head>트랙백주소</td>
    <td><input class='field' size=50 name=wr_trackback itemname="트랙백" value="<?=$trackback?>">
        <? if ($w=="u") { ?><input type=checkbox name="re_trackback" value="1">핑 보냄<? } ?></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<? if ($is_norobot) { ?>
<tr>
    <td class=write_head>
        <?//=$norobot_str?>
        <?
        // 이미지 생성이 가능한 경우 자동등록체크코드를 이미지로 만든다.
        if (function_exists("imagecreate")) {
            echo "<img src='$g4[bbs_path]/norobot_image.php?{$g4['server_time']}' border='0'>";
            $norobot_msg = "* 왼쪽의 자동등록방지 코드를 입력하세요.";
        }
        else {
            echo $norobot_str;
            $norobot_msg = "* 왼쪽의 글자중 <FONT COLOR='red'>빨간글자</font>만 순서대로 입력하세요.";
        }
        ?>
    </td>
    <td><input class='field' type=input size=10 name=wr_key itemname="자동등록방지" required>
        &nbsp;&nbsp;<?=$norobot_msg?>
    </td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td width="100%" align="center" valign="top" style="padding-top:30px;">
        <input type=image id="btn_submit" src="<?=$board_skin_path?>/img/btn_write.gif" border=0 accesskey='s'>&nbsp;
        <a href="./board.php?bo_table=<?=$bo_table?>"><img id="btn_list" src="<?=$board_skin_path?>/img/btn_list.gif" border=0></a></td>
</tr>
</table>

</td></tr></table>
</form>

<script language="javascript">
<?
// 관리자라면 분류 선택에 '공지' 옵션을 추가함
if ($is_admin)
{
    echo "
    if (typeof(document.fwrite.ca_name) != 'undefined')
    {
        document.fwrite.ca_name.options.length += 1;
        document.fwrite.ca_name.options[document.fwrite.ca_name.options.length-1].value = '공지';
        document.fwrite.ca_name.options[document.fwrite.ca_name.options.length-1].text = '공지';
    }";
}
?>

with (document.fwrite) {
    if (typeof(wr_name) != "undefined")
        wr_name.focus();
    else if (typeof(wr_subject) != "undefined")
        wr_subject.focus();
    else if (typeof(wr_content) != "undefined")
        wr_content.focus();

    if (typeof(ca_name) != "undefined")
        if (w.value == "u")
            ca_name.value = "<?=$write[ca_name]?>";
}

function html_auto_br(obj) {
    if (obj.checked) {
        result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
        if (result)
            obj.value = "html2";
        else
            obj.value = "html1";
    }
    else
        obj.value = "";
}

function fwrite_check(f) {
    /*
    var s = "";
    if (s = word_filter_check(f.wr_subject.value)) {
        alert("제목에 금지단어('"+s+"')가 포함되어있습니다");
        return;
    }

    if (s = word_filter_check(f.wr_content.value)) {
        alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
        return;
    }
    */

    if (document.getElementById('char_count')) {
        if (char_min > 0 || char_max > 0) {
            var cnt = parseInt(document.getElementById('char_count').innerHTML);
            if (char_min > 0 && char_min > cnt) {
                alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
                return;
            }
            else if (char_max > 0 && char_max < cnt) {
                alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
                return;
            }
        }
    }

    if (typeof(f.wr_key) != "undefined") {
        if (hex_md5(f.wr_key.value) != md5_norobot_key) {
            alert("자동등록방지용 빨간글자가 순서대로 입력되지 않았습니다.");
            f.wr_key.focus();
            return;
        }
    }

    var geditor_status = document.getElementById("geditor_wr_content_geditor_status");

    if (geditor_status != null)
    {
        if (geditor_status.value == "TEXT") {
            f.html.value = "html2";
        }
        else if (geditor_status.value == "WYSIWYG") {
            f.html.value = "html1";
        }
    }

    document.getElementById('btn_submit').disabled = true;
    document.getElementById('btn_list').disabled = true;

    <?
    if ($g4[https_url])
        echo "f.action = '$g4[https_url]/$g4[bbs]/write_update.php';";
    else
        echo "f.action = './write_update.php';";
    ?>
    f.submit();
}
</script>

<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"></script>
<? if ($is_dhtml_editor) {?><script language="JavaScript" src="<?="$g4[path]/geditor/geditor.js"?>"></script><?}?>
<script language="JavaScript">
window.onload=function() {
    drawFont();
}
</script>

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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