g4용 스킨 g5 변환중인데 한번 봐주세요 고수님들 채택완료
해날
8년 전
조회 4,060
해당소스는 지구인님의 최근글에 댓글뽑기 소스 소스입니다.
http://sir.kr/bbs/board.php?bo_table=g4_skin&wr_id=138402">http://sir.kr/bbs/board.php?bo_table=g4_skin&wr_id=138402
아래코드들의 경로등이 잘 맞았는지 한번 살펴봐주시면 감사하겠습니다.^^
성공하면 지구인님과 도와주신분 성함으로 정리후 봉헌하겠나이다 ^^
/latest.skin.php
</p><p><?<span class="Apple-tab-span" style="white-space:pre"> </span> ////★★★★여기서부터 최근글에 댓글뽑기 소스★★★★</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$this_ca_name = $list[$i]['ca_name'];</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$this_wr_parent = $list[$i]['wr_id'];</p><p> </p><p> if ($list[$i]['comment_cnt']) {</p><p><span class="Apple-tab-span" style="white-space:pre"> </span></p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "<div style='border:solid #ccc 1px;background:#eee;margin:5px;padding:5px;font-size:12px;'>";</p><p> </p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$write_table = $g5['write_prefix'].$bo_table;</p><p><span class="Apple-tab-span" style="white-space:pre"> </span></p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$sql_num = " select count(*) as num from $write_table where wr_parent = '$this_wr_parent' and wr_is_comment = 1 and wr_comment_reply = '' "; </p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$row_num = sql_fetch($sql_num);</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$comment_num = $row_num['num']; //전체댓글수</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$display_comment_num = 3; //메인에 뽑을 댓글수</p><p><span class="Apple-tab-span" style="white-space:pre"> </span></p><p>//댓글 뽑기</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$sql_comment = " select * from $write_table where wr_parent = '$this_wr_parent' and wr_is_comment = 1 and wr_comment_reply = '' order by wr_id desc ";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$result_comment = sql_query($sql_comment);</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>for ($c=0; $row_comment=sql_fetch_array($result_comment); $c++) </p><p><span class="Apple-tab-span" style="white-space:pre"> </span>{</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$this_day = substr($row_comment['wr_datetime'],0,10);</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>if ($this_day==$g5['time_ymd']) $datetime2 = substr($row_comment['wr_datetime'],11,5);</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>else $datetime2 = substr($row_comment['wr_datetime'],5,5);</p><p> </p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "<div style='text-align:left;line-height:1.5;'> <!---((((---->";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "<span style='color:#666;font-size:12px;'><b>".$row_comment['wr_name']."</b></span> ";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "<span style='color:#aaaccc;font-size:11px;'>".$datetime2."</span> ";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "<span style='color:#777;font-size:12px;'>".$row_comment['wr_content']."</span>";</p><p> </p><p>//답댓글 입력폼</p><p>//<span class="Apple-tab-span" style="white-space:pre"> </span>if ($_SESSION['ss_mb_id']==$list[$i]['mb_id']) { ///원글쓴이가 본인일 경우 답글달기 버튼 보임. 적용하지 않으려면 주석처리</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>if ($_SESSION['ss_mb_id']) { ///로그인 중일 경우 답글달기 버튼 보임. 적용하지 않으려면 주석처리</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$form_width = "250px"; ///댓글폼의 가로폭</p><p>?></p><p> </p><p><span class="Apple-tab-span" style="white-space:pre"> </span><span id='show-re-comment-form<?=$list[$i]['wr_id']?><?=$c?>' style='margin:5px;background:navy;color:#fff;padding:2px;cursor:pointer;font-size:11px;'>답댓글</span></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><div id='re-comment-form<?=$list[$i]['wr_id']?><?=$c?>' style='display:none;'></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><form name="fviewcomment" method="post" action="<?=$g5['bbs_path']?>/comment_latest_update.php" onsubmit="return fviewcomment_submit(this);" autocomplete="off" style="margin:0px;"></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><input type=hidden name=w id=w value='c'></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><input type=hidden name=mb_id value='<?=$member['mb_id']?>'></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><input type=hidden name=bo_table value='<?=$bo_table?>'></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><input type=hidden name=wr_id value='<?=$this_wr_parent?>'></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><input type=hidden name=wr_comment value='<?=$row_comment['wr_comment']?>'></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><input type=hidden name=wr_comment_reply value='A'></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><input type=hidden name=comment_id id='comment_id' value=''></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><input type=hidden name=sca value='<?=$this_ca_name?>'></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><input type=hidden name=set value='goto_main'> </p><p><span class="Apple-tab-span" style="white-space:pre"> </span><!---댓글을 단 후 메인으로 가고자 하면 goto_main, 게시판으로 가고자 하면 goto_board----></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><!---해당소스는 comment_latest_update.php 339행, 344행 참조----></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><textarea id='wr_content' name='wr_content' rows=3 itemname='답글달기' required style='width:<?=$form_width?>;word-break:break-all;font-size:12px;' class=tx></textarea></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><div style='margin:0;'><input type='submit' value=' 답글달기 ' accesskey='s' style='font-size:12px;'></div></p><p><span class="Apple-tab-span" style="white-space:pre"> </span></form></p><p><span class="Apple-tab-span" style="white-space:pre"> </span></div></p><p><?</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>} ///원글쓴이가 본인이거나 혹은 로그인 중일 경우 답글달기 버튼 보임. 적용하지 않으려면 주석처리</p><p> </p><p> </p><p>///댓글의 답댓글 뽑기</p><p> </p><p>$sql_comment_reply = " select * from $write_table where wr_parent = '$this_wr_parent' and wr_is_comment = 1 and wr_comment = '$row_comment[wr_comment]' and wr_comment_reply != '' order by wr_comment_reply desc ";</p><p>$result_comment_reply = sql_query($sql_comment_reply);</p><p> </p><p>for ($d=0; $row_comment_reply=sql_fetch_array($result_comment_reply); $d++) </p><p>{</p><p>$this_day_comment_reply = substr($row_comment_reply['wr_datetime'],0,10);</p><p>if ($this_day_comment_reply == $g5['time_ymd']) $datetime2_comment_reply = substr($row_comment_reply['wr_datetime'],11,5);</p><p>else $datetime2_comment_reply = substr($row_comment_reply['wr_datetime'],5,5);</p><p> </p><p>echo "<div style='border:dotted #ccc 1px;margin:5px 5px 5px 15px;padding:5px;'>";</p><p>echo "<span style='color:#666;font-size:12px;'><b>".$row_comment_reply['wr_name']."</b></span> ";</p><p>echo "<span style='color:#aaaccc;font-size:11px;'>".$datetime2_comment_reply."</span> ";</p><p>echo "<span style='color:#777;font-size:12px;'>".$row_comment_reply['wr_content']."</span>";</p><p>echo "</div>";</p><p>}</p><p> </p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "</div> <!---))))---->";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span></p><p><span class="Apple-tab-span" style="white-space:pre"> </span>if ($c == $display_comment_num-1) break; //</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>}</p><p><span class="Apple-tab-span" style="white-space:pre"> </span></p><p><span class="Apple-tab-span" style="white-space:pre"> </span>if ($comment_num > $display_comment_num) { //전체 댓글수가 메인에 뽑을 댓글수보다 많으면 출력. 게시글로 가는 링크</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "<div style='margin-top:5px;text-align:center;'>";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "<a href='".$g5['bbs_path']."/board.php?bo_table=".$bo_table."&sca=".urlencode($this_ca_name)."&wr_id=".$this_wr_parent."'>전체댓글보기</a>";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "</div>";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>}</p><p><span class="Apple-tab-span" style="white-space:pre"> </span></p><p><span class="Apple-tab-span" style="white-space:pre"> </span>echo "</div>";</p><p>?></p><p><script type="text/javascript"></p><p>$(document).ready(function(){</p><p><span class="Apple-tab-span" style="white-space:pre"> </span><?</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$sql_comment = " select * from $write_table where wr_parent = '$this_wr_parent' and wr_is_comment = 1 and wr_comment_reply = '' order by wr_id desc ";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$result_comment = sql_query($sql_comment);</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>for ($c=0; $row=sql_fetch_array($result_comment); $c++) </p><p><span class="Apple-tab-span" style="white-space:pre"> </span>{</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>?></p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$("span#show-re-comment-form<?=$list[$i]['wr_id']?><?=$c?>").click(function(){</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>$("div#re-comment-form<?=$list[$i]['wr_id']?><?=$c?>").toggle("fast");</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>});</p><p><span class="Apple-tab-span" style="white-space:pre"> </span><? } ?></p><p>});</p><p></script></p><p><span class="Apple-tab-span" style="white-space:pre"> </span><?<span class="Apple-tab-span" style="white-space:pre"> </span>} ////★★★★여기까지 최근글에 댓글뽑기 소스★★★★ ?> </p><p>
/bbs/comment_latest_update.php
</p><p><span style="font-size: 14.6667px;"><?</span></p><p><span style="font-size: 14.6667px;">include_once("./_common.php");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">// 090710</span></p><p><span style="font-size: 14.6667px;">if (substr_count($wr_content, "&#") > 50) {</span></p><p><span style="font-size: 14.6667px;"> alert("내용에 올바르지 않은 코드가 다수 포함되어 있습니다.");</span></p><p><span style="font-size: 14.6667px;"> exit;</span></p><p><span style="font-size: 14.6667px;">}</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">$g5[title] = $wr_subject . "코멘트입력";</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">$w = $_POST["w"];</span></p><p><span style="font-size: 14.6667px;">$wr_name = strip_tags($_POST["wr_name"]);</span></p><p><span style="font-size: 14.6667px;">$wr_email = strip_tags($_POST["wr_email"]);</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">// 비회원의 경우 이름이 누락되는 경우가 있음</span></p><p><span style="font-size: 14.6667px;">if (!$is_member)</span></p><p><span style="font-size: 14.6667px;">{</span></p><p><span style="font-size: 14.6667px;"> if (!trim($wr_name))</span></p><p><span style="font-size: 14.6667px;"> alert("로그인 후 댓글을 쓸 수 있습니다.");</span></p><p><span style="font-size: 14.6667px;">}</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">if ($w == "c" || $w == "cu") </span></p><p><span style="font-size: 14.6667px;">{</span></p><p><span style="font-size: 14.6667px;"> if ($member[mb_level] < $board[bo_comment_level]) </span></p><p><span style="font-size: 14.6667px;"> alert("코멘트를 쓸 권한이 없습니다.");</span></p><p><span style="font-size: 14.6667px;">} </span></p><p><span style="font-size: 14.6667px;">else</span></p><p><span style="font-size: 14.6667px;"> alert("w 값이 제대로 넘어오지 않았습니다."); </span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">// 세션의 시간 검사</span></p><p><span style="font-size: 14.6667px;">// 4.00.15 - 코멘트 수정시 연속 게시물 등록 메시지로 인한 오류 수정</span></p><p><span style="font-size: 14.6667px;">if ($w == "c" && $_SESSION["ss_datetime"] >= ($g5[server_time] - $config[cf_delay_sec]) && !$is_admin) </span></p><p><span style="font-size: 14.6667px;"> alert("너무 빠른 시간내에 게시물을 연속해서 올릴 수 없습니다.");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">set_session("ss_datetime", $g5[server_time]);</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">// 동일내용 연속 등록 불가</span></p><p><span style="font-size: 14.6667px;">$sql = " select MD5(CONCAT(wr_ip, wr_subject, wr_content)) as prev_md5 from $write_table ";</span></p><p><span style="font-size: 14.6667px;">if ($w == "cu")</span></p><p><span style="font-size: 14.6667px;"> $sql .= " where wr_id <> '$commend_id' ";</span></p><p><span style="font-size: 14.6667px;">$sql .= " order by wr_id desc limit 1 ";</span></p><p><span style="font-size: 14.6667px;">$row = sql_fetch($sql);</span></p><p><span style="font-size: 14.6667px;">$curr_md5 = md5($_SERVER[REMOTE_ADDR].$wr_subject.$wr_content);</span></p><p><span style="font-size: 14.6667px;">// 코멘트 수정의 경우에는 동일한 내용을 등록할 수 없는 오류 수정</span></p><p><span style="font-size: 14.6667px;">//if ($row[prev_md5] == $curr_md5 && !$is_admin)</span></p><p><span style="font-size: 14.6667px;">if ($row[prev_md5] == $curr_md5 && $w != 'cu' && !$is_admin)</span></p><p><span style="font-size: 14.6667px;"> alert("동일한 내용을 연속해서 등록할 수 없습니다.");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">$wr = get_write($write_table, $wr_id);</span></p><p><span style="font-size: 14.6667px;">if (!$wr[wr_id]) </span></p><p><span style="font-size: 14.6667px;"> alert("글이 존재하지 않습니다.\\n\\n글이 삭제되었거나 이동하였을 수 있습니다."); </span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">// 자동등록방지 검사</span></p><p><span style="font-size: 14.6667px;">//include_once ("./norobot_check.inc.php");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">if (!$is_member) {</span></p><p><span style="font-size: 14.6667px;"> if ($w=='' || $w=='c') {</span></p><p><span style="font-size: 14.6667px;"> $key = get_session("captcha_keystring");</span></p><p><span style="font-size: 14.6667px;"> session_unregister("captcha_keystring");</span></p><p><span style="font-size: 14.6667px;"> if (!($key && $key == $_POST[wr_key])) {</span></p><p><span style="font-size: 14.6667px;"> alert("정상적인 접근이 아닌것 같습니다.");</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;">}</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">// "인터넷옵션 > 보안 > 사용자정의수준 > 스크립팅 > Action 스크립팅 > 사용 안 함" 일 경우의 오류 처리</span></p><p><span style="font-size: 14.6667px;">// 이 옵션을 사용 안 함으로 설정할 경우 어떤 스크립트도 실행 되지 않습니다.</span></p><p><span style="font-size: 14.6667px;">//if (!trim($_POST["wr_content"])) die ("내용을 입력하여 주십시오.");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">if ($member[mb_id]) </span></p><p><span style="font-size: 14.6667px;">{</span></p><p><span style="font-size: 14.6667px;"> $mb_id = $member[mb_id];</span></p><p><span style="font-size: 14.6667px;"> // 4.00.13 - 실명 사용일때 코멘트에 별명으로 입력되던 오류를 수정</span></p><p><span style="font-size: 14.6667px;"> $wr_name = $board[bo_use_name] ? $member[mb_name] : $member[mb_nick];</span></p><p><span style="font-size: 14.6667px;"> $wr_password = $member[mb_password];</span></p><p><span style="font-size: 14.6667px;"> $wr_email = $member[mb_email];</span></p><p><span style="font-size: 14.6667px;"> $wr_homepage = $member[mb_homepage];</span></p><p><span style="font-size: 14.6667px;">} </span></p><p><span style="font-size: 14.6667px;">else </span></p><p><span style="font-size: 14.6667px;">{</span></p><p><span style="font-size: 14.6667px;"> $mb_id = "";</span></p><p><span style="font-size: 14.6667px;"> $wr_password = sql_password($wr_password);</span></p><p><span style="font-size: 14.6667px;">}</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">if ($w == "c") // 코멘트 입력</span></p><p><span style="font-size: 14.6667px;">{</span></p><p><span style="font-size: 14.6667px;"> if ($member[mb_point] + $board[bo_comment_point] < 0 && !$is_admin)</span></p><p><span style="font-size: 14.6667px;"> alert("보유하신 포인트(".number_format($member[mb_point]).")가 없거나 모자라서 코멘트쓰기(".number_format($board[bo_comment_point]).")가 불가합니다.\\n\\n포인트를 적립하신 후 다시 코멘트를 써 주십시오.");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 코멘트 답변</span></p><p><span style="font-size: 14.6667px;"> if ($comment_id) </span></p><p><span style="font-size: 14.6667px;"> {</span></p><p><span style="font-size: 14.6667px;"> $sql = " select wr_id, wr_comment, wr_comment_reply from $write_table </span></p><p><span style="font-size: 14.6667px;"> where wr_id = '$comment_id' ";</span></p><p><span style="font-size: 14.6667px;"> $reply_array = sql_fetch($sql);</span></p><p><span style="font-size: 14.6667px;"> if (!$reply_array[wr_id])</span></p><p><span style="font-size: 14.6667px;"> alert("답변할 코멘트가 없습니다.\\n\\n답변하는 동안 코멘트가 삭제되었을 수 있습니다.");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $tmp_comment = $reply_array[wr_comment];</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> if (strlen($reply_array[wr_comment_reply]) == 5)</span></p><p><span style="font-size: 14.6667px;"> alert("더 이상 답변하실 수 없습니다.\\n\\n답변은 5단계 까지만 가능합니다.");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $reply_len = strlen($reply_array[wr_comment_reply]) + 1;</span></p><p><span style="font-size: 14.6667px;"> if ($board[bo_reply_order]) {</span></p><p><span style="font-size: 14.6667px;"> $begin_reply_char = "A";</span></p><p><span style="font-size: 14.6667px;"> $end_reply_char = "Z";</span></p><p><span style="font-size: 14.6667px;"> $reply_number = +1;</span></p><p><span style="font-size: 14.6667px;"> $sql = " select MAX(SUBSTRING(wr_comment_reply, $reply_len, 1)) as reply </span></p><p><span style="font-size: 14.6667px;"> from $write_table </span></p><p><span style="font-size: 14.6667px;"> where wr_parent = '$wr_id' </span></p><p><span style="font-size: 14.6667px;"> and wr_comment = '$tmp_comment'</span></p><p><span style="font-size: 14.6667px;"> and SUBSTRING(wr_comment_reply, $reply_len, 1) <> '' ";</span></p><p><span style="font-size: 14.6667px;"> } </span></p><p><span style="font-size: 14.6667px;"> else </span></p><p><span style="font-size: 14.6667px;"> {</span></p><p><span style="font-size: 14.6667px;"> $begin_reply_char = "Z";</span></p><p><span style="font-size: 14.6667px;"> $end_reply_char = "A";</span></p><p><span style="font-size: 14.6667px;"> $reply_number = -1;</span></p><p><span style="font-size: 14.6667px;"> $sql = " select MIN(SUBSTRING(wr_comment_reply, $reply_len, 1)) as reply </span></p><p><span style="font-size: 14.6667px;"> from $write_table </span></p><p><span style="font-size: 14.6667px;"> where wr_parent = '$wr_id' </span></p><p><span style="font-size: 14.6667px;"> and wr_comment = '$tmp_comment'</span></p><p><span style="font-size: 14.6667px;"> and SUBSTRING(wr_comment_reply, $reply_len, 1) <> '' ";</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;"> if ($reply_array[wr_comment_reply]) </span></p><p><span style="font-size: 14.6667px;"> $sql .= " and wr_comment_reply like '$reply_array[wr_comment_reply]%' ";</span></p><p><span style="font-size: 14.6667px;"> $row = sql_fetch($sql);</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> if (!$row[reply])</span></p><p><span style="font-size: 14.6667px;"> $reply_char = $begin_reply_char;</span></p><p><span style="font-size: 14.6667px;"> else if ($row[reply] == $end_reply_char) // A~Z은 26 입니다.</span></p><p><span style="font-size: 14.6667px;"> alert("더 이상 답변하실 수 없습니다.\\n\\n답변은 26개 까지만 가능합니다.");</span></p><p><span style="font-size: 14.6667px;"> else</span></p><p><span style="font-size: 14.6667px;"> $reply_char = chr(ord($row[reply]) + $reply_number);</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $tmp_comment_reply = $reply_array[wr_comment_reply] . $reply_char;</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;"> else </span></p><p><span style="font-size: 14.6667px;"> {</span></p><p><span style="font-size: 14.6667px;"> $sql = " select max(wr_comment) as max_comment from $write_table </span></p><p><span style="font-size: 14.6667px;"> where wr_parent = '$wr_id' and wr_is_comment = 1 ";</span></p><p><span style="font-size: 14.6667px;"> $row = sql_fetch($sql);</span></p><p><span style="font-size: 14.6667px;"> //$row[max_comment] -= 1;</span></p><p><span style="font-size: 14.6667px;"> $row[max_comment] += 1;</span></p><p><span style="font-size: 14.6667px;"> $tmp_comment = $row[max_comment];</span></p><p><span style="font-size: 14.6667px;"> $tmp_comment_reply = "";</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $sql = " insert into $write_table</span></p><p><span style="font-size: 14.6667px;"> set ca_name = '$wr[ca_name]',</span></p><p><span style="font-size: 14.6667px;"> wr_option = '$wr_secret',</span></p><p><span style="font-size: 14.6667px;"> wr_num = '$wr[wr_num]',</span></p><p><span style="font-size: 14.6667px;"> wr_reply = '',</span></p><p><span style="font-size: 14.6667px;"> wr_parent = '$wr_id',</span></p><p><span style="font-size: 14.6667px;"> wr_is_comment = '1',</span></p><p><span style="font-size: 14.6667px;"> wr_comment = '$wr_comment',</span></p><p><span style="font-size: 14.6667px;"> wr_comment_reply = '$wr_comment_reply',</span></p><p><span style="font-size: 14.6667px;"> wr_subject = '$wr_subject',</span></p><p><span style="font-size: 14.6667px;"> wr_content = '$wr_content',</span></p><p><span style="font-size: 14.6667px;"> mb_id = '$mb_id',</span></p><p><span style="font-size: 14.6667px;"> wr_password = '$wr_password',</span></p><p><span style="font-size: 14.6667px;"> wr_name = '$wr_name',</span></p><p><span style="font-size: 14.6667px;"> wr_email = '$wr_email',</span></p><p><span style="font-size: 14.6667px;"> wr_homepage = '$wr_homepage',</span></p><p><span style="font-size: 14.6667px;"> wr_datetime = '$g5[time_ymdhis]',</span></p><p><span style="font-size: 14.6667px;"> wr_last = '',</span></p><p><span style="font-size: 14.6667px;"> wr_ip = '$_SERVER[REMOTE_ADDR]',</span></p><p><span style="font-size: 14.6667px;"> wr_1 = '$wr_1',</span></p><p><span style="font-size: 14.6667px;"> wr_2 = '$wr_2',</span></p><p><span style="font-size: 14.6667px;"> wr_3 = '$wr_3',</span></p><p><span style="font-size: 14.6667px;"> wr_4 = '$wr_4',</span></p><p><span style="font-size: 14.6667px;"> wr_5 = '$wr_5',</span></p><p><span style="font-size: 14.6667px;"> wr_6 = '$wr_6',</span></p><p><span style="font-size: 14.6667px;"> wr_7 = '$wr_7',</span></p><p><span style="font-size: 14.6667px;"> wr_8 = '$wr_8',</span></p><p><span style="font-size: 14.6667px;"> wr_9 = '$wr_9',</span></p><p><span style="font-size: 14.6667px;"> wr_10 = '$wr_10' ";</span></p><p><span style="font-size: 14.6667px;"> sql_query($sql);</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $comment_id = mysql_insert_id();</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 원글에 코멘트수 증가 & 마지막 시간 반영</span></p><p><span style="font-size: 14.6667px;"> sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_last = '$g5[time_ymdhis]' where wr_id = '$wr_id' ");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 새글 INSERT</span></p><p><span style="font-size: 14.6667px;"> //sql_query(" insert into $g5[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '$bo_table', '$comment_id', '$wr_id', '$g5[time_ymdhis]' ) ");</span></p><p><span style="font-size: 14.6667px;"> sql_query(" insert into $g5[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '$g5[time_ymdhis]', '$member[mb_id]' ) ");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 코멘트 1 증가</span></p><p><span style="font-size: 14.6667px;"> sql_query(" update $g5[board_table] set bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' ");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 포인트 부여</span></p><p><span style="font-size: 14.6667px;"> insert_point($member[mb_id], $board[bo_comment_point], "$board[bo_subject] {$wr_id}-{$comment_id} 코멘트쓰기", $bo_table, $comment_id, '코멘트');</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 메일발송 사용</span></p><p><span style="font-size: 14.6667px;"> if ($config[cf_email_use] && $board[bo_use_email])</span></p><p><span style="font-size: 14.6667px;"> {</span></p><p><span style="font-size: 14.6667px;"> // 관리자의 정보를 얻고</span></p><p><span style="font-size: 14.6667px;"> $super_admin = get_admin("super");</span></p><p><span style="font-size: 14.6667px;"> $group_admin = get_admin("group");</span></p><p><span style="font-size: 14.6667px;"> $board_admin = get_admin("board");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $wr_subject = get_text(stripslashes($wr[wr_subject]));</span></p><p><span style="font-size: 14.6667px;"> $wr_content = nl2br(get_text(stripslashes("----- 원글 -----\n\n$wr[wr_subject]\n\n\n----- 코멘트 -----\n\n$wr_content")));</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $warr = array( ""=>"입력", "u"=>"수정", "r"=>"답변", "c"=>"코멘트", "cu"=>"코멘트 수정" );</span></p><p><span style="font-size: 14.6667px;"> $str = $warr[$w];</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $subject = "'{$board[bo_subject]}' 게시판에 {$str}글이 올라왔습니다.";</span></p><p><span style="font-size: 14.6667px;"> // 4.00.15 - 메일로 보내는 코멘트의 바로가기 링크 수정</span></p><p><span style="font-size: 14.6667px;"> $link_url = "$g5[url]/$g5[bbs]/board.php?bo_table=$bo_table&wr_id=$wr_id&$qstr#c_{$comment_id}";</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> include_once("$g5[path]/lib/mailer.lib.php");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> ob_start();</span></p><p><span style="font-size: 14.6667px;"> include_once ("./write_update_mail.php");</span></p><p><span style="font-size: 14.6667px;"> $content = ob_get_contents();</span></p><p><span style="font-size: 14.6667px;"> ob_end_clean();</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 게시판 관리자에게 보내는 메일</span></p><p><span style="font-size: 14.6667px;"> if ($config[cf_email_wr_board_admin])</span></p><p><span style="font-size: 14.6667px;"> mailer($wr_name, $wr_email, $board_admin[mb_email], $subject, $content, 1);</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 그룹 관리자에게 보내는 메일</span></p><p><span style="font-size: 14.6667px;"> if ($group_admin[mb_email] != $board_admin[mb_email])</span></p><p><span style="font-size: 14.6667px;"> {</span></p><p><span style="font-size: 14.6667px;"> if ($config[cf_email_wr_group_admin])</span></p><p><span style="font-size: 14.6667px;"> mailer($wr_name, $wr_email, $group_admin[mb_email], $subject, $content, 1);</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 최고관리자에게 보내는 메일</span></p><p><span style="font-size: 14.6667px;"> // 게시판관리자가 존재할 경우 최고관리자에게 메일이 두번씩 발송되는 문제 해결</span></p><p><span style="font-size: 14.6667px;"> if ($super_admin[mb_email] != $board_admin[mb_email] && $super_admin[mb_email] != $group_admin[mb_email])</span></p><p><span style="font-size: 14.6667px;"> {</span></p><p><span style="font-size: 14.6667px;"> if ($config[cf_email_wr_super_admin])</span></p><p><span style="font-size: 14.6667px;"> mailer($wr_name, $wr_email, $super_admin[mb_email], $subject, $content, 1);</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 답변 메일받기 (원게시자에게 보내는 메일)</span></p><p><span style="font-size: 14.6667px;"> //if ($wr[wr_recv_email] && $wr[wr_email] && $wr[wr_email] != $admin[mb_email]) </span></p><p><span style="font-size: 14.6667px;"> if (strstr($wr[wr_option], 'mail') && $wr[wr_email] && $wr[wr_email] != $member[mb_email]) </span></p><p><span style="font-size: 14.6667px;"> {</span></p><p><span style="font-size: 14.6667px;"> if ($config[cf_email_wr_write])</span></p><p><span style="font-size: 14.6667px;"> mailer($wr_name, $wr_email, $wr[wr_email], $subject, $content, 1);</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> // 코멘트 쓴 모든이에게 메일 발송</span></p><p><span style="font-size: 14.6667px;"> if ($config[cf_email_wr_comment_all])</span></p><p><span style="font-size: 14.6667px;"> {</span></p><p><span style="font-size: 14.6667px;"> $sql = " select distinct wr_email from $write_table</span></p><p><span style="font-size: 14.6667px;"> where wr_email not in ( '$wr[wr_email]', '$member[mb_email]', '' )</span></p><p><span style="font-size: 14.6667px;"> and wr_parent = '$wr_id' ";</span></p><p><span style="font-size: 14.6667px;"> $result = sql_query($sql);</span></p><p><span style="font-size: 14.6667px;"> while ($row=sql_fetch_array($result))</span></p><p><span style="font-size: 14.6667px;"> mailer($wr_name, $wr_email, $row[wr_email], $subject, $content, 1);</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;"> }</span></p><p><span style="font-size: 14.6667px;">} </span></p><p><span style="font-size: 14.6667px;">else if ($w == "cu") // 코멘트 수정</span></p><p><span style="font-size: 14.6667px;">{ </span></p><p><span style="font-size: 14.6667px;"> $sql = " select mb_id, wr_comment, wr_comment_reply from $write_table </span></p><p><span style="font-size: 14.6667px;"> where wr_id = '$comment_id' ";</span></p><p><span style="font-size: 14.6667px;"> $comment = $reply_array = sql_fetch($sql);</span></p><p><span style="font-size: 14.6667px;"> $tmp_comment = $reply_array[wr_comment];</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $len = strlen($reply_array[wr_comment_reply]);</span></p><p><span style="font-size: 14.6667px;"> if ($len < 0) $len = 0; </span></p><p><span style="font-size: 14.6667px;"> $comment_reply = substr($reply_array[wr_comment_reply], 0, $len);</span></p><p><span style="font-size: 14.6667px;"> //print_r2($GLOBALS); exit;</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> if ($is_admin == "super") // 최고관리자 통과 </span></p><p><span style="font-size: 14.6667px;"> ; </span></p><p><span style="font-size: 14.6667px;"> else if ($is_admin == "group") { // 그룹관리자 </span></p><p><span style="font-size: 14.6667px;"> $mb = get_member($comment[mb_id]); </span></p><p><span style="font-size: 14.6667px;"> if ($member[mb_id] == $group[gr_admin]) { // 자신이 관리하는 그룹인가? </span></p><p><span style="font-size: 14.6667px;"> if ($member[mb_level] >= $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과 </span></p><p><span style="font-size: 14.6667px;"> ; </span></p><p><span style="font-size: 14.6667px;"> else </span></p><p><span style="font-size: 14.6667px;"> alert("그룹관리자의 권한보다 높은 회원의 코멘트이므로 수정할 수 없습니다."); </span></p><p><span style="font-size: 14.6667px;"> } else </span></p><p><span style="font-size: 14.6667px;"> alert("자신이 관리하는 그룹의 게시판이 아니므로 코멘트를 수정할 수 없습니다."); </span></p><p><span style="font-size: 14.6667px;"> } else if ($is_admin == "board") { // 게시판관리자이면 </span></p><p><span style="font-size: 14.6667px;"> $mb = get_member($comment[mb_id]); </span></p><p><span style="font-size: 14.6667px;"> if ($member[mb_id] == $board[bo_admin]) { // 자신이 관리하는 게시판인가? </span></p><p><span style="font-size: 14.6667px;"> if ($member[mb_level] >= $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과 </span></p><p><span style="font-size: 14.6667px;"> ; </span></p><p><span style="font-size: 14.6667px;"> else </span></p><p><span style="font-size: 14.6667px;"> alert("게시판관리자의 권한보다 높은 회원의 코멘트이므로 수정할 수 없습니다."); </span></p><p><span style="font-size: 14.6667px;"> } else </span></p><p><span style="font-size: 14.6667px;"> alert("자신이 관리하는 게시판이 아니므로 코멘트를 수정할 수 없습니다."); </span></p><p><span style="font-size: 14.6667px;"> } else if ($member[mb_id]) { </span></p><p><span style="font-size: 14.6667px;"> if ($member[mb_id] != $comment[mb_id]) </span></p><p><span style="font-size: 14.6667px;"> alert("자신의 글이 아니므로 수정할 수 없습니다."); </span></p><p><span style="font-size: 14.6667px;"> } </span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $sql = " select count(*) as cnt from $write_table</span></p><p><span style="font-size: 14.6667px;"> where wr_comment_reply like '$comment_reply%'</span></p><p><span style="font-size: 14.6667px;"> and wr_id <> '$comment_id'</span></p><p><span style="font-size: 14.6667px;"> and wr_parent = '$wr_id'</span></p><p><span style="font-size: 14.6667px;"> and wr_comment = '$tmp_comment' </span></p><p><span style="font-size: 14.6667px;"> and wr_is_comment = 1 ";</span></p><p><span style="font-size: 14.6667px;"> $row = sql_fetch($sql);</span></p><p><span style="font-size: 14.6667px;"> if ($row[cnt] && !$is_admin)</span></p><p><span style="font-size: 14.6667px;"> alert("이 코멘트와 관련된 답변코멘트가 존재하므로 수정 할 수 없습니다.");</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $sql_ip = "";</span></p><p><span style="font-size: 14.6667px;"> if (!$is_admin)</span></p><p><span style="font-size: 14.6667px;"> $sql_ip = " , wr_ip = '$_SERVER[REMOTE_ADDR]' ";</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $sql_secret = "";</span></p><p><span style="font-size: 14.6667px;"> if ($wr_secret)</span></p><p><span style="font-size: 14.6667px;"> $sql_secret = " , wr_option = '$wr_secret' ";</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"> $sql = " update $write_table</span></p><p><span style="font-size: 14.6667px;"> set wr_subject = '$wr_subject',</span></p><p><span style="font-size: 14.6667px;"> wr_content = '$wr_content',</span></p><p><span style="font-size: 14.6667px;"> wr_1 = '$wr_1',</span></p><p><span style="font-size: 14.6667px;"> wr_2 = '$wr_2',</span></p><p><span style="font-size: 14.6667px;"> wr_3 = '$wr_3',</span></p><p><span style="font-size: 14.6667px;"> wr_4 = '$wr_4',</span></p><p><span style="font-size: 14.6667px;"> wr_5 = '$wr_5',</span></p><p><span style="font-size: 14.6667px;"> wr_6 = '$wr_6',</span></p><p><span style="font-size: 14.6667px;"> wr_7 = '$wr_7',</span></p><p><span style="font-size: 14.6667px;"> wr_8 = '$wr_8',</span></p><p><span style="font-size: 14.6667px;"> wr_9 = '$wr_9',</span></p><p><span style="font-size: 14.6667px;"> wr_10 = '$wr_10',</span></p><p><span style="font-size: 14.6667px;"> wr_option = '$wr_option'</span></p><p><span style="font-size: 14.6667px;"> $sql_ip</span></p><p><span style="font-size: 14.6667px;"> $sql_secret</span></p><p><span style="font-size: 14.6667px;"> where wr_id = '$comment_id' ";</span></p><p><span style="font-size: 14.6667px;"> sql_query($sql);</span></p><p><span style="font-size: 14.6667px;">}</span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;">?></span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"><? if ($set == 'goto_main') { ?></span></p><p><span style="font-size: 14.6667px;"><script></span></p><p><span style="font-size: 14.6667px;">parent.location.href = '<?=$g5['path']?>/index.php'; //최근댓글이 출력되는 페이지 URL</span></p><p><span style="font-size: 14.6667px;"></script></span></p><p><span style="font-size: 14.6667px;"> </span></p><p><span style="font-size: 14.6667px;"><? } elseif ($set == 'goto_board') { ?></span></p><p><span style="font-size: 14.6667px;"><script></span></p><p><span style="font-size: 14.6667px;">parent.location.href = '<?=$g5['bbs_path']?>/board.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr['wr_parent']?>&page=<?=$page?><?=$qstr?>&cwin=<?=$cwin?>#c_<?=$comment_id?>';</span></p><p><span style="font-size: 14.6667px;"></script></span></p><p><span style="font-size: 14.6667px;"><? } ?></span></p><div>
</div><p style="font-size: 14.6667px;">
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
8년 전
대중 훓어봤을 때 눈에 띄는 에러 발생요소는 날짜 $g5[time~], 경로 부분이겠군요
각 화일 위쪽에다 추가하세요
$g5[server_time] = G5_SERVER_TIME;
$g5['time_ymd'] = G5_TIME_YMD;
$g5[time_ymdhis] = G5_TIME_YMDHIS;
$g5[url]= G5_URL;
$g5[bbs] = G5_BBS_DIR;
$g5['bbs_path'] = G5_BBS_URL;
$g5['path'] = G5_PATH;
341행 $g5['path'] --> $g5[url] 로 변경
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
해날
8년 전
다시해보니 잘됩니다. 감사합니다. ^^
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인