코멘트 등록 안되는 문제.. > 그누4 질문답변

그누4 질문답변

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

코멘트 등록 안되는 문제.. 정보

코멘트 등록 안되는 문제..

본문

리스트 스킨=>

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

//가로 세로 폭 지정
if (eregi('%', $width)) { $col_width = "14%"; }
else { $col_width = round($width/7); }
$col_height= 80 ;

$prevmonth = $month - 1;
$nextmonth = $month + 1;
$prevyear = $year;
$nextyear = $year;
if ($month == 1) {
  $prevmonth = 12;
  $prevyear = $year - 1;
} elseif ($month == 12) {
  $nextmonth = 1;
  $nextyear = $year + 1;
}

$maxdate = date(t, mktime(0, 0, 0, $month, 1, $year));  // the final date of $month
$offset  = date(w, mktime(0, 0, 0, $month, 1, $year));
?>
<style type="text/css">
/* 카테고리 스타일*/
#box_day{width:3%; padding-left: 7px; padding-top: 4px; font-size:12px; font-family:돋움; font-weight:bold; float:left;}
#box_list{width:97%;}
#box_list2{width:97%; padding:5px 7px 5px 7px;}

a.day1:link, a.day1:visited, a.day1:active { font-size:14px; text-decoration:none; color:#9e9e9e; }
a.day1:hover { font-size:16px;color:#9e9e9e; text-decoration:underline; font-weight:bold; }

a.day2:link, a.day2:visited, a.day2:active { font-size:14px; text-decoration:none; color:#9e9e9e; }
a.day2:hover { font-size:16px;color:#9e9e9e; text-decoration:underline; font-weight:bold; }

a.day3:link, a.day3:visited, a.day3:active { font-size:14px; text-decoration:none; color:#9e9e9e; }
a.day3:hover { font-size:16px;color:#9e9e9e; text-decoration:underline; font-weight:bold; }

.day4 {font-size:20px;color:#1641b2;}
.day5 {font-family:돋움;font-size:14px;color:#6c91c3;}
body {
background-color: #dde6f4;
}
</style>
<table width="100%" height="39" border="0" cellpadding="0" cellspacing="0" background="<?=$board_skin_path?>/img/bar_bg.gif"">
<tr>
<td width="10">&nbsp;</td>
<td valign="bottom">
<a href='board.php?bo_table=<?=$bo_table?>&mode=m2'><img src="<?=$board_skin_path?>/img/btn_s_01.gif"></a><a href='http://pulsecam.mireene.com/gnuboard4/bbs/board.php?bo_table=line'><img src="<?=$board_skin_path?>/img/btn_s2_04.gif" border="0"></a></td>
<td align="right">

<div align="right">
</span><span class="day4"><?=$year?></span><span class="day5">년</span>
<a href="<?="$_SERVER[PHP_SELF]?bo_table=$bo_table&mode=m2&"?><?if ($month == 1) { $year_pre=$year-1; $month_pre=$month; } else {$year_pre=$year-1; $month_pre=$month;} echo ("year=$year_pre&month=$month_pre");?>" target="_self" onfocus="this.blur()"><img src="<?=$board_skin_path?>/img/y_prev.gif" border="0" title="<?=$year_pre?>년" align="abbottom" /></a> <a href="<?="$_SERVER[PHP_SELF]?bo_table=$bo_table&mode=m2&"?><?if ($month == 12) { $year_pre=$year+1; $month_pre=$month; } else {$year_pre=$year+1; $month_pre=$month;} echo ("&year=$year_pre&month=$month_pre");?>" target="_self" onfocus="this.blur()"><img src="<?=$board_skin_path?>/img/y_next.gif" border="0" title="<?=$year_pre?>년" align="abbottom" /></a> <span class="day4">
<?=$month?>
</span><span class="day5">월</span> <a href="<?="$_SERVER[PHP_SELF]?bo_table=$bo_table&mode=m2&"?><?if ($month == 1) { $year_pre=$year-1; $month_pre=12; } else {$year_pre=$year; $month_pre=$month-1;} echo ("year=$year_pre&month=$month_pre");?>" target="_self" onfocus="this.blur()"><img src="<?=$board_skin_path?>/img/m_prev.gif" border="0" title="<?=$month_pre?>월" align="abbottom" /></a> <a href="<?="$_SERVER[PHP_SELF]?bo_table=$bo_table&mode=m2&"?><? if ($month == 12) { $year_pre=$year+1; $month_pre=1; } else {$year_pre=$year; $month_pre=$month+1;} echo ("&year=$year_pre&month=$month_pre");?>" target="_self" onfocus="this.blur()"><img src="<?=$board_skin_path?>/img/m_next.gif" border="0" title="<?=$month_pre?>월" align="abbottom" /></a></div> </td>
</tr>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbline1">
<tr>
<td class="tbline2 bbs_head bbs_fhead" align="center" width="<?=$col_width?>">일</td>
<td class="tbline2 bbs_head bbs_fhead" align="center" width="<?=$col_width?>">월</td>
<td class="tbline2 bbs_head bbs_fhead" align="center" width="<?=$col_width?>">화</td>
<td class="tbline2 bbs_head bbs_fhead" align="center" width="<?=$col_width?>">수</td>
<td class="tbline2 bbs_head bbs_fhead" align="center" width="<?=$col_width?>">목</td>
<td class="tbline2 bbs_head bbs_fhead" align="center" width="<?=$col_width?>">금</td>
<td class="tbline2 bbs_head bbs_fhead" align="center" width="<?=$col_width?>">토</td>
</tr>

<?
$cel_mon = sprintf("%02d",$month);
$query = "SELECT * FROM $write_table WHERE left(wr_link1,6) = '$year$cel_mon' ORDER BY wr_id ASC";
$result = sql_query($query);

// 내용을 보여주는 부분
while ($row = mysql_fetch_array($result)) {
for ($i = 1 ; $i <= $maxdate;  $i++) {

if( substr($row[wr_link1],6,2) == $i ) {
switch ($row[wr_3]) {
case 1 :
$html_day[$i].= "<br><img src='$board_skin_path/img/dia_diary.gif' border=0 align=absmiddle>";
break;
case 2 :
$html_day[$i].= "<br><img src='$board_skin_path/img/dia_memorial.gif' border=0 align=absmiddle>";
break;
case 3 :
$html_day[$i].= "<br><img src='$board_skin_path/img/dia_schedual.gif' border=0 align=absmiddle>";
    break;
default :
$html_day[$i].= "<br><img src='$board_skin_path/img/dia_review.gif' border=0 align=absmiddle>";
}

$html_day[$i].= "<a href='./board.php?bo_table=$bo_table&wr_id=$row[wr_id]'>".$row[wr_subject]."</a>"."\n";
}
}
}
?>

<?
// 달력의 틀을 보여주는 부분
$temp = 7 - (($maxdate + $offset)%7);
if ($temp == 7) $temp = 0;

$count_day  = 1;
$count_last = $maxdate + $offset + $temp;

for ($count = 1; $count <= $count_last; $count++) {

if (($count%7) == 1) echo ("<tr>\n"); // 주당 7개씩 한쎌씩을 쌓는다.

// 날짜가 있을경우
if ($offset < $count  &&  $count <= $maxdate + $offset) {
$daytext = "$count_day";  // $count_day 는 숫자

$bgcolor = "#FFFFFF"; //일반날짜

if ($thisyear==$year && $thismonth==$month && $thisday==$count_day) $bgcolor = "#FFFFC0"; //오늘날짜

if ($count%7 == 1) {$daytext = "<font color=#FF0000>$daytext</font>"; $bgcolor = "#FEFAFF";} // 일요일
if ($count%7 == 0) {$daytext = "<font color=#0000FF>$daytext</font>"; $bgcolor = "#F0F8FF";} // 토요일

$tmp = sprintf("%02d",$month)."-".sprintf("%02d",$count_day);
if ($nal[$tmp]) {
$title = trim($nal[$tmp][1]);
$title1 = cut_str($title,8);
if (trim($nal[$tmp][2]) == "*") {
$daytext = "<font color=#FF0000>$daytext</font> <font color=#804180><a title=$title>$title1</a></font>";
$bgcolor = "#FEFAFF";
} //공휴일
else {
$daytext = "$daytext <font color=#804180><a title=$title>$title1</a></font>";
}
}

// 여기까지 숫자와 들어갈 내용에 대한 변수들의 세팅이 끝나고

// 이제 여기 부터 직접 셀이 그려지면서 그 안에 내용이 들어 간다.
echo ("<td height=$col_height class=tbline2 bgcolor=$bgcolor valign=top>\n");

//글쓰기 권한여부
if ($write_href) {
$f_date = $year.sprintf("%02d",$month).sprintf("%02d",$count_day);
echo " <a href='$write_href&write[wr_link1]=$f_date'>$daytext</a>\n";
}
else {
echo "$daytext\n";
}

echo $html_day[$count_day];
echo ("</td>\n");  // 한칸을 마무리

$count_day++; // 날짜를 카운팅
}

// 날짜가 없을경우
else { echo ("<td height=$col_height class=tbline2 bgcolor=#FBFBFB valign=top>&nbsp;</td>\n"); }

if (($count%7) == 0) echo ("</tr>\n");
}
?>
</table>
<blockquote>&nbsp;</blockquote>

<?
// 코멘트 입출력
include_once("./view_comment.php");
?>

코멘트 등록이 왜 안되는지..

view_comment.php=>

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

// 이모티콘
if($cwin==1) {
function emoticon_html($str, $board_skin_path)
{

for($i=1; $i<=120; $i++) {
if($i < 10) {
$emo_id = "emoticon_00$i";
} else if($i < 100) {
$emo_id = "emoticon_0$i";
} else {
$emo_id = "emoticon_$i";
}
$img_src = "<img src='$board_skin_path/emoticons/$i.gif' width=18 height=18 border=0 title=$emo_id>";
$str = eregi_replace($emo_id, $img_src, $str);
}

return $str;
}
}
?>
<? if ($cwin==1) { ?>
<link rel="stylesheet" href="<?=$board_skin_path?>/style.css" type="text/css">
<? } ?>

<!-- 코멘트 리스트 -->
<? for ($i=0; $i<count($list); $i++) {
$comment_id = $list[$i][wr_id];

// 회원레벨아이콘
$mb = get_member($list[$i][mb_id]);
$level=level_name($mb[mb_level]);
if (!$level) { $level = "<img src=$g4[path]/img/level/01.gif align=absmiddle>"; }
?>
<a name="c_<?=$comment_id?>"></a>

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr height=25>
<td>
<? for ($k=0; $k<strlen($list[$i][wr_comment_reply]); $k++) { ?>
&nbsp;&nbsp;
<? } ?>
</td>
<td>
<? if ($list[$i][wr_comment_reply]) { echo "<img src='$board_skin_path/img/icon_reply.gif'>"; } ?>
<?=$level?> <?=$list[$i][name]?>
<? if ($is_ip_view) { echo "&nbsp;({$list[$i][ip]})"; } ?>
</td>
<td align=right>
        <? if ($list[$i][is_reply]) { echo "<a href=\"javascript:comment_box('{$comment_id}', 'c');\"><img src='$board_skin_path/img/btn_comment_reply.gif' border=0 align=absmiddle></a> "; } ?>
        <? if ($list[$i][is_edit]) { echo "<a href=\"javascript:comment_box('{$comment_id}', 'cu');\"><img src='$board_skin_path/img/btn_comment_edit.gif' border=0 align=absmiddle></a> "; } ?>
        <? if ($list[$i][is_del])  { echo "<a href=\"javascript:comment_delete('{$list[$i][del_link]}');\"><img src='$board_skin_path/img/btn_comment_delete.gif' border=0 align=absmiddle></a> "; } ?>&nbsp;
<?=$list[$i][datetime]?>
</td>
</tr>


<tr>
<td></td>
<td colspan="2" align="left" class="c_tc">
<!-- 코멘트 출력 -->
<? $list[$i][content] = emoticon_html($list[$i][content], $board_skin_path); ?>
<span class="vc_content"><?=$list[$i][content]?></span>
<? if ($list[$i][trackback]) { echo "<p>".$list[$i][trackback]."</p>"; } ?>

<textarea id='save_comment_<?=$comment_id?>' style='display:none;'><?=get_text($list[$i][wr_content], 0)?></textarea>
<span id='edit_<?=$comment_id?>' style='display:none;'></span><!-- 수정 -->
<span id='reply_<?=$comment_id?>' style='display:none;'></span><!-- 답변 -->
</td>
</tr>
<tr><td></td><td colspan=2 class=c_tl></td></tr>
</table>
<br>
<? } ?>

<!-- 코멘트 리스트 -->
<? if ($is_comment_write) { ?>
<table width="98%" cellspacing="0" cellpadding="0" align="center">
<tr>
    <td height=30 align=right>
<a href="javascript:comment_box('', 'c');"><img src='<?=$board_skin_path?>/img/btn_comment.gif' border=0 align=absmiddle></a>
<? if($cwin==1) { ?>
<a href="javascript:window.close();"><img src="<?=$board_skin_path?>/img/btn_close.gif" width="48" height="20" border="0" align=absmiddle></a>
<? } ?>
</td>
</tr>
<tr>
    <td>
        <!-- 코멘트 입력테이블시작 -->
        <span id=comment_write style='display:none;'>
        <form name="fviewcomment" method="post" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" autocomplete="off">
        <input type=hidden name=w          id=w value='c'>
        <input type=hidden name=bo_table    value='<?=$bo_table?>'>
        <input type=hidden name=wr_id      value='<?=$wr_id?>'>
        <input type=hidden name=comment_id  id='comment_id' value=''>
        <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=cwin        value='<?=$cwin?>'>
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
            <td height='30' width="100%">
<? if ($is_guest) { ?>
이름 <INPUT type=text maxLength=20 size=15 name="wr_name" itemname="이름" required class="bbs_ft">
비번 <INPUT type=password maxLength=20 size=15 name="wr_password" itemname="패스워드" required class="bbs_ft">
<? if ($is_norobot) { ?>
<?=$norobot_str?> <INPUT title="왼쪽의 글자중 빨간글자만 순서대로 입력하세요." type="input" name="wr_key" itemname="자동등록방지" required class="bbs_ft">
<? } ?>
<? } ?>
</td>
        </tr>

<tr>
            <td>
                <textarea id='wr_content' name='wr_content' class="bbs_fa" style="width:100%;" rows="5" itemname="내용" required ></textarea>
            </td>
<td width="70">
<INPUT type="image" src="<?=$board_skin_path?>/img/btn_comment_ok.gif" border=0 accesskey='s'>
</td>
        </tr>
<tr>
<td><? include "$board_skin_path/write_input.php"; ?></td>
<td>
<SPAN class="bbs_point" onclick="textarea_decrease('wr_content', 10);"><img src="<?=$board_skin_path?>/img/write_up.gif"></SPAN>
<SPAN  class="bbs_point" onclick="textarea_original('wr_content', 5);"><img src="<?=$board_skin_path?>/img/write_start.gif"></SPAN>
<SPAN  class="bbs_point" onclick="textarea_increase('wr_content', 10);"><img src="<?=$board_skin_path?>/img/write_down.gif"></SPAN>
</td>
</tr>
        </table>
        </form>
        </span>
        <!-- 코멘트 입력 테이블 끝 -->
    </td>
</tr>
</table>

<script language='JavaScript'>
var save_before = '';
var save_html = document.getElementById('comment_write').innerHTML;
function fviewcomment_submit(f)
{
    var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자

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

    if (typeof(f.wr_name) != 'undefined')
    {
        f.wr_name.value = f.wr_name.value.replace(pattern, "");
        if (f.wr_name.value == '')
        {
            alert('이름이 입력되지 않았습니다.');
            f.wr_name.focus();
            return false;
        }
    }

    if (typeof(f.wr_password) != 'undefined')
    {
        f.wr_password.value = f.wr_password.value.replace(pattern, "");
        if (f.wr_password.value == '')
        {
            alert('패스워드가 입력되지 않았습니다.');
            f.wr_password.focus();
            return false;
        }
    }

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

    return true;
}

function comment_box(comment_id, work)
{
    var el_id;
    // 코멘트 아이디가 넘어오면 답변, 수정
    if (comment_id)
    {
comment_box('', 'c');
        if (work == 'c')
            el_id = 'reply_' + comment_id;
        else
            el_id = 'edit_' + comment_id;
    }
    else
        el_id = 'comment_write';

    if (save_before != el_id)
    {
        if (save_before)
        {
            document.getElementById(save_before).style.display = 'none';
            document.getElementById(save_before).innerHTML = '';
        }

        document.getElementById(el_id).style.display = '';
        document.getElementById(el_id).innerHTML = save_html;
        // 코멘트 수정
        if (work == 'cu')
        {
            document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value;
        }

        document.getElementById('comment_id').value = comment_id;
        document.getElementById('w').value = work;

        save_before = el_id;
    }
}

function comment_delete(url)
{
    if (confirm("이 코멘트를 삭제하시겠습니까?")) location.href = url;
}
</script>
<? } ?>
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로