This commit is contained in:
Amberstone 2024-10-22 17:57:41 +09:00
parent 75ea133f82
commit c9b65efbf3
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
10 changed files with 197 additions and 179 deletions

View file

@ -1,2 +1,2 @@
<?php <?php
include_once('../../../common.php'); include_once '../../../common.php';

View file

@ -1,8 +1,8 @@
<? <?php
if (!defined('_GNUBOARD_')) if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가 exit;
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
include_once(G5_LIB_PATH . '/thumbnail.lib.php'); include_once G5_LIB_PATH . '/thumbnail.lib.php';
if ($board['bo_table_width'] == 0) if ($board['bo_table_width'] == 0)
$width = "100%"; $width = "100%";
@ -10,12 +10,12 @@ $cate = array();
$lists = array(); $lists = array();
?> ?>
<div class="board-skin-basic theme-box" style="max-width:<?= $width ?>;"> <div class="board-skin-basic theme-box" style="max-width:<?= $width ?>;">
<? if ($board['bo_content_head']) { ?> <?php if ($board['bo_content_head']) { ?>
<div class="content_head"> <div class="content_head">
<?= stripslashes($board['bo_content_head']); ?> <?= stripslashes($board['bo_content_head']); ?>
</div> </div>
<? } ?> <?php } ?>
<? <?php
if ($is_category) { if ($is_category) {
$cate = explode('|', $board['bo_category_list']); $cate = explode('|', $board['bo_category_list']);
} }
@ -29,10 +29,11 @@ $lists = array();
} }
?> ?>
<div class="bo_list"> <div class="bo_list">
<? if ($is_category) { ?> <?php if ($is_category) { ?>
<h2><?= $cate[$h] ?></h2><? } ?> <h2><?= $cate[$h] ?></h2>
<?php } ?>
<ul class="list_box"> <ul class="list_box">
<? <?php
if (count($lists) > 0) { if (count($lists) > 0) {
for ($i = 0; $i < count($lists); $i++) { for ($i = 0; $i < count($lists); $i++) {
// 수정, 삭제 링크 // 수정, 삭제 링크
@ -53,53 +54,64 @@ $lists = array();
if (($lists[$i]['ca_name'] != $cate[$h]) || ($sca && $lists[$i]['ca_name'] != $sca)) if (($lists[$i]['ca_name'] != $cate[$h]) || ($sca && $lists[$i]['ca_name'] != $sca))
continue; continue;
} }
$_link = $lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);";
$_secret = strstr($lists[$i]['wr_option'], 'secret') ? " secret" : "";
$_extraattr = "style=\"cursor:default;\" onclick=\"return false;\" ";
?> ?>
<li class="bo-list"> <li class="bo-list">
<a href="<?= $lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);" ?>" target="_blank" <a href="<?= $_link ?>" target="_blank" class="link-banner<?= $_secret ?>" <?= !$lists[$i]['wr_link2'] ? $_extraattr : "" ?>>
class="link-banner <? if (strstr($lists[$i]['wr_option'], 'secret')) <?php if ($lists[$i]['wr_link1']) { ?>
echo "secret"; ?>" <img src="<?= $lists[$i]['wr_link1'] ?>" alt="<?= $lists[$i]['wr_1'] ?>">
<? if (!$lists[$i]['wr_link2']) { ?>style="cursor:default;" onclick="return false;" <? } ?>> <?php } else { ?>
<? if ($lists[$i]['wr_link1']) { ?><img src="<?= $lists[$i]['wr_link1'] ?>" <strong><?= $lists[$i]['wr_1'] ?></strong>
alt="<?= $lists[$i]['wr_1'] ?>"><? } else { ?><strong><?= $lists[$i]['wr_1'] ?></strong><? } ?> <?php } ?>
</a> </a>
<p class="link-desc"> <p class="link-desc">
<? if ($lists[$i]['wr_1'] && $lists[$i]['wr_link1']) { ?> <?php if ($lists[$i]['wr_1'] && $lists[$i]['wr_link1']) {
<a href="<?= $lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);" ?>" target="_blank" ?>
<? if (!$lists[$i]['wr_link2']) { ?>style="cursor:default;" onclick="return false;" <? } ?> class="name"> <a href="<?= $link ?>" target="_blank" <?= !$lists[$i]['wr_link2'] ? $_extraattr : "" ?>class="name">
<strong> <strong>
<?= $lists[$i]['wr_1'] ?> <?= $lists[$i]['wr_1'] ?>
</strong> </strong>
</a> </a>
<? } ?> <?php } ?>
<? if ($update_href || $delete_href) { ?> <?php if ($update_href || $delete_href) { ?>
<span class="options"> <span class="options">
<? if ($update_href) { ?><a href="<?= $update_href ?>">*</a><? } ?> <?php if ($update_href) { ?><a href="<?= $update_href ?>">*</a><?php } ?>
<? if ($delete_href) { ?><a href="<?= $delete_href ?>">-</a><? } ?> <?php if ($delete_href) { ?><a href="<?= $delete_href ?>">-</a><?php } ?>
</span> </span>
<? } ?> <?php } ?>
</p> </p>
</li><? } </li><?php }
} ?></ul> } ?>
</ul>
</div> </div>
<? } ?> <?php } ?>
<?php if ($board['bo_content_tail']) { ?>
<? if ($board['bo_content_tail']) { ?>
<div class="content_head"> <div class="content_head">
<?= stripslashes($board['bo_content_tail']); ?> <?= stripslashes($board['bo_content_tail']); ?>
</div> </div>
<? } ?> <?php } ?>
<? if ($list_href || $is_checkbox || $write_href) { ?> <?php if ($list_href || $is_checkbox || $write_href) { ?>
<div class="bo_fx txt-right" style="padding: 20px 0;"> <div class="bo_fx txt-right" style="padding: 20px 0;">
<? if ($list_href || $write_href) { ?> <?php if ($list_href || $write_href) { ?>
<? if ($list_href) { ?><a href="<? echo $list_href ?>" class="ui-btn">목록</a><? } ?> <?php if ($list_href) { ?><a href="<?php echo $list_href ?>" class="ui-btn">목록</a>
<? if ($write_href) { ?> <?php } ?>
<a href="<? echo $write_href ?>" class="ui-btn point">링크 추가</a><? } ?> <?php if ($write_href) { ?>
<? } ?> <a href="<?php echo $write_href ?>" class="ui-btn point">링크 추가</a>
<? if ($admin_href) { ?> <?php } ?>
<a href="<?= $board_skin_url ?>/set_order.php?bo_table=<?= $bo_table ?>&write_table=<?= $write_table ?>" class="ui-btn">링크 <?php } ?>
관리</a> <?php if ($admin_href) { ?>
<a href="<?= $admin_href ?>" class="ui-btn admin">관리자</a><? } ?> <a href="<?= $board_skin_url ?>/set_order.php?bo_table=<?= $bo_table ?>&write_table=<?= $write_table ?>"
class="ui-btn">링크
관리
</a>
<a href="<?= $admin_href ?>" class="ui-btn admin">
관리자
</a>
<?php } ?>
</div>
<?php } ?>
</div> </div>
<? } ?> </div>
<!-- } 게시판 목록 --> <!-- } 게시판 목록 -->

