update and fix code

This commit is contained in:
Amberstone 2024-10-18 11:25:52 +09:00
parent 1aa77a0ada
commit f8f58e6f1b
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
7 changed files with 1345 additions and 1233 deletions

View file

@ -1,97 +1,140 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 /**
* from avocado common.lib
* @var string|int $year
* @var string|int $year_pre
* @var string|int $month_pre
* @var string|int $sc_no
*/
if (!defined('_GNUBOARD_'))
exit;
//include_once($board_skin_path."/moonday.php"); // 석봉운님의 음력날짜 함수 //include_once($board_skin_path."/moonday.php"); // 석봉운님의 음력날짜 함수
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
include_once(G5_LIB_PATH . '/thumbnail.lib.php');
if (preg_match('/%/', $width)) { if (preg_match('/%/', $width)) {
$col_width = "14%"; //표의 가로 폭이 100보다 크면 픽셀값입력 //표의 가로 폭이 100보다 크면 픽셀값입력
} else{ $col_width = "14%";
$col_width = round($width/7); //표의 가로 폭이 100보다 작거나 같으면 백분율 값을 입력 } else {
//표의 가로 폭이 100보다 작거나 같으면 백분율 값을 입력
$col_width = round($width / 7);
} }
$col_height= 80 ;//내용 들어갈 사각공간의 세로길이를 가로 폭과 같도록
$offset=$board['bo_3']? " ".$board['bo_3']." hours" : ""; //내용 들어갈 사각공간의 세로길이를 가로 폭과 같도록
$today=date('Ymd',strtotime(date('Y/m/d H:i:s').$offset)); $col_height = 80;
$b_mon = date('n',strtotime($today));
$b_day = date('j',strtotime($today)); $offset = $board['bo_3'] ? " " . $board['bo_3'] . " hours" : "";
$b_year = date('Y',strtotime($today)); $today = date('Ymd', strtotime(date('Y/m/d H:i:s') . $offset));
if ($year < 1) { // 오늘의 달력 일때 $b_mon = date('n', strtotime($today));
$b_day = date('j', strtotime($today));
$b_year = date('Y', strtotime($today));
// 오늘의 달력 일때
if ($year < 1) {
$month = $b_mon; $month = $b_mon;
$mday = $b_day; $mday = $b_day;
$year = $b_year; $year = $b_year;
} }
if(!$year) $year = date("Y"); if (!$year)
$file_index = $board_skin_path."/day"; ### 기념일 폴더 위치 지정 $year = date("Y");
// 기념일 폴더 위치 지정
$file_index = $board_skin_path . "/day";
### 양력 기념일 파일 지정 : 해당년도 파일이 없으면 기본파일(solar.txt)을 불러온다 // 양력 기념일 파일 지정 : 해당년도 파일이 없으면 기본파일(solar.txt)을 불러온다
//$dayfile = file($file_index."/solar.txt"); // $dayfile = file($file_index."/solar.txt");
$lastday=array(0,31,28,31,30,31,30,31,31,30,31,30,31); $lastday = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if ($year%4 == 0) $lastday[2] = 29; if ($year % 4 == 0)
$dayoftheweek = date("w", mktime (0,0,0,$month,1,$year)); $lastday[2] = 29;
$dayoftheweek = date("w", mktime(0, 0, 0, $month, 1, $year));
$cday = 1; $cday = 1;
$sel_mon = sprintf("%02d",$month); $sel_mon = sprintf("%02d", $month);
// 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);
$width=$board['bo_table_width'] ? $board['bo_table_width'] : 1000; $width = $board['bo_table_width'] ? $board['bo_table_width'] : 1000;
if($width>100) $width.="px"; if ($width > 100)
else $width.="%"; $width .= "px";
$gall_w=$board['bo_1'] ? $board['bo_1'] : 400; else
$gall_h=$board['bo_2'] ? $board['bo_2'] : 300; $width .= "%";
$gall_w = $board['bo_1'] ? $board['bo_1'] : 400;
$gall_h = $board['bo_2'] ? $board['bo_2'] : 300;
$year_pre = 0;
$month_pre = 0;
?> ?>
<div id="bo_frame" style="max-width:<?= $width ?>;margin:0 auto;">
<div id="bo_frame" style="max-width:<?=$width?>;margin:0 auto;"> <!-- 상단 공지 부분 -->
<!-- 상단 공지 부분 -->
<nav class="pg_wrap theme-box"> <nav class="pg_wrap theme-box">
<span class="pg control"> <span class="pg control">
<a href="<?php echo G5_BBS_URL."/board.php?bo_table=".$bo_table."&"; <a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&";
if ($month == 1) { if ($month == 1) {
$year_pre=$year-1; $month_pre=$month; $year_pre = $year - 1;
$month_pre = $month;
} else { } else {
$year_pre=$year-1; $month_pre=$month; $year_pre = $year - 1;
$month_pre = $month;
} }
echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no");?>" class="pg_page"> echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no"); ?>" class="pg_page">
<i class="ico prevyr txt-default"><?php echo $year_pre ?></i> <i class="ico prevyr txt-default"><?= $year_pre ?></i>
</a><a href="<?php echo G5_BBS_URL."/board.php?bo_table=".$bo_table."&"; </a><a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&";
if ($month == 1) { if ($month == 1) {
$year_pre=$year-1; $month_pre=12; $year_pre = $year - 1;
$month_pre = 12;
} else { } else {
$year_pre=$year; $month_pre=$month-1; $year_pre = $year;
$month_pre = $month - 1;
} }
echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no");?>" class="pg_page"> echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no"); ?>" class="pg_page">
<i class="ico prevmth txt-default"><?php echo $month_pre ?></i> <i class="ico prevmth txt-default"><?= $month_pre ?></i>
</a> </a>
</span> </span>
<span class="pg"> <span class="pg">
<strong class="year"><?=$year?></strong><?for($m=1;$m<=12;$m++){ <strong class="year"><?= $year ?></strong><?php for ($m = 1; $m <= 12; $m++) {
if($m==$month){ if ($m == $month) {
?><strong class="pg_current pg_page month" title="<?=$year?>년 <?=$m?>월"><span class="txt-point"><?=$m?></span></strong><?} ?><strong class="pg_current pg_page month" title="<?= $year ?>년 <?= $m ?>월"><span
else{?><a href="<?php echo G5_BBS_URL."/board.php?bo_table=".$bo_table."&year=".$year."&month=".$m."&sc_no=".$sc_no; ?>" class="pg_page month"><span class="txt-default"><?=$m?></span></a><?}?> class="txt-point"><?= $m ?></span></strong><?php } else { ?>
<?}?> <a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&year=" . $year . "&month=" . $m . "&sc_no=" . $sc_no; ?>"
class="pg_page month">
<span class="txt-default"><?= $m ?></span>
</a>
<?php } ?>
<?php } ?>
</span> </span>
<span class="pg control"> <span class="pg control">
<a href="<?php echo G5_BBS_URL."/board.php?bo_table=".$bo_table."&"; <a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&";
if ($month == 12) { if ($month == 12) {
$year_pre=$year+1; $month_pre=1; } else {$year_pre=$year; $month_pre=$month+1;} echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no");?>" class="pg_page"> $year_pre = $year + 1;
<i class="ico nextmth txt-default"><?php echo $month_pre ?></i> $month_pre = 1;
</a><a href="<?php echo G5_BBS_URL."/board.php?bo_table=".$bo_table."&"; } else {
if ($month == 12) { $year_pre = $year;
$year_pre=$year+1; $month_pre=$month; } else {$year_pre=$year+1; $month_pre=$month; $month_pre = $month + 1;
} }
echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no");?>" class="pg_page"> echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no"); ?>" class="pg_page">
<i class="ico nextyr txt-default"><?php echo $year_pre ?></i> <i class="ico nextmth txt-default"><?= $month_pre ?></i>
</a><a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&";
if ($month == 12) {
$year_pre = $year + 1;
$month_pre = $month;
} else {
$year_pre = $year + 1;
$month_pre = $month;
}
echo ("year={$year_pre}&month={$month_pre}&sc_no={$sc_no}"); ?>" class="pg_page">
<i class="ico nextyr txt-default"><?= $year_pre ?></i>
</a> </a>
</span> </span>
</nav> </nav>
<div id="bo_list"> <div id="bo_list">
<section id="diary_calendar"> <section id="diary_calendar">
<div class="diary-calendar theme-box"> <div class="diary-calendar theme-box">
<h2 class="this-month txt-point"><?=$year?>/<?=$sel_mon?></h2> <h2 class="this-month txt-point"><?= $year ?>/<?= $sel_mon ?></h2>
<div class="controls txt-right"> <div class="controls txt-right">
<?php if ($admin_href) { ?><a href="<?php echo $admin_href ?>" class="ui-btn small admin">관리자</a><?php } ?> <?php if ($admin_href) { ?><a href="<?= $admin_href ?>" class="ui-btn small admin">관리자</a><?php } ?>
</div> </div>
<table class="theme-list calendar-list"> <table class="theme-list calendar-list">
<thead> <thead>
@ -109,49 +152,54 @@ $gall_h=$board['bo_2'] ? $board['bo_2'] : 300;
<?php <?php
$query = "SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_id ASC"; $query = "SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_id ASC";
$result = sql_query($query); $result = sql_query($query);
$j=0; // layer id $j = 0; // layer id
// 내용을 보여주는 부분 // 내용을 보여주는 부분
while ($row = sql_fetch_array($result)) { // 제목글 뽑아서 링크 문자열 만들기.. while ($row = sql_fetch_array($result)) { // 제목글 뽑아서 링크 문자열 만들기..
if(strstr($row['wr_option'],"secret") && (!$is_admin || ($row['mb_id'] && $member['mb_id']!=$member['mb_id']))) continue; if (strstr($row['wr_option'], "secret") && (!$is_admin || ($row['mb_id'] && $member['mb_id'] != $member['mb_id'])))
if( substr($row['wr_1'],0,6) < $year.$sel_mon ) { continue;
$start_day =1; if (substr($row['wr_1'], 0, 6) < $year . $sel_mon) {
$start_day= (int)$start_day; $start_day = 1;
$start_day = (int) $start_day;
} else { } else {
$start_day = substr($row['wr_1'],6,2); $start_day = substr($row['wr_1'], 6, 2);
$start_day= (int)$start_day; $start_day = (int) $start_day;
} }
$end_day = $start_day; $end_day = $start_day;
if(!$write_href){ $link=''; $cursor=" default";} if (!$write_href) {
else if($is_admin || ($member['mb_id'] && $member['mb_id']==$row['mb_id'])){ $link = '';
$cursor=""; $cursor = " default";
$link="get_info('".$row['wr_1']."');"; } else if ($is_admin || ($member['mb_id'] && $member['mb_id'] == $row['mb_id'])) {
$cursor = "";
$link = "get_info('" . $row['wr_1'] . "');";
} else {
$link = "";
$cursor = " default";
} }
else { $secret = strstr($row['wr_option'], "secret") ? "secret" : "";
$link="";
$cursor=" default";
}
$secret=strstr($row['wr_option'],"secret") ? "secret":"";
$html_day[$start_day].= '<a href="#" onclick="'.$link.' return false;" id="d_'.$row['wr_1'].'" class="wr-date ui-btn point'.$cursor.'">'; $html_day[$start_day] .= '<a href="#" onclick="' . $link . ' return false;" id="d_' . $row['wr_1'] . '" class="wr-date ui-btn point' . $cursor . '">';
$html_day[$start_day].= '<i>'.$start_day.'</i>'; $html_day[$start_day] .= '<i>' . $start_day . '</i>';
$html_day[$start_day].='</a>'; $html_day[$start_day] .= '</a>';
} }
// 달력의 틀을 보여주는 부분 // 달력의 틀을 보여주는 부분
$temp = 7- (($lastday[$month]+$dayoftheweek)%7); $temp = 7 - (($lastday[$month] + $dayoftheweek) % 7);
if ($temp == 7) $temp = 0; if ($temp == 7)
$lastcount = $lastday[$month]+$dayoftheweek + $temp; $temp = 0;
$lastcount = $lastday[$month] + $dayoftheweek + $temp;
for ($iz = 1; $iz <= $lastcount; $iz++) { // 42번을 칠하게 된다. for ($iz = 1; $iz <= $lastcount; $iz++) { // 42번을 칠하게 된다.
$bgcolor = "days"; // 쭉 흰색으로 칠하고 $bgcolor = "days"; // 쭉 흰색으로 칠하고
if ($b_year==$year && $b_mon==$month && $b_day==$cday) $bgcolor = "today"; // 오늘날짜 표기 if ($b_year == $year && $b_mon == $month && $b_day == $cday)
$re=$iz%7; $bgcolor = "today"; // 오늘날짜 표기
if ($re == 1) echo ("<tr>"); // 주당 7개씩 한쎌씩을 쌓는다. $re = $iz % 7;
if ($dayoftheweek < $iz && $iz <= $lastday[$month]+$dayoftheweek) { if ($re == 1)
echo ("<tr>"); // 주당 7개씩 한쎌씩을 쌓는다.
if ($dayoftheweek < $iz && $iz <= $lastday[$month] + $dayoftheweek) {
// 전체 루프안에서 숫자가 들어가는 셀들만 해당됨 // 전체 루프안에서 숫자가 들어가는 셀들만 해당됨
// 즉 11월 달에서 1일부터 30 일까지만 해당 // 즉 11월 달에서 1일부터 30 일까지만 해당
$daytext = "$cday"; // $cday 는 숫자 예> 11월달은 1~ 30일 까지 $daytext = "$cday"; // $cday 는 숫자 예> 11월달은 1~ 30일 까지
@ -159,26 +207,29 @@ $gall_h=$board['bo_2'] ? $board['bo_2'] : 300;
// 여기까지 숫자와 들어갈 내용에 대한 변수들의 세팅이 끝나고 // 여기까지 숫자와 들어갈 내용에 대한 변수들의 세팅이 끝나고
// 이제 여기 부터 직접 셀이 그려지면서 그 안에 내용이 들어 간다. // 이제 여기 부터 직접 셀이 그려지면서 그 안에 내용이 들어 간다.
if($re==0) $col="right"; if ($re == 0)
else if($re==1) $col="left"; $col = "right";
else $col=""; else if ($re == 1)
$fr_date = $year.sprintf("%02d",$month).sprintf("%02d",$cday); $col = "left";
else
$col = "";
$fr_date = $year . sprintf("%02d", $month) . sprintf("%02d", $cday);
echo ("<td width=$col_width height=$col_height class='{$bgcolor} {$col}' valign='top'>"); echo ("<td width=$col_width height=$col_height class='{$bgcolor} {$col}' valign='top'>");
// 기념일 파일 내용 비교위한 변수 선언, 월과 일을 두자리 포맷으로 고정 // 기념일 파일 내용 비교위한 변수 선언, 월과 일을 두자리 포맷으로 고정
if (strlen($month) == 1) { if (strlen($month) == 1) {
$monthp = "0".$month ; $monthp = "0" . $month;
} else { } else {
$monthp = $month ; $monthp = $month;
} }
if (strlen($cday) == 1) { if (strlen($cday) == 1) {
$cdayp = "0".$cday ; $cdayp = "0" . $cday;
} else { } else {
$cdayp = $cday ; $cdayp = $cday;
} }
$memday = $year.$monthp.$cdayp; $memday = $year . $monthp . $cdayp;
$daycont = "" ; $daycont = "";
// 기념일(양력) 표시 // 기념일(양력) 표시
/* /*
@ -191,8 +242,8 @@ $gall_h=$board['bo_2'] ? $board['bo_2'] : 300;
} }
} }
*/ */
/*
// 석봉운님의 음력날짜 변수선언 // 석봉운님의 음력날짜 변수선언
/*
$myarray = soltolun($year,$month,$cday); $myarray = soltolun($year,$month,$cday);
if ($myarray[day]==1 || $myarray[day]==11 || $myarray[day]==21) { if ($myarray[day]==1 || $myarray[day]==11 || $myarray[day]==21) {
$moonday ="<font color='gray'>&nbsp;(음)$myarray[month].$myarray[day]$myarray[leap]</font>"; $moonday ="<font color='gray'>&nbsp;(음)$myarray[month].$myarray[day]$myarray[leap]</font>";
@ -205,96 +256,114 @@ $gall_h=$board['bo_2'] ? $board['bo_2'] : 300;
if ($annivmoonday&&$daycont) $blank="<br />"; // 음력절기와 양력기념일이 동시에 있으면 한칸 띔 if ($annivmoonday&&$daycont) $blank="<br />"; // 음력절기와 양력기념일이 동시에 있으면 한칸 띔
else $blank=""; else $blank="";
*/ */
if($html_day[$cday]){ if ($html_day[$cday]) {
echo $html_day[$cday]; echo $html_day[$cday];
}else { } else {
if($write_href){ $wlink="get_info('".$fr_date."');"; $cursor="";} if ($write_href) {
else {$wlink=""; $cursor=" default";} $wlink = "get_info('" . $fr_date . "');";
$html_day[$cday].= '<a href="#" onclick="'.$wlink.' return false;" id="w_'.$fr_date.'" class="wr-date ui-btn etc'.$cursor.'" data-date="'.$fr_date.'" data-mood="" data-etc="" data-wid="">'; $cursor = "";
$html_day[$cday].= '<i>'.$daytext.'</i>'; } else {
$html_day[$cday].='</a>'; $wlink = "";
$cursor = " default";
}
$html_day[$cday] .= '<a href="#" onclick="' . $wlink . ' return false;" id="w_' . $fr_date . '" class="wr-date ui-btn etc' . $cursor . '" data-date="' . $fr_date . '" data-mood="" data-etc="" data-wid="">';
$html_day[$cday] .= '<i>' . $daytext . '</i>';
$html_day[$cday] .= '</a>';
echo $html_day[$cday]; echo $html_day[$cday];
} }
echo ("</td>"); // 한칸을 마무리 echo ("</td>"); // 한칸을 마무리
$cday++; // 날짜를 카운팅 $cday++; // 날짜를 카운팅
} }
// 유효날짜가 아니면 그냥 회색을 칠한다. // 유효날짜가 아니면 그냥 회색을 칠한다.
else { echo ("<td width=$col_width height=$col_height class='noday'>&nbsp;</td>"); } else {
if ($re == 0) echo ("</tr>"); echo ("<td width=$col_width height=$col_height class='noday'>&nbsp;</td>");
}
if ($re == 0)
echo ("</tr>");
} // 반복구문이 끝남 } // 반복구문이 끝남
unset($row); unset($row);
?> ?>
</tbody> </tbody>
</table> </table>
</div> </div>
<? if($board['bo_content_head']) { ?> <?php if ($board['bo_content_head']) { ?>
<hr class="padding small"> <hr class="padding small">
<div class="board-notice"> <div class="board-notice">
<?=stripslashes($board['bo_content_head']);?> <?= stripslashes($board['bo_content_head']); ?>
</div> </div>
<? } ?> <?php } ?>
<?if($is_member && $write_href){?> <?php if ($is_member && $write_href) { ?>
<hr class="padding small"> <hr class="padding small">
<div id="diary_write" class="none-trans"> <div id="diary_write" class="none-trans">
<div class="theme-box"> <div class="theme-box">
<a href="#" onclick="$('#bo_w').toggleClass('on');return false;" id="write_open"> 글쓰기</a> <a href="#" onclick="$('#bo_w').toggleClass('on');return false;" id="write_open"> 글쓰기</a>
<? include_once($board_skin_path.'/write.php');?> <?php include_once($board_skin_path . '/write.php'); ?>
</div> </div>
</div> </div>
<hr class="padding small"> <hr class="padding small">
<?}?> <?php } ?>
</section> </section>
<section id="diary_list"> <section id="diary_list">
<div class="diary-cont"> <div class="diary-cont">
<? <?php
$order=$board['bo_4'] ? "asc" : "desc"; $order = $board['bo_4'] ? "asc" : "desc";
$result=sql_query("SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_1 {$order}"); $result = sql_query("SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_1 {$order}");
for($i=0;$row = sql_fetch_array($result);$i++){ for ($i = 0; $row = sql_fetch_array($result); $i++) {
if(strstr($row['wr_option'],"secret") && (!$is_admin || ($row['mb_id'] && $member['mb_id']!=$member['mb_id']))) continue; if (strstr($row['wr_option'], "secret") && (!$is_admin || ($row['mb_id'] && $member['mb_id'] != $member['mb_id'])))
continue;
?> ?>
<div class="theme-box" id="w_<?=$row['wr_1']?>" data-date="<?=$row['wr_1']?>" data-wid="<?=$row['wr_id']?>"> <div class="theme-box" id="w_<?= $row['wr_1'] ?>" data-date="<?= $row['wr_1'] ?>"
data-wid="<?= $row['wr_id'] ?>">
<div class="options"> <div class="options">
<h3 class="wr_date"><?=substr($row['wr_1'],0,4)?>/<?=substr($row['wr_1'],4,2)?>/<?=substr($row['wr_1'],6,2)?><span class="secret"><?=strstr($row['wr_option'],"secret") ? " ::":"";?></span></h3> <h3 class="wr_date">
<?= substr($row['wr_1'], 0, 4) ?>/<?= substr($row['wr_1'], 4, 2) ?>/<?= substr($row['wr_1'], 6, 2) ?><span
class="secret"><?= strstr($row['wr_option'], "secret") ? " ::" : ""; ?></span>
</h3>
<p class="btn_confirm"> <p class="btn_confirm">
<? if($is_admin || ($member['mb_id'] && $member['mb_id']==$row['mb_id'])){ <?php if ($is_admin || ($member['mb_id'] && $member['mb_id'] == $row['mb_id'])) {
$cursor=""; $cursor = "";
$delete_href = ""; $delete_href = "";
// 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능 // 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능
if (($member['mb_id'] && ($member['mb_id'] == $row['mb_id'])) || $is_admin) { if (($member['mb_id'] && ($member['mb_id'] == $row['mb_id'])) || $is_admin) {
$delete_href = "javascript:del('./delete.php?bo_table=".$bo_table."&wr_id=".$row['wr_id']."&page=".$page.urldecode($qstr)."');"; $delete_href = "javascript:del('./delete.php?bo_table=" . $bo_table . "&wr_id=" . $row['wr_id'] . "&page=" . $page . urldecode($qstr) . "');";
if ($is_admin) if ($is_admin) {
{ $delete_href = "javascript:del('./delete.php?bo_table=" . $bo_table . "&wr_id=" . $row['wr_id'] . "&token=" . $token . "&page=" . $page . urldecode($qstr) . "');";
$delete_href = "javascript:del('./delete.php?bo_table=".$bo_table."&wr_id=".$row['wr_id']."&token=".$token."&page=".$page.urldecode($qstr)."');";
} }
} else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
$delete_href = "./password.php?w=d&bo_table=" . $bo_table . "&wr_id=" . $row['wr_id'] . "&page=" . $page . $qstr;
} }
else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면 ?><a href="#" onclick="get_info('<?= $row['wr_1'] ?>'); return false;">M</a><a
$delete_href = "./password.php?w=d&bo_table=".$bo_table."&wr_id=".$row['wr_id']."&page=".$page.$qstr; href="<?= $delete_href ?>">D</a>
} <?php
?><a href="#" onclick="get_info('<?=$row['wr_1']?>'); return false;">M</a><a href="<?=$delete_href?>">D</a><? } ?>
}?>
</p> </p>
</div> </div>
<hr class="line"> <hr class="line">
<div class="ui-cont<?=$row['wr_file'] ? " with-image":"";?>"> <div class="ui-cont<?= $row['wr_file'] ? " with-image" : ""; ?>">
<div class="ui-thumb file" data-file="<?=$row['wr_file']?>"> <div class="ui-thumb file" data-file="<?= $row['wr_file'] ?>">
<?if($row['wr_file']){ <?php if ($row['wr_file']) {
$thumb=get_list_thumbnail($bo_table,$row['wr_id'],$gall_w,$gall_h,false,true); $thumb = get_list_thumbnail($bo_table, $row['wr_id'], $gall_w, $gall_h, false, true);
$thumb2= get_mmb_image($bo_table, $row['wr_id']); $thumb2 = get_mmb_image($bo_table, $row['wr_id']);
?> ?>
<a href="<?=$thumb2['src']?>" onclick="view_img(this.href);return false;"><img src="<?=$thumb['src']?>"></a> <a href="<?= $thumb2['src'] ?>" onclick="view_img(this.href);return false;"><img
<?}?> src="<?= $thumb['src'] ?>"></a>
<?php } ?>
</div> </div>
<div class="diary-text"> <div class="diary-text">
<p class="misc"><?if($row['wr_4']){?><em><?=$board['bo_5'] ? $board['bo_5']: "[날씨]";?></em> <span class="weather"><?=$row['wr_4']?></span><?}if($row['wr_3']){?><em><?=$board['bo_6'] ? $board['bo_6']: "[무드]";?></em> <span class="mood"><?=$row['wr_3']?></span><?}?></p> <p class="misc"><?php if ($row['wr_4']) { ?><em><?= $board['bo_5'] ? $board['bo_5'] : "[날씨]"; ?></em>
<div class="content"><?=nl2br($row['wr_content'])?></div> <span class="weather"><?= $row['wr_4'] ?></span><?php }
if ($row['wr_3']) { ?><em><?= $board['bo_6'] ? $board['bo_6'] : "[무드]"; ?></em>
<span class="mood"><?= $row['wr_3'] ?></span><?php } ?>
</p>
<div class="content"><?= nl2br($row['wr_content']) ?></div>
</div> </div>
</div> </div>
</div> </div>
<hr class="padding small"> <hr class="padding small">
<?}?> <?php } ?>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
<div id="view_img"> <div id="view_img">
<a href="#" onclick="$('#img_cont').empty();$('#view_img').removeClass();return false;" id="img_close"> <a href="#" onclick="$('#img_cont').empty();$('#view_img').removeClass();return false;" id="img_close">
@ -302,25 +371,25 @@ $gall_h=$board['bo_2'] ? $board['bo_2'] : 300;
</a> </a>
</div> </div>
<script> <script>
function view_img(url){ function view_img(url) {
$("#view_img").addClass('on'); $("#view_img").addClass('on');
$("#img_cont").empty().html('<p><img src="'+url+'"></p>'); $("#img_cont").empty().html('<p><img src="' + url + '"></p>');
} }
const bo_skin_url="<?=$board_skin_url?>"; const bo_skin_url = "<?= $board_skin_url ?>";
<?if($is_member && $write_href){?> <?php if ($is_member && $write_href) { ?>
const idx=$("td.today .wr-date").data("wid"); const idx = $("td.today .wr-date").data("wid");
if(idx!='')$("#btn_submit").prop("disabled",true); if (idx != '') $("#btn_submit").prop("disabled", true);
function get_info(wr_id){ function get_info(wr_id) {
$('#bo_w').addClass('on'); $('#bo_w').addClass('on');
let elem=$("#w_"+wr_id); let elem = $("#w_" + wr_id);
let wid=elem.data("wid"); let wid = elem.data("wid");
let w_date=elem.data("date"); let w_date = elem.data("date");
let contents=$("#wr_content").val(); let contents = $("#wr_content").val();
if(contents!='' && $("#write_w").val()==''){ if (contents != '' && $("#write_w").val() == '') {
var result=confirm("작성하던 내용을 파기합니까?"); var result = confirm("작성하던 내용을 파기합니까?");
if(!result) return false; if (!result) return false;
} }
$("#btn_submit").prop("disabled",false); $("#btn_submit").prop("disabled", false);
$("#write_open").text("▶ 글쓰기"); $("#write_open").text("▶ 글쓰기");
$("#wr_subject").val(w_date); $("#wr_subject").val(w_date);
@ -332,12 +401,12 @@ $gall_h=$board['bo_2'] ? $board['bo_2'] : 300;
$("#write_id").val(""); $("#write_id").val("");
$("#wr_file").val(""); $("#wr_file").val("");
$("#file_del").addClass("sound_only"); $("#file_del").addClass("sound_only");
$("#secret").prop("checked",false); $("#secret").prop("checked", false);
if(wid>0){ if (wid > 0) {
$("#write_open").text("▶ 글수정"); $("#write_open").text("▶ 글수정");
let w_3=elem.find(".mood").text(); let w_3 = elem.find(".mood").text();
let w_4=elem.find(".weather").text(); let w_4 = elem.find(".weather").text();
let w_content=elem.find(".content").text(); let w_content = elem.find(".content").text();
let w_file = elem.find(".file").data("file"); let w_file = elem.find(".file").data("file");
let w_secret = elem.find(".secret").text(); let w_secret = elem.find(".secret").text();
$("#wr_content").val(w_content); $("#wr_content").val(w_content);
@ -345,22 +414,23 @@ $gall_h=$board['bo_2'] ? $board['bo_2'] : 300;
$("#wr_4").val(w_4); $("#wr_4").val(w_4);
$("#write_w").val("u"); $("#write_w").val("u");
$("#write_id").val(wid); $("#write_id").val(wid);
if(w_file=='1') $("#file_del").removeClass(); if (w_file == '1') $("#file_del").removeClass();
if(w_secret) $("#secret").prop("checked",true); if (w_secret) $("#secret").prop("checked", true);
} }
}; };
const d_pos=$("#diary_write").offset().top; const d_pos = $("#diary_write").offset().top;
console.log(d_pos); console.log(d_pos);
if($(window).width()<=720){ if ($(window).width() <= 720) {
$(window).scroll(function(){ $(window).scroll(function () {
var w_pos=$(window).scrollTop(); var w_pos = $(window).scrollTop();
if(w_pos>=d_pos){ if (w_pos >= d_pos) {
$("#diary_write").addClass("scroll-fix"); $("#diary_write").addClass("scroll-fix");
}else if (w_pos<d_pos){ } else if (w_pos < d_pos) {
$("#diary_write").removeClass("scroll-fix").css("transform","translateY(0)"); $("#diary_write").removeClass("scroll-fix").css("transform", "translateY(0)");
} }
}); } });
<?}?> }
<?php } ?>
</script> </script>

