모바일 테스트

This commit is contained in:
gnuboard
2013-01-16 18:57:51 +09:00
parent 7f7a9dfe07
commit 199538ca17
501 changed files with 6867 additions and 0 deletions

View File

@ -0,0 +1,4 @@
<?
$g4_path = '../../..'; // common.php 의 상대 경로
include_once($g4_path.'/common.php');
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

View File

@ -0,0 +1,226 @@
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
?>
<? if (!$wr_id) {?><h1><?=$g4['title']?></h1><?}?>
<div class="bo_fx">
<div id="bo_cate">
<? if ($is_category) { ?>
<form id="fcategory" name="fcategory" method="get">
<select name="sca" onchange="location='<?=$category_location?>'+<?=strtolower($g4['charset'])=='utf-8' ? "encodeURIComponent(this.value)" : "this.value"?>;">
<option value=''>전체</option>
<?=$category_option?>
</select>
</form>
<? } ?>
<span>Total <?=number_format($total_count)?>건</span>
<?=$page?> 페이지
</div>
<fieldset id="bo_sch">
<legend>게시물 검색</legend>
<form name="fsearch" method="get">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sca" value="<?=$sca?>">
<select name="sfl" title="검색대상">
<option value="wr_subject">제목</option>
<option value="wr_content">내용</option>
<option value="wr_subject||wr_content">제목+내용</option>
<option value="mb_id,1">회원아이디</option>
<option value="mb_id,0">회원아이디(코)</option>
<option value="wr_name,1">글쓴이</option>
<option value="wr_name,0">글쓴이(코)</option>
</select>
<input name="stx" class="fieldset_input required" maxlength="15" size="15" required value="<?=stripslashes($stx)?>" title="검색어">
<input type="hidden" name="sop" value="and">
<input type="submit" class="fieldset_submit" value="검색">
</form>
</fieldset>
<? if ($rss_href || $write_href) {?>
<ul class="btn_bo_user">
<? if ($rss_href) { ?><li><a href="<?=$rss_href?>" class="btn02">RSS</a></li><? } ?>
<? if ($admin_href) { ?><li><a href="<?=$admin_href?>" class="btn03">관리자</a></li><? } ?>
<? if ($write_href) { ?><li><a href="<?=$write_href?>" class="btn01">글쓰기</a></li><? } ?>
</ul>
<? } ?>
</div>
<!-- 게시판 목록 시작 -->
<form id="fboardlist" name="fboardlist" method="post" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);">
<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="">
<table id="bo_list">
<caption><?=$board['bo_subject']?> 목록</caption>
<thead>
<tr>
<th scope="col">번호</th>
<? if ($is_checkbox) { ?><th scope="col"><input type="checkbox" onclick="if (this.checked) all_checked(true); else all_checked(false);"></th><?}?>
<th scope="col">제목</th>
<th scope="col">글쓴이</th>
<th scope="col"><?=subject_sort_link('wr_datetime', $qstr2, 1)?>날짜</a></th>
<th scope="col"><?=subject_sort_link('wr_hit', $qstr2, 1)?>조회</a></th>
<? if ($is_good) { ?><th scope="col"><?=subject_sort_link('wr_good', $qstr2, 1)?>추천</a></th><?}?>
<? if ($is_nogood) { ?><th scope="col"><?=subject_sort_link('wr_nogood', $qstr2, 1)?>비추천</a></th><?}?>
</tr>
</thead>
<tbody>
<?
for ($i=0; $i<count($list); $i++) {
?>
<tr<? if ($list[$i]['is_notice']) echo " class=\"bo_notice\"";?>>
<td class="td_bignum">
<?
if ($list[$i]['is_notice']) // 공지사항
echo '공지';
else if ($wr_id == $list[$i]['wr_id'])
echo "<span class=\"bo_current\">열람중</span>";
else
echo $list[$i]['num'];
?>
</td>
<? if ($is_checkbox) { ?><td class="td_chk"><input type="checkbox" name="chk_wr_id[]" value="<?=$list[$i]['wr_id']?>" title="이 게시물 선택"></td><? } ?>
<td class="td_subject">
<?
echo $list[$i]['reply'];
echo $list[$i]['icon_reply'];
if ($is_category && $list[$i]['ca_name']) {
?>
<a href="<?=$list[$i]['ca_name_href']?>" class="bo_cate_link<? if ($wr_id == $list[$i]['wr_id']) echo " bo_current";?>"><?=$list[$i]['ca_name']?></a>
<? } ?>
<a href="<?=$list[$i]['href']?>"<? if ($wr_id == $list[$i]['wr_id']) echo " class=\"bo_current\"";?>>
<?=$list[$i]['subject']?>
<? if ($list[$i]['comment_cnt']) { ?><?=$list[$i]['comment_cnt'];?><? } ?>
</a>
<?
// if ($list[$i]['link']['count']) { echo '['.$list[$i]['link']['count']}.']'; }
// if ($list[$i]['file']['count']) { echo '<'.$list[$i]['file']['count'].'>'; }
if (isset($list[$i]['icon_new'])) echo $list[$i]['icon_new'];
if (isset($list[$i]['icon_file'])) echo $list[$i]['icon_file'];
if (isset($list[$i]['icon_link'])) echo $list[$i]['icon_link'];
if (isset($list[$i]['icon_hot'])) echo $list[$i]['icon_hot'];
if (isset($list[$i]['icon_secret'])) echo $list[$i]['icon_secret'];
?>
</td>
<td class="td_name"><div><?=$list[$i]['name']?></div></td>
<td class="td_date"><?=$list[$i]['datetime2']?></td>
<td class="td_num"><?=$list[$i]['wr_hit']?></td>
<? if ($is_good) { ?><td class="td_num"><?=$list[$i]['wr_good']?></td><? } ?>
<? if ($is_nogood) { ?><td class="td_num"><?=$list[$i]['wr_nogood']?></td><? } ?>
</tr>
<?}?>
<? if (count($list) == 0) { echo '<tr><td colspan="'.$colspan.'" class="empty_table">게시물이 없습니다.</td></tr>'; } ?>
</tbody>
</table>
<div class="bo_fx">
<ul class="btn_bo_adm">
<? if ($list_href) { ?>
<li><a href="<?=$list_href?>" class="btn02">목록</a></li>
<? } ?>
<? if ($is_checkbox) { ?>
<li><input type="submit" name="btn_submit" class="btn02" onclick="document.pressed=this.value" value="선택삭제"></li>
<li><input type="submit" name="btn_submit" class="btn02" onclick="document.pressed=this.value" value="선택복사"></li>
<li><input type="submit" name="btn_submit" class="btn02" onclick="document.pressed=this.value" value="선택이동"></li>
<? } ?>
</ul>
<ul class="btn_bo_user">
<li><? if ($write_href) { ?><a href="<?=$write_href?>" class="btn01">글쓰기</a><? } ?></li>
</ul>
</div>
</form>
<noscript>
<p>자바스크립트를 사용하지 않는 경우<br>별도의 확인 절차 없이 바로 선택삭제 처리하므로 주의하시기 바랍니다.</p>
</noscript>
<!-- 페이지 -->
<div class="pg">
<? if ($prev_part_href) { echo '<a href="'.$prev_part_href.'">이전검색</a>'; } ?>
<?=$write_pages?>
<? if ($next_part_href) { echo '<a href="'.$next_part_href.'">다음검색</a>'; } ?>
</div>
<script>
<? if ($sca) { echo "document.fcategory.sca.value = \"$sca\";"; } ?>
<? if ($stx) { echo "document.fsearch.sfl.value = \"$sfl\";"; } ?>
</script>
<? if ($is_checkbox) { ?>
<script>
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 fboardlist_submit(f) {
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(document.pressed + "할 게시물을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택복사") {
select_copy("copy");
return;
}
if(document.pressed == "선택이동") {
select_copy("move");
return;
}
if(document.pressed == "선택삭제") {
if (!confirm("선택한 게시물을 정말 삭제하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다"))
return false;
}
return true;
}
// 선택한 게시물 복사 및 이동
function select_copy(sw) {
var f = document.fboardlist;
if (sw == 'copy')
str = "복사";
else
str = "이동";
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->

View File

@ -0,0 +1,188 @@
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<p id="bo_v_title"><strong><?=$board['bo_subject']?></strong></p>
<div id="bo_v">
<h1 id="bo_v_h1"><?=cut_hangul_last(get_text($view['wr_subject']))?></h1>
<section id="bo_v_info">
<h2>게시물 정보</h2>
<dl>
<? if ($is_category) { ?>
<dt>분류</dt>
<dd><?=($category_name ? "{$view['ca_name']} " : "");?></dd>
<? } ?>
<dt>작성자</dt>
<dd><div><?=$view['name']?><? if ($is_ip_view) { echo "&nbsp;($ip)"; } ?></div></dd>
<dt>작성일</dt>
<dd><?=date("y-m-d H:i", strtotime($view['wr_datetime']))?></dd>
<dt>조회</dt>
<dd><?=number_format($view['wr_hit'])?>회</dd>
<dt>댓글</dt>
<dd><?=number_format($view['wr_comment'])?>건</dd>
</dl>
</section>
<? if (!empty($view['file'])) {?>
<section id="bo_v_file">
<h2>첨부파일</h2>
<ul>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view['file']); $i++) {
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) {
$cnt++;
if($board['bo_download_point'] < 0) {
$view['file'][$i]['confirm_href'] = str_replace("download.php", "downloadconfirm.php", $view['file'][$i]['href']);
} else {
$view['file'][$i]['confirm_href'] = $view['file'][$i]['href'];
}
?>
<li>
<a href="<? echo $view['file'][$i]['confirm_href']; ?>" onclick="javascript:file_download('<?=$view['file'][$i]['href']?>', '<?=$view['file'][$i]['source']?>'); return false;">
<span><?=$view['file'][$i]['source']?> (<?=$view['file'][$i]['size']?>)</span>
<span class="bo_v_file_cnt"><?=$view['file'][$i]['download']?></span>
<span>DATE : <?=$view['file'][$i]['datetime']?></span>
</a>
</li>
<?
}
}
?>
</ul>
</section>
<? } ?>
<? if (!empty($view['link'])) {?>
<section id="bo_v_link">
<h2>관련링크</h2>
<ul>
<?
// 링크
$cnt = 0;
for ($i=1; $i<=$g4['link_count']; $i++) {
if ($view['link'][$i]) {
$cnt++;
$link = cut_str($view['link'][$i], 70);
?>
<li>
<a href="<?=$view['link_href'][$i]?>" target="_blank">
<span><?=$link?></span>
<span class="bo_v_link_cnt"><?=$view['link_hit'][$i]?>회 연결</span>
</a>
</li>
<?
}
}
?>
</ul>
</section>
<? } ?>
<aside id="bo_v_top">
<h2>게시물 상단 링크</h2>
<?
ob_start();
?>
<ul class="bo_v_com">
<? if ($update_href) { ?><li><a href="<?=$update_href?>" class="btn02">수정</a></li><? } ?>
<? if ($delete_href) { ?><li><a href="<?=$delete_href?>" onclick="del(this.href); return false;" class="btn02">삭제</a></li><? } ?>
<? if ($copy_href) { ?><li><a href="<?=$copy_href?>" onclick="board_move(this.href); return false;" class="btn03">복사</a></li><? } ?>
<? if ($move_href) { ?><li><a href="<?=$move_href?>" onclick="board_move(this.href); return false;" class="btn03">이동</a></li><? } ?>
<? if ($search_href) { ?><li><a href="<?=$search_href?>" class="btn02">검색</a></li><? } ?>
<li><a href="<?=$list_href?>" class="btn02">목록</a></li>
<? if ($reply_href) { ?><li><a href="<?=$reply_href?>" class="btn02">답변</a></li><? } ?>
<? if ($write_href) { ?><li><a href="<?=$write_href?>" class="btn01">글쓰기</a></li><? } ?>
</ul>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</aside>
<article id="bo_v_atc">
<header>
<h1>본문</h1>
</header>
<div>
<?
// 파일 출력
for ($i=0; $i<=count($view['file']); $i++) {
if (isset($view['file'][$i]['view']) && $view['file'][$i]['view'])
echo $view['file'][$i]['view'];
}
?>
</div>
<p><?=$view['content'];?></p>
<?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
<? if ($is_signature) { ?><p><?=$signature?></p><? } ?>
<? if ($scrap_href || $good_href || $nogood_href) { ?>
<div id="bo_v_act">
<? if ($scrap_href) { ?><a href="<? echo $scrap_href; ?>" onclick="win_scrap(this.href); return false;" target="_blank" class="btn02">스크랩</a><? } ?>
<? if ($good_href) {?><a href="<?=$good_href?>" class="btn02" target="hiddenframe">추천 <strong><?=number_format($view['wr_good'])?></strong></a><? } ?>
<? if ($nogood_href) {?><a href="<?=$nogood_href?>" class="btn02" target="hiddenframe">비추천 <strong><?=number_format($view['wr_nogood'])?></strong></a><? } ?>
</div>
<? } ?>
</article>
<?
// 코멘트 입출력
include_once('./view_comment.php');
?>
<aside id="bo_v_bot">
<h2>게시물 하단 링크</h2>
<? if ($prev_href || $next_href) { ?>
<ul id="bo_v_nb">
<? if ($prev_href) { ?><li><a href="<?=$prev_href?>" class="btn02">이전</a></li><? } ?>
<? if ($next_href) { ?><li><a href="<?=$next_href?>" class="btn02">다음</a></li><? } ?>
</ul>
<? } ?>
<!-- 링크 버튼 -->
<?=$link_buttons?>
</aside>
</div>
<script>
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;
}
function board_move(href)
{
window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
}
</script>
<script src="<?=$g4['path']?>/js/board.js"></script>
<!-- 게시글 보기 끝 -->
<script>
// 이미지 등비율 리사이징
$(document).ready(function(){
var img = $('#bo_v_atc img');
var img_org_width = img.width();
$(window).resize(function(){
var wrapper_width = $('#bo_v_atc').width();
img.each(function() {
var img_width = $(this).width();
if (img_width > wrapper_width) {
$(this).addClass('img_fix');
} else if (img_width <= wrapper_width && img_width >= img_org_width) {
$(this).removeClass('img_fix');
}
});
}).resize();
});
</script>

