update codes

This commit is contained in:
Amberstone 2024-10-19 08:43:05 +09:00
parent 898b885c54
commit 591fd50a42
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
14 changed files with 1487 additions and 1415 deletions

View file

@ -1,4 +1,4 @@
<? <?php
$g5_path = "../../.."; $g5_path = "../../..";
include_once("$g5_path/common.php"); include_once "{$g5_path}/common.php";
?> include_once "_extend.php";

28
_extend.php Normal file
View file

@ -0,0 +1,28 @@
<?php
$g5['clap_table'] = G5_TABLE_PREFIX . 'clap';
// 랜덤 테이블이 없을 경우 생성
if (!sql_table_exists($g5['clap_table'])) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['clap_table']}` (
`cl_id` int(11) NOT NULL AUTO_INCREMENT,
`cl_ip` varchar(255) NOT NULL default '',
`cl_date` datetime NULL,
`cl_cnt` int(11) NOT NULL default 1,
`cl_val` varchar(255) NOT NULL default '',
PRIMARY KEY (`cl_id`)
) ENGINE = MyISAM DEFAULT CHARSET=utf8;", false);
}
$last = date("Y-m-d", strtotime("today -30 day"));
$be = sql_fetch("SELECT cl_id,cl_date FROM {$g5['clap_table']} WHERE cl_cnt > 1 AND date_format(cl_date, '%Y-%m-%d') <= '{$last}' ORDER BY cl_date LIMIT 1");
if ($be['cl_id']) {
$last = date("Y-m-d", strtotime($be['cl_date']));
}
$sum = sql_fetch("SELECT sum(cl_cnt) as sum FROM {$g5['clap_table']} WHERE date_format(cl_date, '%Y-%m-%d') <= '{$last}'");
if ($sum['sum']) {
$cnt = $sum['sum'];
sql_query("DELETE FROM {$g5['clap_table']} WHERE date_format(cl_date, '%Y-%m-%d') <= '{$last}'");
sql_query("INSERT INTO {$g5['clap_table']} SET cl_cnt = '{$cnt}', cl_date = '" . G5_TIME_YMD . "', cl_val=1");
}

View file

@ -1,8 +1,7 @@
<? <?php
include_once("./_common.php"); include_once "./_common.php";
if (!function_exists('convert_charset')) if (!function_exists('convert_charset')) {
{
/* /*
----------------------------------------------------------- -----------------------------------------------------------
Charset 변환하는 함수 Charset 변환하는 함수
@ -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
@ -69,4 +64,3 @@ for ($i=0; $i<count($filter); $i++)
} }
die("{\"subject\":\"$subj\",\"content\":\"$cont\"}"); die("{\"subject\":\"$subj\",\"content\":\"$cont\"}");
?>

View file

@ -1,17 +1,20 @@
<? if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 <?php
// 수정, 삭제 링크 if (!defined("_GNUBOARD_"))
$update_href = $delete_href = ""; exit;
include_once "_extend.php";
$update_href = "";
$delete_href = "";
// 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능 // 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능
if (($member['mb_id'] && ($member['mb_id'] == $write['mb_id'])) || $is_admin) { if (($member['mb_id'] && ($member['mb_id'] == $write['mb_id'])) || $is_admin) {
$update_href = "./write.php?w=u&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr; $update_href = "./write.php?w=u&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr;
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . urldecode($qstr) . "');"; $delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . urldecode($qstr) . "');";
if ($is_admin) if ($is_admin) {
{
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&token=$token&page=$page" . urldecode($qstr) . "');"; $delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&token=$token&page=$page" . urldecode($qstr) . "');";
} }
} } else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
$update_href = "./password.php?w=u&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr; $update_href = "./password.php?w=u&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr;
$delete_href = "./password.php?w=d&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr; $delete_href = "./password.php?w=d&bo_table=$bo_table&wr_id={$lists[$ii]['wr_id']}&page=$page" . $qstr;
} }
?>

View file

@ -1,5 +1,9 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
include_once "_extend.php";
if ($is_admin) { ?> if ($is_admin) { ?>
<section id="clap_stat_box"> <section id="clap_stat_box">
<a href="#clap_stat_box" onclick="$('#clap_wrap').slideToggle();return false;" class="ui-btn point small"> 통계</a> <a href="#clap_stat_box" onclick="$('#clap_wrap').slideToggle();return false;" class="ui-btn point small"> 통계</a>
@ -9,53 +13,65 @@ if($is_admin){?>
<h3 class="txt-center">지난 <span class="less">10</span><span class="full">14</span> (일별)</h3> <h3 class="txt-center">지난 <span class="less">10</span><span class="full">14</span> (일별)</h3>
<table> <table>
<tbody> <tbody>
<? $clap_wlist=array(); <?php $clap_wlist = array();
$h_max = 5; $h_max = 5;
$cnt = 13; $cnt = 13;
for ($k = 0; $k < 14; $k++) { for ($k = 0; $k < 14; $k++) {
$this_day = date("Y-m-d", strtotime("today - {$k} day")); $this_day = date("Y-m-d", strtotime("today - {$k} day"));
$clap_w = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d')='{$this_day}' and cl_val=''"); $clap_w = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d')='{$this_day}' and cl_val=''");
if($h_max<$clap_w['sum']) $h_max=$clap_w['sum']; if ($h_max < $clap_w['sum'])
$h_max = $clap_w['sum'];
$clap_wlist[$cnt]['sum'] = $clap_w['sum']; $clap_wlist[$cnt]['sum'] = $clap_w['sum'];
$clap_wlist[$cnt]['day'] = date("n/j", strtotime($this_day)); $clap_wlist[$cnt]['day'] = date("n/j", strtotime($this_day));
$cnt--; $cnt--;
} }
$c_h = 100 / $h_max; $c_h = 100 / $h_max;
for ($k = 0; $k < 14; $k++) { for ($k = 0; $k < 14; $k++) {
if($k==0) echo "<tr>"; if ($k == 0)
echo "<tr>";
?> ?>
<td <?if($k<4) echo "class='old'";?>> <td <?php if ($k < 4)
<p class="bar highlight" style="height:<?=$c_h * $clap_wlist[$k]['sum']?>%;"><i class="ui-btn small"><?=$clap_wlist[$k]['sum']?></i></p> echo "class='old'"; ?>>
<p class="bar highlight" style="height:<?= $c_h * $clap_wlist[$k]['sum'] ?>%;"><i
class="ui-btn small"><?= $clap_wlist[$k]['sum'] ?></i></p>
<p class="num"><?= $clap_wlist[$k]['day'] ?></p> <p class="num"><?= $clap_wlist[$k]['day'] ?></p>
</td> </td>
<? if($k==13) echo "</tr>";} <?php if ($k == 13)
?></tbody> echo "</tr>";
}
?>
</tbody>
</table> </table>
</section> </section>
<section class="clap_stat_daily"> <section class="clap_stat_daily">
<h3 class="txt-center"><?= G5_TIME_YMD ?> (오늘)</h3> <h3 class="txt-center"><?= G5_TIME_YMD ?> (오늘)</h3>
<table> <table>
<tbody> <tbody>
<? <?php
$h_max = 5; $h_max = 5;
$clap_dlist = array(); $clap_dlist = array();
for ($k = 0; $k < 24; $k++) { for ($k = 0; $k < 24; $k++) {
$this_hour = G5_TIME_YMD . " " . sprintf('%02d', $k); $this_hour = G5_TIME_YMD . " " . sprintf('%02d', $k);
$clap_d = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d %H')='{$this_hour}' and cl_val=''"); $clap_d = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d %H')='{$this_hour}' and cl_val=''");
if ($h_max<$clap_d['sum']) $h_max=$clap_d['sum']; if ($h_max < $clap_d['sum'])
$h_max = $clap_d['sum'];
$clap_dlist[$k] = $clap_d['sum']; $clap_dlist[$k] = $clap_d['sum'];
} }
$c_h = 100 / $h_max; $c_h = 100 / $h_max;
for ($k = 0; $k < 24; $k++) { for ($k = 0; $k < 24; $k++) {
if($k==0) echo "<tr>"; if ($k == 0)
echo "<tr>";
?> ?>
<td> <td>
<p class="bar highlight" style="height:<?=$c_h * $clap_dlist[$k]?>%;"><i class="ui-btn small"><?=$clap_dlist[$k]?></i></p> <p class="bar highlight" style="height:<?= $c_h * $clap_dlist[$k] ?>%;"><i
class="ui-btn small"><?= $clap_dlist[$k] ?></i></p>
<p class="num"><?= $k ?></p> <p class="num"><?= $k ?></p>
</td> </td>
<? <?php
if($k==11) echo "</tr><tr>"; if ($k == 11)
if($k==23) echo "</tr>"; echo "</tr><tr>";
if ($k == 23)
echo "</tr>";
} ?> } ?>
</tbody> </tbody>
</table> </table>
@ -64,26 +80,31 @@ if($is_admin){?>
<h3 class="txt-center"><?= date("Y-m-d", strtotime("yesterday")) ?> (어제)</h3> <h3 class="txt-center"><?= date("Y-m-d", strtotime("yesterday")) ?> (어제)</h3>
<table> <table>
<tbody> <tbody>
<? <?php
$h_max = 5; $h_max = 5;
$clap_dlist = array(); $clap_dlist = array();
for ($k = 0; $k < 24; $k++) { for ($k = 0; $k < 24; $k++) {
$this_hour = date("Y-m-d", strtotime("yesterday")) . " " . sprintf('%02d', $k); $this_hour = date("Y-m-d", strtotime("yesterday")) . " " . sprintf('%02d', $k);
$clap_d = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d %H')='{$this_hour}' and cl_val=''"); $clap_d = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d %H')='{$this_hour}' and cl_val=''");
if ($h_max<$clap_d['sum']) $h_max=$clap_d['sum']; if ($h_max < $clap_d['sum'])
$h_max = $clap_d['sum'];
$clap_dlist[$k] = $clap_d['sum']; $clap_dlist[$k] = $clap_d['sum'];
} }
$c_h = 100 / $h_max; $c_h = 100 / $h_max;
for ($k = 0; $k < 24; $k++) { for ($k = 0; $k < 24; $k++) {
if($k==0) echo "<tr>"; if ($k == 0)
echo "<tr>";
?> ?>
<td> <td>
<p class="bar highlight" style="height:<?=$c_h * $clap_dlist[$k]?>%;"><i class="ui-btn small"><?=$clap_dlist[$k]?></i></p> <p class="bar highlight" style="height:<?= $c_h * $clap_dlist[$k] ?>%;"><i
class="ui-btn small"><?= $clap_dlist[$k] ?></i></p>
<p class="num"><?= $k ?></p> <p class="num"><?= $k ?></p>
</td> </td>
<? <?php
if($k==11) echo "</tr><tr>"; if ($k == 11)
if($k==23) echo "</tr>"; echo "</tr><tr>";
if ($k == 23)
echo "</tr>";
} ?> } ?>
</tbody> </tbody>
</table> </table>
@ -92,26 +113,31 @@ if($is_admin){?>
<h3 class="txt-center"><?= date("Y-m-d", strtotime("today -2 day")) ?> (2일전)</h3> <h3 class="txt-center"><?= date("Y-m-d", strtotime("today -2 day")) ?> (2일전)</h3>
<table> <table>
<tbody> <tbody>
<? <?php
$h_max = 5; $h_max = 5;
$clap_dlist = array(); $clap_dlist = array();
for ($k = 0; $k < 24; $k++) { for ($k = 0; $k < 24; $k++) {
$this_hour = date("Y-m-d", strtotime("today -2 day")) . " " . sprintf('%02d', $k); $this_hour = date("Y-m-d", strtotime("today -2 day")) . " " . sprintf('%02d', $k);
$clap_d = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d %H')='{$this_hour}' and cl_val=''"); $clap_d = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d %H')='{$this_hour}' and cl_val=''");
if ($h_max<$clap_d['sum']) $h_max=$clap_d['sum']; if ($h_max < $clap_d['sum'])
$h_max = $clap_d['sum'];
$clap_dlist[$k] = $clap_d['sum']; $clap_dlist[$k] = $clap_d['sum'];
} }
$c_h = 100 / $h_max; $c_h = 100 / $h_max;
for ($k = 0; $k < 24; $k++) { for ($k = 0; $k < 24; $k++) {
if($k==0) echo "<tr>"; if ($k == 0)
echo "<tr>";
?> ?>
<td> <td>
<p class="bar highlight" style="height:<?=$c_h * $clap_dlist[$k]?>%;"><i class="ui-btn small"><?=$clap_dlist[$k]?></i></p> <p class="bar highlight" style="height:<?= $c_h * $clap_dlist[$k] ?>%;"><i
class="ui-btn small"><?= $clap_dlist[$k] ?></i></p>
<p class="num"><?= $k ?></p> <p class="num"><?= $k ?></p>
</td> </td>
<? <?php
if($k==11) echo "</tr><tr>"; if ($k == 11)
if($k==23) echo "</tr>"; echo "</tr><tr>";
if ($k == 23)
echo "</tr>";
} ?> } ?>
</tbody> </tbody>
</table> </table>
@ -120,26 +146,31 @@ if($is_admin){?>
<h3 class="txt-center"><?= date("Y-m-d", strtotime("today -3 day")) ?> (3일전)</h3> <h3 class="txt-center"><?= date("Y-m-d", strtotime("today -3 day")) ?> (3일전)</h3>
<table> <table>
<tbody> <tbody>
<? <?php
$h_max = 5; $h_max = 5;
$clap_dlist = array(); $clap_dlist = array();
for ($k = 0; $k < 24; $k++) { for ($k = 0; $k < 24; $k++) {
$this_hour = date("Y-m-d", strtotime("today -3 day")) . " " . sprintf('%02d', $k); $this_hour = date("Y-m-d", strtotime("today -3 day")) . " " . sprintf('%02d', $k);
$clap_d = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d %H')='{$this_hour}' and cl_val=''"); $clap_d = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d %H')='{$this_hour}' and cl_val=''");
if ($h_max<$clap_d['sum']) $h_max=$clap_d['sum']; if ($h_max < $clap_d['sum'])
$h_max = $clap_d['sum'];
$clap_dlist[$k] = $clap_d['sum']; $clap_dlist[$k] = $clap_d['sum'];
} }
$c_h = 100 / $h_max; $c_h = 100 / $h_max;
for ($k = 0; $k < 24; $k++) { for ($k = 0; $k < 24; $k++) {
if($k==0) echo "<tr>"; if ($k == 0)
echo "<tr>";
?> ?>
<td> <td>
<p class="bar highlight" style="height:<?=$c_h * $clap_dlist[$k]?>%;"><i class="ui-btn small"><?=$clap_dlist[$k]?></i></p> <p class="bar highlight" style="height:<?= $c_h * $clap_dlist[$k] ?>%;"><i
class="ui-btn small"><?= $clap_dlist[$k] ?></i></p>
<p class="num"><?= $k ?></p> <p class="num"><?= $k ?></p>
</td> </td>
<? <?php
if($k==11) echo "</tr><tr>"; if ($k == 11)
if($k==23) echo "</tr>"; echo "</tr><tr>";
if ($k == 23)
echo "</tr>";
} ?> } ?>
</tbody> </tbody>
</table> </table>
@ -147,4 +178,4 @@ if($is_admin){?>
</div> </div>
</div> </div>
</section> </section>
<?}?> <?php } ?>

View file

@ -1,16 +1,23 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
if($is_admin) set_session("ss_delete_token", $token = uniqid(time())); include_once "_extend.php";
if ($is_admin)
set_session("ss_delete_token", $token = uniqid(time()));
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
$width = $board['bo_width'] ? $board['bo_width'] : 100; $width = $board['bo_width'] ? $board['bo_width'] : 100;
if($width<=100) $width=$width."%"; if ($width <= 100)
else $width=$width."px"; $width = $width . "%";
else
$width = $width . "px";
$clap_max = 10; $clap_max = 10;
if($board['bo_1']!='') $clap_max=$board['bo_1']; if ($board['bo_1'] != '')
$clap_max = $board['bo_1'];
$clap_t = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date, '%Y-%m-%d')='" . G5_TIME_YMD . "' and cl_ip='{$_SERVER['REMOTE_ADDR']}'"); $clap_t = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date, '%Y-%m-%d')='" . G5_TIME_YMD . "' and cl_ip='{$_SERVER['REMOTE_ADDR']}'");
$cl_cnt = $clap_t['sum']; $cl_cnt = $clap_t['sum'];
@ -18,9 +25,11 @@ $cl_cnt=$clap_t['sum'];
<div id="page_board_content" style="max-width:<?= $width ?>;margin:0 auto;"> <div id="page_board_content" style="max-width:<?= $width ?>;margin:0 auto;">
<? if($admin_href){?><p class="txt-right"><a href="<?=$admin_href?>" class="ui-btn admin" target="_blank">관리자</a></p><hr class="padding"><?}?> <?php if ($admin_href) { ?>
<p class="txt-right"><a href="<?= $admin_href ?>" class="ui-btn admin" target="_blank">관리자</a></p>
<hr class="padding"><?php } ?>
<? <?php
$no_id = ''; $no_id = '';
@ -45,24 +54,25 @@ $cl_cnt=$clap_t['sum'];
<div class="rand_img txt-center"> <div class="rand_img txt-center">
<img src="<?= $img_list[0] ?>"> <img src="<?= $img_list[0] ?>">
</div> </div>
<?}?> <?php } ?>
<?}?> <?php } ?>
<br> <br>
<!-- 상단 공지 부분 --> <!-- 상단 공지 부분 -->
<? if($board['bo_content_head']) { ?> <?php if ($board['bo_content_head']) { ?>
<div class="board-notice"> <div class="board-notice">
<?= stripslashes($board['bo_content_head']); ?> <?= stripslashes($board['bo_content_head']); ?>
</div> </div>
<hr class="padding" /> <hr class="padding" />
<? } ?> <?php } ?>
<!-- 버튼 링크 --> <!-- 버튼 링크 -->
<?if($is_admin || $no_id){?> <?php if ($is_admin || $no_id) { ?>
<?if($no_id){ <?php if ($no_id) {
if (!$is_admin) if (!$is_admin)
include_once($board_skin_path.'/update_hit.php'); include_once $board_skin_path . '/update_hit.php';
?> ?>
<div class="clap_box txt-center "> <div class="clap_box txt-center ">
<form name="clap" id="clap" action="<?=$board_skin_url?>/update_hit.php" method="post" enctype="multipart/form-data" onsubmit="return clap_submit(this)" autocomplete="off"> <form name="clap" id="clap" action="<?= $board_skin_url ?>/update_hit.php" method="post"
enctype="multipart/form-data" onsubmit="return clap_submit(this)" autocomplete="off">
<input type="hidden" name="bo_table" value="<?= $bo_table ?>"> <input type="hidden" name="bo_table" value="<?= $bo_table ?>">
<input type="hidden" name="clap_max" value="<?= $clap_max ?>"> <input type="hidden" name="clap_max" value="<?= $clap_max ?>">
<input type="hidden" name="cl_cnt" value="<?= $cl_cnt ?>"> <input type="hidden" name="cl_cnt" value="<?= $cl_cnt ?>">
@ -70,27 +80,30 @@ $cl_cnt=$clap_t['sum'];
<button type="submit" class="ui-btn point clap">박수!</button> <button type="submit" class="ui-btn point clap">박수!</button>
</form> </form>
</div> </div>
<?}?> <?php } ?>
<hr class="padding" /> <hr class="padding" />
<?if (!$no_id && $is_admin){?> <?php if (!$no_id && $is_admin) { ?>
<p class="txt-center">* 통계 확인 웹박수 랜덤이미지 등록을 위해 아래 공지 체크후 메시지를 작성해주세요.<br>* 랜덤 이미지는 등록 수정(M) 눌러 이미지를 업로드 해주시면 됩니다.<br> <p class="txt-center">* 통계 확인 웹박수 랜덤이미지 등록을 위해 아래 공지 체크후 메시지를 작성해주세요.<br>* 랜덤 이미지는 등록 수정(M) 눌러 이미지를 업로드 해주시면
됩니다.<br>
* 공지글로 작성한 내용은 노출되지 않습니다.</p> * 공지글로 작성한 내용은 노출되지 않습니다.</p>
<hr class="padding"> <hr class="padding">
<? } ?> <?php } ?>
<? if ($write_href) { ?> <?php if ($write_href) { ?>
<div class="ui-write-area"> <div class="ui-write-area">
<? include ($board_skin_path."/write.php"); ?> <?php include $board_skin_path . "/write.php"; ?>
</div> </div>
<hr class="padding"> <hr class="padding">
<? } ?> <?php } ?>
<div class="ui-qna-list"> <div class="ui-qna-list">
<ul> <ul>
<? <?php
$lists = array(); $lists = array();
$cnt = 0; $cnt = 0;
for ($i = 0; $i < count($list); $i++) { for ($i = 0; $i < count($list); $i++) {
if(!$list[$i]['is_notice'] && !$is_admin && $list[$i]['wr_comment']<1) continue; if (!$list[$i]['is_notice'] && !$is_admin && $list[$i]['wr_comment'] < 1)
if($list[$i]['is_notice'] && !$is_admin && strstr($list[$i]['wr_option'],'secret')) continue; continue;
if ($list[$i]['is_notice'] && !$is_admin && strstr($list[$i]['wr_option'], 'secret'))
continue;
$lists[$cnt] = $list[$i]; $lists[$cnt] = $list[$i];
$cnt++; $cnt++;
} }
@ -119,71 +132,75 @@ $cl_cnt=$clap_t['sum'];
<input type="hidden" name="wr_idx" value="<?= $lists[$ii]['wr_id'] ?>"> <input type="hidden" name="wr_idx" value="<?= $lists[$ii]['wr_id'] ?>">
<input type="hidden" name="sw" value=""> <input type="hidden" name="sw" value="">
<? if($lists[$ii]['is_notice']) { ?> <?php if ($lists[$ii]['is_notice']) { ?>
<? $clap_total=sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']}"); <?php $clap_total = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']}");
$clap_today = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d')='" . G5_TIME_YMD . "' and cl_val=''"); $clap_today = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date,'%Y-%m-%d')='" . G5_TIME_YMD . "' and cl_val=''");
?> ?>
<p id="stat_total"><em>오늘: <?=sprintf("%01d",$clap_today['sum'])?></em> / <em>전체: <?=sprintf("%01d",$clap_total['sum'])?></em></p> <p id="stat_total"><em>오늘: <?= sprintf("%01d", $clap_today['sum']) ?></em> / <em>전체:
<?if($is_admin){?> <?= sprintf("%01d", $clap_total['sum']) ?></em></p>
<?php if ($is_admin) { ?>
<p class="notice"> <p class="notice">
<strong> <strong>
<? if(($member['mb_id'] && ($member['mb_id'] == $lists[$ii]['mb_id'])) || $is_admin) { ?> <?php if (($member['mb_id'] && ($member['mb_id'] == $lists[$ii]['mb_id'])) || $is_admin) { ?>
<a href="<?= $delete_href ?>">D</a> <a href="<?= $delete_href ?>">D</a>
<a href="<?= $update_href ?>">M</a> <a href="<?= $update_href ?>">M</a>
<? }?> <?php } ?>
</strong> </strong>
</p> </p>
<? <?php
include_once($board_skin_path.'/inc.stat.php'); include_once $board_skin_path . '/inc.stat.php';
if ($lists[$ii]['wr_file'] > 0) { ?> if ($lists[$ii]['wr_file'] > 0) { ?>
<a href="#" onclick="$(this).next().slideToggle();return false;" class="ui-btn small"> 랜덤이미지 확인</a> <a href="#" onclick="$(this).next().slideToggle();return false;" class="ui-btn small"> 랜덤이미지 확인</a>
<p style="display:none;" class="txt-center"> <p style="display:none;" class="txt-center">
<? <?php
for ($k = 0; $k < $board['bo_upload_count']; $k++) { for ($k = 0; $k < $board['bo_upload_count']; $k++) {
if ($file[$k]['file']) { if ($file[$k]['file']) {
?> ?>
<img src="<?= G5_DATA_URL . "/file/" . $bo_table . "/" . $file[$k]['file'] ?>"> <img src="<?= G5_DATA_URL . "/file/" . $bo_table . "/" . $file[$k]['file'] ?>">
<?}?> <?php } ?>
<?}?> <?php } ?>
</p> </p>
<?}else{ if(!$board['bo_3']){?> <?php } else {
if (!$board['bo_3']) { ?>
<p class="txt-center">* 수정(M) 눌러 웹박수 랜덤이미지를 등록 해주세요.</p> <p class="txt-center">* 수정(M) 눌러 웹박수 랜덤이미지를 등록 해주세요.</p>
<?} }?> <?php }
<?}?> } ?>
<? } else { ?> <?php } ?>
<?php } else { ?>
<p> <p>
<span class="date"> <span class="date">
<?= $lists[$ii]['datetime'] ?> <?= $lists[$ii]['datetime'] ?>
</span> </span>
<?if($is_admin){?><?=$lists[$ii]['wr_ip']?><?}?> <?php if ($is_admin) { ?> <?= $lists[$ii]['wr_ip'] ?> <?php } ?>
<strong> <strong>
<? if($is_admin) { ?> <?php if ($is_admin) { ?>
<a href="<?= $delete_href ?>">D</a> <a href="<?= $delete_href ?>">D</a>
<a href="javascript:comment_wri('comment_write', '<?= $lists[$ii]['wr_id'] ?>');">R</a> <a href="javascript:comment_wri('comment_write', '<?= $lists[$ii]['wr_id'] ?>');">R</a>
<? } ?> <?php } ?>
</strong> </strong>
</p> </p>
<div class="qna-content <?= !$is_admin ? " guest" : ""; ?>"> <div class="qna-content <?= !$is_admin ? " guest" : ""; ?>">
<?if(!$board['bo_2'] || $is_admin){ <?php if (!$board['bo_2'] || $is_admin) {
if (strstr($lists[$ii]['wr_option'], 'secret')) { ?> if (strstr($lists[$ii]['wr_option'], 'secret')) { ?>
<span class="txt-point">[SECRET]</span><br /> <span class="txt-point">[SECRET]</span><br />
<? } ?> <?php } ?>
<?if((!strstr($lists[$ii]['wr_option'], 'secret')) || $is_admin) { ?> <?php if ((!strstr($lists[$ii]['wr_option'], 'secret')) || $is_admin) { ?>
<?= $lists[$ii]['content'] ?> <?= $lists[$ii]['content'] ?>
<? } } ?> <?php }
} ?>
</div> </div>
<? } ?> <?php } ?>
</form> </form>
<? <?php
$wr_id = $lists[$ii]['wr_id']; $wr_id = $lists[$ii]['wr_id'];
include ("$board_skin_path/view_comment.php"); include "$board_skin_path/view_comment.php";
?> ?>
</div> </div>
</li> </li>
<? } <?php }
// 필터 // 필터
?> ?>
</ul> </ul>
@ -191,7 +208,7 @@ $cl_cnt=$clap_t['sum'];
<!-- 페이지 --> <!-- 페이지 -->
<div class="ui-page"> <div class="ui-page">
<? <?php
$add = ""; $add = "";
if (!$is_admin) if (!$is_admin)
$add = "and wr_comment=1 "; $add = "and wr_comment=1 ";
@ -205,7 +222,7 @@ $cl_cnt=$clap_t['sum'];
</div> </div>
</div> </div>
<?}?> <?php } ?>
</div> </div>
<script> <script>
//if ("<?= $sca ?>") document.fcategory.sca.value = "<?= $sca ?>"; //if ("<?= $sca ?>") document.fcategory.sca.value = "<?= $sca ?>";
@ -215,8 +232,7 @@ if ("<?=$stx?>") {
} }
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다. // HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image() function resize_image() {
{
var target = document.getElementsByName('target_resize_image[]'); var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt("<?= $board['bo_image_width'] ?>"); var image_width = parseInt("<?= $board['bo_image_width'] ?>");
var image_height = 0; var image_height = 0;
@ -239,12 +255,12 @@ const bg = $(".question.theme-box").css("background-color");
$(".qna-content.guest, .qna-content.guest a").css({ "color": bg, "opacity": 1, "background-color": bg }); $(".qna-content.guest, .qna-content.guest a").css({ "color": bg, "opacity": 1, "background-color": bg });
let clap_max = 10; let clap_max = 10;
<? if($board['bo_1']!=''){?> <?php if ($board['bo_1'] != '') { ?>
clap_max = parseInt('<?= $board['bo_1'] ?>'); clap_max = parseInt('<?= $board['bo_1'] ?>');
<?}?> <?php } ?>
let clap_t = parseInt('<?= $clap_t['sum'] ?>'); let clap_t = parseInt('<?= $clap_t['sum'] ?>');
<?if(!$is_admin){?> <?php if (!$is_admin) { ?>
$(document).keydown(function (event) { $(document).keydown(function (event) {
if ((event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) || (event.keyCode == 116)) { if ((event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) || (event.keyCode == 116)) {
if (clap_max == 0 || (clap_max > 0 && clap_t < clap_max)) { if (clap_max == 0 || (clap_max > 0 && clap_t < clap_max)) {
@ -258,10 +274,9 @@ $(document).keydown(function(event){
} }
} }
}); });
<?}?> <?php } ?>
function clap_submit(f) function clap_submit(f) {
{
if (clap_max > 0 && clap_t >= clap_max) { if (clap_max > 0 && clap_t >= clap_max) {
alert("박수는 하루에 " + clap_max + "번 까지 칠 수 있습니다."); alert("박수는 하루에 " + clap_max + "번 까지 칠 수 있습니다.");
return false; return false;
@ -274,16 +289,14 @@ function comment_wri(name, id) {
var layer = document.getElementById(name + id); var layer = document.getElementById(name + id);
layer.style.display = (layer.style.display == "none") ? "block" : "none"; layer.style.display = (layer.style.display == "none") ? "block" : "none";
} }
function comment_delete(url) function comment_delete(url) {
{
if (confirm("이 코멘트를 삭제하시겠습니까?")) location.href = url; if (confirm("이 코멘트를 삭제하시겠습니까?")) location.href = url;
} }
</script> </script>
<? if ($is_checkbox) { ?> <?php if ($is_checkbox) { ?>
<script> <script>
function all_checked(sw) function all_checked(sw) {
{
var f = document.fboardlist; var f = document.fboardlist;
for (var i = 0; i < f.length; i++) { for (var i = 0; i < f.length; i++) {
@ -292,8 +305,7 @@ function all_checked(sw)
} }
} }
function check_confirm(str) function check_confirm(str) {
{
var f = document.fboardlist; var f = document.fboardlist;
var chk_count = 0; var chk_count = 0;
@ -310,8 +322,7 @@ function check_confirm(str)
} }
// 선택한 게시물 삭제 // 선택한 게시물 삭제
function select_delete() function select_delete() {
{
var f = document.fboardlist; var f = document.fboardlist;
str = "삭제"; str = "삭제";
@ -326,8 +337,7 @@ function select_delete()
} }
// 선택한 게시물 복사 및 이동 // 선택한 게시물 복사 및 이동
function select_copy(sw) function select_copy(sw) {
{
var f = document.fboardlist; var f = document.fboardlist;
if (sw == "copy") if (sw == "copy")
@ -369,7 +379,8 @@ function modify_commnet(co_id) {
</script> </script>
<form name="modify_comment" id="frm_modify_comment" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" method="post" autocomplete="off"> <form name="modify_comment" id="frm_modify_comment" action="./write_comment_update.php"
onsubmit="return fviewcomment_submit(this);" method="post" autocomplete="off">
<input type="hidden" name="w" value="cu"> <input type="hidden" name="w" value="cu">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>"> <input type="hidden" name="sca" value="<?php echo $sca ?>">
@ -384,4 +395,4 @@ function modify_commnet(co_id) {
<textarea name="wr_content" style="display: none;"></textarea> <textarea name="wr_content" style="display: none;"></textarea>
<button type="submit" style="display: none;"></button> <button type="submit" style="display: none;"></button>
</form> </form>
<? } ?> <?php } ?>

View file

@ -5,6 +5,9 @@
모든 아보카도 버전에 호환됩니다. 모든 아보카도 버전에 호환됩니다.
### 주요 수정 사항
- short open tag 제거
## 설치방법 ## 설치방법
아보카도가 설치된 폴더의 하위 폴더인 `skin/board/``webclap` 라는 폴더를 생성하고 파일을 업로드합니다. 아보카도가 설치된 폴더의 하위 폴더인 `skin/board/``webclap` 라는 폴더를 생성하고 파일을 업로드합니다.

View file

@ -1,6 +1,6 @@
<? <?php
//if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 //if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once('./_common.php'); include_once './_common.php';
if ($clap_max == 0 || ($clap_max > 0 && $cl_cnt < $clap_max)) { if ($clap_max == 0 || ($clap_max > 0 && $cl_cnt < $clap_max)) {
sql_query("insert into {$g5['clap_table']} sql_query("insert into {$g5['clap_table']}
@ -10,4 +10,3 @@ if($clap_max==0 || ($clap_max>0 && $cl_cnt<$clap_max)){
} }
if ($return_url) if ($return_url)
goto_url($return_url); goto_url($return_url);
?>

View file

@ -1,7 +1,8 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
include_once "_extend.php";
set_session("ss_delete_token", $token = uniqid(time())); set_session("ss_delete_token", $token = uniqid(time()));
goto_url("./board.php?bo_table=$bo_table" . $qstr); goto_url("./board.php?bo_table=$bo_table" . $qstr);
?>

View file

@ -1,5 +1,8 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_'))
exit; // 개별 페이지 접근 불가
include_once "_extend.php";
$list = array(); $list = array();
@ -10,8 +13,7 @@ if ($member['mb_level'] >= $board['bo_comment_level'])
// 코멘트 출력 // 코멘트 출력
$sql = " select * from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 order by wr_comment, wr_comment_reply "; $sql = " select * from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 order by wr_comment, wr_comment_reply ";
$result = sql_query($sql); $result = sql_query($sql);
for ($i=0; $c_row=sql_fetch_array($result); $i++) for ($i = 0; $c_row = sql_fetch_array($result); $i++) {
{
$list[$i] = $c_row; $list[$i] = $c_row;
//$list[$i]['name'] = get_sideview($c_row['mb_id'], cut_str($c_row['wr_name'], 20, ''), $c_row['wr_email'], $c_row['wr_homepage']); //$list[$i]['name'] = get_sideview($c_row['mb_id'], cut_str($c_row['wr_name'], 20, ''), $c_row['wr_email'], $c_row['wr_homepage']);
@ -28,10 +30,12 @@ for ($i=0; $c_row=sql_fetch_array($result); $i++)
//$list[$i]['content'] = eregi_replace("[^ \n<>]{130}", "\\0\n", $c_row['wr_content']); //$list[$i]['content'] = eregi_replace("[^ \n<>]{130}", "\\0\n", $c_row['wr_content']);
$list[$i]['content'] = $list[$i]['content1'] = '비밀글 입니다.'; $list[$i]['content'] = $list[$i]['content1'] = '비밀글 입니다.';
if (!strstr($c_row['wr_option'], 'secret') || if (
!strstr($c_row['wr_option'], 'secret') ||
$is_admin || $is_admin ||
($write['mb_id'] == $member['mb_id'] && $member['mb_id']) || ($write['mb_id'] == $member['mb_id'] && $member['mb_id']) ||
($c_row['mb_id']==$member['mb_id'] && $member['mb_id'])) { ($c_row['mb_id'] == $member['mb_id'] && $member['mb_id'])
) {
$list[$i]['content1'] = $c_row['wr_content']; $list[$i]['content1'] = $c_row['wr_content'];
$list[$i]['content'] = conv_content($c_row['wr_content'], 0, 'wr_content'); $list[$i]['content'] = conv_content($c_row['wr_content'], 0, 'wr_content');
$list[$i]['content'] = search_font($stx, $list[$i]['content']); $list[$i]['content'] = search_font($stx, $list[$i]['content']);
@ -56,22 +60,17 @@ for ($i=0; $c_row=sql_fetch_array($result); $i++)
$list[$i]['is_reply'] = false; $list[$i]['is_reply'] = false;
$list[$i]['is_edit'] = false; $list[$i]['is_edit'] = false;
$list[$i]['is_del'] = false; $list[$i]['is_del'] = false;
if ($is_comment_write || $is_admin) if ($is_comment_write || $is_admin) {
{
$token = ''; $token = '';
if ($member['mb_id']) if ($member['mb_id']) {
{ if ($c_row['mb_id'] == $member['mb_id'] || $is_admin) {
if ($c_row['mb_id'] == $member['mb_id'] || $is_admin)
{
set_session('ss_delete_comment_' . $c_row['wr_id'] . '_token', $token = uniqid(time())); set_session('ss_delete_comment_' . $c_row['wr_id'] . '_token', $token = uniqid(time()));
$list[$i]['del_link'] = './delete_comment.php?bo_table=' . $bo_table . '&amp;comment_id=' . $c_row['wr_id'] . '&amp;token=' . $token . '&amp;page=' . $page . $qstr; $list[$i]['del_link'] = './delete_comment.php?bo_table=' . $bo_table . '&amp;comment_id=' . $c_row['wr_id'] . '&amp;token=' . $token . '&amp;page=' . $page . $qstr;
$list[$i]['is_edit'] = true; $list[$i]['is_edit'] = true;
$list[$i]['is_del'] = true; $list[$i]['is_del'] = true;
} }
} } else {
else
{
if (!$c_row['mb_id']) { if (!$c_row['mb_id']) {
$list[$i]['del_link'] = './password.php?w=x&amp;bo_table=' . $bo_table . '&amp;comment_id=' . $c_row['wr_id'] . '&amp;page=' . $page . $qstr; $list[$i]['del_link'] = './password.php?w=x&amp;bo_table=' . $bo_table . '&amp;comment_id=' . $c_row['wr_id'] . '&amp;page=' . $page . $qstr;
$list[$i]['is_del'] = true; $list[$i]['is_del'] = true;
@ -84,13 +83,10 @@ for ($i=0; $c_row=sql_fetch_array($result); $i++)
// 05.05.22 // 05.05.22
// 답변있는 코멘트는 수정, 삭제 불가 // 답변있는 코멘트는 수정, 삭제 불가
if ($i > 0 && !$is_admin) if ($i > 0 && !$is_admin) {
{ if ($c_row['wr_comment_reply']) {
if ($c_row['wr_comment_reply'])
{
$tmp_comment_reply = substr($c_row['wr_comment_reply'], 0, strlen($c_row['wr_comment_reply']) - 1); $tmp_comment_reply = substr($c_row['wr_comment_reply'], 0, strlen($c_row['wr_comment_reply']) - 1);
if ($tmp_comment_reply == $list[$i-1]['wr_comment_reply']) if ($tmp_comment_reply == $list[$i - 1]['wr_comment_reply']) {
{
$list[$i - 1]['is_edit'] = false; $list[$i - 1]['is_edit'] = false;
$list[$i - 1]['is_del'] = false; $list[$i - 1]['is_del'] = false;
} }
@ -99,16 +95,11 @@ for ($i=0; $c_row=sql_fetch_array($result); $i++)
} }
// 코멘트수 제한 설정값 // 코멘트수 제한 설정값
if ($is_admin) if ($is_admin) {
{
$comment_min = $comment_max = 0; $comment_min = $comment_max = 0;
} } else {
else
{
$comment_min = (int) $board['bo_comment_min']; $comment_min = (int) $board['bo_comment_min'];
$comment_max = (int) $board['bo_comment_max']; $comment_max = (int) $board['bo_comment_max'];
} }
include($board_skin_path.'/view_comment.skin.php'); include $board_skin_path . '/view_comment.skin.php';
?>

View file

@ -1,29 +1,31 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
?> exit; // 개별 페이지 접근 불가
include_once "_extend.php";
?>
<script language="JavaScript"> <script language="JavaScript">
// 글자수 제한 // 글자수 제한
var char_min = parseInt(<?= $comment_min ?>); // 최소 var char_min = parseInt(<?= $comment_min ?>); // 최소
var char_max = parseInt(<?= $comment_max ?>); // 최대 var char_max = parseInt(<?= $comment_max ?>); // 최대
</script> </script>
<!-- 코멘트 리스트 --> <!-- 코멘트 리스트 -->
<ul> <ul>
<!-- 코멘트 리스트 --> <!-- 코멘트 리스트 -->
<? <?php
for ($i = 0; $i < count($list); $i++) { for ($i = 0; $i < count($list); $i++) {
$comment_id = $list[$i]['wr_id']; $comment_id = $list[$i]['wr_id'];
?> ?>
<li id="c_<?= $comment_id ?>"> <li id="c_<?= $comment_id ?>">
<a name="c_<?= $comment_id ?>"></a> <a name="c_<?= $comment_id ?>"></a>
<a href="#c_<?=$comment_id?>" onclick="$(this).next().slideToggle(); return false;" class="ui-btn small"> 답변<?=$lists[$ii]['wr_comment']>1 ? $i+1:""?></a> <a href="#c_<?= $comment_id ?>" onclick="$(this).next().slideToggle(); return false;" class="ui-btn small">
답변<?= $lists[$ii]['wr_comment'] > 1 ? $i + 1 : "" ?></a>
<div class="qna-comment-content" style="display:none;"> <div class="qna-comment-content" style="display:none;">
<!-- 코멘트 출력 --> <!-- 코멘트 출력 -->
<? <?php
if (strstr($list[$i]['wr_option'], "secret")) echo "<span style='color:#ff6600;'>*</span> "; if (strstr($list[$i]['wr_option'], "secret"))
echo "<span style='color:#ff6600;'>*</span> ";
$str = $list[$i]['content']; $str = $list[$i]['content'];
if (strstr($list[$i]['wr_option'], "secret")) if (strstr($list[$i]['wr_option'], "secret"))
$str = "<span class='small' style='color:#ff6600;'>$str</span>"; $str = "<span class='small' style='color:#ff6600;'>$str</span>";
@ -46,62 +48,61 @@ for ($i=0; $i<count($list); $i++) {
$c_edit_href = './board.php?' . $query_string . '&amp;comment_id=' . $comment_id . '&amp;wr_id=' . $wr_id . 'w=cu'; $c_edit_href = './board.php?' . $query_string . '&amp;comment_id=' . $comment_id . '&amp;wr_id=' . $wr_id . 'w=cu';
?> ?>
<? if ($list[$i]['is_edit']||$list[$i]['is_del']) { ?> <?php if ($list[$i]['is_edit'] || $list[$i]['is_del']) { ?>
<p class="clear"> <p class="clear">
<strong> <strong>
<? if ($list[$i]['is_edit']) { ?><span><a href="javascript:comment_box('<? echo $comment_id ?>', '<?=$list[$ii]['wr_id']?>');">M</a></span><? } ?> <?php if ($list[$i]['is_edit']) { ?><span><a
<? if ($list[$i]['is_del']) { ?><span><a href="javascript:comment_delete('<?=$list[$i]['del_link']?>');">D</a></span><?}?> href="javascript:comment_box('<?php echo $comment_id ?>', '<?= $list[$ii]['wr_id'] ?>');">M</a></span><?php } ?>
</strong> <?php if ($list[$i]['is_del']) { ?><span><a
href="javascript:comment_delete('<?= $list[$i]['del_link'] ?>');">D</a></span><?php } ?> </strong>
</p> </p>
<?}?> <?php } ?>
<span id="edit_<? echo $comment_id ?>"></span><!-- 수정 --> <span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 -->
<input type="hidden" value="<? echo strstr($list[$i]['wr_option'],"secret") ?>" id="secret_comment_<? echo $comment_id ?>"> <input type="hidden" value="<?php echo strstr($list[$i]['wr_option'], "secret") ?>"
<textarea id="save_comment_<? echo $comment_id ?>" style="display:none"><? echo get_text($list[$i]['content1'], 0) ?></textarea> id="secret_comment_<?php echo $comment_id ?>">
<textarea id="save_comment_<?php echo $comment_id ?>"
style="display:none"><?php echo get_text($list[$i]['content1'], 0) ?></textarea>
</div> </div>
<?php if ($list[$i]['is_edit']) { ?>
<? if ($list[$i]['is_edit']) { ?>
<div class="modify_area" id="save_comment_<?php echo $comment_id ?>" style="display:none;"> <div class="modify_area" id="save_comment_<?php echo $comment_id ?>" style="display:none;">
<textarea id="save_co_comment_<?php echo $comment_id ?>" rows="4"><?php echo get_text($list[$i]['wr_content'], 0) ?></textarea> <textarea id="save_co_comment_<?php echo $comment_id ?>"
rows="4"><?php echo get_text($list[$i]['wr_content'], 0) ?></textarea>
<p class="txt-right"><button type="button" class="mod_comment ui-btn" onclick="modify_commnet('<?php echo $comment_id ?>'); return false;">수정</button></p> <p class="txt-right"><button type="button" class="mod_comment ui-btn"
onclick="modify_commnet('<?php echo $comment_id ?>'); return false;">수정</button></p>
</div> </div>
<? } ?> <?php } ?>
</li> </li>
<? } ?> <?php } ?>
</ul> </ul>
<? if ($is_comment_write) { <?php if ($is_comment_write) {
if($w == '') $w = 'c'; if ($w == '')
$w = 'c';
?> ?>
<div class="ui-write-area" id="comment_write<?= $lists[$ii]['wr_id'] ?>" style="display:none;"> <div class="ui-write-area" id="comment_write<?= $lists[$ii]['wr_id'] ?>" style="display:none;">
<!-- 코멘트 입력테이블시작 --> <!-- 코멘트 입력테이블시작 -->
<form name="fviewcomment" method="post" action="./write_comment_update.php" autocomplete="off"> <form name="fviewcomment" method="post" action="./write_comment_update.php" autocomplete="off">
<input type="hidden" name="w" value="<? echo $w ?>" > <input type="hidden" name="w" value="<?php echo $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="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 ?>">
<textarea id="wr_content<?= $comment_id ?>" name="wr_content" rows="4" itemname="내용" required <?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');" <?php } ?>
style='width:100%; word-break:break-all;' class='tx'><?= $list[$i]['wr_content'] ?></textarea>
<textarea id="wr_content<?=$comment_id?>" name="wr_content" rows="4" itemname="내용" required <?php if ($comment_min || $comment_max) { ?>
<? if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?}?> style='width:100%; word-break:break-all;' class='tx'><?=$list[$i]['wr_content']?></textarea> <script type="text/javascript"> check_byte('wr_content', 'char_count'); </script><?php } ?>
<? if ($comment_min || $comment_max) { ?><script type="text/javascript"> check_byte('wr_content', 'char_count'); </script><?}?>
<div class="txt-right" style="padding-bottom:5px;"> <div class="txt-right" style="padding-bottom:5px;">
<button type="submit" class="ui-btn" accesskey='s'>입력</button> <button type="submit" class="ui-btn" accesskey='s'>입력</button>
</div> </div>
</form> </form>
</div> </div>
<? } ?> <?php } ?>
<script language='JavaScript'> <script language='JavaScript'>
function fviewcomment_submit(f) function fviewcomment_submit(f) {
{
return true; return true;
} }
</script> </script>

View file

@ -1,6 +1,6 @@
<?php <?php
include_once('./_common.php'); include_once './_common.php';
include_once(G5_EDITOR_LIB); include_once G5_EDITOR_LIB;
if (!$board['bo_table']) { if (!$board['bo_table']) {
alert('존재하지 않는 게시판입니다.', G5_URL); alert('존재하지 않는 게시판입니다.', G5_URL);
@ -66,7 +66,8 @@ if ($w == '') {
} }
$len = strlen($write['wr_reply']); $len = strlen($write['wr_reply']);
if ($len < 0) $len = 0; if ($len < 0)
$len = 0;
$reply = substr($write['wr_reply'], 0, $len); $reply = substr($write['wr_reply'], 0, $len);
// 원글만 구한다. // 원글만 구한다.
@ -144,7 +145,8 @@ if ($w == '') {
$reply_number = -1; $reply_number = -1;
$sql = " select MIN(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply from {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' "; $sql = " select MIN(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply from {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' ";
} }
if ($reply_array['wr_reply']) $sql .= " and wr_reply like '{$reply_array['wr_reply']}%' "; if ($reply_array['wr_reply'])
$sql .= " and wr_reply like '{$reply_array['wr_reply']}%' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if (!$row['reply']) if (!$row['reply'])
@ -203,12 +205,9 @@ if ($config['cf_cert_use'] && !$is_admin) {
} }
// 글자수 제한 설정값 // 글자수 제한 설정값
if ($is_admin || $board['bo_use_dhtml_editor']) if ($is_admin || $board['bo_use_dhtml_editor']) {
{
$write_min = $write_max = 0; $write_min = $write_max = 0;
} } else {
else
{
$write_min = (int) $board['bo_write_min']; $write_min = (int) $board['bo_write_min'];
$write_max = (int) $board['bo_write_max']; $write_max = (int) $board['bo_write_max'];
} }
@ -408,6 +407,5 @@ $autosave_count = autosave_count($member['mb_id']);
$action_url = https_url(G5_BBS_DIR) . "/write_update.php"; $action_url = https_url(G5_BBS_DIR) . "/write_update.php";
echo '<!-- skin : ' . (G5_IS_MOBILE ? $board['bo_mobile_skin'] : $board['bo_skin']) . ' -->'; echo '<!-- skin : ' . (G5_IS_MOBILE ? $board['bo_mobile_skin'] : $board['bo_skin']) . ' -->';
include_once ($board_skin_path.'/write.skin.php');
?> include_once $board_skin_path . '/write.skin.php';

View file

@ -1,5 +1,8 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
include_once "_extend.php";
$option = ''; $option = '';
$option_hidden = ''; $option_hidden = '';
@ -33,7 +36,8 @@ echo $option_hidden;
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0); add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
$clap_o = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date, '%Y-%m-%d')='" . G5_TIME_YMD . "' and cl_ip='{$_SERVER['REMOTE_ADDR']}'"); $clap_o = sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date_format(cl_date, '%Y-%m-%d')='" . G5_TIME_YMD . "' and cl_ip='{$_SERVER['REMOTE_ADDR']}'");
?> ?>
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off"> <form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post"
enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>"> <input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
<input type="hidden" name="w" value="<?php echo $w ?>"> <input type="hidden" name="w" value="<?php echo $w ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>"> <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
@ -54,31 +58,38 @@ $clap_o=sql_fetch("select sum(cl_cnt) as sum from {$g5['clap_table']} where date
<button type="submit" id="btn_submit" class="ui-btn point" accesskey='s'>메세지<br>남기기</button> <button type="submit" id="btn_submit" class="ui-btn point" accesskey='s'>메세지<br>남기기</button>
<div class="ui-control"> <div class="ui-control">
<?php echo $option ?>&nbsp;&nbsp; <?php echo $option ?>&nbsp;&nbsp;
<? if(!$is_member){ ?> <?php if (!$is_member) { ?>
<input type="hidden" maxlength="20" name="wr_name" id="wr_name" placeholder="NAME" itemname="이름" required value="익명" /> <input type="hidden" maxlength="20" name="wr_name" id="wr_name" placeholder="NAME" itemname="이름" required
<input type="hidden" maxlength="20" id="wr_password" name="wr_password" placeholder="PASSWORD" itemname="패스워드" value="<?=time();?>" <?=$password_required?> /> value="익명" />
<? } ?> <input type="hidden" maxlength="20" id="wr_password" name="wr_password" placeholder="PASSWORD" itemname="패스워드"
<?if($is_admin && $w=='u') {?> value="<?= time(); ?>" <?= $password_required ?> />
<?for($k=0;$k<$board['bo_upload_count'];$k++){?> <?php } ?>
<?php if ($is_admin && $w == 'u') { ?>
<?php for ($k = 0; $k < $board['bo_upload_count']; $k++) { ?>
<dl class="files"> <dl class="files">
<dt> <dt>
<?php if ($file[$k]['file']) { ?> <?php if ($file[$k]['file']) { ?>
<a href="<?= G5_DATA_URL . "/file/" . $bo_table . "/" . $file[$k]['file'] ?>" target="_blank"> <a href="<?= G5_DATA_URL . "/file/" . $bo_table . "/" . $file[$k]['file'] ?>" target="_blank">
<img src="<?= G5_DATA_URL . "/file/" . $bo_table . "/" . $file[$k]['file'] ?>"></a> <img src="<?= G5_DATA_URL . "/file/" . $bo_table . "/" . $file[$k]['file'] ?>"></a>
<?}?> <?php } ?>
</dt> </dt>
<dd> <dd>
<input type="file" name="bf_file[]" title="파일첨부 <?php echo $k+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input full"> <input type="file" name="bf_file[]"
title="파일첨부 <?php echo $k + 1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능"
class="frm_file frm_input full">
<?php if ($is_file_content) { ?> <?php if ($is_file_content) { ?>
<input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$k]['bf_content'] : ''; ?>" title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50"> <input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$k]['bf_content'] : ''; ?>"
title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50">
<?php } ?> <?php } ?>
<?php if ($file[$k]['file']) { ?> <?php if ($file[$k]['file']) { ?>
<input type="checkbox" id="bf_file_del<?php echo $k ?>" name="bf_file_del[<?php echo $k; ?>]" value="1"> <label for="bf_file_del<?php echo $k ?>"><?php echo $file[$k]['source'].'('.$file[$k]['size'].')'; ?> 파일 삭제</label> <input type="checkbox" id="bf_file_del<?php echo $k ?>" name="bf_file_del[<?php echo $k; ?>]" value="1">
<label for="bf_file_del<?php echo $k ?>"><?php echo $file[$k]['source'] . '(' . $file[$k]['size'] . ')'; ?> 파일
삭제</label>
<?php } ?> <?php } ?>
</dd> </dd>
</dl> </dl>
<?}?> <?php } ?>
<?}?> <?php } ?>
</div> </div>
</div> </div>
</form> </form>
@ -97,19 +108,18 @@ $(function() {
}); });
<?php } ?> <?php } ?>
function fwrite_submit(f) function fwrite_submit(f) {
{ <?php if (!$is_admin) { ?>
<?if(!$is_admin){?>
let clap_max = 10; let clap_max = 10;
<? if($board['bo_1']!=''){?> <?php if ($board['bo_1'] != '') { ?>
clap_max = parseInt('<?= $board['bo_1'] ?>'); clap_max = parseInt('<?= $board['bo_1'] ?>');
<?}?> <?php } ?>
let clap_t = parseInt('<?= $clap_o['sum'] ?>'); let clap_t = parseInt('<?= $clap_o['sum'] ?>');
if (clap_max > 0 && clap_t >= clap_max) { if (clap_max > 0 && clap_t >= clap_max) {
alert("박수는 하루에 " + clap_max + "번 까지 칠 수 있습니다."); alert("박수는 하루에 " + clap_max + "번 까지 칠 수 있습니다.");
return false; return false;
} }
<?}?> <?php } ?>
if (f.wr_dum.value != '') { if (f.wr_dum.value != '') {
alert("스팸방지"); alert("스팸방지");
return false; return false;

View file

@ -1,9 +1,11 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
if($w!=u && $notice!=1) include_once "_extend.php";
include_once($board_skin_path.'/update_hit.php');
if ($w != "u" && $notice != 1)
include_once $board_skin_path . '/update_hit.php';
// 자신만의 코드를 넣어주세요. // 자신만의 코드를 넣어주세요.
goto_url("./board.php?bo_table=$bo_table"); goto_url("./board.php?bo_table=$bo_table");
?>