View file

@ -1,92 +1,101 @@
<?php <?php
############################################################# /**
/* * @author 대하 (https://extrashot.tistory.com/pages/Extra-Shot), phpschool 석봉운 (http://www.phpschool.com/bbs2/inc_view.html?id=9914&code=tnt2), Amber (https://info.drk.st/about)
*
PHPschool의 석봉운님 오픈소스를 수정하여 사용하였습니다. * PHPschool의 석봉운님 오픈소스를 수정하여 사용하였습니다.
석봉운님께 감사드립니다. * 석봉운님께 감사드립니다.
주소 http://www.phpschool.com/bbs2/inc_view.html?id=9914&code=tnt2 * 주소 http://www.phpschool.com/bbs2/inc_view.html?id=9914&code=tnt2
*
음력 데이터는 * 음력 데이터는
작은 : 1 * 작은 : 1
큰달 : 2 * 큰달 : 2
윤달이 있는 - 평달이 작고 윤달도 작으면 : 3 * 윤달이 있는 - 평달이 작고 윤달도 작으면 : 3
평달이 작고 윤달이 크면: 4 * 평달이 작고 윤달이 크면: 4
평달이 크고 윤달이 작으면 : 5 * 평달이 크고 윤달이 작으면 : 5
평달과 윤달이 모두 크면: 6 * 평달과 윤달이 모두 크면: 6
* @var int[] $kk
* @var int[] $md
*
* compatible php 5.3.x
*/ */
#############################################################
$kk = array ( $kk = array (
//1841년 ~ 1900년 //1841년 ~ 1900년
1,2,4,1,1,2,1,2,1,2,2,1, 2,2,1,2,1,1,2,1,2,1,2,1, 2,2,2,1,2,1,4,1,2,1,2,1, 2,2,1,2,1,2,1,2,1,2,1,2, 1,2,1,2,2,1,2,1,2,1,2,1, 1,2,4,1,1,2,1,2,1,2,2,1, 2,2,1,2,1,1,2,1,2,1,2,1, 2,2,2,1,2,1,4,1,2,1,2,1, 2,2,1,2,1,2,1,2,1,2,1,2, 1,2,1,2,2,1,2,1,2,1,2,1,
2,1,2,1,5,2,1,2,2,1,2,1, 2,1,1,2,1,2,1,2,2,2,1,2, 1,2,1,1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,2, 1,2,1,2,2,1,2,1,2,1,2,1,
2,1,5,2,1,2,2,1,2,1,2,1, 2,1,1,2,1,2,2,1,2,2,1,2, 1,2,1,1,2,1,5,2,2,2,1,2, 1,2,1,1,2,1,2,1,2,2,2,1, 2,1,2,1,1,2,1,1,2,2,1,2, 2,1,5,2,1,2,2,1,2,1,2,1, 2,1,1,2,1,2,2,1,2,2,1,2, 1,2,1,1,2,1,5,2,2,2,1,2, 1,2,1,1,2,1,2,1,2,2,2,1, 2,1,2,1,1,2,1,1,2,2,1,2,
2,2,1,2,1,4,1,1,2,1,2,2, 2,2,1,2,1,1,2,1,1,2,1,2, 2,2,1,2,1,2,1,2,1,1,2,1, 2,2,1,2,5,2,1,2,1,2,1,1, 2,1,2,2,1,2,2,1,2,1,2,1, 2,2,1,2,1,4,1,1,2,1,2,2, 2,2,1,2,1,1,2,1,1,2,1,2, 2,2,1,2,1,2,1,2,1,1,2,1, 2,2,1,2,5,2,1,2,1,2,1,1, 2,1,2,2,1,2,2,1,2,1,2,1,
2,1,1,2,1,2,2,1,2,2,1,2, 1,5,1,2,1,2,1,2,2,2,1,2, 1,2,1,1,2,1,1,2,2,1,2,2); 2,1,1,2,1,2,2,1,2,2,1,2, 1,5,1,2,1,2,1,2,2,2,1,2, 1,2,1,1,2,1,1,2,2,1,2,2);
###################################################
/* /*
$sy/ly : $sy/ly :
$sm/lm : $sm/lm :
$sd/ld : $sd/ld :
$leapyes: 윤달 $leapyes: 윤달
*/ */
###################################################
$md = array(31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); $md = array(31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
function febdays($sy) { function febdays($sy)
if(($sy%100 != 0 && $sy%4 ==0) || $sy%400 ==0) $md[1] = 29; {
else $md[1] = 28; global $md;
if (($sy % 100 != 0 && $sy % 4 == 0) || $sy % 400 == 0)
$md[1] = 29;
else
$md[1] = 28;
return array($md[1]); return array($md[1]);
} }
function alltd($sy) { function alltd($sy)
{
global $md; global $md;
$td = 0; $td = 0;
for($i=1841;$i<=$sy-1;$i++) { $ttd = array();
list($md[1]) = febdays($i); for ($i = 1841; $i <= $sy - 1; $i++) {
for($j=0;$j<12;$j++) { $ttd[$i] = array();
$ttd[$i][12] = 0;
$feb_days = febdays($i);
$md[1] = $feb_days[0];
for ($j = 0; $j < 12; $j++) {
$td += $md[$j]; $td += $md[$j];
$ttd[$i][12] += $md[$j]; $ttd[$i][12] += $md[$j];
} }
@ -95,117 +104,131 @@ function alltd($sy) {
return array($td); return array($td);
} }
function soltolun($sy, $sm, $sd) { function soltolun($sy, $sm, $sd)
global $kk; {
global $md; global $kk, $md;
$ly = 0;
$yoon = "";
list($td) = alltd($sy); $td_result = alltd($sy);
list($md[1]) = febdays($sy); $td = $td_result[0];
for($i=0;$i<$sm-1;$i++) $td += $md[$i]; $feb_days = febdays($sy);
$md[1] = $feb_days[0];
for ($i = 0; $i < $sm - 1; $i++)
$td += $md[$i];
$td += $sd; $td += $sd;
$i = 0; $i = 0;
$temptd = $td; $temptd = $td;
while($temptd>0) { while ($temptd > 0) {
$yoon = ""; $yoon = "";
switch($kk[$i]) { switch ($kk[$i]) {
case 1 : case 1:
$mm = 29; $mm = 29;
break; break;
case 2 : case 2:
$mm = 30; $mm = 30;
break; break;
case 3 : case 3:
$mm = 29; $mm = 29;
$ymm = 29; $ymm = 29;
if($temptd > 29) { if ($temptd > 29) {
$temptd -= 29; $temptd -= 29;
$yoon = "*"; $yoon = "*";
} }
break; break;
case 4 : case 4:
$mm = 29; $mm = 29;
$ymm = 30; $ymm = 30;
if($temptd > 30) { if ($temptd > 30) {
$temptd -= 30; $temptd -= 30;
$yoon = "*"; $yoon = "*";
} }
break; break;
case 5 : case 5:
$mm = 30; $mm = 30;
$ymm = 29; $ymm = 29;
if($temptd > 29) { if ($temptd > 29) {
$temptd -= 29; $temptd -= 29;
$yoon = "*"; $yoon = "*";
} }
break; break;
case 6 : case 6:
$mm = 30; $mm = 30;
$ymm = 30; $ymm = 30;
if($temptd > 30) { if ($temptd > 30) {
$temptd -= 30; $temptd -= 30;
$yoon = "*"; $yoon = "*";
} }
break; break;
} }
$temptd -=$mm; $temptd -= $mm;
$i++; $i++;
if($i%12 == 1) $ly += 1; if ($i % 12 == 1)
$ly += 1;
} }
if($temptd <= 0) { if ($temptd <= 0) {
if($yoon=="*") $temptd += $ymm; if ($yoon == "*")
else $temptd +=$mm; $temptd += $ymm;
else
$temptd += $mm;
} }
$ly += 1840; $ly += 1840;
$lm = $i % 12; $lm = $i % 12;
if($lm==0) $lm=12; if ($lm == 0)
$lm = 12;
$ld = $temptd; $ld = $temptd;
/* output */ /* output */
$myarray["year"] = $ly; $myarray = array(
$myarray["month"] = $lm; "year" => $ly,
$myarray["day"] = $ld; "month" => $lm,
$myarray["leap"] = $yoon; "day" => $ld,
"leap" => $yoon
);
return $myarray; return $myarray;
} }
function luntosol($ly, $lm, $ld) { function luntosol($ly, $lm, $ld, $leapyes = "")
global $kk; {
global $md; global $kk, $md;
$temptd = 0; $temptd = 0;
$dm = ($ly-1841)*12 + ($lm-1) -1; $dm = ($ly - 1841) * 12 + ($lm - 1) - 1;
for($i=$dm;$i>=0;$i--) { for ($i = $dm; $i >= 0; $i--) {
switch($kk[$i]) { switch ($kk[$i]) {
case 1 : case 1:
$temptd += 29; $temptd += 29;
break; break;
case 2 : case 2:
$temptd += 30; $temptd += 30;
break; break;
case 3 : case 3:
$temptd += 58; $temptd += 58;
break; break;
case 4 : case 4:
case 5 : case 5:
$temptd += 59; $temptd += 59;
break; break;
case 6 : case 6:
$temptd += 60; $temptd += 60;
break; break;
} }
} }
$dm = ($ly-1841)*12 + ($lm) -1;
if($leapyes == "yoon") { $dm = ($ly - 1841) * 12 + ($lm) - 1;
switch($kk[$dm]) {
case 1 : if ($leapyes == "yoon") {
case 2 : break; switch ($kk[$dm]) {
case 3 : case 1:
case 4 : case 2:
break;
case 3:
case 4:
$temptd += 29; $temptd += 29;
break; break;
case 5 : case 5:
case 6 : case 6:
$temptd += 30; $temptd += 30;
break; break;
} }
@ -215,13 +238,15 @@ function luntosol($ly, $lm, $ld) {
$temptd += 22; $temptd += 22;
$td = $temptd; $td = $temptd;
$tempsy = 1841; $tempsy = 1841;
while(1) { while (1) {
list($md[1]) = febdays($tempsy); $feb_days = febdays($tempsy);
for($tempsm=0;$tempsm<=11;$tempsm++) { $md[1] = $feb_days[0];
for ($tempsm = 0; $tempsm <= 11; $tempsm++) {
$temptd -= $md[$tempsm]; $temptd -= $md[$tempsm];
if($temptd <= 0) break; if ($temptd <= 0)
break;
} }
if($temptd <= 0) { if ($temptd <= 0) {
$temptd += $md[$tempsm]; $temptd += $md[$tempsm];
$tempsd = $temptd; $tempsd = $temptd;
break; break;
@ -234,11 +259,10 @@ function luntosol($ly, $lm, $ld) {
$sd = $tempsd; $sd = $tempsd;
/* output */ /* output */
$myyarray["year"] = $sy; $myyarray = array(
$myyarray["month"] = $sm; "year" => $sy,
$myyarray["day"] = $sd; "month" => $sm,
$myyarray["leap"] = $yoob; "day" => $sd
);
return $myyarray; return $myyarray;
} }
?>

View file

@ -10,3 +10,7 @@
``` ```
php 최소 버전: 5.3 php 최소 버전: 5.3
``` ```
## 설치방법
아보카도가 설치된 폴더의 하위 폴더인 `skin/board/``diary` 라는 폴더를 생성하고 파일을 업로드합니다.

View file

@ -1,9 +1,10 @@
<?php <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
include_once(G5_LIB_PATH.'/thumbnail.lib.php'); exit; // 개별 페이지 접근 불가
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);
?> ?>
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script> <script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
@ -13,7 +14,8 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<article id="bo_v" class="theme-box"> <article id="bo_v" class="theme-box">
<h2 id="bo_v_title" class="txt-center"> <h2 id="bo_v_title" class="txt-center">
<?php <?php
if ($category_name) echo $view['ca_name'].' | '; // 분류 출력 끝 if ($category_name)
echo $view['ca_name'] . ' | '; // 분류 출력 끝
echo cut_str(get_text($view['wr_subject']), 70); echo cut_str(get_text($view['wr_subject']), 70);
?> ?>
</h2> </h2>
@ -22,21 +24,21 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php <?php
if ($view['file']['count']) { if ($view['file']['count']) {
$cnt = 0; $cnt = 0;
for ($i=0; $i<count($view['file']); $i++) { for ($i = 0; $i < count($view['file']); $i++) {
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view'])
$cnt++; $cnt++;
} }
} }
?> ?>
<?php if($cnt) { ?> <?php if ($cnt) { ?>
<!-- 첨부파일 시작 { --> <!-- 첨부파일 시작 { -->
<section id="bo_v_file"> <section id="bo_v_file">
<h2>첨부파일</h2> <h2>첨부파일</h2>
<ul> <ul>
<?php <?php
// 가변 파일 // 가변 파일
for ($i=0; $i<count($view['file']); $i++) { for ($i = 0; $i < count($view['file']); $i++) {
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) { if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) {
?> ?>
<li> <li>
@ -64,13 +66,13 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php <?php
// 링크 // 링크
$cnt = 0; $cnt = 0;
for ($i=1; $i<=count($view['link']); $i++) { for ($i = 1; $i <= count($view['link']); $i++) {
if ($view['link'][$i]) { if ($view['link'][$i]) {
$cnt++; $cnt++;
$link = cut_str($view['link'][$i], 70); $link = cut_str($view['link'][$i], 70);
?> ?>
<li> <li>
<em>LINK <?=$i+1?></em> <a href="<?php echo $view['link_href'][$i] ?>" target="_blank"> <em>LINK <?= $i + 1 ?></em> <a href="<?php echo $view['link_href'][$i] ?>" target="_blank">
<strong><?php echo $link ?></strong> <strong><?php echo $link ?></strong>
</a> </a>
</li> </li>
@ -90,10 +92,10 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php <?php
// 파일 출력 // 파일 출력
$v_img_count = count($view['file']); $v_img_count = count($view['file']);
if($v_img_count) { if ($v_img_count) {
echo "<div id=\"bo_v_img\">\n"; echo "<div id=\"bo_v_img\">\n";
for ($i=0; $i<=count($view['file']); $i++) { for ($i = 0; $i <= count($view['file']); $i++) {
if ($view['file'][$i]['view']) { if ($view['file'][$i]['view']) {
//echo $view['file'][$i]['view']; //echo $view['file'][$i]['view'];
echo get_view_thumbnail($view['file'][$i]['view']); echo get_view_thumbnail($view['file'][$i]['view']);
@ -120,26 +122,29 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<!-- 링크 버튼 시작 { --> <!-- 링크 버튼 시작 { -->
<div id="bo_v_bot"> <div id="bo_v_bot">
<hr class="padding"> <hr class="padding">
<? <?php
ob_start(); ob_start();
?> ?>
<? if ($prev_href || $next_href) { ?> <?php if ($prev_href || $next_href) { ?>
<div class="bo_v_nb"> <div class="bo_v_nb">
<? if ($prev_href) { ?><a href="<? echo $prev_href ?>" class="ui-btn">이전글</a><? } ?> <?php if ($prev_href) { ?><a href="<?php echo $prev_href ?>" class="ui-btn">이전글</a><?php } ?>
<? if ($next_href) { ?><a href="<? echo $next_href ?>" class="ui-btn">다음글</a><? } ?> <?php if ($next_href) { ?><a href="<?php echo $next_href ?>" class="ui-btn">다음글</a><?php } ?>
</div> </div>
<? } ?> <?php } ?>
<div class="bo_v_com"> <div class="bo_v_com">
<? 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" onclick="del(this.href); return false;">삭제</a><? } ?> <?php if ($delete_href) { ?><a href="<?php echo $delete_href ?>" class="ui-btn"
<? if ($copy_href) { ?><a href="<? echo $copy_href ?>" class="ui-btn admin" onclick="board_move(this.href); return false;">복사</a><? } ?> onclick="del(this.href); return false;">삭제</a><?php } ?>
<? if ($move_href) { ?><a href="<? echo $move_href ?>" class="ui-btn admin" onclick="board_move(this.href); return false;">이동</a><? } ?> <?php if ($copy_href) { ?><a href="<?php echo $copy_href ?>" class="ui-btn admin"
<? if ($search_href) { ?><a href="<? echo $search_href ?>" class="ui-btn">검색</a><? } ?> onclick="board_move(this.href); return false;">복사</a><?php } ?>
<a href="<? echo $list_href ?>" class="ui-btn">목록</a> <?php if ($move_href) { ?><a href="<?php echo $move_href ?>" class="ui-btn admin"
<? if ($write_href) { ?><a href="<? echo $write_href ?>" class="ui-btn point">글쓰기</a><? } ?> onclick="board_move(this.href); return false;">이동</a><?php } ?>
<?php if ($search_href) { ?><a href="<?php echo $search_href ?>" class="ui-btn">검색</a><?php } ?>
<a href="<?php echo $list_href ?>" class="ui-btn">목록</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();
?> ?>
@ -150,18 +155,18 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<!-- } 게시판 읽기 --> <!-- } 게시판 읽기 -->
<script> <script>
<?php if ($board['bo_download_point'] < 0) { ?> <?php if ($board['bo_download_point'] < 0) { ?>
$(function() { $(function () {
$("a.view_file_download").click(function() { $("a.view_file_download").click(function () {
if(!g5_is_member) { if (!g5_is_member) {
alert("다운로드 권한이 없습니다.\n회원이시라면 로그인 후 이용해 보십시오."); alert("다운로드 권한이 없습니다.\n회원이시라면 로그인 후 이용해 보십시오.");
return false; return false;
} }
var msg = "파일을 다운로드 하시면 포인트가 차감(<?php echo number_format($board['bo_download_point']) ?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"; var msg = "파일을 다운로드 하시면 포인트가 차감(<?php echo number_format($board['bo_download_point']) ?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?";
if(confirm(msg)) { if (confirm(msg)) {
var href = $(this).attr("href")+"&js=on"; var href = $(this).attr("href") + "&js=on";
$(this).attr("href", href); $(this).attr("href", href);
return true; return true;
@ -169,26 +174,25 @@ $(function() {
return false; return false;
} }
}); });
}); });
<?php } ?> <?php } ?>
function board_move(href) function board_move(href) {
{
window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1"); window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
} }
</script> </script>
<script> <script>
$(function() { $(function () {
$("a.view_image").click(function() { $("a.view_image").click(function () {
window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no"); window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
return false; return false;
}); });
// 추천, 비추천 // 추천, 비추천
$("#good_button, #nogood_button").click(function() { $("#good_button, #nogood_button").click(function () {
var $tx; var $tx;
if(this.id == "good_button") if (this.id == "good_button")
$tx = $("#bo_v_act_good"); $tx = $("#bo_v_act_good");
else else
$tx = $("#bo_v_act_nogood"); $tx = $("#bo_v_act_nogood");
@ -199,22 +203,21 @@ $(function() {
// 이미지 리사이즈 // 이미지 리사이즈
$("#bo_v_atc").viewimageresize(); $("#bo_v_atc").viewimageresize();
}); });
function excute_good(href, $el, $tx) function excute_good(href, $el, $tx) {
{
$.post( $.post(
href, href,
{ js: "on" }, { js: "on" },
function(data) { function (data) {
if(data.error) { if (data.error) {
alert(data.error); alert(data.error);
return false; return false;
} }
if(data.count) { if (data.count) {
$el.find("strong").text(number_format(String(data.count))); $el.find("strong").text(number_format(String(data.count)));
if($tx.attr("id").search("nogood") > -1) { if ($tx.attr("id").search("nogood") > -1) {
$tx.text("이 글을 비추천하셨습니다."); $tx.text("이 글을 비추천하셨습니다.");
$tx.fadeIn(200).delay(2500).fadeOut(200); $tx.fadeIn(200).delay(2500).fadeOut(200);
} else { } else {
@ -224,6 +227,6 @@ function excute_good(href, $el, $tx)
} }
}, "json" }, "json"
); );
} }
</script> </script>
<!-- } 게시글 읽기 --> <!-- } 게시글 읽기 -->

View file

@ -21,9 +21,9 @@ if (!($w == '' || $w == 'u' || $w == 'r')) {
if ($w == 'u' || $w == 'r') { if ($w == 'u' || $w == 'r') {
if ($write['wr_id']) { if ($write['wr_id']) {
// 가변 변수로 $wr_1 .. $wr_10 까지 만든다. // 가변 변수로 $wr_1 .. $wr_10 까지 만든다.
for ($i=1; $i<=10; $i++) { for ($i = 1; $i <= 10; $i++) {
$vvar = "wr_".$i; $vvar = "wr_" . $i;
$$vvar = $write['wr_'.$i]; $$vvar = $write['wr_' . $i];
} }
} else { } else {
alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G5_URL); alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G5_URL);
@ -32,14 +32,14 @@ if ($w == 'u' || $w == 'r') {
if ($w == '') { if ($w == '') {
if ($wr_id) { if ($wr_id) {
alert('글쓰기에는 \$wr_id 값을 사용하지 않습니다.', G5_BBS_URL.'/board.php?bo_table='.$bo_table); alert('글쓰기에는 \$wr_id 값을 사용하지 않습니다.', G5_BBS_URL . '/board.php?bo_table=' . $bo_table);
} }
if ($member['mb_level'] < $board['bo_write_level']) { if ($member['mb_level'] < $board['bo_write_level']) {
if ($member['mb_id']) { if ($member['mb_id']) {
alert('글을 쓸 권한이 없습니다.'); alert('글을 쓸 권한이 없습니다.');
} else { } else {
alert("글을 쓸 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.", './login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table)); alert("글을 쓸 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.", './login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
} }
} }
@ -47,7 +47,7 @@ if ($w == '') {
if ($is_member) { if ($is_member) {
$tmp_point = ($member['mb_point'] > 0) ? $member['mb_point'] : 0; $tmp_point = ($member['mb_point'] > 0) ? $member['mb_point'] : 0;
if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin) { if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin) {
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글쓰기('.number_format($board['bo_write_point']).')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글쓰기 해 주십시오.'); alert('보유하신 포인트(' . number_format($member['mb_point']) . ')가 없거나 모자라서 글쓰기(' . number_format($board['bo_write_point']) . ')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글쓰기 해 주십시오.');
} }
} }
@ -55,18 +55,19 @@ if ($w == '') {
} else if ($w == 'u') { } else if ($w == 'u') {
// 김선용 1.00 : 글쓰기 권한과 수정은 별도로 처리되어야 함 // 김선용 1.00 : 글쓰기 권한과 수정은 별도로 처리되어야 함
//if ($member['mb_level'] < $board['bo_write_level']) { //if ($member['mb_level'] < $board['bo_write_level']) {
if($member['mb_id'] && $write['mb_id'] == $member['mb_id']) { if ($member['mb_id'] && $write['mb_id'] == $member['mb_id']) {
; ;
} else if ($member['mb_level'] < $board['bo_write_level']) { } else if ($member['mb_level'] < $board['bo_write_level']) {
if ($member['mb_id']) { if ($member['mb_id']) {
alert('글을 수정할 권한이 없습니다.'); alert('글을 수정할 권한이 없습니다.');
} else { } else {
alert('글을 수정할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table)); alert('글을 수정할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
} }
} }
$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);
// 원글만 구한다. // 원글만 구한다.
@ -86,7 +87,7 @@ if ($w == '') {
and wr_is_comment = 1 "; and wr_is_comment = 1 ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if ($board['bo_count_modify'] && $row['cnt'] >= $board['bo_count_modify'] && !$is_admin) if ($board['bo_count_modify'] && $row['cnt'] >= $board['bo_count_modify'] && !$is_admin)
alert('이 글과 관련된 댓글이 존재하므로 수정 할 수 없습니다.\\n\\n댓글이 '.$board['bo_count_modify'].'건 이상 달린 원글은 수정할 수 없습니다.'); alert('이 글과 관련된 댓글이 존재하므로 수정 할 수 없습니다.\\n\\n댓글이 ' . $board['bo_count_modify'] . '건 이상 달린 원글은 수정할 수 없습니다.');
$title_msg = '글수정'; $title_msg = '글수정';
} else if ($w == 'r') { } else if ($w == 'r') {
@ -94,15 +95,15 @@ if ($w == '') {
if ($member['mb_id']) if ($member['mb_id'])
alert('글을 답변할 권한이 없습니다.'); alert('글을 답변할 권한이 없습니다.');
else else
alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table)); alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
} }
$tmp_point = isset($member['mb_point']) ? $member['mb_point'] : 0; $tmp_point = isset($member['mb_point']) ? $member['mb_point'] : 0;
if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin) if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin)
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글답변('.number_format($board['bo_comment_point']).')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글답변 해 주십시오.'); alert('보유하신 포인트(' . number_format($member['mb_point']) . ')가 없거나 모자라서 글답변(' . number_format($board['bo_comment_point']) . ')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글답변 해 주십시오.');
//if (preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board['bo_notice'])) //if (preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board['bo_notice']))
if (in_array((int)$wr_id, $notice_array)) if (in_array((int) $wr_id, $notice_array))
alert('공지에는 답변 할 수 없습니다.'); alert('공지에는 답변 할 수 없습니다.');
//---------- //----------
@ -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'])
@ -158,13 +160,13 @@ if ($w == '') {
$title_msg = '글답변'; $title_msg = '글답변';
$write['wr_subject'] = 'Re: '.$write['wr_subject']; $write['wr_subject'] = 'Re: ' . $write['wr_subject'];
} }
// 그룹접근 가능 // 그룹접근 가능
if (!empty($group['gr_use_access'])) { if (!empty($group['gr_use_access'])) {
if ($is_guest) { if ($is_guest) {
alert("접근 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.", 'login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table)); alert("접근 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.", 'login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
} }
if ($is_admin == 'super' || $group['gr_admin'] == $member['mb_id'] || $board['bo_admin'] == $member['mb_id']) { if ($is_admin == 'super' || $group['gr_admin'] == $member['mb_id'] || $board['bo_admin'] == $member['mb_id']) {
@ -182,7 +184,7 @@ if (!empty($group['gr_use_access'])) {
if ($config['cf_cert_use'] && !$is_admin) { if ($config['cf_cert_use'] && !$is_admin) {
// 인증된 회원만 가능 // 인증된 회원만 가능
if ($board['bo_use_cert'] != '' && $is_guest) { if ($board['bo_use_cert'] != '' && $is_guest) {
alert('이 게시판은 본인확인 하신 회원님만 글쓰기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', 'login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table)); alert('이 게시판은 본인확인 하신 회원님만 글쓰기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', 'login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
} }
if ($board['bo_use_cert'] == 'cert' && !$member['mb_certify']) { if ($board['bo_use_cert'] == 'cert' && !$member['mb_certify']) {
@ -203,17 +205,14 @@ 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_max = (int) $board['bo_write_max'];
$write_min = (int)$board['bo_write_min'];
$write_max = (int)$board['bo_write_max'];
} }
$g5['title'] = ((G5_IS_MOBILE && $board['bo_mobile_subject']) ? $board['bo_mobile_subject'] : $board['bo_subject']).' '.$title_msg; $g5['title'] = ((G5_IS_MOBILE && $board['bo_mobile_subject']) ? $board['bo_mobile_subject'] : $board['bo_subject']) . ' ' . $title_msg;
$is_notice = false; $is_notice = false;
$notice_checked = ''; $notice_checked = '';
@ -225,7 +224,7 @@ if ($is_admin && $w != 'r') {
if ($write['wr_reply']) { if ($write['wr_reply']) {
$is_notice = false; $is_notice = false;
} else { } else {
if (in_array((int)$wr_id, $notice_array)) { if (in_array((int) $wr_id, $notice_array)) {
$notice_checked = 'checked'; $notice_checked = 'checked';
} }
} }
@ -282,7 +281,7 @@ if ($board['bo_use_file_content']) {
$is_file_content = true; $is_file_content = true;
} }
$file_count = (int)$board['bo_upload_count']; $file_count = (int) $board['bo_upload_count'];
$name = ""; $name = "";
$email = ""; $email = "";
@ -290,7 +289,7 @@ $homepage = "";
if ($w == "" || $w == "r") { if ($w == "" || $w == "r") {
if ($is_member) { if ($is_member) {
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']); $email = get_email_address($member['mb_email']);
$homepage = get_text(stripslashes($member['mb_homepage'])); $homepage = get_text(stripslashes($member['mb_homepage']));
@ -314,13 +313,13 @@ if ($w == '') {
} }
} }
$name = get_text(cut_str(stripslashes($write['wr_name']),20)); $name = get_text(cut_str(stripslashes($write['wr_name']), 20));
$email = get_email_address($write['wr_email']); $email = get_email_address($write['wr_email']);
$homepage = get_text(stripslashes($write['wr_homepage'])); $homepage = get_text(stripslashes($write['wr_homepage']));
for ($i=1; $i<=G5_LINK_COUNT; $i++) { for ($i = 1; $i <= G5_LINK_COUNT; $i++) {
$write['wr_link'.$i] = get_text($write['wr_link'.$i]); $write['wr_link' . $i] = get_text($write['wr_link' . $i]);
$link[$i] = $write['wr_link'.$i]; $link[$i] = $write['wr_link' . $i];
} }
if (strstr($write['wr_option'], 'html1')) { if (strstr($write['wr_option'], 'html1')) {
@ -336,7 +335,7 @@ if ($w == '') {
} }
$file = get_file($bo_table, $wr_id); $file = get_file($bo_table, $wr_id);
if($file_count < $file['count']) if ($file_count < $file['count'])
$file_count = $file['count']; $file_count = $file['count'];
} else if ($w == 'r') { } else if ($w == 'r') {
if (strstr($write['wr_option'], 'secret')) { if (strstr($write['wr_option'], 'secret')) {
@ -346,8 +345,8 @@ if ($w == '') {
$password_required = "required"; $password_required = "required";
for ($i=1; $i<=G5_LINK_COUNT; $i++) { for ($i = 1; $i <= G5_LINK_COUNT; $i++) {
$write['wr_link'.$i] = get_text($write['wr_link'.$i]); $write['wr_link' . $i] = get_text($write['wr_link' . $i]);
} }
} }
@ -365,10 +364,10 @@ if ($w == '') {
} else if ($w == 'r') { } else if ($w == 'r') {
if (!strstr($write['wr_option'], 'html')) { if (!strstr($write['wr_option'], 'html')) {
$content = "\n\n\n &gt; " $content = "\n\n\n &gt; "
."\n &gt; " . "\n &gt; "
."\n &gt; ".str_replace("\n", "\n> ", get_text($write['wr_content'], 0)) . "\n &gt; " . str_replace("\n", "\n> ", get_text($write['wr_content'], 0))
."\n &gt; " . "\n &gt; "
."\n &gt; "; . "\n &gt; ";
} }
} else { } else {
@ -387,15 +386,15 @@ else
$is_dhtml_editor = false; $is_dhtml_editor = false;
$is_dhtml_editor_use = false; $is_dhtml_editor_use = false;
$editor_content_js = ''; $editor_content_js = '';
if(!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE) if (!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE)
$is_dhtml_editor_use = true; $is_dhtml_editor_use = true;
// 모바일에서는 G5_IS_MOBILE_DHTML_USE 설정에 따라 DHTML 에디터 적용 // 모바일에서는 G5_IS_MOBILE_DHTML_USE 설정에 따라 DHTML 에디터 적용
if ($config['cf_editor'] && $is_dhtml_editor_use && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) { if ($config['cf_editor'] && $is_dhtml_editor_use && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) {
$is_dhtml_editor = true; $is_dhtml_editor = true;
if(is_file(G5_EDITOR_PATH.'/'.$config['cf_editor'].'/autosave.editor.js')) if (is_file(G5_EDITOR_PATH . '/' . $config['cf_editor'] . '/autosave.editor.js'))
$editor_content_js = '<script src="'.G5_EDITOR_URL.'/'.$config['cf_editor'].'/autosave.editor.js"></script>'.PHP_EOL; $editor_content_js = '<script src="' . G5_EDITOR_URL . '/' . $config['cf_editor'] . '/autosave.editor.js"></script>' . PHP_EOL;
} }
$editor_html = editor_html('wr_content', $content, $is_dhtml_editor); $editor_html = editor_html('wr_content', $content, $is_dhtml_editor);
$editor_js = ''; $editor_js = '';
@ -405,9 +404,9 @@ $editor_js .= chk_editor_js('wr_content', $is_dhtml_editor);
// 임시 저장된 글 수 // 임시 저장된 글 수
$autosave_count = autosave_count($member['mb_id']); $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,15 +1,17 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_'))
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);
?> ?>
<section id="bo_w"> <section id="bo_w">
<hr class="padding small"> <hr class="padding small">
<!-- 게시물 작성/수정 시작 --> <!-- 게시물 작성/수정 시작 -->
<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 ?>" id="write_w" > <input type="hidden" name="w" value="<?php echo $w ?>" id="write_w">
<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="wr_id" value="<?php echo $wr_id ?>" id="write_id"> <input type="hidden" name="wr_id" value="<?php echo $wr_id ?>" id="write_id">
<input type="hidden" name="sca" value="<?php echo $sca ?>"> <input type="hidden" name="sca" value="<?php echo $sca ?>">
@ -20,13 +22,15 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<input type="hidden" name="sod" value="<?php echo $sod ?>"> <input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>"> <input type="hidden" name="page" value="<?php echo $page ?>">
<?php <?php
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php'); include_once(G5_PLUGIN_PATH . '/jquery-ui/datepicker.php');
$offset=$board['bo_3']? " ".$board['bo_3']." hours" : ""; $offset = $board['bo_3'] ? " " . $board['bo_3'] . " hours" : "";
$today=date('Ymd',strtotime(date('Y/m/d H:i:s').$offset)); $today = date('Ymd', strtotime(date('Y/m/d H:i:s') . $offset));
if (empty($fr_date)) $fr_date = $today; if (empty($fr_date))
if($w=='' ){if ($_GET['fr_date']) { $fr_date = $today;
if ($w == '') {
if ($_GET['fr_date']) {
$write['wr_1'] = $_GET['fr_date']; $write['wr_1'] = $_GET['fr_date'];
}else{ } else {
$write['wr_1'] = $today; $write['wr_1'] = $today;
} }
@ -40,13 +44,15 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php if ($is_name) { ?> <?php if ($is_name) { ?>
<p> <p>
<label for="wr_name">이름<strong class="sound_only">필수</strong></label> <label for="wr_name">이름<strong class="sound_only">필수</strong></label>
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" size="10" maxlength="20"> <input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required"
size="10" maxlength="20">
</p> </p>
<?php } ?> <?php } ?>
<?php if ($is_password) { ?> <?php if ($is_password) { ?>
<p> <p>
<label for="wr_password">패스워드<strong class="sound_only">필수</strong></label> <label for="wr_password">패스워드<strong class="sound_only">필수</strong></label>
<input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?> class="frm_input <?php echo $password_required ?>" maxlength="20"> <input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?>
class="frm_input <?php echo $password_required ?>" maxlength="20">
</p> </p>
<?php } ?> <?php } ?>
<?php if ($option) { ?> <?php if ($option) { ?>
@ -56,25 +62,32 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php } ?> <?php } ?>
<?php if ($is_category) { ?> <?php if ($is_category) { ?>
<p> <p>
<select name="ca_name" id="ca_name" required class="required" > <select name="ca_name" id="ca_name" required class="required">
<option value="">선택하세요</option> <option value="">선택하세요</option>
<?php echo $category_option ?> <?php echo $category_option ?>
</select> </select>
</p> </p>
<?php } ?> <?php } ?>
<p> <p>
<input type="hidden" name="wr_subject" value="<?php echo $write['wr_1']; ?>" id="wr_subject" required maxlength="255"> <input type="hidden" name="wr_subject" value="<?php echo $write['wr_1']; ?>" id="wr_subject" required
<input type="text" name="wr_1" value="<?php echo $write['wr_1']; ?>" id="wr_1" required class="date full frm_input required" size="21" maxlength="8" placeholder="날짜"> maxlength="255">
<input type="text" name="wr_1" value="<?php echo $write['wr_1']; ?>" id="wr_1" required
class="date full frm_input required" size="21" maxlength="8" placeholder="날짜">
</p> </p>
</div> </div>
<section class="options"> <section class="options">
<input type="text" name="wr_4" id="wr_4" value="<?=$write['wr_4']?>" placeholder="<?=$board['bo_5'] ? $board['bo_5']: "날씨";?>"><input type="text" name="wr_3" id="wr_3" value="<?=$write['wr_3']?>" placeholder="<?=$board['bo_6'] ? $board['bo_6']: "무드";?>"> <input type="text" name="wr_4" id="wr_4" value="<?= $write['wr_4'] ?>"
placeholder="<?= $board['bo_5'] ? $board['bo_5'] : "날씨"; ?>"><input type="text" name="wr_3" id="wr_3"
value="<?= $write['wr_3'] ?>" placeholder="<?= $board['bo_6'] ? $board['bo_6'] : "무드"; ?>">
</section> </section>
<textarea name="wr_content" id="wr_content" maxlength="255" required></textarea> <textarea name="wr_content" id="wr_content" maxlength="255" required></textarea>
<input type="file" id="wr_file" name="bf_file[0]" title="파일첨부 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input full"> <input type="file" id="wr_file" name="bf_file[0]" title="파일첨부 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능"
class="frm_file frm_input full">
<div class="btn_confirm txt-right"> <div class="btn_confirm txt-right">
<label id="file_del" for="bf_file_del0" class="sound_only"><input type="checkbox" id="bf_file_del0" name="bf_file_del[0]" value="1"> 파일 삭제</label> <label id="file_del" for="bf_file_del0" class="sound_only"><input type="checkbox" id="bf_file_del0"
<?if($is_secret){?><label for="secret" id="wr_secret"><input type="checkbox" id="secret" value="secret" name="secret"> 비밀글 </label><?}?> name="bf_file_del[0]" value="1"> 파일 삭제</label>
<?php if ($is_secret) { ?><label for="secret" id="wr_secret"><input type="checkbox" id="secret" value="secret"
name="secret"> 비밀글 </label><?php } ?>
<input type="submit" value="입력" id="btn_submit" accesskey="s" class="ui-btn point"> <input type="submit" value="입력" id="btn_submit" accesskey="s" class="ui-btn point">
</div> </div>
</section> </section>
@ -84,12 +97,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<!-- 게시물 작성/수정 --> <!-- 게시물 작성/수정 -->
<script> <script>
$(function(){ $(function () {
$(".date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yymmdd", showButtonPanel: true, yearRange: "c-99:c+99" }); $(".date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yymmdd", showButtonPanel: true, yearRange: "c-99:c+99" });
}); });
function html_auto_br(obj) function html_auto_br(obj) {
{
if (obj.checked) { if (obj.checked) {
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다."); result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
if (result) if (result)
@ -101,14 +113,13 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
obj.value = ""; obj.value = "";
} }
function fwrite_submit(f) function fwrite_submit(f) {
{
var frdate="<?=$fr_date?>"; var frdate = "<?= $fr_date ?>";
var subject = ""; var subject = "";
var content = ""; var content = "";
$.ajax({ $.ajax({
url: g5_bbs_url+"/ajax.filter.php", url: g5_bbs_url + "/ajax.filter.php",
type: "POST", type: "POST",
data: { data: {
"subject": f.wr_subject.value, "subject": f.wr_subject.value,
@ -117,21 +128,21 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
dataType: "json", dataType: "json",
async: false, async: false,
cache: false, cache: false,
success: function(data, textStatus) { success: function (data, textStatus) {
subject = data.subject; subject = data.subject;
content = data.content; content = data.content;
} }
}); });
if (subject) { if (subject) {
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다"); alert("제목에 금지단어('" + subject + "')가 포함되어있습니다");
f.wr_subject.focus(); f.wr_subject.focus();
return false; return false;
} }
if (content) { if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다"); alert("내용에 금지단어('" + content + "')가 포함되어있습니다");
if (typeof(ed_wr_content) != "undefined") if (typeof (ed_wr_content) != "undefined")
ed_wr_content.returnFalse(); ed_wr_content.returnFalse();
else else
f.wr_content.focus(); f.wr_content.focus();
@ -141,11 +152,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
if (char_min > 0 || char_max > 0) { if (char_min > 0 || char_max > 0) {
var cnt = parseInt(check_byte("wr_content", "char_count")); var cnt = parseInt(check_byte("wr_content", "char_count"));
if (char_min > 0 && char_min > cnt) { if (char_min > 0 && char_min > cnt) {
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다."); alert("내용은 " + char_min + "글자 이상 쓰셔야 합니다.");
return false; return false;
} }
else if (char_max > 0 && char_max < cnt) { else if (char_max > 0 && char_max < cnt) {
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다."); alert("내용은 " + char_max + "글자 이하로 쓰셔야 합니다.");
return false; return false;
} }
} }
@ -154,4 +165,4 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
return true; return true;
} }
</script> </script>

View file

@ -1,15 +1,16 @@
<? <?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_"))
exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요. // 자신만의 코드를 넣어주세요.
if($wr_etc){ if ($wr_etc) {
$etc=implode("||",$wr_etc); $etc = implode("||", $wr_etc);
$etc.="||"; $etc .= "||";
$sql = " update {$write_table} $sql = " update {$write_table}
set wr_4='{$etc}' set wr_4='{$etc}'
where wr_id = '{$wr_id}' "; where wr_id = '{$wr_id}' ";
sql_query($sql); sql_query($sql);
} }
goto_url("./board.php?bo_table=$bo_table"); goto_url("./board.php?bo_table=$bo_table");
?>