19
readme.md Normal file
View file

@ -0,0 +1,19 @@
## 링크 게시판 스킨
작성자: 대하 (Extra Shot)
원본주소: https://extrashot.tistory.com/59
오류 수정 및 일부 코드에 최적화 작업을 진행했습니다.
### 주요 수정 사항
- short open tag 제거
모든 아보카도 버전에 호환됩니다.
## 설치방법
아보카도가 설치된 폴더의 하위 폴더인 `skin/board/``link` 라는 폴더를 생성하고 파일을 업로드합니다.
```
php 최소 버전: 5.6 이상 (5.3부터 사용 가능)
```

View file

@ -1,6 +1,6 @@
<?php <?php
include_once("./_common.php"); include_once "./_common.php";
include_once(G5_PATH . "/head.sub.php"); include_once G5_PATH . "/head.sub.php";
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
if ($board['bo_write_level'] <= $member['mb_level']) { if ($board['bo_write_level'] <= $member['mb_level']) {
?> ?>
@ -10,8 +10,9 @@ if ($board['bo_write_level'] <= $member['mb_level']) {
<div style="max-width:1000px;margin:10px auto;"> <div style="max-width:1000px;margin:10px auto;">
<table class="theme-form"> <table class="theme-form">
<colgroup> <colgroup>
<? if ($board['bo_use_category'] && $board['bo_category_list']) { ?> <?php if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
<col style="width:100px;"><? } ?> <col style="width:100px;">
<?php } ?>
<col style="width:150px;"> <col style="width:150px;">
<col> <col>
<col> <col>
@ -19,39 +20,47 @@ if ($board['bo_write_level'] <= $member['mb_level']) {
</colgroup> </colgroup>
<tbody> <tbody>
<tr> <tr>
<? if ($board['bo_use_category'] && $board['bo_category_list']) { ?> <?php if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
<th>카테고리</th><? } ?> <th>카테고리</th>
<?php } ?>
<th>제목</th> <th>제목</th>
<th>배너</th> <th>배너</th>
<th>링크</th> <th>링크</th>
<th>순서</th> <th>순서</th>
</tr> </tr>
<? <?php
$order = sql_query("select * from {$write_table} order by wr_10*1, wr_id"); $order = sql_query("select * from {$write_table} order by wr_10*1, wr_id");
for ($i = 0; $row = sql_fetch_array($order); $i++) { ?> for ($i = 0; $row = sql_fetch_array($order); $i++) { ?>
<tr> <tr>
<? if ($board['bo_use_category'] && $board['bo_category_list']) { ?> <?php if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
<td><select name="category[<?= $row['wr_id'] ?>]"> <td>
<select name="category[<?= $row['wr_id'] ?>]">
<option value="">카테고리</option> <option value="">카테고리</option>
<? $cate = explode('|', $board['bo_category_list']); <?php
$cate = explode('|', $board['bo_category_list']);
for ($h = 0; $h < count($cate); $h++) { ?> for ($h = 0; $h < count($cate); $h++) { ?>
<option value="<?= $cate[$h] ?>" <?= $row['ca_name'] == $cate[$h] ? "selected" : ""; ?>><?= $cate[$h] ?> <option value="<?= $cate[$h] ?>" <?= $row['ca_name'] == $cate[$h] ? "selected" : ""; ?>>
<?= $cate[$h] ?>
</option> </option>
<? } ?> <?php } ?>
</select><? } ?> </select>
<?php } ?>
</td> </td>
<td><input type="text" name="subject[<?= $row['wr_id'] ?>]" value="<?= $row['wr_1'] ?>" style="width:100%;"> <td>
<input type="text" name="subject[<?= $row['wr_id'] ?>]" value="<?= $row['wr_1'] ?>" style="width:100%;">
</td> </td>
<td><input type="text" name="banner[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link1'] ?>" <td>
style="width:100%;"> <input type="text" name="banner[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link1'] ?>" style="width:100%;">
</td> </td>
<td><input type="text" name="link[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link2'] ?>" style="width:100%;"> <td>
<input type="text" name="link[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link2'] ?>" style="width:100%;">
</td> </td>
<td><input type="text" name="order[<?= $row['wr_id'] ?>]" value="<?= $row['wr_10'] ?>" size="4"> <td>
<input type="text" name="order[<?= $row['wr_id'] ?>]" value="<?= $row['wr_10'] ?>" size="4">
<input type="hidden" name="idx[]" value="<?= $row['wr_id'] ?>"> <input type="hidden" name="idx[]" value="<?= $row['wr_id'] ?>">
</td> </td>
</tr> </tr>
<? } ?> <?php } ?>
</tbody> </tbody>
</table> </table>
<br> <br>
@ -61,4 +70,4 @@ if ($board['bo_write_level'] <= $member['mb_level']) {
</div> </div>
</div> </div>
</form> </form>
<? } ?> <?php } ?>

