Compare commits

..

No commits in common. "main" and "1.0.2" have entirely different histories.
main ... 1.0.2

11 changed files with 811 additions and 810 deletions

View file

@ -1,7 +1,8 @@
<?php <?php
include_once "./_common.php"; include_once "./_common.php";
if (!function_exists('convert_charset')) { if (!function_exists('convert_charset'))
{
/* /*
----------------------------------------------------------- -----------------------------------------------------------
Charset 변환하는 함수 Charset 변환하는 함수
@ -13,9 +14,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.");
@ -28,7 +29,8 @@ $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']);
@ -37,13 +39,15 @@ 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
@ -54,7 +58,8 @@ 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,8 +123,7 @@ if ($board['bo_table_width'] == 0)
<p class="control"> <p class="control">
<?php <?php
if ($is_comment_write) { if ($is_comment_write) {
?><a ?><a href="javascript:comment_wri('comment_write', '<?= $lists[$ii]['wr_id'] ?>');">+</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) {
@ -180,8 +179,10 @@ 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');" 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('move');" 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">
</div> </div>
<?php } ?> <?php } ?>
</div> </div>

View file

@ -1,4 +1,4 @@
<?php <textarea?php
if (!defined("_GNUBOARD_")) if (!defined("_GNUBOARD_"))
exit; exit;
?> ?>
@ -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">
<textarea 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>
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'] ?>" style="max-width:40%" /> <input type="text" name="wr_name" placeholder="이름" value="<?= $_COOKIE['MMB_NAME'] ?>"
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,18 @@ 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 ?>"> <textarea name="wr_content" required class="frm-input full" value="<?= $list[$i]['wr_content'] ?>" 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>
<textarea name="wr_content" required class="frm-input full" value="<?= $list[$i]['wr_content'] ?>"
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;">
<textarea type="text" id="save_co_comment_<?php echo $comment_id ?>" oninput="wr_resize(this);" <textarea type="text" id="save_co_comment_<?php echo $comment_id ?>" oninput="wr_resize(this);" style="resize: vertical !important; transition: none; min-height: 1em;"><?php echo get_text($list[$i]['wr_content'], 0) ?></textarea>
style="resize: vertical !important; transition: none; min-height: 1em;"><?php echo get_text($list[$i]['wr_content'], 0) ?></textarea>
<p class="txt-right"> <p class="txt-right">
<button type="button" class="mod_comment ui-btn" onclick="mod_comment('<?php echo $comment_id ?>')">수정</button> <button type="button" class="mod_comment ui-btn" onclick="mod_comment('<?php echo $comment_id ?>')">수정</button>
</p> </p>
</div> </div>
<?php } ?> <?php } ?> </li>
</li>
<?php } ?> <?php } ?>
</ul> </ul>
<script> <script>

View file

@ -49,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 ?>" <textarea name="wr_content" id="content" class="frm-input full" required value="<?= $content ?>" style="resize: vertical !important; transition: none; min-height: 1em;"><?=$content?></textarea>
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 value="<?= $name ?>" /> <input type="text" maxlength="20" name="wr_name" id="wr_name" placeholder="이름" required
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 } ?>
@ -84,7 +84,7 @@ 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 = `calc(${this.scrollHeight}px + 0.25em)`; this.style.height = `calc(${this.scrollHeight}px + 0.25em)`;
}); });