View File

@ -0,0 +1,256 @@
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<script>
// 글자수 제한
var char_min = parseInt(<?=$comment_min?>); // 최소
var char_max = parseInt(<?=$comment_max?>); // 최대
</script>
<!-- 댓글 리스트 -->
<section id="bo_vc">
<h2>댓글</h2>
<?
for ($i=0; $i<count($list); $i++) {
$comment_id = $list[$i]['wr_id'];
$comment_depth = strlen($list[$i]['wr_comment_reply']);
if (strstr($list[$i]['wr_option'], "secret")) echo '비밀글';
$str = $list[$i]['content'];
if (strstr($list[$i]['wr_option'], "secret"))
$str = $str;
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
// FLASH XSS 공격에 의해 주석 처리 - 110406
//$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\"\s*[^\>]*\>[^\s]*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
?>
<article id="c_<?=$comment_id?>">
<header>
<h1><?=$list[$i]['name']?><span class="sound_only">님의 댓글</span></h1>
<dl class="bo_vc_info">
<? if ($is_ip_view) { ?>
<dt>아이피</dt>
<dd><?=$list[$i]['ip'];?></dd>
<? } ?>
<dt>작성일</dt>
<dd><time datetime="<?=date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime']))?>"><?=$list[$i]['datetime']?></time></dd>
</dl>
</header>
<!-- 댓글 출력 -->
<p><?=$str?></p>
<span id="edit_<?=$comment_id?>"></span><!-- 수정 -->
<span id="reply_<?=$comment_id?>"></span><!-- 답변 -->
<input type="hidden" id="secret_comment_<?=$comment_id?>" value="<?=strstr($list[$i]['wr_option'],"secret")?>">
<textarea id="save_comment_<?=$comment_id?>" style="display:none"><?=get_text($list[$i]['content1'], 0)?></textarea>
<? if($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) { ?>
<footer>
<ul class="bo_vc_act">
<? if ($list[$i]['is_reply']) { ?><li><a href="javascript:comment_box('<?=$comment_id?>', 'c');">답변</a></li><? } ?>
<? if ($list[$i]['is_edit']) { ?><li><a href="javascript:comment_box('<?=$comment_id?>', 'cu');">수정</a></li><? } ?>
<? if ($list[$i]['is_del']) { ?><li><a href="javascript:comment_delete('<?=$list[$i]['del_link']?>');">삭제</a></li><? } ?>
</ul>
</footer>
<? } ?>
</article>
<?}?>
<? if ($is_comment_write) { ?>
<form name="fviewcomment" method="post" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" autocomplete="off">
<input type="hidden" id="w" name="w" value="c">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="wr_id" value="<?=$wr_id?>">
<input type="hidden" id="comment_id" name="comment_id" value="">
<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="page" value="<?=$page?>">
<input type="hidden" name="is_good" value="">
<aside id="bo_vc_w">
<h2>댓글쓰기</h2>
<fieldset id="bo_vc_winfo">
<legend class="sound_only">작성자</legend>
<? if ($is_guest) { ?>
<label for="wr_name">이름</label> <input type="text" id="wr_name" name="wr_name" class="fieldset_input required" maxLength="20" size="5" required>
<label for="wr_password">패스워드</label> <input type="password" id="wr_password" name="wr_password" class="fieldset_input required" maxLength="20" size="10" required>
<? } ?>
<input type="checkbox" id="wr_secret" name="wr_secret" value="secret">
<label for="wr_secret">비밀글</label>
</fieldset>
<? echo $captcha_html; ?>
<? if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><?}?>
<div id="bo_vc_warea">
<textarea id="wr_content" name="wr_content" required
<? if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?>></textarea>
<? if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><?}?>
<input type="submit" class="bo_vc_submit" value="댓글입력">
</div>
</aside>
</form>
<script>
var save_before = '';
var save_html = document.getElementById('bo_vc_w').innerHTML;
function good_and_write()
{
var f = document.fviewcomment;
if (fviewcomment_submit(f)) {
f.is_good.value = 1;
f.submit();
} else {
f.is_good.value = 0;
}
}
function fviewcomment_submit(f)
{
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
f.is_good.value = 0;
/*
var s;
if (s = word_filter_check(document.getElementById('wr_content').value))
{
alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
document.getElementById('wr_content').focus();
return false;
}
*/
var subject = "";
var content = "";
$.ajax({
url: bbs_path+"/filter.ajax.php",
type: "POST",
data: {
"subject": "",
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
f.wr_content.focus();
return false;
}
// 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, "");
if (char_min > 0 || char_max > 0)
{
check_byte('wr_content', 'char_count');
var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt)
{
alert("댓글는 "+char_min+"글자 이상 쓰셔야 합니다.");
return false;
} else if (char_max > 0 && char_max < cnt)
{
alert("댓글는 "+char_max+"글자 이하로 쓰셔야 합니다.");
return false;
}
}
else if (!document.getElementById('wr_content').value)
{
alert("댓글를 입력하여 주십시오.");
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;
}
}
<? echo chk_captcha_js(); ?>
return true;
}
function comment_box(comment_id, work)
{
var el_id;
// 댓글 아이디가 넘어오면 답변, 수정
if (comment_id)
{
if (work == 'c')
el_id = 'reply_' + comment_id;
else
el_id = 'edit_' + comment_id;
}
else
el_id = 'bo_vc_w';
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;
if (typeof char_count != 'undefined')
check_byte('wr_content', 'char_count');
if (document.getElementById('secret_comment_'+comment_id).value)
document.getElementById('wr_secret').checked = true;
else
document.getElementById('wr_secret').checked = false;
}
document.getElementById('comment_id').value = comment_id;
document.getElementById('w').value = work;
save_before = el_id;
}
if (typeof(wrestInitialized) != 'undefined')
wrestInitialized();
}
function comment_delete(url)
{
if (confirm("이 댓글를 삭제하시겠습니까?")) location.href = url;
}
comment_box('', 'c'); // 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
</script>
<? } ?>
</section>

