Compare commits

...

4 commits
1.0.0 ... main

Author SHA1 Message Date
7da8d3743e
change tab style 2025-01-16 13:25:14 +09:00
40da17043b
typo 2024-12-11 15:32:03 +09:00
6f8ed103ae
[bugfix] edit document form empty and comment edit form to multiline 2024-12-11 15:26:39 +09:00
be7d60fbde
support comment resize 2024-12-11 02:42:22 +09:00
11 changed files with 813 additions and 826 deletions

View file

@ -1,8 +1,7 @@
<?php <?php
include_once "./_common.php"; include_once "./_common.php";
if (!function_exists('convert_charset')) if (!function_exists('convert_charset')) {
{
/* /*
----------------------------------------------------------- -----------------------------------------------------------
Charset 변환하는 함수 Charset 변환하는 함수
@ -14,9 +13,9 @@ if (!function_exists('convert_charset'))
function convert_charset($from_charset, $to_charset, $str) function convert_charset($from_charset, $to_charset, $str)
{ {
if( function_exists('iconv') ) if (function_exists('iconv'))
return iconv($from_charset, $to_charset, $str); return iconv($from_charset, $to_charset, $str);
elseif( function_exists('mb_convert_encoding') ) elseif (function_exists('mb_convert_encoding'))
return mb_convert_encoding($str, $to_charset, $from_charset); return mb_convert_encoding($str, $to_charset, $from_charset);
else else
die("Not found 'iconv' or 'mbstring' library in server."); die("Not found 'iconv' or 'mbstring' library in server.");
@ -29,8 +28,7 @@ $subject = strtolower($_POST['subject']);
$content = strtolower(strip_tags($_POST['content'])); $content = strtolower(strip_tags($_POST['content']));
//euc-kr 일 경우 $config['cf_filter'] 를 utf-8로 변환한다. //euc-kr 일 경우 $config['cf_filter'] 를 utf-8로 변환한다.
if (strtolower($g5['charset']) == 'euc-kr') if (strtolower($g5['charset']) == 'euc-kr') {
{
//$subject = convert_charset('utf-8', 'cp949', $subject); //$subject = convert_charset('utf-8', 'cp949', $subject);
//$content = convert_charset('utf-8', 'cp949', $content); //$content = convert_charset('utf-8', 'cp949', $content);
$config['cf_filter'] = convert_charset('cp949', 'utf-8', $config['cf_filter']); $config['cf_filter'] = convert_charset('cp949', 'utf-8', $config['cf_filter']);
@ -39,15 +37,13 @@ if (strtolower($g5['charset']) == 'euc-kr')
//$filter = explode(",", strtolower(trim($config['cf_filter']))); //$filter = explode(",", strtolower(trim($config['cf_filter'])));
// strtolower 에 의한 한글 변형으로 아래 코드로 대체 (곱슬최씨님이 알려 주셨습니다.) // strtolower 에 의한 한글 변형으로 아래 코드로 대체 (곱슬최씨님이 알려 주셨습니다.)
$filter = explode(",", trim($config['cf_filter'])); $filter = explode(",", trim($config['cf_filter']));
for ($i=0; $i<count($filter); $i++) for ($i = 0; $i < count($filter); $i++) {
{
$str = $filter[$i]; $str = $filter[$i];
// 제목 필터링 (찾으면 중지) // 제목 필터링 (찾으면 중지)
$subj = ""; $subj = "";
$pos = strpos($subject, $str); $pos = strpos($subject, $str);
if ($pos !== false) if ($pos !== false) {
{
if (strtolower($g5['charset']) == 'euc-kr') if (strtolower($g5['charset']) == 'euc-kr')
$subj = convert_charset('utf-8', 'cp949', $str);//cp949 로 변환해서 반환 $subj = convert_charset('utf-8', 'cp949', $str);//cp949 로 변환해서 반환
else else
@ -58,8 +54,7 @@ for ($i=0; $i<count($filter); $i++)
// 내용 필터링 (찾으면 중지) // 내용 필터링 (찾으면 중지)
$cont = ""; $cont = "";
$pos = strpos($content, $str); $pos = strpos($content, $str);
if ($pos !== false) if ($pos !== false) {
{
if (strtolower($g5['charset']) == 'euc-kr') if (strtolower($g5['charset']) == 'euc-kr')
$cont = convert_charset('utf-8', 'cp949', $str);//cp949 로 변환해서 반환 $cont = convert_charset('utf-8', 'cp949', $str);//cp949 로 변환해서 반환
else else

View file

@ -123,7 +123,8 @@ if ($board['bo_table_width'] == 0)
<p class="control"> <p class="control">
<?php <?php
if ($is_comment_write) { if ($is_comment_write) {
?><a href="javascript:comment_wri('comment_write', '<?= $lists[$ii]['wr_id'] ?>');">+</a> ?><a
href="javascript:comment_wri('comment_write', '<?= $lists[$ii]['wr_id'] ?>');">+</a>
<?php <?php
} }
if (($member['mb_id'] && ($member['mb_id'] == $lists[$ii]['mb_id'])) || $is_admin) { if (($member['mb_id'] && ($member['mb_id'] == $lists[$ii]['mb_id'])) || $is_admin) {
@ -179,10 +180,8 @@ if ($board['bo_table_width'] == 0)
</span> </span>
<?php } ?> <?php } ?>
<input type="submit" name="btn_submit" value="선택삭제" onclick="select_delete();" class="ui-btn small admin"> <input type="submit" name="btn_submit" value="선택삭제" onclick="select_delete();" class="ui-btn small admin">
<input type="submit" name="btn_submit" value="선택복사" onclick="select_copy('copy');" <input type="submit" name="btn_submit" value="선택복사" onclick="select_copy('copy');" class="ui-btn small admin">
class="ui-btn small admin"> <input type="submit" name="btn_submit" value="선택이동" onclick="select_copy('move');" class="ui-btn small admin">
<input type="submit" name="btn_submit" value="선택이동" onclick="select_copy('move');"
class="ui-btn small admin">
</div> </div>
<?php } ?> <?php } ?>
</div> </div>

View file

@ -29,13 +29,13 @@ if (!defined("_GNUBOARD_"))
<input type="hidden" name="page" value="<?php echo $page ?>"> <input type="hidden" name="page" value="<?php echo $page ?>">
<p class="ui-text-area"> <p class="ui-text-area">
<input type="text" name="wr_content" required class="frm-input full" value="<?= $list[$i]['wr_content'] ?>"> <textarea name="wr_content" required class="frm-input full" value="<?= $list[$i]['wr_content'] ?>"
oninput="wr_resize(this);" style="resize: vertical !important; transition: none; min-height: 1em;"></textarea>
<button type="submit" class="ui-btn" accesskey='s'>입력</button> <button type="submit" class="ui-btn" accesskey='s'>입력</button>
</p> </p>
<?php if (!$is_member && $is_comment_write) { ?> <?php if (!$is_member && $is_comment_write) { ?>
<p> <p>
<input type="text" name="wr_name" placeholder="이름" value="<?= $_COOKIE['MMB_NAME'] ?>" <input type="text" name="wr_name" placeholder="이름" value="<?= $_COOKIE['MMB_NAME'] ?>" style="max-width:40%" />
style="max-width:40%" />
<input type="password" name="wr_password" value="<?= $_COOKIE['MMB_PW'] ?>" placeholder="비밀번호" <input type="password" name="wr_password" value="<?= $_COOKIE['MMB_PW'] ?>" placeholder="비밀번호"
style="max-width:40%" /> style="max-width:40%" />
</p> </p>
@ -93,23 +93,30 @@ if (!defined("_GNUBOARD_"))
</p> </p>
<?php } ?> <?php } ?>
<span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 --> <span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 -->
<input type="hidden" value="<?php echo strstr($list[$i]['wr_option'], "secret") ?>" <input type="hidden" value="<?php echo strstr($list[$i]['wr_option'], "secret") ?>"
id="secret_comment_<?php echo $comment_id ?>"> id="secret_comment_<?php echo $comment_id ?>">
<input type="text" id="save_comment_<?php echo $comment_id ?>" style="display:none" <textarea name="wr_content" required class="frm-input full" value="<?= $list[$i]['wr_content'] ?>"
value="<?php echo get_text($list[$i]['content1'], 0) ?>"> oninput="wr_resize(this);" id="save_comment_<?php echo $comment_id ?>"
style="display:none; resize: vertical !important; transition: none; min-height: 1em;"><?php echo get_text($list[$i]['content1'], 0) ?></textarea>
</div> </div>
<?php if ($list[$i]['is_edit']) { ?> <?php if ($list[$i]['is_edit']) { ?>
<div class="modify_area ui-text-area" id="save_comment_<?php echo $comment_id ?>" style="display:none;"> <div class="modify_area ui-text-area" id="save_comment_<?php echo $comment_id ?>" style="display:none;">
<input type="text" id="save_co_comment_<?php echo $comment_id ?>" <textarea type="text" id="save_co_comment_<?php echo $comment_id ?>" oninput="wr_resize(this);"
value="<?php echo get_text($list[$i]['wr_content'], 0) ?>" class="full"> style="resize: vertical !important; transition: none; min-height: 1em;"><?php echo get_text($list[$i]['wr_content'], 0) ?></textarea>
<p class="txt-right"><button type="button" class="mod_comment ui-btn" <p class="txt-right">
onclick="mod_comment('<?php echo $comment_id ?>')">수정</button></p> <button type="button" class="mod_comment ui-btn" onclick="mod_comment('<?php echo $comment_id ?>')">수정</button>
</p>
</div> </div>
<?php } ?> </li> <?php } ?>
</li>
<?php } ?> <?php } ?>
</ul> </ul>
<script>
function wr_resize(e) {
e.style.height = 'auto';
e.style.height = `calc(${e.scrollHeight}px + 0.25em)`;
}
</script>
<?php <?php
include_once "$board_skin_path/view_skin_js.php"; include_once "$board_skin_path/view_skin_js.php";

View file

@ -237,14 +237,6 @@ if ($member['mb_level'] >= $board['bo_html_level'])
$is_secret = $board['bo_use_secret']; $is_secret = $board['bo_use_secret'];
//$is_mail = false;
//if ($config['cf_email_use'] && $board['bo_use_email'])
// $is_mail = true;
//$recv_email_checked = '';
//if ($w == '' || strstr($write['wr_option'], 'mail'))
// $recv_email_checked = 'checked';
$is_name = false; $is_name = false;
$is_password = false; $is_password = false;
$is_email = false; $is_email = false;
@ -291,8 +283,6 @@ if ($w == "" || $w == "r") {
if (isset($write['wr_name'])) { if (isset($write['wr_name'])) {
$name = get_text(cut_str(stripslashes($write['wr_name']), 20)); $name = get_text(cut_str(stripslashes($write['wr_name']), 20));
} }
//$email = get_email_address($member['mb_email']);
//$homepage = get_text(stripslashes($member['mb_homepage']));
} }
} }

View file

@ -26,10 +26,6 @@ if ($is_notice || $is_html || $is_secret || $is_mail) {
$option_hidden .= '<input type="hidden" name="secret" value="secret">'; $option_hidden .= '<input type="hidden" name="secret" value="secret">';
} }
} }
//if ($is_mail) {
// $option .= "\n".'<input type="checkbox" id="mail" name="mail" value="mail" '.$recv_email_checked.'>'."\n".'<label for="mail">답변메일받기</label>';
//}
} }
echo $option_hidden; echo $option_hidden;
@ -53,12 +49,12 @@ echo $option_hidden;
<div class="ui-write-box ui-text-area<?= $w == 'u' ? " update" : ""; ?>"> <div class="ui-write-box ui-text-area<?= $w == 'u' ? " update" : ""; ?>">
<a href="#" class="write_open ui-btn point">+</a> <a href="#" class="write_open ui-btn point">+</a>
<p> <p>
<textarea name="wr_content" id="content" class="frm-input full" required value="<?= $content ?>" style="resize: vertical !important; transition: none; min-height: 1em;"></textarea> <textarea name="wr_content" id="content" class="frm-input full" required value="<?= $content ?>"
style="resize: vertical !important; transition: none; min-height: 1em;"><?= $content ?></textarea>
<button type="submit" id="btn_submit" class="ui-btn" accesskey='s'>입력</button><?php if ($w == 'u') { ?><a <button type="submit" id="btn_submit" class="ui-btn" accesskey='s'>입력</button><?php if ($w == 'u') { ?><a
href="<?= G5_BBS_URL ?>/board.php?bo_table=<?= $bo_table ?>" class="ui-btn etc">뒤로</a><?php } ?> href="<?= G5_BBS_URL ?>/board.php?bo_table=<?= $bo_table ?>" class="ui-btn etc">뒤로</a><?php } ?>
<?php if (!$is_member) { ?> <?php if (!$is_member) { ?>
<input type="text" maxlength="20" name="wr_name" id="wr_name" placeholder="이름" required <input type="text" maxlength="20" name="wr_name" id="wr_name" placeholder="이름" required value="<?= $name ?>" />
value="<?= $name ?>" />
<input type="password" maxlength="20" id="wr_password" name="wr_password" placeholder="비밀번호" <input type="password" maxlength="20" id="wr_password" name="wr_password" placeholder="비밀번호"
value="<?= $password ?>" <?= $password_required ?> /> value="<?= $password ?>" <?= $password_required ?> />
<?php } ?> <?php } ?>
@ -88,8 +84,8 @@ echo $option_hidden;
return true; return true;
} }
document.getElementById("content").addEventListener("input", function() { document.getElementById("content").addEventListener("input", function () {
this.style.height = 'auto'; this.style.height = 'auto';
this.style.height = this.scrollHeight + 'px'; this.style.height = `calc(${this.scrollHeight}px + 0.25em)`;
}); });
</script> </script>