View file

@ -1,5 +1,5 @@
<?php <?php
include_once("./_common.php"); include_once "./_common.php";
for ($i = 0; $i < count($idx); $i++) { for ($i = 0; $i < count($idx); $i++) {
$k = $idx[$i]; $k = $idx[$i];
@ -14,4 +14,5 @@ for ($i = 0; $i < count($idx); $i++) {
sql_query("update {$write_table} set ca_name='{$category[$k]}' where wr_id='{$k}'"); sql_query("update {$write_table} set ca_name='{$category[$k]}' where wr_id='{$k}'");
} }
} }
goto_url('./set_order.php?bo_table=' . $bo_table . '&write_table=' . $write_table); goto_url('./set_order.php?bo_table=' . $bo_table . '&write_table=' . $write_table);

View file

@ -1,7 +1,7 @@
<? <?php
if (!defined("_GNUBOARD_")) if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가 exit;
include_once(G5_LIB_PATH . '/thumbnail.lib.php'); include_once G5_LIB_PATH . '/thumbnail.lib.php';
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 // add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
@ -9,15 +9,15 @@ if ($board['bo_table_width'] == 0)
$width = "100%"; ?> $width = "100%"; ?>
<!-- 링크 버튼 시작 { --> <!-- 링크 버튼 시작 { -->
<div id="bo_v_bot"> <div id="bo_v_bot">
<? ob_start(); ?> <?php ob_start(); ?>
<div class="bo_v_com"> <div class="bo_v_com">
<a href="<? echo $list_href ?>" class="ui-btn left">목록</a> <a href="<?php echo $list_href ?>" class="ui-btn left">목록</a>
<? if ($update_href) { ?><a href="<? echo $update_href ?>" class="ui-btn">수정</a><? } ?> <?php if ($update_href) { ?><a href="<?php echo $update_href ?>" class="ui-btn">수정</a><?php } ?>
<? if ($delete_href) { ?><a href="<? echo $delete_href ?>" class="ui-btn admin" <?php if ($delete_href) { ?><a href="<?php echo $delete_href ?>" class="ui-btn admin"
onclick="del(this.href); return false;">삭제</a><? } ?> onclick="del(this.href); return false;">삭제</a><?php } ?>
<? if ($write_href) { ?><a href="<? echo $write_href ?>" class="ui-btn point">링크 추가</a><? } ?> <?php if ($write_href) { ?><a href="<?php echo $write_href ?>" class="ui-btn point">링크 추가</a><?php } ?>
</div> </div>
<? <?php
$link_buttons = ob_get_contents(); $link_buttons = ob_get_contents();
ob_end_flush(); ob_end_flush();
?> ?>
@ -26,8 +26,8 @@ if ($board['bo_table_width'] == 0)
<div class="board-viewer"> <div class="board-viewer">
<div class="contents"> <div class="contents">
<!-- 본문 내용 시작 { --> <!-- 본문 내용 시작 { -->
<div id="bo_v_con"><? echo get_view_thumbnail($view['content']); ?></div> <div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
<?//echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?> <?php //echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?>
<!-- } 본문 내용 --> <!-- } 본문 내용 -->
</div> </div>
</div> </div>

View file

@ -1,6 +1,6 @@
<? <?php
if (!defined('_GNUBOARD_')) if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가 exit;
$cmt_link = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_comment=1 and wr_parent='{$wr_id}' and wr_content!='옷장'"); $cmt_link = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_comment=1 and wr_parent='{$wr_id}' and wr_content!='옷장'");
$clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_comment=1 and wr_parent='{$wr_id}' and wr_content='옷장'"); $clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_comment=1 and wr_parent='{$wr_id}' and wr_content='옷장'");
@ -8,16 +8,16 @@ $clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_com
<div class="board-comment-view"> <div class="board-comment-view">
<script> <script>
// 글자수 제한 // 글자수 제한
var char_min = parseInt(<? echo $comment_min ?>); // 최소 var char_min = parseInt(<?php echo $comment_min ?>); // 최소
var char_max = parseInt(<? echo $comment_max ?>); // 최대 var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</script> </script>
<? <?php
if ($member['mb_level'] >= $board['bo_comment_level']) { if ($member['mb_level'] >= $board['bo_comment_level']) {
?> ?>
<div class="board-comment-list"> <div class="board-comment-list">
<? if ($cmt_link['cnt'] > 0) { ?> <?php if ($cmt_link['cnt'] > 0) { ?>
<strong>로그</strong><? } ?> <strong>로그</strong><?php } ?>
<? <?php
$cmt_amt = count($list); $cmt_amt = count($list);
for ($i = 0; $i < $cmt_amt; $i++) { for ($i = 0; $i < $cmt_amt; $i++) {
if ($list[$i]['wr_content'] == '옷장') if ($list[$i]['wr_content'] == '옷장')
@ -30,10 +30,10 @@ $clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_com
$cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결 $cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
?> ?>
<div class="item" id="c_<? echo $comment_id ?>"> <div class="item" id="c_<?php echo $comment_id ?>">
<div class="co-content"> <div class="co-content">
<div class="co-inner"> <div class="co-inner">
<? $co_links = explode(PHP_EOL, $list[$i]['wr_content']); <?php $co_links = explode(PHP_EOL, $list[$i]['wr_content']);
if (count($co_links) > 0) { if (count($co_links) > 0) {
$co_list = array(); $co_list = array();
for ($k = 0; $k < count($co_links); $k++) { for ($k = 0; $k < count($co_links); $k++) {
@ -44,9 +44,8 @@ $clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_com
} }
?> ?>
</div> </div>
<div class="co-info"> <div class="co-info">
<? if ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) { <?php if ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']); $query_string = clean_query_string($_SERVER['QUERY_STRING']);
if ($w == 'cu') { if ($w == 'cu') {
@ -59,57 +58,48 @@ $clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_com
$c_edit_href = './board.php?' . $query_string . '&amp;c_id=' . $comment_id . '&amp;w=cu#bo_vc_w'; $c_edit_href = './board.php?' . $query_string . '&amp;c_id=' . $comment_id . '&amp;w=cu#bo_vc_w';
?> ?>
<? if ($list[$i]['is_edit']) { ?><span><a <?php if ($list[$i]['is_edit']) { ?><span><a
href="javascript:comment_box('<? echo $comment_id ?>', 'cu','link');">m</a></span><? } ?> href="javascript:comment_box('<?php echo $comment_id ?>', 'cu','link');">m</a></span><?php } ?>
<? if ($list[$i]['is_del']) { ?><span><a href="<? echo $list[$i]['del_link']; ?>" <?php if ($list[$i]['is_del']) { ?><span><a href="<?php echo $list[$i]['del_link']; ?>"
onclick="return comment_delete();">d</a></span><? } ?> onclick="return comment_delete();">d</a></span><?php } ?>
<? } ?> <?php } ?>
</div> </div>
</div> </div>
<span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 -->
<span id="edit_<? echo $comment_id ?>"></span><!-- 수정 -->
</div> </div>
<input type="hidden" value="<?php echo strstr($list[$i]['wr_option'], "secret") ?>"
<input type="hidden" value="<? echo strstr($list[$i]['wr_option'], "secret") ?>" id="secret_comment_<?php echo $comment_id ?>">
id="secret_comment_<? echo $comment_id ?>"> <textarea id="save_comment_<?php echo $comment_id ?>"
<textarea id="save_comment_<? echo $comment_id ?>" style="display:none"><?php echo get_text($list[$i]['content1'], 0) ?></textarea>
style="display:none"><? echo get_text($list[$i]['content1'], 0) ?></textarea>
<input type="hidden" id="save_cl_<?= $comment_id ?>" name="bf_content"> <input type="hidden" id="save_cl_<?= $comment_id ?>" name="bf_content">
<input type="hidden" id="save_order_<?= $comment_id ?>" name="wr_10"> <input type="hidden" id="save_order_<?= $comment_id ?>" name="wr_10">
<?php } ?>
<? } ?>
</div> </div>
<?php }
<? }
if ($view['mb_id'] == $member['mb_id']) { if ($view['mb_id'] == $member['mb_id']) {
if ($w == '') if ($w == '')
$w = 'c'; $w = 'c';
?> ?>
<div class="board-clothes-list board-comment-list"> <div class="board-clothes-list board-comment-list">
<? if ($clo['cnt'] > 0) { ?> <?php if ($clo['cnt'] > 0) { ?>
<strong>옷장</strong> <strong>옷장</strong>
<? } ?> <?php } ?>
<? <?php
$clothes = sql_query("select * from {$write_table} where wr_content='옷장' and wr_parent='{$wr_id}' and wr_is_comment=1 order by wr_10 asc"); $clothes = sql_query("select * from {$write_table} where wr_content='옷장' and wr_parent='{$wr_id}' and wr_is_comment=1 order by wr_10 asc");
for ($k = 0; $cl = sql_fetch_array($clothes); $k++) { for ($k = 0; $cl = sql_fetch_array($clothes); $k++) {
$comment_id = $cl['wr_id']; $comment_id = $cl['wr_id'];
?> ?>
<div class="item" id="cl_<? echo $comment_id ?>"> <div class="item" id="cl_<?php echo $comment_id ?>">
<div class="co-content"> <div class="co-content">
<div class="co-inner"> <div class="co-inner">
<? $files = get_file($bo_table, $comment_id); <?php $files = get_file($bo_table, $comment_id);
$filelink = G5_DATA_URL . '/file/' . $bo_table . '/' . $files[0]['file']; ?> $filelink = G5_DATA_URL . '/file/' . $bo_table . '/' . $files[0]['file']; ?>
<a href="<?= $filelink ?>" target="_blank"><?= $files[0]['content'] ?></a> <a href="<?= $filelink ?>" target="_blank"><?= $files[0]['content'] ?></a>
</div> </div>
<div class="co-info"> <div class="co-info">
<? if ($member['mb_id'] == $cl['mb_id']) { <?php if ($member['mb_id'] == $cl['mb_id']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']); $query_string = clean_query_string($_SERVER['QUERY_STRING']);
if ($w == 'cu') { if ($w == 'cu') {
$sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' "; $sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";
$cmt = sql_fetch($sql); $cmt = sql_fetch($sql);
@ -132,54 +122,49 @@ $clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_com
$c_edit_href = './board.php?' . $query_string . '&amp;c_id=' . $comment_id . '&amp;w=cu#bo_cl_w'; $c_edit_href = './board.php?' . $query_string . '&amp;c_id=' . $comment_id . '&amp;w=cu#bo_cl_w';
?> ?>
<span><a href="javascript:comment_box('<? echo $comment_id ?>', 'cu', 'clo');">m</a></span> <span><a href="javascript:comment_box('<?php echo $comment_id ?>', 'cu', 'clo');">m</a></span>
<span><a href="<? echo $cl['del_link']; ?>" onclick="return comment_delete();">d</a></span> <span><a href="<?php echo $cl['del_link']; ?>" onclick="return comment_delete();">d</a></span>
<? } ?> <?php } ?>
</div> </div>
</div> </div>
<span id="edit_cl_<?php echo $comment_id ?>"></span><!-- 수정 -->
<span id="edit_cl_<? echo $comment_id ?>"></span><!-- 수정 -->
</div> </div>
<input type="hidden" value="<?php echo strstr($cl['wr_option'], "secret") ?>"
<input type="hidden" value="<? echo strstr($cl['wr_option'], "secret") ?>" id="secret_comment_<?php echo $comment_id ?>">
id="secret_comment_<? echo $comment_id ?>"> <textarea id="save_comment_<?php echo $comment_id ?>" style="display:none">옷장</textarea>
<textarea id="save_comment_<? echo $comment_id ?>" style="display:none">옷장</textarea>
<input type="hidden" id="save_cl_<?= $comment_id ?>" name="bf_content" value="<?= $files[0]['content'] ?>"> <input type="hidden" id="save_cl_<?= $comment_id ?>" name="bf_content" value="<?= $files[0]['content'] ?>">
<input type="hidden" id="save_order_<?= $comment_id ?>" name="wr_10" value="<?= $cl['wr_10'] ?>"> <input type="hidden" id="save_order_<?= $comment_id ?>" name="wr_10" value="<?= $cl['wr_10'] ?>">
<? } ?> <?php } ?>
</div> </div>
<!-- 댓글 쓰기 시작 { --> <!-- 댓글 쓰기 시작 { -->
<? if ($cmt_link['cnt'] == 0) { ?> <?php if ($cmt_link['cnt'] == 0) { ?>
<p class="txt-left add"><a href="javascript:comment_box('', 'c','link');"> 로그 링크 추가</a></p><? } ?> <p class="txt-left add"><a href="javascript:comment_box('', 'c','link');"> 로그 링크 추가</a></p><?php } ?>
<p class="add txt-right"><a href="javascript:comment_box('', 'c','clo');"> 의상 추가</a></p> <p class="add txt-right"><a href="javascript:comment_box('', 'c','clo');"> 의상 추가</a></p>
<div id="bo_vc_w" class="board-comment-write" style="display:none;"> <div id="bo_vc_w" class="board-comment-write" style="display:none;">
<form name="fviewcomment" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" <form name="fviewcomment" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);"
method="post" enctype="multipart/form-data" autocomplete="off"> method="post" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="w" value="<? echo $w ?>" id="w"> <input type="hidden" name="w" value="<?php echo $w ?>" id="w">
<input type="hidden" name="bo_table" value="<? echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<? echo $wr_id ?>"> <input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="comment_id" value="<? echo $c_id ?>" id="comment_id"> <input type="hidden" name="comment_id" value="<?php echo $c_id ?>" id="comment_id">
<input type="hidden" name="sca" value="<? echo $sca ?>"> <input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sfl" value="<? echo $sfl ?>"> <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<? echo $stx ?>"> <input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<? echo $spt ?>"> <input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="page" value="<? echo $page ?>"> <input type="hidden" name="page" value="<?php echo $page ?>">
<div class="board-comment-form"> <div class="board-comment-form">
<input type="text" name="bf_content" id="bf_content" placeholder="의상 이름" style="width:80%"><input type="text" <input type="text" name="bf_content" id="bf_content" placeholder="의상 이름" style="width:80%"><input type="text"
name="wr_10" id="wr_10" placeholder="순서" style="width:20%;"><input type="file" name="bf_file" id="bf_file" name="wr_10" id="wr_10" placeholder="순서" style="width:20%;"><input type="file" name="bf_file" id="bf_file"
class="frm_file frm_input full upload-data on"> class="frm_file frm_input full upload-data on">
<? if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><? } ?> <?php if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span
id="char_count"></span>글자</strong><?php } ?>
<textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" placeholder="제목|링크로 로그를 링크할 수 있습니다. 여러개 입력시 엔터로 구분해주세요. 예시: <textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" placeholder="제목|링크로 로그를 링크할 수 있습니다. 여러개 입력시 엔터로 구분해주세요. 예시:
링크1|http://url-1 링크1|http://url-1
링크2|http://url-2 링크2|http://url-2
링크3|http://url-3 링크3|http://url-3
..." <? if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');" <? } ?>><? echo $c_wr_content; ?></textarea> ..." <?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');" <?php } ?>><?php echo $c_wr_content; ?></textarea>
<? if ($comment_min || $comment_max) { ?> <?php if ($comment_min || $comment_max) { ?>
<script> check_byte('wr_content', 'char_count'); </script><? } ?> <script> check_byte('wr_content', 'char_count'); </script><?php } ?>
<script> <script>
$(document).on("keyup change", "textarea#wr_content[maxlength]", function () { $(document).on("keyup change", "textarea#wr_content[maxlength]", function () {
var str = $(this).val() var str = $(this).val()
@ -190,26 +175,20 @@ $clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_com
} }
}); });
</script> </script>
<p style="display:none;"><input type="checkbox" name="secret" value="1" id="secret"> <label <p style="display:none;"><input type="checkbox" name="secret" value="1" id="secret"> <label
for="secret">비밀글</label></p> for="secret">비밀글</label></p>
<div class="btn_confirm"> <div class="btn_confirm">
<button type="submit" id="btn_submit" class="ui-btn">등록</button> <button type="submit" id="btn_submit" class="ui-btn">등록</button>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<? } ?> <?php } ?>
</div> </div>
<script> <script>
var save_before = ''; var save_before = '';
var save_html = document.getElementById('bo_vc_w').innerHTML; var save_html = document.getElementById('bo_vc_w').innerHTML;
function fviewcomment_submit(f) { function fviewcomment_submit(f) {
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자 var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
@ -274,7 +253,6 @@ $clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_com
} }
} }
set_comment_token(f); set_comment_token(f);
document.getElementById("btn_submit").disabled = "disabled"; document.getElementById("btn_submit").disabled = "disabled";
@ -351,15 +329,15 @@ $clo = sql_fetch("select count(wr_id) as cnt from {$write_table} where wr_is_com
// 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님) // 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
<? if ($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?> <?php if ($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?>
// sns 등록 // sns 등록
$(function () { $(function () {
$("#bo_vc_send_sns").load( $("#bo_vc_send_sns").load(
"<? echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<? echo $bo_table; ?>", "<?php echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<?php echo $bo_table; ?>",
function () { function () {
save_html = document.getElementById('bo_vc_w').innerHTML; save_html = document.getElementById('bo_vc_w').innerHTML;
} }
); );
}); });
<? } ?> <?php } ?>
</script> </script>

View file

@ -1,6 +1,6 @@
<?php <?php
if (!defined('_GNUBOARD_')) if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가 exit;
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 // add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
@ -22,10 +22,7 @@ if ($is_category && $board['bo_category_list']) {
$category_option .= ">$categories[$i]</option>\n"; $category_option .= ">$categories[$i]</option>\n";
} }
} }
?> ?>
<hr class="padding"> <hr class="padding">
<section id="bo_w"> <section id="bo_w">
<!-- 게시물 작성/수정 시작 { --> <!-- 게시물 작성/수정 시작 { -->
@ -78,7 +75,7 @@ if ($is_category && $board['bo_category_list']) {
?> ?>
<div class="board-write theme-box"> <div class="board-write theme-box">
<? if ($is_category) { ?> <?php if ($is_category) { ?>
<dl> <dl>
<dt style="line-height:150%;">카테고리</dt> <dt style="line-height:150%;">카테고리</dt>
<dd><select name="ca_name" id="ca_name" required class="required"> <dd><select name="ca_name" id="ca_name" required class="required">
@ -87,7 +84,7 @@ if ($is_category && $board['bo_category_list']) {
</select> </select>
</dd> </dd>
</dl> </dl>
<? } ?> <?php } ?>
<dl> <dl>
<dt>제목</dt> <dt>제목</dt>
<dd> <dd>
@ -125,14 +122,12 @@ if ($is_category && $board['bo_category_list']) {
</dd> </dd>
</dl> </dl>
</div> </div>
<hr class="padding" /> <hr class="padding" />
<div class="btn_confirm txt-center"> <div class="btn_confirm txt-center">
<input type="submit" value="작성완료" id="btn_submit" accesskey="s" class="btn_submit ui-btn point"> <input type="submit" value="작성완료" id="btn_submit" accesskey="s" class="btn_submit ui-btn point">
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel ui-btn">취소</a> <a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel ui-btn">취소</a>
</div> </div>
</form> </form>
<script> <script>
<?php if ($write_min || $write_max) { ?> <?php if ($write_min || $write_max) { ?>
// 글자수 제한 // 글자수 제한
@ -140,7 +135,6 @@ if ($is_category && $board['bo_category_list']) {
var char_max = parseInt(<?php echo $write_max; ?>); // 최대 var char_max = parseInt(<?php echo $write_max; ?>); // 최대
check_byte("wr_content", "char_count"); check_byte("wr_content", "char_count");
$(function () { $(function () {
$("#wr_content").on("keyup", function () { $("#wr_content").on("keyup", function () {
check_byte("wr_content", "char_count"); check_byte("wr_content", "char_count");
@ -162,7 +156,10 @@ if ($is_category && $board['bo_category_list']) {
} }
function fwrite_submit(f) { function fwrite_submit(f) {
<?php echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함 ?> <?php
// 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함
echo $editor_js;
?>
var subject = ""; var subject = "";
var content = ""; var content = "";
@ -214,6 +211,7 @@ if ($is_category && $board['bo_category_list']) {
return true; return true;
} }
$(".wr_8").on("change", function () { $(".wr_8").on("change", function () {
if ($(this).val() == 'wr_1') { if ($(this).val() == 'wr_1') {
$("#crop").css("display", "block"); $("#crop").css("display", "block");

View file

@ -3,17 +3,17 @@
* @var string|int $bf_content * @var string|int $bf_content
*/ */
if (!defined("_GNUBOARD_")) if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가 exit;
$customer_sql = ""; $customer_sql = "";
$temp_wr_id = $comment_id; $temp_wr_id = $comment_id;
$wr_num = $wr['wr_num']; $wr_num = $wr['wr_num'];
if (!$wr_num) if (!$wr_num)
$wr_num = $comment['wr_num']; $wr_num = $comment['wr_num'];
include_once($board_skin_path . '/upload_file.php'); include_once $board_skin_path . '/upload_file.php';
if ($_FILES['bf_file']['name']) { if ($_FILES['bf_file']['name']) {
$files = upload_c_file('bf_file', $bo_table); $files = upload_c_file('bf_file', $bo_table);
$file = sql_fetch("select * from {$g5['board_file_table']} where bo_table='{$bo_table}' and wr_id='{$comment_id}' and bf_no='0'"); $file = sql_fetch("SELECT * FROM {$g5['board_file_table']} WHERE bo_table='{$bo_table}' AND wr_id='{$comment_id}' AND bf_no='0'");
$sql_common = "bf_source='{$files['source']}', $sql_common = "bf_source='{$files['source']}',
bf_file='{$files['name']}', bf_file='{$files['name']}',
bf_filesize='{$files['size']}', bf_filesize='{$files['size']}',
@ -23,13 +23,13 @@ if ($_FILES['bf_file']['name']) {
bf_content = '{$bf_content}', bf_content = '{$bf_content}',
bf_datetime = '" . G5_TIME_YMDHIS . "' "; bf_datetime = '" . G5_TIME_YMDHIS . "' ";
if ($file['wr_id']) { if ($file['wr_id']) {
sql_query("update {$g5['board_file_table']} sql_query("UPDATE {$g5['board_file_table']}
set {$sql_common} SET {$sql_common}
where bo_table = '{$bo_table}' and wr_id='{$comment_id}' and bf_no = '0' WHERE bo_table = '{$bo_table}' AND wr_id='{$comment_id}' AND bf_no = '0'
"); ");
} else { } else {
sql_query("insert into {$g5['board_file_table']} sql_query("INSERT INTO {$g5['board_file_table']}
set {$sql_common}, SET {$sql_common},
wr_id = '{$comment_id}' , wr_id = '{$comment_id}' ,
bo_table = '{$bo_table}' , bo_table = '{$bo_table}' ,
bf_no = '0' bf_no = '0'
@ -39,10 +39,10 @@ if ($_FILES['bf_file']['name']) {
} }
if ($w == 'cu' && $bf_content) { if ($w == 'cu' && $bf_content) {
sql_query("update {$g5['board_file_table']} sql_query("UPDATE {$g5['board_file_table']}
set bf_content = '{$bf_content}' SET bf_content = '{$bf_content}'
where wr_id ='{$comment_id}' and WHERE wr_id ='{$comment_id}' AND
bo_table = '{$bo_table}' and bo_table = '{$bo_table}' AND
bf_no = '0' bf_no = '0'
"); ");
} }

View file

@ -1,4 +1,5 @@
<?php <?php
if (!defined("_GNUBOARD_")) if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가 exit;
goto_url("./board.php?bo_table=$bo_table"); goto_url("./board.php?bo_table=$bo_table");