View File

@ -0,0 +1,232 @@
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<h1><?=$g4['title']?></h1>
<form id="fwrite" name="fwrite" method="post" action="<?=$action_url?>" onsubmit="return fwrite_submit(this);" enctype="multipart/form-data" autocomplete="off">
<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?>">
<?
$option = '';
$option_hidden = '';
if ($is_notice || $is_html || $is_secret || $is_mail) {
$option = '';
if ($is_notice) {
$option .= PHP_EOL.'<input type="checkbox" id="notice" name="notice" value="1" '.$notice_checked.'>'.PHP_EOL.'<label for="notice">공지</label>';
}
if ($is_html) {
if ($is_dhtml_editor) {
$option_hidden .= '<input type="hidden" value="html1" name="html">';
} else {
$option .= PHP_EOL.'<input type="checkbox" id="html" name="html" onclick="html_auto_br(this);" value="'.$html_value.'" '.$html_checked.'>'.PHP_EOL.'<label for="html">html</label>';
}
}
if ($is_secret) {
if ($is_admin || $is_secret==1) {
$option .= PHP_EOL.'<input type="checkbox" id="secret" name="secret" value="secret" '.$secret_checked.'>'.PHP_EOL.'<label for="secret">비밀글</label>';
} else {
$option_hidden .= '<input type="hidden" name="secret" value="secret">';
}
}
if ($is_mail) {
$option .= PHP_EOL.'<input type="checkbox" name="mail" value="mail" '.$recv_email_checked.'>'.PHP_EOL.'<label for="mail">답변메일받기</label>';
}
}
echo $option_hidden;
?>
<table id="bo_w" class="frm_tbl">
<tbody>
<? if ($is_name) { ?>
<tr>
<th scope="row"><label for="wr_name">이름</label></th>
<td><input type="text" id="wr_name" name="wr_name" class="frm_input required" size="10" maxlength="20" required value="<?=$name?>" title="이름"></td>
</tr>
<? } ?>
<? if ($is_password) { ?>
<tr>
<th scope="row"><label for="wr_password">패스워드</label></th>
<td><input type="password" id="wr_password" name="wr_password" class="frm_input" maxlength="20" <?=$password_required?>></td>
</tr>
<? } ?>
<? if ($is_email) { ?>
<tr>
<th scope="row"><label for="wr_email">이메일</label></th>
<td><input type="text" id="wr_email" name="wr_email" class="frm_input email" size="50" value="<?=$email?>" maxlength="100"></td>
</tr>
<? } ?>
<? if ($is_homepage) { ?>
<tr>
<th scope="row"><label for="wr_homepage">홈페이지</label></th>
<td><input type="text" id="wr_homepage" name="wr_homepage" class="frm_input" size="50" value="<?=$homepage?>"></td>
</tr>
<? } ?>
<? if ($option) { ?>
<tr>
<th scope="row">옵션</th>
<td><?=$option?></td>
</tr>
<? } ?>
<? if ($is_category) { ?>
<tr>
<th scope="row"><label for="ca_name">분류</label></th>
<td>
<select id="ca_name" name="ca_name" class="required" required>
<option value="">선택하세요</option>
<?=$category_option?>
</select>
</td>
</tr>
<? } ?>
<tr>
<th scope="row"><label for="wr_subject">제목</label></th>
<td><input type="text" id="wr_subject" name="wr_subject" class="frm_input required" size="50" required value="<?=$subject?>" title="제목"></td>
</tr>
<tr>
<th scope="row"><label for="wr_content">내용</label></th>
<td><?=editor_html("wr_content", $content);?></td>
</tr>
<? for ($i=1; $is_link && $i<=$g4['link_count']; $i++) { ?>
<tr>
<th scope="row"><label for="wr_link<?=$i?>">링크 #<?=$i?></label></th>
<td><input type="text" id="wr_link<?=$i?>" name="wr_link<?=$i?>" class="frm_input" size="50" value="<?if($w=="u"){echo$write['wr_link'.$i];}?>"></td>
</tr>
<? } ?>
<? for ($i=1; $is_file && $i<=$file_count; $i++) { ?>
<tr>
<th scope="row">파일 #<?=$i?></th>
<td>
<input type="file" name="bf_file[]" class="frm_input" title="파일 용량 <?=$upload_max_filesize?> 이하만 업로드 가능">
<? if ($is_file_content) { ?>
<input type="text" name="bf_content[]" class="frm_input" size="50" title="파일 설명을 입력해주세요.">
<?}?>
</td>
</tr>
<?}?>
<? if ($is_guest) { //자동등록방지 ?>
<tr>
<th scope="row">자동등록방지</th>
<td>
<?=$captcha_html?>
</td>
</tr>
<? } ?>
</tbody>
</table>
<div class="btn_confirm">
<input type="submit" id="btn_submit" class="btn_submit" value="글쓰기" accesskey="s">
<a href="./board.php?bo_table=<?=$bo_table?>" class="btn_cancel" title="글쓰기를 취소하고 목록으로 돌아가기">목록</a>
</div>
</form>
<script>
<?
// 관리자라면 분류 선택에 '공지' 옵션을 추가함
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 = "<?=isset($write['ca_name'])?$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_submit(f)
{
<? echo get_editor_js('wr_content'); ?>
<? echo chk_editor_js('wr_content'); ?>
var subject = "";
var content = "";
$.ajax({
url: g4_bbs_path+"/filter.ajax.php",
type: "POST",
data: {
"subject": f.wr_subject.value,
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (subject) {
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
f.wr_subject.focus();
return false;
}
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
if (typeof(ed_wr_content) != "undefined")
ed_wr_content.returnFalse();
else
f.wr_content.focus();
return false;
}
<? if ($is_guest) { echo chk_captcha_js(); } ?>
return true;
}
</script>