update and fix code
This commit is contained in:
parent
1aa77a0ada
commit
f8f58e6f1b
7 changed files with 1345 additions and 1233 deletions
802
list.skin.php
802
list.skin.php
|
|
@ -1,366 +1,436 @@
|
||||||
<?php
|
<?php
|
||||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
/**
|
||||||
//include_once($board_skin_path."/moonday.php"); // 석봉운님의 음력날짜 함수
|
* from avocado common.lib
|
||||||
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
|
* @var string|int $year
|
||||||
|
* @var string|int $year_pre
|
||||||
if (preg_match('/%/', $width)) {
|
* @var string|int $month_pre
|
||||||
$col_width = "14%"; //표의 가로 폭이 100보다 크면 픽셀값입력
|
* @var string|int $sc_no
|
||||||
} else{
|
*/
|
||||||
$col_width = round($width/7); //표의 가로 폭이 100보다 작거나 같으면 백분율 값을 입력
|
|
||||||
}
|
if (!defined('_GNUBOARD_'))
|
||||||
$col_height= 80 ;//내용 들어갈 사각공간의 세로길이를 가로 폭과 같도록
|
exit;
|
||||||
|
|
||||||
$offset=$board['bo_3']? " ".$board['bo_3']." hours" : "";
|
//include_once($board_skin_path."/moonday.php"); // 석봉운님의 음력날짜 함수
|
||||||
$today=date('Ymd',strtotime(date('Y/m/d H:i:s').$offset));
|
|
||||||
$b_mon = date('n',strtotime($today));
|
include_once(G5_LIB_PATH . '/thumbnail.lib.php');
|
||||||
$b_day = date('j',strtotime($today));
|
|
||||||
$b_year = date('Y',strtotime($today));
|
if (preg_match('/%/', $width)) {
|
||||||
if ($year < 1) { // 오늘의 달력 일때
|
//표의 가로 폭이 100보다 크면 픽셀값입력
|
||||||
$month = $b_mon;
|
$col_width = "14%";
|
||||||
$mday = $b_day;
|
} else {
|
||||||
$year = $b_year;
|
//표의 가로 폭이 100보다 작거나 같으면 백분율 값을 입력
|
||||||
}
|
$col_width = round($width / 7);
|
||||||
|
}
|
||||||
if(!$year) $year = date("Y");
|
|
||||||
$file_index = $board_skin_path."/day"; ### 기념일 폴더 위치 지정
|
//내용 들어갈 사각공간의 세로길이를 가로 폭과 같도록
|
||||||
|
$col_height = 80;
|
||||||
### 양력 기념일 파일 지정 : 해당년도 파일이 없으면 기본파일(solar.txt)을 불러온다
|
|
||||||
//$dayfile = file($file_index."/solar.txt");
|
$offset = $board['bo_3'] ? " " . $board['bo_3'] . " hours" : "";
|
||||||
|
$today = date('Ymd', strtotime(date('Y/m/d H:i:s') . $offset));
|
||||||
$lastday=array(0,31,28,31,30,31,30,31,31,30,31,30,31);
|
$b_mon = date('n', strtotime($today));
|
||||||
if ($year%4 == 0) $lastday[2] = 29;
|
$b_day = date('j', strtotime($today));
|
||||||
$dayoftheweek = date("w", mktime (0,0,0,$month,1,$year));
|
$b_year = date('Y', strtotime($today));
|
||||||
$cday = 1;
|
|
||||||
$sel_mon = sprintf("%02d",$month);
|
// 오늘의 달력 일때
|
||||||
|
if ($year < 1) {
|
||||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
$month = $b_mon;
|
||||||
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
|
$mday = $b_day;
|
||||||
|
$year = $b_year;
|
||||||
$width=$board['bo_table_width'] ? $board['bo_table_width'] : 1000;
|
}
|
||||||
if($width>100) $width.="px";
|
|
||||||
else $width.="%";
|
if (!$year)
|
||||||
$gall_w=$board['bo_1'] ? $board['bo_1'] : 400;
|
$year = date("Y");
|
||||||
$gall_h=$board['bo_2'] ? $board['bo_2'] : 300;
|
// 기념일 폴더 위치 지정
|
||||||
?>
|
$file_index = $board_skin_path . "/day";
|
||||||
|
|
||||||
<div id="bo_frame" style="max-width:<?=$width?>;margin:0 auto;">
|
// 양력 기념일 파일 지정 : 해당년도 파일이 없으면 기본파일(solar.txt)을 불러온다
|
||||||
<!-- 상단 공지 부분 -->
|
// $dayfile = file($file_index."/solar.txt");
|
||||||
<nav class="pg_wrap theme-box">
|
|
||||||
<span class="pg control">
|
$lastday = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
|
||||||
<a href="<?php echo G5_BBS_URL."/board.php?bo_table=".$bo_table."&";
|
if ($year % 4 == 0)
|
||||||
if ($month == 1) {
|
$lastday[2] = 29;
|
||||||
$year_pre=$year-1; $month_pre=$month;
|
$dayoftheweek = date("w", mktime(0, 0, 0, $month, 1, $year));
|
||||||
} else {
|
$cday = 1;
|
||||||
$year_pre=$year-1; $month_pre=$month;
|
$sel_mon = sprintf("%02d", $month);
|
||||||
}
|
|
||||||
echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no");?>" class="pg_page">
|
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||||
<i class="ico prevyr txt-default"><?php echo $year_pre ?></i>
|
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
|
||||||
</a><a href="<?php echo G5_BBS_URL."/board.php?bo_table=".$bo_table."&";
|
|
||||||
if ($month == 1) {
|
$width = $board['bo_table_width'] ? $board['bo_table_width'] : 1000;
|
||||||
$year_pre=$year-1; $month_pre=12;
|
if ($width > 100)
|
||||||
} else {
|
$width .= "px";
|
||||||
$year_pre=$year; $month_pre=$month-1;
|
else
|
||||||
}
|
$width .= "%";
|
||||||
echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no");?>" class="pg_page">
|
$gall_w = $board['bo_1'] ? $board['bo_1'] : 400;
|
||||||
<i class="ico prevmth txt-default"><?php echo $month_pre ?></i>
|
$gall_h = $board['bo_2'] ? $board['bo_2'] : 300;
|
||||||
</a>
|
|
||||||
</span>
|
$year_pre = 0;
|
||||||
<span class="pg">
|
$month_pre = 0;
|
||||||
<strong class="year"><?=$year?></strong><?for($m=1;$m<=12;$m++){
|
?>
|
||||||
if($m==$month){
|
<div id="bo_frame" style="max-width:<?= $width ?>;margin:0 auto;">
|
||||||
?><strong class="pg_current pg_page month" title="<?=$year?>년 <?=$m?>월"><span class="txt-point"><?=$m?></span></strong><?}
|
<!-- 상단 공지 부분 -->
|
||||||
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><?}?>
|
<nav class="pg_wrap theme-box">
|
||||||
<?}?>
|
<span class="pg control">
|
||||||
</span>
|
<a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&";
|
||||||
<span class="pg control">
|
if ($month == 1) {
|
||||||
<a href="<?php echo G5_BBS_URL."/board.php?bo_table=".$bo_table."&";
|
$year_pre = $year - 1;
|
||||||
if ($month == 12) {
|
$month_pre = $month;
|
||||||
$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">
|
} else {
|
||||||
<i class="ico nextmth txt-default"><?php echo $month_pre ?></i>
|
$year_pre = $year - 1;
|
||||||
</a><a href="<?php echo G5_BBS_URL."/board.php?bo_table=".$bo_table."&";
|
$month_pre = $month;
|
||||||
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 prevyr txt-default"><?= $year_pre ?></i>
|
||||||
echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no");?>" class="pg_page">
|
</a><a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&";
|
||||||
<i class="ico nextyr txt-default"><?php echo $year_pre ?></i>
|
if ($month == 1) {
|
||||||
</a>
|
$year_pre = $year - 1;
|
||||||
</span>
|
$month_pre = 12;
|
||||||
</nav>
|
} else {
|
||||||
<div id="bo_list">
|
$year_pre = $year;
|
||||||
<section id="diary_calendar">
|
$month_pre = $month - 1;
|
||||||
<div class="diary-calendar theme-box">
|
}
|
||||||
<h2 class="this-month txt-point"><?=$year?>/<?=$sel_mon?></h2>
|
echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no"); ?>" class="pg_page">
|
||||||
<div class="controls txt-right">
|
<i class="ico prevmth txt-default"><?= $month_pre ?></i>
|
||||||
<?php if ($admin_href) { ?><a href="<?php echo $admin_href ?>" class="ui-btn small admin">관리자</a><?php } ?>
|
</a>
|
||||||
</div>
|
</span>
|
||||||
<table class="theme-list calendar-list">
|
<span class="pg">
|
||||||
<thead>
|
<strong class="year"><?= $year ?></strong><?php for ($m = 1; $m <= 12; $m++) {
|
||||||
<tr class="txt-center">
|
if ($m == $month) {
|
||||||
<th class="sun">일</th>
|
?><strong class="pg_current pg_page month" title="<?= $year ?>년 <?= $m ?>월"><span
|
||||||
<th>월</th>
|
class="txt-point"><?= $m ?></span></strong><?php } else { ?>
|
||||||
<th>화</th>
|
<a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&year=" . $year . "&month=" . $m . "&sc_no=" . $sc_no; ?>"
|
||||||
<th>수</th>
|
class="pg_page month">
|
||||||
<th>목</th>
|
<span class="txt-default"><?= $m ?></span>
|
||||||
<th>금</th>
|
</a>
|
||||||
<th class="sat">토</th>
|
<?php } ?>
|
||||||
</tr>
|
<?php } ?>
|
||||||
</thead>
|
</span>
|
||||||
<tbody>
|
<span class="pg control">
|
||||||
<?php
|
<a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&";
|
||||||
$query = "SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_id ASC";
|
if ($month == 12) {
|
||||||
$result = sql_query($query);
|
$year_pre = $year + 1;
|
||||||
$j=0; // layer id
|
$month_pre = 1;
|
||||||
// 내용을 보여주는 부분
|
} else {
|
||||||
while ($row = sql_fetch_array($result)) { // 제목글 뽑아서 링크 문자열 만들기..
|
$year_pre = $year;
|
||||||
if(strstr($row['wr_option'],"secret") && (!$is_admin || ($row['mb_id'] && $member['mb_id']!=$member['mb_id']))) continue;
|
$month_pre = $month + 1;
|
||||||
if( substr($row['wr_1'],0,6) < $year.$sel_mon ) {
|
}
|
||||||
$start_day =1;
|
echo ("year=$year_pre&month=$month_pre&sc_no=$sc_no"); ?>" class="pg_page">
|
||||||
$start_day= (int)$start_day;
|
<i class="ico nextmth txt-default"><?= $month_pre ?></i>
|
||||||
} else {
|
</a><a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&";
|
||||||
$start_day = substr($row['wr_1'],6,2);
|
if ($month == 12) {
|
||||||
$start_day= (int)$start_day;
|
$year_pre = $year + 1;
|
||||||
}
|
$month_pre = $month;
|
||||||
|
} else {
|
||||||
$end_day = $start_day;
|
$year_pre = $year + 1;
|
||||||
|
$month_pre = $month;
|
||||||
if(!$write_href){ $link=''; $cursor=" default";}
|
}
|
||||||
else if($is_admin || ($member['mb_id'] && $member['mb_id']==$row['mb_id'])){
|
echo ("year={$year_pre}&month={$month_pre}&sc_no={$sc_no}"); ?>" class="pg_page">
|
||||||
$cursor="";
|
<i class="ico nextyr txt-default"><?= $year_pre ?></i>
|
||||||
$link="get_info('".$row['wr_1']."');";
|
</a>
|
||||||
}
|
</span>
|
||||||
else {
|
</nav>
|
||||||
$link="";
|
<div id="bo_list">
|
||||||
$cursor=" default";
|
<section id="diary_calendar">
|
||||||
}
|
<div class="diary-calendar theme-box">
|
||||||
$secret=strstr($row['wr_option'],"secret") ? "secret":"";
|
<h2 class="this-month txt-point"><?= $year ?>/<?= $sel_mon ?></h2>
|
||||||
|
<div class="controls txt-right">
|
||||||
$html_day[$start_day].= '<a href="#" onclick="'.$link.' return false;" id="d_'.$row['wr_1'].'" class="wr-date ui-btn point'.$cursor.'">';
|
<?php if ($admin_href) { ?><a href="<?= $admin_href ?>" class="ui-btn small admin">관리자</a><?php } ?>
|
||||||
$html_day[$start_day].= '<i>'.$start_day.'</i>';
|
</div>
|
||||||
$html_day[$start_day].='</a>';
|
<table class="theme-list calendar-list">
|
||||||
}
|
<thead>
|
||||||
|
<tr class="txt-center">
|
||||||
// 달력의 틀을 보여주는 부분
|
<th class="sun">일</th>
|
||||||
|
<th>월</th>
|
||||||
$temp = 7- (($lastday[$month]+$dayoftheweek)%7);
|
<th>화</th>
|
||||||
|
<th>수</th>
|
||||||
if ($temp == 7) $temp = 0;
|
<th>목</th>
|
||||||
$lastcount = $lastday[$month]+$dayoftheweek + $temp;
|
<th>금</th>
|
||||||
|
<th class="sat">토</th>
|
||||||
for ($iz = 1; $iz <= $lastcount; $iz++) { // 42번을 칠하게 된다.
|
</tr>
|
||||||
$bgcolor = "days"; // 쭉 흰색으로 칠하고
|
</thead>
|
||||||
if ($b_year==$year && $b_mon==$month && $b_day==$cday) $bgcolor = "today"; // 오늘날짜 표기
|
<tbody>
|
||||||
$re=$iz%7;
|
<?php
|
||||||
if ($re == 1) echo ("<tr>"); // 주당 7개씩 한쎌씩을 쌓는다.
|
$query = "SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_id ASC";
|
||||||
if ($dayoftheweek < $iz && $iz <= $lastday[$month]+$dayoftheweek) {
|
$result = sql_query($query);
|
||||||
// 전체 루프안에서 숫자가 들어가는 셀들만 해당됨
|
$j = 0; // layer id
|
||||||
// 즉 11월 달에서 1일부터 30 일까지만 해당
|
// 내용을 보여주는 부분
|
||||||
$daytext = "$cday"; // $cday 는 숫자 예> 11월달은 1~ 30일 까지
|
while ($row = sql_fetch_array($result)) { // 제목글 뽑아서 링크 문자열 만들기..
|
||||||
//$daytext 은 셀에 써질 날짜 숫자 넣을 공간
|
if (strstr($row['wr_option'], "secret") && (!$is_admin || ($row['mb_id'] && $member['mb_id'] != $member['mb_id'])))
|
||||||
|
continue;
|
||||||
// 여기까지 숫자와 들어갈 내용에 대한 변수들의 세팅이 끝나고
|
if (substr($row['wr_1'], 0, 6) < $year . $sel_mon) {
|
||||||
// 이제 여기 부터 직접 셀이 그려지면서 그 안에 내용이 들어 간다.
|
$start_day = 1;
|
||||||
if($re==0) $col="right";
|
$start_day = (int) $start_day;
|
||||||
else if($re==1) $col="left";
|
} else {
|
||||||
else $col="";
|
$start_day = substr($row['wr_1'], 6, 2);
|
||||||
$fr_date = $year.sprintf("%02d",$month).sprintf("%02d",$cday);
|
$start_day = (int) $start_day;
|
||||||
echo ("<td width=$col_width height=$col_height class='{$bgcolor} {$col}' valign='top'>");
|
}
|
||||||
|
|
||||||
|
$end_day = $start_day;
|
||||||
// 기념일 파일 내용 비교위한 변수 선언, 월과 일을 두자리 포맷으로 고정
|
|
||||||
if (strlen($month) == 1) {
|
if (!$write_href) {
|
||||||
$monthp = "0".$month ;
|
$link = '';
|
||||||
} else {
|
$cursor = " default";
|
||||||
$monthp = $month ;
|
} else if ($is_admin || ($member['mb_id'] && $member['mb_id'] == $row['mb_id'])) {
|
||||||
}
|
$cursor = "";
|
||||||
if (strlen($cday) == 1) {
|
$link = "get_info('" . $row['wr_1'] . "');";
|
||||||
$cdayp = "0".$cday ;
|
} else {
|
||||||
} else {
|
$link = "";
|
||||||
$cdayp = $cday ;
|
$cursor = " default";
|
||||||
}
|
}
|
||||||
$memday = $year.$monthp.$cdayp;
|
$secret = strstr($row['wr_option'], "secret") ? "secret" : "";
|
||||||
$daycont = "" ;
|
|
||||||
|
$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] .= '</a>';
|
||||||
for($i=0 ; $i < sizeof($dayfile) ; $i++) { // 파일 첫 행부터 끝행까지 루프
|
}
|
||||||
$arrDay = explode("|", $dayfile[$i]);
|
|
||||||
if($memday == $year.$arrDay[0]) {
|
// 달력의 틀을 보여주는 부분
|
||||||
$daycont = $arrDay[1];
|
|
||||||
$daycontcolor = $arrDay[2];
|
$temp = 7 - (($lastday[$month] + $dayoftheweek) % 7);
|
||||||
if(substr($arrDay[2],0,3)=="red") $daycolor = "red"; // 공휴일은 날짜를 빨간색으로 표시
|
|
||||||
}
|
if ($temp == 7)
|
||||||
}
|
$temp = 0;
|
||||||
*/
|
$lastcount = $lastday[$month] + $dayoftheweek + $temp;
|
||||||
/*
|
|
||||||
// 석봉운님의 음력날짜 변수선언
|
for ($iz = 1; $iz <= $lastcount; $iz++) { // 42번을 칠하게 된다.
|
||||||
$myarray = soltolun($year,$month,$cday);
|
$bgcolor = "days"; // 쭉 흰색으로 칠하고
|
||||||
if ($myarray[day]==1 || $myarray[day]==11 || $myarray[day]==21) {
|
if ($b_year == $year && $b_mon == $month && $b_day == $cday)
|
||||||
$moonday ="<font color='gray'> (음)$myarray[month].$myarray[day]$myarray[leap]</font>";
|
$bgcolor = "today"; // 오늘날짜 표기
|
||||||
} else {
|
$re = $iz % 7;
|
||||||
$moonday="";
|
if ($re == 1)
|
||||||
}
|
echo ("<tr>"); // 주당 7개씩 한쎌씩을 쌓는다.
|
||||||
|
if ($dayoftheweek < $iz && $iz <= $lastday[$month] + $dayoftheweek) {
|
||||||
include($file_index."/lunar.txt"); ### 음력 기념일 파일 지정
|
// 전체 루프안에서 숫자가 들어가는 셀들만 해당됨
|
||||||
|
// 즉 11월 달에서 1일부터 30 일까지만 해당
|
||||||
if ($annivmoonday&&$daycont) $blank="<br />"; // 음력절기와 양력기념일이 동시에 있으면 한칸 띔
|
$daytext = "$cday"; // $cday 는 숫자 예> 11월달은 1~ 30일 까지
|
||||||
else $blank="";
|
//$daytext 은 셀에 써질 날짜 숫자 넣을 공간
|
||||||
*/
|
|
||||||
if($html_day[$cday]){
|
// 여기까지 숫자와 들어갈 내용에 대한 변수들의 세팅이 끝나고
|
||||||
echo $html_day[$cday];
|
// 이제 여기 부터 직접 셀이 그려지면서 그 안에 내용이 들어 간다.
|
||||||
}else {
|
if ($re == 0)
|
||||||
if($write_href){ $wlink="get_info('".$fr_date."');"; $cursor="";}
|
$col = "right";
|
||||||
else {$wlink=""; $cursor=" default";}
|
else if ($re == 1)
|
||||||
$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="">';
|
$col = "left";
|
||||||
$html_day[$cday].= '<i>'.$daytext.'</i>';
|
else
|
||||||
$html_day[$cday].='</a>';
|
$col = "";
|
||||||
echo $html_day[$cday];
|
$fr_date = $year . sprintf("%02d", $month) . sprintf("%02d", $cday);
|
||||||
}
|
echo ("<td width=$col_width height=$col_height class='{$bgcolor} {$col}' valign='top'>");
|
||||||
echo ("</td>"); // 한칸을 마무리
|
|
||||||
$cday++; // 날짜를 카운팅
|
|
||||||
}
|
// 기념일 파일 내용 비교위한 변수 선언, 월과 일을 두자리 포맷으로 고정
|
||||||
// 유효날짜가 아니면 그냥 회색을 칠한다.
|
if (strlen($month) == 1) {
|
||||||
else { echo ("<td width=$col_width height=$col_height class='noday'> </td>"); }
|
$monthp = "0" . $month;
|
||||||
if ($re == 0) echo ("</tr>");
|
} else {
|
||||||
} // 반복구문이 끝남
|
$monthp = $month;
|
||||||
unset($row);
|
}
|
||||||
?>
|
if (strlen($cday) == 1) {
|
||||||
</tbody>
|
$cdayp = "0" . $cday;
|
||||||
</table>
|
} else {
|
||||||
</div>
|
$cdayp = $cday;
|
||||||
<? if($board['bo_content_head']) { ?>
|
}
|
||||||
<hr class="padding small">
|
$memday = $year . $monthp . $cdayp;
|
||||||
<div class="board-notice">
|
$daycont = "";
|
||||||
<?=stripslashes($board['bo_content_head']);?>
|
|
||||||
</div>
|
// 기념일(양력) 표시
|
||||||
<? } ?>
|
/*
|
||||||
<?if($is_member && $write_href){?>
|
for($i=0 ; $i < sizeof($dayfile) ; $i++) { // 파일 첫 행부터 끝행까지 루프
|
||||||
<hr class="padding small">
|
$arrDay = explode("|", $dayfile[$i]);
|
||||||
<div id="diary_write" class="none-trans">
|
if($memday == $year.$arrDay[0]) {
|
||||||
<div class="theme-box">
|
$daycont = $arrDay[1];
|
||||||
<a href="#" onclick="$('#bo_w').toggleClass('on');return false;" id="write_open">▶ 글쓰기</a>
|
$daycontcolor = $arrDay[2];
|
||||||
<? include_once($board_skin_path.'/write.php');?>
|
if(substr($arrDay[2],0,3)=="red") $daycolor = "red"; // 공휴일은 날짜를 빨간색으로 표시
|
||||||
</div>
|
}
|
||||||
</div>
|
}
|
||||||
<hr class="padding small">
|
*/
|
||||||
<?}?>
|
// 석봉운님의 음력날짜 변수선언
|
||||||
</section>
|
/*
|
||||||
<section id="diary_list">
|
$myarray = soltolun($year,$month,$cday);
|
||||||
<div class="diary-cont">
|
if ($myarray[day]==1 || $myarray[day]==11 || $myarray[day]==21) {
|
||||||
<?
|
$moonday ="<font color='gray'> (음)$myarray[month].$myarray[day]$myarray[leap]</font>";
|
||||||
$order=$board['bo_4'] ? "asc" : "desc";
|
} else {
|
||||||
$result=sql_query("SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_1 {$order}");
|
$moonday="";
|
||||||
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;
|
|
||||||
?>
|
include($file_index."/lunar.txt"); ### 음력 기념일 파일 지정
|
||||||
<div class="theme-box" id="w_<?=$row['wr_1']?>" data-date="<?=$row['wr_1']?>" data-wid="<?=$row['wr_id']?>">
|
|
||||||
<div class="options">
|
if ($annivmoonday&&$daycont) $blank="<br />"; // 음력절기와 양력기념일이 동시에 있으면 한칸 띔
|
||||||
<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>
|
else $blank="";
|
||||||
<p class="btn_confirm">
|
*/
|
||||||
<? if($is_admin || ($member['mb_id'] && $member['mb_id']==$row['mb_id'])){
|
if ($html_day[$cday]) {
|
||||||
$cursor="";
|
echo $html_day[$cday];
|
||||||
$delete_href = "";
|
} else {
|
||||||
// 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능
|
if ($write_href) {
|
||||||
if (($member['mb_id'] && ($member['mb_id'] == $row['mb_id'])) || $is_admin) {
|
$wlink = "get_info('" . $fr_date . "');";
|
||||||
$delete_href = "javascript:del('./delete.php?bo_table=".$bo_table."&wr_id=".$row['wr_id']."&page=".$page.urldecode($qstr)."');";
|
$cursor = "";
|
||||||
if ($is_admin)
|
} else {
|
||||||
{
|
$wlink = "";
|
||||||
$delete_href = "javascript:del('./delete.php?bo_table=".$bo_table."&wr_id=".$row['wr_id']."&token=".$token."&page=".$page.urldecode($qstr)."');";
|
$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="">';
|
||||||
else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
|
$html_day[$cday] .= '<i>' . $daytext . '</i>';
|
||||||
$delete_href = "./password.php?w=d&bo_table=".$bo_table."&wr_id=".$row['wr_id']."&page=".$page.$qstr;
|
$html_day[$cday] .= '</a>';
|
||||||
}
|
echo $html_day[$cday];
|
||||||
?><a href="#" onclick="get_info('<?=$row['wr_1']?>'); return false;">M</a><a href="<?=$delete_href?>">D</a><?
|
}
|
||||||
}?>
|
echo ("</td>"); // 한칸을 마무리
|
||||||
</p>
|
$cday++; // 날짜를 카운팅
|
||||||
</div>
|
}
|
||||||
<hr class="line">
|
// 유효날짜가 아니면 그냥 회색을 칠한다.
|
||||||
<div class="ui-cont<?=$row['wr_file'] ? " with-image":"";?>">
|
else {
|
||||||
<div class="ui-thumb file" data-file="<?=$row['wr_file']?>">
|
echo ("<td width=$col_width height=$col_height class='noday'> </td>");
|
||||||
<?if($row['wr_file']){
|
}
|
||||||
$thumb=get_list_thumbnail($bo_table,$row['wr_id'],$gall_w,$gall_h,false,true);
|
if ($re == 0)
|
||||||
$thumb2= get_mmb_image($bo_table, $row['wr_id']);
|
echo ("</tr>");
|
||||||
?>
|
} // 반복구문이 끝남
|
||||||
<a href="<?=$thumb2['src']?>" onclick="view_img(this.href);return false;"><img src="<?=$thumb['src']?>"></a>
|
unset($row);
|
||||||
<?}?>
|
?>
|
||||||
</div>
|
</tbody>
|
||||||
<div class="diary-text">
|
</table>
|
||||||
<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>
|
</div>
|
||||||
<div class="content"><?=nl2br($row['wr_content'])?></div>
|
<?php if ($board['bo_content_head']) { ?>
|
||||||
</div>
|
<hr class="padding small">
|
||||||
</div>
|
<div class="board-notice">
|
||||||
</div>
|
<?= stripslashes($board['bo_content_head']); ?>
|
||||||
<hr class="padding small">
|
</div>
|
||||||
<?}?>
|
<?php } ?>
|
||||||
</div>
|
<?php if ($is_member && $write_href) { ?>
|
||||||
</section>
|
<hr class="padding small">
|
||||||
</div>
|
<div id="diary_write" class="none-trans">
|
||||||
</div>
|
<div class="theme-box">
|
||||||
<div id="view_img">
|
<a href="#" onclick="$('#bo_w').toggleClass('on');return false;" id="write_open">▶ 글쓰기</a>
|
||||||
<a href="#" onclick="$('#img_cont').empty();$('#view_img').removeClass();return false;" id="img_close">
|
<?php include_once($board_skin_path . '/write.php'); ?>
|
||||||
<div id="img_cont"></div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
</div>
|
<hr class="padding small">
|
||||||
<script>
|
<?php } ?>
|
||||||
function view_img(url){
|
</section>
|
||||||
$("#view_img").addClass('on');
|
<section id="diary_list">
|
||||||
$("#img_cont").empty().html('<p><img src="'+url+'"></p>');
|
<div class="diary-cont">
|
||||||
}
|
<?php
|
||||||
const bo_skin_url="<?=$board_skin_url?>";
|
$order = $board['bo_4'] ? "asc" : "desc";
|
||||||
<?if($is_member && $write_href){?>
|
$result = sql_query("SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_1 {$order}");
|
||||||
const idx=$("td.today .wr-date").data("wid");
|
for ($i = 0; $row = sql_fetch_array($result); $i++) {
|
||||||
if(idx!='')$("#btn_submit").prop("disabled",true);
|
if (strstr($row['wr_option'], "secret") && (!$is_admin || ($row['mb_id'] && $member['mb_id'] != $member['mb_id'])))
|
||||||
function get_info(wr_id){
|
continue;
|
||||||
$('#bo_w').addClass('on');
|
?>
|
||||||
let elem=$("#w_"+wr_id);
|
<div class="theme-box" id="w_<?= $row['wr_1'] ?>" data-date="<?= $row['wr_1'] ?>"
|
||||||
let wid=elem.data("wid");
|
data-wid="<?= $row['wr_id'] ?>">
|
||||||
let w_date=elem.data("date");
|
<div class="options">
|
||||||
let contents=$("#wr_content").val();
|
<h3 class="wr_date">
|
||||||
if(contents!='' && $("#write_w").val()==''){
|
<?= substr($row['wr_1'], 0, 4) ?>/<?= substr($row['wr_1'], 4, 2) ?>/<?= substr($row['wr_1'], 6, 2) ?><span
|
||||||
var result=confirm("작성하던 내용을 파기합니까?");
|
class="secret"><?= strstr($row['wr_option'], "secret") ? " ::" : ""; ?></span>
|
||||||
if(!result) return false;
|
</h3>
|
||||||
}
|
<p class="btn_confirm">
|
||||||
$("#btn_submit").prop("disabled",false);
|
<?php if ($is_admin || ($member['mb_id'] && $member['mb_id'] == $row['mb_id'])) {
|
||||||
|
$cursor = "";
|
||||||
$("#write_open").text("▶ 글쓰기");
|
$delete_href = "";
|
||||||
$("#wr_subject").val(w_date);
|
// 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능
|
||||||
$("#wr_1").val(w_date);
|
if (($member['mb_id'] && ($member['mb_id'] == $row['mb_id'])) || $is_admin) {
|
||||||
$("#wr_3").val("");
|
$delete_href = "javascript:del('./delete.php?bo_table=" . $bo_table . "&wr_id=" . $row['wr_id'] . "&page=" . $page . urldecode($qstr) . "');";
|
||||||
$("#wr_4").val("");
|
if ($is_admin) {
|
||||||
$("#wr_content").val("");
|
$delete_href = "javascript:del('./delete.php?bo_table=" . $bo_table . "&wr_id=" . $row['wr_id'] . "&token=" . $token . "&page=" . $page . urldecode($qstr) . "');";
|
||||||
$("#write_w").val("");
|
}
|
||||||
$("#write_id").val("");
|
} else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
|
||||||
$("#wr_file").val("");
|
$delete_href = "./password.php?w=d&bo_table=" . $bo_table . "&wr_id=" . $row['wr_id'] . "&page=" . $page . $qstr;
|
||||||
$("#file_del").addClass("sound_only");
|
}
|
||||||
$("#secret").prop("checked",false);
|
?><a href="#" onclick="get_info('<?= $row['wr_1'] ?>'); return false;">M</a><a
|
||||||
if(wid>0){
|
href="<?= $delete_href ?>">D</a>
|
||||||
$("#write_open").text("▶ 글수정");
|
<?php
|
||||||
let w_3=elem.find(".mood").text();
|
} ?>
|
||||||
let w_4=elem.find(".weather").text();
|
</p>
|
||||||
let w_content=elem.find(".content").text();
|
</div>
|
||||||
let w_file = elem.find(".file").data("file");
|
<hr class="line">
|
||||||
let w_secret = elem.find(".secret").text();
|
<div class="ui-cont<?= $row['wr_file'] ? " with-image" : ""; ?>">
|
||||||
$("#wr_content").val(w_content);
|
<div class="ui-thumb file" data-file="<?= $row['wr_file'] ?>">
|
||||||
$("#wr_3").val(w_3);
|
<?php if ($row['wr_file']) {
|
||||||
$("#wr_4").val(w_4);
|
$thumb = get_list_thumbnail($bo_table, $row['wr_id'], $gall_w, $gall_h, false, true);
|
||||||
$("#write_w").val("u");
|
$thumb2 = get_mmb_image($bo_table, $row['wr_id']);
|
||||||
$("#write_id").val(wid);
|
?>
|
||||||
if(w_file=='1') $("#file_del").removeClass();
|
<a href="<?= $thumb2['src'] ?>" onclick="view_img(this.href);return false;"><img
|
||||||
if(w_secret) $("#secret").prop("checked",true);
|
src="<?= $thumb['src'] ?>"></a>
|
||||||
}
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
<div class="diary-text">
|
||||||
};
|
<p class="misc"><?php if ($row['wr_4']) { ?><em><?= $board['bo_5'] ? $board['bo_5'] : "[날씨]"; ?></em>
|
||||||
const d_pos=$("#diary_write").offset().top;
|
<span class="weather"><?= $row['wr_4'] ?></span><?php }
|
||||||
console.log(d_pos);
|
if ($row['wr_3']) { ?><em><?= $board['bo_6'] ? $board['bo_6'] : "[무드]"; ?></em>
|
||||||
if($(window).width()<=720){
|
<span class="mood"><?= $row['wr_3'] ?></span><?php } ?>
|
||||||
$(window).scroll(function(){
|
</p>
|
||||||
var w_pos=$(window).scrollTop();
|
<div class="content"><?= nl2br($row['wr_content']) ?></div>
|
||||||
if(w_pos>=d_pos){
|
</div>
|
||||||
$("#diary_write").addClass("scroll-fix");
|
</div>
|
||||||
}else if (w_pos<d_pos){
|
</div>
|
||||||
$("#diary_write").removeClass("scroll-fix").css("transform","translateY(0)");
|
<hr class="padding small">
|
||||||
}
|
<?php } ?>
|
||||||
}); }
|
</div>
|
||||||
<?}?>
|
</section>
|
||||||
</script>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="view_img">
|
||||||
|
<a href="#" onclick="$('#img_cont').empty();$('#view_img').removeClass();return false;" id="img_close">
|
||||||
|
<div id="img_cont"></div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
function view_img(url) {
|
||||||
|
$("#view_img").addClass('on');
|
||||||
|
$("#img_cont").empty().html('<p><img src="' + url + '"></p>');
|
||||||
|
}
|
||||||
|
const bo_skin_url = "<?= $board_skin_url ?>";
|
||||||
|
<?php if ($is_member && $write_href) { ?>
|
||||||
|
const idx = $("td.today .wr-date").data("wid");
|
||||||
|
if (idx != '') $("#btn_submit").prop("disabled", true);
|
||||||
|
function get_info(wr_id) {
|
||||||
|
$('#bo_w').addClass('on');
|
||||||
|
let elem = $("#w_" + wr_id);
|
||||||
|
let wid = elem.data("wid");
|
||||||
|
let w_date = elem.data("date");
|
||||||
|
let contents = $("#wr_content").val();
|
||||||
|
if (contents != '' && $("#write_w").val() == '') {
|
||||||
|
var result = confirm("작성하던 내용을 파기합니까?");
|
||||||
|
if (!result) return false;
|
||||||
|
}
|
||||||
|
$("#btn_submit").prop("disabled", false);
|
||||||
|
|
||||||
|
$("#write_open").text("▶ 글쓰기");
|
||||||
|
$("#wr_subject").val(w_date);
|
||||||
|
$("#wr_1").val(w_date);
|
||||||
|
$("#wr_3").val("");
|
||||||
|
$("#wr_4").val("");
|
||||||
|
$("#wr_content").val("");
|
||||||
|
$("#write_w").val("");
|
||||||
|
$("#write_id").val("");
|
||||||
|
$("#wr_file").val("");
|
||||||
|
$("#file_del").addClass("sound_only");
|
||||||
|
$("#secret").prop("checked", false);
|
||||||
|
if (wid > 0) {
|
||||||
|
$("#write_open").text("▶ 글수정");
|
||||||
|
let w_3 = elem.find(".mood").text();
|
||||||
|
let w_4 = elem.find(".weather").text();
|
||||||
|
let w_content = elem.find(".content").text();
|
||||||
|
let w_file = elem.find(".file").data("file");
|
||||||
|
let w_secret = elem.find(".secret").text();
|
||||||
|
$("#wr_content").val(w_content);
|
||||||
|
$("#wr_3").val(w_3);
|
||||||
|
$("#wr_4").val(w_4);
|
||||||
|
$("#write_w").val("u");
|
||||||
|
$("#write_id").val(wid);
|
||||||
|
if (w_file == '1') $("#file_del").removeClass();
|
||||||
|
if (w_secret) $("#secret").prop("checked", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
const d_pos = $("#diary_write").offset().top;
|
||||||
|
console.log(d_pos);
|
||||||
|
if ($(window).width() <= 720) {
|
||||||
|
$(window).scroll(function () {
|
||||||
|
var w_pos = $(window).scrollTop();
|
||||||
|
if (w_pos >= d_pos) {
|
||||||
|
$("#diary_write").addClass("scroll-fix");
|
||||||
|
} else if (w_pos < d_pos) {
|
||||||
|
$("#diary_write").removeClass("scroll-fix").css("transform", "translateY(0)");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
<?php } ?>
|
||||||
|
</script>
|
||||||
|
|
|
||||||
460
moonday.php
460
moonday.php
|
|
@ -1,244 +1,268 @@
|
||||||
<?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,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2,1,2,1,2, 1,2,1,1,2,1,2,2,1,2,2,1, 2,1,2,1,1,5,2,1,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,2, 1,2,2,1,5,1,2,1,1,2,2,1, 2,2,1,2,2,1,1,2,1,1,2,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,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);
|
|
||||||
|
|
||||||
|
|
||||||
###################################################
|
|
||||||
/*
|
/*
|
||||||
$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);
|
|
||||||
|
|
||||||
function febdays($sy) {
|
$md = array(31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
|
||||||
if(($sy%100 != 0 && $sy%4 ==0) || $sy%400 ==0) $md[1] = 29;
|
|
||||||
else $md[1] = 28;
|
function febdays($sy)
|
||||||
return array($md[1]);
|
{
|
||||||
|
global $md;
|
||||||
|
if (($sy % 100 != 0 && $sy % 4 == 0) || $sy % 400 == 0)
|
||||||
|
$md[1] = 29;
|
||||||
|
else
|
||||||
|
$md[1] = 28;
|
||||||
|
return array($md[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function alltd($sy) {
|
function alltd($sy)
|
||||||
global $md;
|
{
|
||||||
$td = 0;
|
global $md;
|
||||||
for($i=1841;$i<=$sy-1;$i++) {
|
$td = 0;
|
||||||
list($md[1]) = febdays($i);
|
$ttd = array();
|
||||||
for($j=0;$j<12;$j++) {
|
for ($i = 1841; $i <= $sy - 1; $i++) {
|
||||||
$td += $md[$j];
|
$ttd[$i] = array();
|
||||||
$ttd[$i][12] += $md[$j];
|
$ttd[$i][12] = 0;
|
||||||
}
|
$feb_days = febdays($i);
|
||||||
|
$md[1] = $feb_days[0];
|
||||||
|
for ($j = 0; $j < 12; $j++) {
|
||||||
|
$td += $md[$j];
|
||||||
|
$ttd[$i][12] += $md[$j];
|
||||||
}
|
}
|
||||||
$td -= 22;
|
}
|
||||||
return array($td);
|
$td -= 22;
|
||||||
|
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);
|
||||||
$td += $sd;
|
$md[1] = $feb_days[0];
|
||||||
$i = 0;
|
for ($i = 0; $i < $sm - 1; $i++)
|
||||||
$temptd = $td;
|
$td += $md[$i];
|
||||||
while($temptd>0) {
|
$td += $sd;
|
||||||
$yoon = "";
|
$i = 0;
|
||||||
switch($kk[$i]) {
|
$temptd = $td;
|
||||||
case 1 :
|
while ($temptd > 0) {
|
||||||
$mm = 29;
|
$yoon = "";
|
||||||
break;
|
switch ($kk[$i]) {
|
||||||
case 2 :
|
case 1:
|
||||||
$mm = 30;
|
$mm = 29;
|
||||||
break;
|
break;
|
||||||
case 3 :
|
case 2:
|
||||||
$mm = 29;
|
$mm = 30;
|
||||||
$ymm = 29;
|
break;
|
||||||
if($temptd > 29) {
|
case 3:
|
||||||
$temptd -= 29;
|
$mm = 29;
|
||||||
$yoon = "*";
|
$ymm = 29;
|
||||||
}
|
if ($temptd > 29) {
|
||||||
break;
|
$temptd -= 29;
|
||||||
case 4 :
|
$yoon = "*";
|
||||||
$mm = 29;
|
|
||||||
$ymm = 30;
|
|
||||||
if($temptd > 30) {
|
|
||||||
$temptd -= 30;
|
|
||||||
$yoon = "*";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5 :
|
|
||||||
$mm = 30;
|
|
||||||
$ymm = 29;
|
|
||||||
if($temptd > 29) {
|
|
||||||
$temptd -= 29;
|
|
||||||
$yoon = "*";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6 :
|
|
||||||
$mm = 30;
|
|
||||||
$ymm = 30;
|
|
||||||
if($temptd > 30) {
|
|
||||||
$temptd -= 30;
|
|
||||||
$yoon = "*";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
$temptd -=$mm;
|
break;
|
||||||
|
case 4:
|
||||||
$i++;
|
$mm = 29;
|
||||||
if($i%12 == 1) $ly += 1;
|
$ymm = 30;
|
||||||
|
if ($temptd > 30) {
|
||||||
|
$temptd -= 30;
|
||||||
|
$yoon = "*";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
$mm = 30;
|
||||||
|
$ymm = 29;
|
||||||
|
if ($temptd > 29) {
|
||||||
|
$temptd -= 29;
|
||||||
|
$yoon = "*";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
$mm = 30;
|
||||||
|
$ymm = 30;
|
||||||
|
if ($temptd > 30) {
|
||||||
|
$temptd -= 30;
|
||||||
|
$yoon = "*";
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if($temptd <= 0) {
|
$temptd -= $mm;
|
||||||
if($yoon=="*") $temptd += $ymm;
|
|
||||||
else $temptd +=$mm;
|
|
||||||
}
|
|
||||||
$ly += 1840;
|
|
||||||
$lm = $i % 12;
|
|
||||||
if($lm==0) $lm=12;
|
|
||||||
$ld = $temptd;
|
|
||||||
|
|
||||||
/* output */
|
$i++;
|
||||||
$myarray["year"] = $ly;
|
if ($i % 12 == 1)
|
||||||
$myarray["month"] = $lm;
|
$ly += 1;
|
||||||
$myarray["day"] = $ld;
|
}
|
||||||
$myarray["leap"] = $yoon;
|
if ($temptd <= 0) {
|
||||||
return $myarray;
|
if ($yoon == "*")
|
||||||
|
$temptd += $ymm;
|
||||||
|
else
|
||||||
|
$temptd += $mm;
|
||||||
|
}
|
||||||
|
$ly += 1840;
|
||||||
|
$lm = $i % 12;
|
||||||
|
if ($lm == 0)
|
||||||
|
$lm = 12;
|
||||||
|
$ld = $temptd;
|
||||||
|
|
||||||
|
/* output */
|
||||||
|
$myarray = array(
|
||||||
|
"year" => $ly,
|
||||||
|
"month" => $lm,
|
||||||
|
"day" => $ld,
|
||||||
|
"leap" => $yoon
|
||||||
|
);
|
||||||
|
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") {
|
|
||||||
switch($kk[$dm]) {
|
$dm = ($ly - 1841) * 12 + ($lm) - 1;
|
||||||
case 1 :
|
|
||||||
case 2 : break;
|
if ($leapyes == "yoon") {
|
||||||
case 3 :
|
switch ($kk[$dm]) {
|
||||||
case 4 :
|
case 1:
|
||||||
$temptd += 29;
|
case 2:
|
||||||
break;
|
break;
|
||||||
case 5 :
|
case 3:
|
||||||
case 6 :
|
case 4:
|
||||||
$temptd += 30;
|
$temptd += 29;
|
||||||
break;
|
break;
|
||||||
}
|
case 5:
|
||||||
|
case 6:
|
||||||
|
$temptd += 30;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$temptd += $ld;
|
$temptd += $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];
|
||||||
$temptd -= $md[$tempsm];
|
for ($tempsm = 0; $tempsm <= 11; $tempsm++) {
|
||||||
if($temptd <= 0) break;
|
$temptd -= $md[$tempsm];
|
||||||
}
|
if ($temptd <= 0)
|
||||||
if($temptd <= 0) {
|
break;
|
||||||
$temptd += $md[$tempsm];
|
|
||||||
$tempsd = $temptd;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$tempsy++;
|
|
||||||
}
|
}
|
||||||
|
if ($temptd <= 0) {
|
||||||
|
$temptd += $md[$tempsm];
|
||||||
|
$tempsd = $temptd;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$tempsy++;
|
||||||
|
}
|
||||||
|
|
||||||
$sy = $tempsy;
|
$sy = $tempsy;
|
||||||
$sm = $tempsm + 1;
|
$sm = $tempsm + 1;
|
||||||
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
@ -10,3 +10,7 @@
|
||||||
```
|
```
|
||||||
php 최소 버전: 5.3
|
php 최소 버전: 5.3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 설치방법
|
||||||
|
|
||||||
|
아보카도가 설치된 폴더의 하위 폴더인 `skin/board/` 에 `diary` 라는 폴더를 생성하고 파일을 업로드합니다.
|
||||||
|
|
|
||||||
461
view.skin.php
461
view.skin.php
|
|
@ -1,229 +1,232 @@
|
||||||
<?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('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
|
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||||
?>
|
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>
|
||||||
<!-- 게시물 읽기 시작 { -->
|
|
||||||
<hr class="padding big">
|
<!-- 게시물 읽기 시작 { -->
|
||||||
<article id="bo_v" class="theme-box">
|
<hr class="padding big">
|
||||||
<h2 id="bo_v_title" class="txt-center">
|
<article id="bo_v" class="theme-box">
|
||||||
<?php
|
<h2 id="bo_v_title" class="txt-center">
|
||||||
if ($category_name) echo $view['ca_name'].' | '; // 분류 출력 끝
|
<?php
|
||||||
echo cut_str(get_text($view['wr_subject']), 70);
|
if ($category_name)
|
||||||
?>
|
echo $view['ca_name'] . ' | '; // 분류 출력 끝
|
||||||
</h2>
|
echo cut_str(get_text($view['wr_subject']), 70);
|
||||||
|
?>
|
||||||
|
</h2>
|
||||||
<?php
|
|
||||||
if ($view['file']['count']) {
|
|
||||||
$cnt = 0;
|
<?php
|
||||||
for ($i=0; $i<count($view['file']); $i++) {
|
if ($view['file']['count']) {
|
||||||
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view'])
|
$cnt = 0;
|
||||||
$cnt++;
|
for ($i = 0; $i < count($view['file']); $i++) {
|
||||||
}
|
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view'])
|
||||||
}
|
$cnt++;
|
||||||
?>
|
}
|
||||||
|
}
|
||||||
<?php if($cnt) { ?>
|
?>
|
||||||
<!-- 첨부파일 시작 { -->
|
|
||||||
<section id="bo_v_file">
|
<?php if ($cnt) { ?>
|
||||||
<h2>첨부파일</h2>
|
<!-- 첨부파일 시작 { -->
|
||||||
<ul>
|
<section id="bo_v_file">
|
||||||
<?php
|
<h2>첨부파일</h2>
|
||||||
// 가변 파일
|
<ul>
|
||||||
for ($i=0; $i<count($view['file']); $i++) {
|
<?php
|
||||||
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) {
|
// 가변 파일
|
||||||
?>
|
for ($i = 0; $i < count($view['file']); $i++) {
|
||||||
<li>
|
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source'] && !$view['file'][$i]['view']) {
|
||||||
<a href="<?php echo $view['file'][$i]['href']; ?>" class="view_file_download">
|
?>
|
||||||
<strong><?php echo $view['file'][$i]['source'] ?></strong>
|
<li>
|
||||||
<?php echo $view['file'][$i]['content'] ?> (<?php echo $view['file'][$i]['size'] ?>)
|
<a href="<?php echo $view['file'][$i]['href']; ?>" class="view_file_download">
|
||||||
</a>
|
<strong><?php echo $view['file'][$i]['source'] ?></strong>
|
||||||
</li>
|
<?php echo $view['file'][$i]['content'] ?> (<?php echo $view['file'][$i]['size'] ?>)
|
||||||
<?php
|
</a>
|
||||||
}
|
</li>
|
||||||
}
|
<?php
|
||||||
?>
|
}
|
||||||
</ul>
|
}
|
||||||
</section>
|
?>
|
||||||
<!-- } 첨부파일 끝 -->
|
</ul>
|
||||||
<?php } ?>
|
</section>
|
||||||
|
<!-- } 첨부파일 끝 -->
|
||||||
<?php
|
<?php } ?>
|
||||||
if ($view['link']) {
|
|
||||||
?>
|
<?php
|
||||||
<!-- 관련링크 시작 { -->
|
if ($view['link']) {
|
||||||
<section id="bo_v_link">
|
?>
|
||||||
<h2>관련링크</h2>
|
<!-- 관련링크 시작 { -->
|
||||||
<ul>
|
<section id="bo_v_link">
|
||||||
<?php
|
<h2>관련링크</h2>
|
||||||
// 링크
|
<ul>
|
||||||
$cnt = 0;
|
<?php
|
||||||
for ($i=1; $i<=count($view['link']); $i++) {
|
// 링크
|
||||||
if ($view['link'][$i]) {
|
$cnt = 0;
|
||||||
$cnt++;
|
for ($i = 1; $i <= count($view['link']); $i++) {
|
||||||
$link = cut_str($view['link'][$i], 70);
|
if ($view['link'][$i]) {
|
||||||
?>
|
$cnt++;
|
||||||
<li>
|
$link = cut_str($view['link'][$i], 70);
|
||||||
<em>LINK <?=$i+1?></em> <a href="<?php echo $view['link_href'][$i] ?>" target="_blank">
|
?>
|
||||||
<strong><?php echo $link ?></strong>
|
<li>
|
||||||
</a>
|
<em>LINK <?= $i + 1 ?></em> <a href="<?php echo $view['link_href'][$i] ?>" target="_blank">
|
||||||
</li>
|
<strong><?php echo $link ?></strong>
|
||||||
<?php
|
</a>
|
||||||
}
|
</li>
|
||||||
}
|
<?php
|
||||||
?>
|
}
|
||||||
</ul>
|
}
|
||||||
</section>
|
?>
|
||||||
<!-- } 관련링크 끝 -->
|
</ul>
|
||||||
<?php } ?>
|
</section>
|
||||||
|
<!-- } 관련링크 끝 -->
|
||||||
|
<?php } ?>
|
||||||
<section id="bo_v_atc" class='txt-center'>
|
|
||||||
<h2 id="bo_v_atc_title">본문</h2>
|
|
||||||
|
<section id="bo_v_atc" class='txt-center'>
|
||||||
<?php
|
<h2 id="bo_v_atc_title">본문</h2>
|
||||||
// 파일 출력
|
|
||||||
$v_img_count = count($view['file']);
|
<?php
|
||||||
if($v_img_count) {
|
// 파일 출력
|
||||||
echo "<div id=\"bo_v_img\">\n";
|
$v_img_count = count($view['file']);
|
||||||
|
if ($v_img_count) {
|
||||||
for ($i=0; $i<=count($view['file']); $i++) {
|
echo "<div id=\"bo_v_img\">\n";
|
||||||
if ($view['file'][$i]['view']) {
|
|
||||||
//echo $view['file'][$i]['view'];
|
for ($i = 0; $i <= count($view['file']); $i++) {
|
||||||
echo get_view_thumbnail($view['file'][$i]['view']);
|
if ($view['file'][$i]['view']) {
|
||||||
}
|
//echo $view['file'][$i]['view'];
|
||||||
}
|
echo get_view_thumbnail($view['file'][$i]['view']);
|
||||||
|
}
|
||||||
echo "</div>\n";
|
}
|
||||||
}
|
|
||||||
?>
|
echo "</div>\n";
|
||||||
|
}
|
||||||
<!-- 본문 내용 시작 { -->
|
?>
|
||||||
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
|
|
||||||
<?php //echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?>
|
<!-- 본문 내용 시작 { -->
|
||||||
<!-- } 본문 내용 끝 -->
|
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
|
||||||
|
<?php //echo $view['rich_content']; // {이미지:0} 과 같은 코드를 사용할 경우 ?>
|
||||||
</section>
|
<!-- } 본문 내용 끝 -->
|
||||||
|
|
||||||
<?php
|
</section>
|
||||||
// 코멘트 입출력
|
|
||||||
// include_once(G5_BBS_PATH.'/view_comment.php');
|
<?php
|
||||||
?>
|
// 코멘트 입출력
|
||||||
|
// include_once(G5_BBS_PATH.'/view_comment.php');
|
||||||
|
?>
|
||||||
<!-- 링크 버튼 시작 { -->
|
|
||||||
<div id="bo_v_bot">
|
|
||||||
<hr class="padding">
|
<!-- 링크 버튼 시작 { -->
|
||||||
<?
|
<div id="bo_v_bot">
|
||||||
ob_start();
|
<hr class="padding">
|
||||||
?>
|
<?php
|
||||||
<? if ($prev_href || $next_href) { ?>
|
ob_start();
|
||||||
<div class="bo_v_nb">
|
?>
|
||||||
<? if ($prev_href) { ?><a href="<? echo $prev_href ?>" class="ui-btn">이전글</a><? } ?>
|
<?php if ($prev_href || $next_href) { ?>
|
||||||
<? if ($next_href) { ?><a href="<? echo $next_href ?>" class="ui-btn">다음글</a><? } ?>
|
<div class="bo_v_nb">
|
||||||
</div>
|
<?php if ($prev_href) { ?><a href="<?php echo $prev_href ?>" class="ui-btn">이전글</a><?php } ?>
|
||||||
<? } ?>
|
<?php if ($next_href) { ?><a href="<?php echo $next_href ?>" class="ui-btn">다음글</a><?php } ?>
|
||||||
|
</div>
|
||||||
<div class="bo_v_com">
|
<?php } ?>
|
||||||
<? if ($update_href) { ?><a href="<? echo $update_href ?>" class="ui-btn">수정</a><? } ?>
|
|
||||||
<? if ($delete_href) { ?><a href="<? echo $delete_href ?>" class="ui-btn" onclick="del(this.href); return false;">삭제</a><? } ?>
|
<div class="bo_v_com">
|
||||||
<? if ($copy_href) { ?><a href="<? echo $copy_href ?>" class="ui-btn admin" onclick="board_move(this.href); return false;">복사</a><? } ?>
|
<?php if ($update_href) { ?><a href="<?php echo $update_href ?>" class="ui-btn">수정</a><?php } ?>
|
||||||
<? if ($move_href) { ?><a href="<? echo $move_href ?>" class="ui-btn admin" onclick="board_move(this.href); return false;">이동</a><? } ?>
|
<?php if ($delete_href) { ?><a href="<?php echo $delete_href ?>" class="ui-btn"
|
||||||
<? if ($search_href) { ?><a href="<? echo $search_href ?>" class="ui-btn">검색</a><? } ?>
|
onclick="del(this.href); return false;">삭제</a><?php } ?>
|
||||||
<a href="<? echo $list_href ?>" class="ui-btn">목록</a>
|
<?php if ($copy_href) { ?><a href="<?php echo $copy_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 } ?>
|
||||||
</div>
|
<?php if ($move_href) { ?><a href="<?php echo $move_href ?>" class="ui-btn admin"
|
||||||
<?
|
onclick="board_move(this.href); return false;">이동</a><?php } ?>
|
||||||
$link_buttons = ob_get_contents();
|
<?php if ($search_href) { ?><a href="<?php echo $search_href ?>" class="ui-btn">검색</a><?php } ?>
|
||||||
ob_end_flush();
|
<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();
|
||||||
</article>
|
ob_end_flush();
|
||||||
<!-- } 게시판 읽기 끝 -->
|
?>
|
||||||
|
</div>
|
||||||
<script>
|
<!-- } 링크 버튼 끝 -->
|
||||||
<?php if ($board['bo_download_point'] < 0) { ?>
|
|
||||||
$(function() {
|
</article>
|
||||||
$("a.view_file_download").click(function() {
|
<!-- } 게시판 읽기 끝 -->
|
||||||
if(!g5_is_member) {
|
|
||||||
alert("다운로드 권한이 없습니다.\n회원이시라면 로그인 후 이용해 보십시오.");
|
<script>
|
||||||
return false;
|
<?php if ($board['bo_download_point'] < 0) { ?>
|
||||||
}
|
$(function () {
|
||||||
|
$("a.view_file_download").click(function () {
|
||||||
var msg = "파일을 다운로드 하시면 포인트가 차감(<?php echo number_format($board['bo_download_point']) ?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?";
|
if (!g5_is_member) {
|
||||||
|
alert("다운로드 권한이 없습니다.\n회원이시라면 로그인 후 이용해 보십시오.");
|
||||||
if(confirm(msg)) {
|
return false;
|
||||||
var href = $(this).attr("href")+"&js=on";
|
}
|
||||||
$(this).attr("href", href);
|
|
||||||
|
var msg = "파일을 다운로드 하시면 포인트가 차감(<?php echo number_format($board['bo_download_point']) ?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?";
|
||||||
return true;
|
|
||||||
} else {
|
if (confirm(msg)) {
|
||||||
return false;
|
var href = $(this).attr("href") + "&js=on";
|
||||||
}
|
$(this).attr("href", href);
|
||||||
});
|
|
||||||
});
|
return true;
|
||||||
<?php } ?>
|
} else {
|
||||||
|
return false;
|
||||||
function board_move(href)
|
}
|
||||||
{
|
});
|
||||||
window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
|
});
|
||||||
}
|
<?php } ?>
|
||||||
</script>
|
|
||||||
|
function board_move(href) {
|
||||||
<script>
|
window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
|
||||||
$(function() {
|
}
|
||||||
$("a.view_image").click(function() {
|
</script>
|
||||||
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;
|
<script>
|
||||||
});
|
$(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");
|
||||||
$("#good_button, #nogood_button").click(function() {
|
return false;
|
||||||
var $tx;
|
});
|
||||||
if(this.id == "good_button")
|
|
||||||
$tx = $("#bo_v_act_good");
|
// 추천, 비추천
|
||||||
else
|
$("#good_button, #nogood_button").click(function () {
|
||||||
$tx = $("#bo_v_act_nogood");
|
var $tx;
|
||||||
|
if (this.id == "good_button")
|
||||||
excute_good(this.href, $(this), $tx);
|
$tx = $("#bo_v_act_good");
|
||||||
return false;
|
else
|
||||||
});
|
$tx = $("#bo_v_act_nogood");
|
||||||
|
|
||||||
// 이미지 리사이즈
|
excute_good(this.href, $(this), $tx);
|
||||||
$("#bo_v_atc").viewimageresize();
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
function excute_good(href, $el, $tx)
|
// 이미지 리사이즈
|
||||||
{
|
$("#bo_v_atc").viewimageresize();
|
||||||
$.post(
|
});
|
||||||
href,
|
|
||||||
{ js: "on" },
|
function excute_good(href, $el, $tx) {
|
||||||
function(data) {
|
$.post(
|
||||||
if(data.error) {
|
href,
|
||||||
alert(data.error);
|
{ js: "on" },
|
||||||
return false;
|
function (data) {
|
||||||
}
|
if (data.error) {
|
||||||
|
alert(data.error);
|
||||||
if(data.count) {
|
return false;
|
||||||
$el.find("strong").text(number_format(String(data.count)));
|
}
|
||||||
if($tx.attr("id").search("nogood") > -1) {
|
|
||||||
$tx.text("이 글을 비추천하셨습니다.");
|
if (data.count) {
|
||||||
$tx.fadeIn(200).delay(2500).fadeOut(200);
|
$el.find("strong").text(number_format(String(data.count)));
|
||||||
} else {
|
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 {
|
||||||
}
|
$tx.text("이 글을 추천하셨습니다.");
|
||||||
}, "json"
|
$tx.fadeIn(200).delay(2500).fadeOut(200);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
</script>
|
}, "json"
|
||||||
<!-- } 게시글 읽기 끝 -->
|
);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<!-- } 게시글 읽기 끝 -->
|
||||||
|
|
|
||||||
495
write.php
495
write.php
|
|
@ -3,11 +3,11 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$bo_table) {
|
if (!$bo_table) {
|
||||||
alert("bo_table 값이 넘어오지 않았습니다.\\nwrite.php?bo_table=code 와 같은 방식으로 넘겨 주세요.", G5_URL);
|
alert("bo_table 값이 넘어오지 않았습니다.\\nwrite.php?bo_table=code 와 같은 방식으로 넘겨 주세요.", G5_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
check_device($board['bo_device']);
|
check_device($board['bo_device']);
|
||||||
|
|
@ -15,340 +15,339 @@ check_device($board['bo_device']);
|
||||||
$notice_array = explode(',', trim($board['bo_notice']));
|
$notice_array = explode(',', trim($board['bo_notice']));
|
||||||
|
|
||||||
if (!($w == '' || $w == 'u' || $w == 'r')) {
|
if (!($w == '' || $w == 'u' || $w == 'r')) {
|
||||||
alert('w 값이 제대로 넘어오지 않았습니다.');
|
alert('w 값이 제대로 넘어오지 않았습니다.');
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
|
||||||
alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G5_URL);
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G5_URL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
|
alert("글을 쓸 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.", './login.php?' . $qstr . '&url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 음수도 true 인것을 왜 이제야 알았을까?
|
// 음수도 true 인것을 왜 이제야 알았을까?
|
||||||
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포인트를 적립하신 후 다시 글쓰기 해 주십시오.');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$title_msg = '글쓰기';
|
$title_msg = '글쓰기';
|
||||||
} 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.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
|
alert('글을 수정할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?' . $qstr . '&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)
|
||||||
$reply = substr($write['wr_reply'], 0, $len);
|
$len = 0;
|
||||||
|
$reply = substr($write['wr_reply'], 0, $len);
|
||||||
|
|
||||||
// 원글만 구한다.
|
// 원글만 구한다.
|
||||||
$sql = " select count(*) as cnt from {$write_table}
|
$sql = " select count(*) as cnt from {$write_table}
|
||||||
where wr_reply like '{$reply}%'
|
where wr_reply like '{$reply}%'
|
||||||
and wr_id <> '{$write['wr_id']}'
|
and wr_id <> '{$write['wr_id']}'
|
||||||
and wr_num = '{$write['wr_num']}'
|
and wr_num = '{$write['wr_num']}'
|
||||||
and wr_is_comment = 0 ";
|
and wr_is_comment = 0 ";
|
||||||
$row = sql_fetch($sql);
|
$row = sql_fetch($sql);
|
||||||
if ($row['cnt'] && !$is_admin)
|
if ($row['cnt'] && !$is_admin)
|
||||||
alert('이 글과 관련된 답변글이 존재하므로 수정 할 수 없습니다.\\n\\n답변글이 있는 원글은 수정할 수 없습니다.');
|
alert('이 글과 관련된 답변글이 존재하므로 수정 할 수 없습니다.\\n\\n답변글이 있는 원글은 수정할 수 없습니다.');
|
||||||
|
|
||||||
// 코멘트 달린 원글의 수정 여부
|
// 코멘트 달린 원글의 수정 여부
|
||||||
$sql = " select count(*) as cnt from {$write_table}
|
$sql = " select count(*) as cnt from {$write_table}
|
||||||
where wr_parent = '{$wr_id}'
|
where wr_parent = '{$wr_id}'
|
||||||
and mb_id <> '{$member['mb_id']}'
|
and mb_id <> '{$member['mb_id']}'
|
||||||
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') {
|
||||||
if ($member['mb_level'] < $board['bo_reply_level']) {
|
if ($member['mb_level'] < $board['bo_reply_level']) {
|
||||||
if ($member['mb_id'])
|
if ($member['mb_id'])
|
||||||
alert('글을 답변할 권한이 없습니다.');
|
alert('글을 답변할 권한이 없습니다.');
|
||||||
else
|
|
||||||
alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
|
|
||||||
}
|
|
||||||
|
|
||||||
$tmp_point = isset($member['mb_point']) ? $member['mb_point'] : 0;
|
|
||||||
if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin)
|
|
||||||
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 (in_array((int)$wr_id, $notice_array))
|
|
||||||
alert('공지에는 답변 할 수 없습니다.');
|
|
||||||
|
|
||||||
//----------
|
|
||||||
// 4.06.13 : 비밀글을 타인이 열람할 수 있는 오류 수정 (헐랭이, 플록님께서 알려주셨습니다.)
|
|
||||||
// 코멘트에는 원글의 답변이 불가하므로
|
|
||||||
if ($write['wr_is_comment'])
|
|
||||||
alert('정상적인 접근이 아닙니다.');
|
|
||||||
|
|
||||||
// 비밀글인지를 검사
|
|
||||||
if (strstr($write['wr_option'], 'secret')) {
|
|
||||||
if ($write['mb_id']) {
|
|
||||||
// 회원의 경우는 해당 글쓴 회원 및 관리자
|
|
||||||
if (!($write['mb_id'] == $member['mb_id'] || $is_admin))
|
|
||||||
alert('비밀글에는 자신 또는 관리자만 답변이 가능합니다.');
|
|
||||||
} else {
|
|
||||||
// 비회원의 경우는 비밀글에 답변이 불가함
|
|
||||||
if (!$is_admin)
|
|
||||||
alert('비회원의 비밀글에는 답변이 불가합니다.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//----------
|
|
||||||
|
|
||||||
// 게시글 배열 참조
|
|
||||||
$reply_array = &$write;
|
|
||||||
|
|
||||||
// 최대 답변은 테이블에 잡아놓은 wr_reply 사이즈만큼만 가능합니다.
|
|
||||||
if (strlen($reply_array['wr_reply']) == 10)
|
|
||||||
alert('더 이상 답변하실 수 없습니다.\\n\\n답변은 10단계 까지만 가능합니다.');
|
|
||||||
|
|
||||||
$reply_len = strlen($reply_array['wr_reply']) + 1;
|
|
||||||
if ($board['bo_reply_order']) {
|
|
||||||
$begin_reply_char = 'A';
|
|
||||||
$end_reply_char = 'Z';
|
|
||||||
$reply_number = +1;
|
|
||||||
$sql = " select MAX(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) <> '' ";
|
|
||||||
} else {
|
|
||||||
$begin_reply_char = 'Z';
|
|
||||||
$end_reply_char = 'A';
|
|
||||||
$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) <> '' ";
|
|
||||||
}
|
|
||||||
if ($reply_array['wr_reply']) $sql .= " and wr_reply like '{$reply_array['wr_reply']}%' ";
|
|
||||||
$row = sql_fetch($sql);
|
|
||||||
|
|
||||||
if (!$row['reply'])
|
|
||||||
$reply_char = $begin_reply_char;
|
|
||||||
else if ($row['reply'] == $end_reply_char) // A~Z은 26 입니다.
|
|
||||||
alert('더 이상 답변하실 수 없습니다.\\n\\n답변은 26개 까지만 가능합니다.');
|
|
||||||
else
|
else
|
||||||
$reply_char = chr(ord($row['reply']) + $reply_number);
|
alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?' . $qstr . '&url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
|
||||||
|
}
|
||||||
|
|
||||||
$reply = $reply_array['wr_reply'] . $reply_char;
|
$tmp_point = isset($member['mb_point']) ? $member['mb_point'] : 0;
|
||||||
|
if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin)
|
||||||
|
alert('보유하신 포인트(' . number_format($member['mb_point']) . ')가 없거나 모자라서 글답변(' . number_format($board['bo_comment_point']) . ')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글답변 해 주십시오.');
|
||||||
|
|
||||||
$title_msg = '글답변';
|
//if (preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board['bo_notice']))
|
||||||
|
if (in_array((int) $wr_id, $notice_array))
|
||||||
|
alert('공지에는 답변 할 수 없습니다.');
|
||||||
|
|
||||||
$write['wr_subject'] = 'Re: '.$write['wr_subject'];
|
//----------
|
||||||
|
// 4.06.13 : 비밀글을 타인이 열람할 수 있는 오류 수정 (헐랭이, 플록님께서 알려주셨습니다.)
|
||||||
|
// 코멘트에는 원글의 답변이 불가하므로
|
||||||
|
if ($write['wr_is_comment'])
|
||||||
|
alert('정상적인 접근이 아닙니다.');
|
||||||
|
|
||||||
|
// 비밀글인지를 검사
|
||||||
|
if (strstr($write['wr_option'], 'secret')) {
|
||||||
|
if ($write['mb_id']) {
|
||||||
|
// 회원의 경우는 해당 글쓴 회원 및 관리자
|
||||||
|
if (!($write['mb_id'] == $member['mb_id'] || $is_admin))
|
||||||
|
alert('비밀글에는 자신 또는 관리자만 답변이 가능합니다.');
|
||||||
|
} else {
|
||||||
|
// 비회원의 경우는 비밀글에 답변이 불가함
|
||||||
|
if (!$is_admin)
|
||||||
|
alert('비회원의 비밀글에는 답변이 불가합니다.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//----------
|
||||||
|
|
||||||
|
// 게시글 배열 참조
|
||||||
|
$reply_array = &$write;
|
||||||
|
|
||||||
|
// 최대 답변은 테이블에 잡아놓은 wr_reply 사이즈만큼만 가능합니다.
|
||||||
|
if (strlen($reply_array['wr_reply']) == 10)
|
||||||
|
alert('더 이상 답변하실 수 없습니다.\\n\\n답변은 10단계 까지만 가능합니다.');
|
||||||
|
|
||||||
|
$reply_len = strlen($reply_array['wr_reply']) + 1;
|
||||||
|
if ($board['bo_reply_order']) {
|
||||||
|
$begin_reply_char = 'A';
|
||||||
|
$end_reply_char = 'Z';
|
||||||
|
$reply_number = +1;
|
||||||
|
$sql = " select MAX(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) <> '' ";
|
||||||
|
} else {
|
||||||
|
$begin_reply_char = 'Z';
|
||||||
|
$end_reply_char = 'A';
|
||||||
|
$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) <> '' ";
|
||||||
|
}
|
||||||
|
if ($reply_array['wr_reply'])
|
||||||
|
$sql .= " and wr_reply like '{$reply_array['wr_reply']}%' ";
|
||||||
|
$row = sql_fetch($sql);
|
||||||
|
|
||||||
|
if (!$row['reply'])
|
||||||
|
$reply_char = $begin_reply_char;
|
||||||
|
else if ($row['reply'] == $end_reply_char) // A~Z은 26 입니다.
|
||||||
|
alert('더 이상 답변하실 수 없습니다.\\n\\n답변은 26개 까지만 가능합니다.');
|
||||||
|
else
|
||||||
|
$reply_char = chr(ord($row['reply']) + $reply_number);
|
||||||
|
|
||||||
|
$reply = $reply_array['wr_reply'] . $reply_char;
|
||||||
|
|
||||||
|
$title_msg = '글답변';
|
||||||
|
|
||||||
|
$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.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
|
alert("접근 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.", 'login.php?' . $qstr . '&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']) {
|
||||||
; // 통과
|
; // 통과
|
||||||
} else {
|
} else {
|
||||||
// 그룹접근
|
// 그룹접근
|
||||||
$sql = " select gr_id from {$g5['group_member_table']} where gr_id = '{$board['gr_id']}' and mb_id = '{$member['mb_id']}' ";
|
$sql = " select gr_id from {$g5['group_member_table']} where gr_id = '{$board['gr_id']}' and mb_id = '{$member['mb_id']}' ";
|
||||||
$row = sql_fetch($sql);
|
$row = sql_fetch($sql);
|
||||||
if (!$row['gr_id'])
|
if (!$row['gr_id'])
|
||||||
alert('접근 권한이 없으므로 글쓰기가 불가합니다.\\n\\n궁금하신 사항은 관리자에게 문의 바랍니다.');
|
alert('접근 권한이 없으므로 글쓰기가 불가합니다.\\n\\n궁금하신 사항은 관리자에게 문의 바랍니다.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 본인확인을 사용한다면
|
// 본인확인을 사용한다면
|
||||||
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.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
|
alert('이 게시판은 본인확인 하신 회원님만 글쓰기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', 'login.php?' . $qstr . '&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']) {
|
||||||
alert('이 게시판은 본인확인 하신 회원님만 글쓰기가 가능합니다.\\n\\n회원정보 수정에서 본인확인을 해주시기 바랍니다.', G5_URL);
|
alert('이 게시판은 본인확인 하신 회원님만 글쓰기가 가능합니다.\\n\\n회원정보 수정에서 본인확인을 해주시기 바랍니다.', G5_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($board['bo_use_cert'] == 'adult' && !$member['mb_adult']) {
|
if ($board['bo_use_cert'] == 'adult' && !$member['mb_adult']) {
|
||||||
alert('이 게시판은 본인확인으로 성인인증 된 회원님만 글쓰기가 가능합니다.\\n\\n성인인데 글쓰기가 안된다면 회원정보 수정에서 본인확인을 다시 해주시기 바랍니다.', G5_URL);
|
alert('이 게시판은 본인확인으로 성인인증 된 회원님만 글쓰기가 가능합니다.\\n\\n성인인데 글쓰기가 안된다면 회원정보 수정에서 본인확인을 다시 해주시기 바랍니다.', G5_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($board['bo_use_cert'] == 'hp-cert' && $member['mb_certify'] != 'hp') {
|
if ($board['bo_use_cert'] == 'hp-cert' && $member['mb_certify'] != 'hp') {
|
||||||
alert('이 게시판은 휴대폰 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원정보 수정에서 휴대폰 본인확인을 해주시기 바랍니다.', G5_URL);
|
alert('이 게시판은 휴대폰 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원정보 수정에서 휴대폰 본인확인을 해주시기 바랍니다.', G5_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($board['bo_use_cert'] == 'hp-adult' && (!$member['mb_adult'] || $member['mb_certify'] != 'hp')) {
|
if ($board['bo_use_cert'] == 'hp-adult' && (!$member['mb_adult'] || $member['mb_certify'] != 'hp')) {
|
||||||
alert('이 게시판은 휴대폰 본인확인으로 성인인증 된 회원님만 글읽기가 가능합니다.\\n\\n현재 성인인데 글읽기가 안된다면 회원정보 수정에서 휴대폰 본인확인을 다시 해주시기 바랍니다.', G5_URL);
|
alert('이 게시판은 휴대폰 본인확인으로 성인인증 된 회원님만 글읽기가 가능합니다.\\n\\n현재 성인인데 글읽기가 안된다면 회원정보 수정에서 휴대폰 본인확인을 다시 해주시기 바랍니다.', G5_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 글자수 제한 설정값
|
// 글자수 제한 설정값
|
||||||
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 {
|
||||||
}
|
$write_min = (int) $board['bo_write_min'];
|
||||||
else
|
$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 = '';
|
||||||
if ($is_admin && $w != 'r') {
|
if ($is_admin && $w != 'r') {
|
||||||
$is_notice = true;
|
$is_notice = true;
|
||||||
|
|
||||||
if ($w == 'u') {
|
if ($w == 'u') {
|
||||||
// 답변 수정시 공지 체크 없음
|
// 답변 수정시 공지 체크 없음
|
||||||
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';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_html = false;
|
$is_html = false;
|
||||||
if ($member['mb_level'] >= $board['bo_html_level'])
|
if ($member['mb_level'] >= $board['bo_html_level'])
|
||||||
$is_html = true;
|
$is_html = true;
|
||||||
|
|
||||||
$is_secret = $board['bo_use_secret'];
|
$is_secret = $board['bo_use_secret'];
|
||||||
|
|
||||||
$is_mail = false;
|
$is_mail = false;
|
||||||
if ($config['cf_email_use'] && $board['bo_use_email'])
|
if ($config['cf_email_use'] && $board['bo_use_email'])
|
||||||
$is_mail = true;
|
$is_mail = true;
|
||||||
|
|
||||||
$recv_email_checked = '';
|
$recv_email_checked = '';
|
||||||
if ($w == '' || strstr($write['wr_option'], 'mail'))
|
if ($w == '' || strstr($write['wr_option'], 'mail'))
|
||||||
$recv_email_checked = 'checked';
|
$recv_email_checked = 'checked';
|
||||||
|
|
||||||
$is_name = false;
|
$is_name = false;
|
||||||
$is_password = false;
|
$is_password = false;
|
||||||
$is_email = false;
|
$is_email = false;
|
||||||
$is_homepage = false;
|
$is_homepage = false;
|
||||||
if ($is_guest || ($is_admin && $w == 'u' && $member['mb_id'] != $write['mb_id'])) {
|
if ($is_guest || ($is_admin && $w == 'u' && $member['mb_id'] != $write['mb_id'])) {
|
||||||
$is_name = true;
|
$is_name = true;
|
||||||
$is_password = true;
|
$is_password = true;
|
||||||
$is_email = true;
|
$is_email = true;
|
||||||
$is_homepage = true;
|
$is_homepage = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_category = false;
|
$is_category = false;
|
||||||
$category_option = '';
|
$category_option = '';
|
||||||
if ($board['bo_use_category']) {
|
if ($board['bo_use_category']) {
|
||||||
$ca_name = "";
|
$ca_name = "";
|
||||||
if (isset($write['ca_name']))
|
if (isset($write['ca_name']))
|
||||||
$ca_name = $write['ca_name'];
|
$ca_name = $write['ca_name'];
|
||||||
$category_option = get_category_option($bo_table, $ca_name);
|
$category_option = get_category_option($bo_table, $ca_name);
|
||||||
$is_category = true;
|
$is_category = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_link = false;
|
$is_link = false;
|
||||||
if ($member['mb_level'] >= $board['bo_link_level']) {
|
if ($member['mb_level'] >= $board['bo_link_level']) {
|
||||||
$is_link = true;
|
$is_link = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_file = false;
|
$is_file = false;
|
||||||
if ($member['mb_level'] >= $board['bo_upload_level']) {
|
if ($member['mb_level'] >= $board['bo_upload_level']) {
|
||||||
$is_file = true;
|
$is_file = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_file_content = false;
|
$is_file_content = false;
|
||||||
if ($board['bo_use_file_content']) {
|
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 = "";
|
||||||
$homepage = "";
|
$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']);
|
|
||||||
$homepage = get_text(stripslashes($member['mb_homepage']));
|
|
||||||
}
|
}
|
||||||
|
$email = get_email_address($member['mb_email']);
|
||||||
|
$homepage = get_text(stripslashes($member['mb_homepage']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$html_checked = "";
|
$html_checked = "";
|
||||||
$html_value = "";
|
$html_value = "";
|
||||||
$secret_checked = "";
|
$secret_checked = "";
|
||||||
|
|
||||||
if ($w == '') {
|
if ($w == '') {
|
||||||
$password_required = 'required';
|
$password_required = 'required';
|
||||||
} else if ($w == 'u') {
|
} else if ($w == 'u') {
|
||||||
$password_required = '';
|
$password_required = '';
|
||||||
|
|
||||||
if (!$is_admin) {
|
if (!$is_admin) {
|
||||||
if (!($is_member && $member['mb_id'] == $write['mb_id'])) {
|
if (!($is_member && $member['mb_id'] == $write['mb_id'])) {
|
||||||
if (!check_password($wr_password, $write['wr_password'])) {
|
if (!check_password($wr_password, $write['wr_password'])) {
|
||||||
alert('비밀번호가 틀립니다.');
|
alert('비밀번호가 틀립니다.');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$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')) {
|
||||||
$html_checked = 'checked';
|
$html_checked = 'checked';
|
||||||
$html_value = 'html1';
|
$html_value = 'html1';
|
||||||
} else if (strstr($write['wr_option'], 'html2')) {
|
} else if (strstr($write['wr_option'], 'html2')) {
|
||||||
$html_checked = 'checked';
|
$html_checked = 'checked';
|
||||||
$html_value = 'html2';
|
$html_value = 'html2';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strstr($write['wr_option'], 'secret')) {
|
if (strstr($write['wr_option'], 'secret')) {
|
||||||
$secret_checked = 'checked';
|
$secret_checked = 'checked';
|
||||||
}
|
}
|
||||||
|
|
||||||
$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')) {
|
||||||
$is_secret = true;
|
$is_secret = true;
|
||||||
$secret_checked = 'checked';
|
$secret_checked = 'checked';
|
||||||
}
|
}
|
||||||
|
|
||||||
$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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set_session('ss_bo_table', $_REQUEST['bo_table']);
|
set_session('ss_bo_table', $_REQUEST['bo_table']);
|
||||||
|
|
@ -356,46 +355,46 @@ set_session('ss_wr_id', $_REQUEST['wr_id']);
|
||||||
|
|
||||||
$subject = "";
|
$subject = "";
|
||||||
if (isset($write['wr_subject'])) {
|
if (isset($write['wr_subject'])) {
|
||||||
$subject = str_replace("\"", """, get_text(cut_str($write['wr_subject'], 255), 0));
|
$subject = str_replace("\"", """, get_text(cut_str($write['wr_subject'], 255), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = '';
|
$content = '';
|
||||||
if ($w == '') {
|
if ($w == '') {
|
||||||
$content = $board['bo_insert_content'];
|
$content = $board['bo_insert_content'];
|
||||||
} else if ($w == 'r') {
|
} else if ($w == 'r') {
|
||||||
if (!strstr($write['wr_option'], 'html')) {
|
if (!strstr($write['wr_option'], 'html')) {
|
||||||
$content = "\n\n\n > "
|
$content = "\n\n\n > "
|
||||||
."\n > "
|
. "\n > "
|
||||||
."\n > ".str_replace("\n", "\n> ", get_text($write['wr_content'], 0))
|
. "\n > " . str_replace("\n", "\n> ", get_text($write['wr_content'], 0))
|
||||||
."\n > "
|
. "\n > "
|
||||||
."\n > ";
|
. "\n > ";
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$content = get_text($write['wr_content'], 0);
|
$content = get_text($write['wr_content'], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$upload_max_filesize = number_format($board['bo_upload_size']) . ' 바이트';
|
$upload_max_filesize = number_format($board['bo_upload_size']) . ' 바이트';
|
||||||
|
|
||||||
$width = $board['bo_table_width'];
|
$width = $board['bo_table_width'];
|
||||||
if ($width <= 100)
|
if ($width <= 100)
|
||||||
$width .= '%';
|
$width .= '%';
|
||||||
else
|
else
|
||||||
$width .= 'px';
|
$width .= 'px';
|
||||||
|
|
||||||
|
|
||||||
$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');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
325
write.skin.php
325
write.skin.php
|
|
@ -1,157 +1,168 @@
|
||||||
<?php
|
<?php
|
||||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
if (!defined('_GNUBOARD_'))
|
||||||
|
exit; // 개별 페이지 접근 불가
|
||||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
|
||||||
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
|
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||||
?>
|
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
|
||||||
<section id="bo_w">
|
?>
|
||||||
<hr class="padding small">
|
<section id="bo_w">
|
||||||
<!-- 게시물 작성/수정 시작 -->
|
<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">
|
<!-- 게시물 작성/수정 시작 -->
|
||||||
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
|
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);"
|
||||||
<input type="hidden" name="w" value="<?php echo $w ?>" id="write_w" >
|
method="post" enctype="multipart/form-data" autocomplete="off">
|
||||||
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
|
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
|
||||||
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>" id="write_id">
|
<input type="hidden" name="w" value="<?php echo $w ?>" id="write_w">
|
||||||
<input type="hidden" name="sca" value="<?php echo $sca ?>">
|
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
|
||||||
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
|
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>" id="write_id">
|
||||||
<input type="hidden" name="stx" value="<?php echo $stx ?>">
|
<input type="hidden" name="sca" value="<?php echo $sca ?>">
|
||||||
<input type="hidden" name="spt" value="<?php echo $spt ?>">
|
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
|
||||||
<input type="hidden" name="sst" value="<?php echo $sst ?>">
|
<input type="hidden" name="stx" value="<?php echo $stx ?>">
|
||||||
<input type="hidden" name="sod" value="<?php echo $sod ?>">
|
<input type="hidden" name="spt" value="<?php echo $spt ?>">
|
||||||
<input type="hidden" name="page" value="<?php echo $page ?>">
|
<input type="hidden" name="sst" value="<?php echo $sst ?>">
|
||||||
<?php
|
<input type="hidden" name="sod" value="<?php echo $sod ?>">
|
||||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
<input type="hidden" name="page" value="<?php echo $page ?>">
|
||||||
$offset=$board['bo_3']? " ".$board['bo_3']." hours" : "";
|
<?php
|
||||||
$today=date('Ymd',strtotime(date('Y/m/d H:i:s').$offset));
|
include_once(G5_PLUGIN_PATH . '/jquery-ui/datepicker.php');
|
||||||
if (empty($fr_date)) $fr_date = $today;
|
$offset = $board['bo_3'] ? " " . $board['bo_3'] . " hours" : "";
|
||||||
if($w=='' ){if ($_GET['fr_date']) {
|
$today = date('Ymd', strtotime(date('Y/m/d H:i:s') . $offset));
|
||||||
$write['wr_1'] = $_GET['fr_date'];
|
if (empty($fr_date))
|
||||||
}else{
|
$fr_date = $today;
|
||||||
|
if ($w == '') {
|
||||||
$write['wr_1'] = $today;
|
if ($_GET['fr_date']) {
|
||||||
}
|
$write['wr_1'] = $_GET['fr_date'];
|
||||||
}
|
} else {
|
||||||
$option = '';
|
|
||||||
$option_hidden = '';
|
$write['wr_1'] = $today;
|
||||||
echo $option_hidden;
|
}
|
||||||
?>
|
}
|
||||||
<section class="wr_content">
|
$option = '';
|
||||||
<div id="wr_info">
|
$option_hidden = '';
|
||||||
<?php if ($is_name) { ?>
|
echo $option_hidden;
|
||||||
<p>
|
?>
|
||||||
<label for="wr_name">이름<strong class="sound_only">필수</strong></label>
|
<section class="wr_content">
|
||||||
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" size="10" maxlength="20">
|
<div id="wr_info">
|
||||||
</p>
|
<?php if ($is_name) { ?>
|
||||||
<?php } ?>
|
<p>
|
||||||
<?php if ($is_password) { ?>
|
<label for="wr_name">이름<strong class="sound_only">필수</strong></label>
|
||||||
<p>
|
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required"
|
||||||
<label for="wr_password">패스워드<strong class="sound_only">필수</strong></label>
|
size="10" 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 ($is_password) { ?>
|
||||||
<?php if ($option) { ?>
|
<p>
|
||||||
<p>
|
<label for="wr_password">패스워드<strong class="sound_only">필수</strong></label>
|
||||||
<?php echo $option ?>
|
<input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?>
|
||||||
</p>
|
class="frm_input <?php echo $password_required ?>" maxlength="20">
|
||||||
<?php } ?>
|
</p>
|
||||||
<?php if ($is_category) { ?>
|
<?php } ?>
|
||||||
<p>
|
<?php if ($option) { ?>
|
||||||
<select name="ca_name" id="ca_name" required class="required" >
|
<p>
|
||||||
<option value="">선택하세요</option>
|
<?php echo $option ?>
|
||||||
<?php echo $category_option ?>
|
</p>
|
||||||
</select>
|
<?php } ?>
|
||||||
</p>
|
<?php if ($is_category) { ?>
|
||||||
<?php } ?>
|
<p>
|
||||||
<p>
|
<select name="ca_name" id="ca_name" required class="required">
|
||||||
<input type="hidden" name="wr_subject" value="<?php echo $write['wr_1']; ?>" id="wr_subject" required maxlength="255">
|
<option value="">선택하세요</option>
|
||||||
<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="날짜">
|
<?php echo $category_option ?>
|
||||||
</p>
|
</select>
|
||||||
</div>
|
</p>
|
||||||
<section class="options">
|
<?php } ?>
|
||||||
<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']: "무드";?>">
|
<p>
|
||||||
</section>
|
<input type="hidden" name="wr_subject" value="<?php echo $write['wr_1']; ?>" id="wr_subject" required
|
||||||
<textarea name="wr_content" id="wr_content" maxlength="255" required></textarea>
|
maxlength="255">
|
||||||
<input type="file" id="wr_file" name="bf_file[0]" title="파일첨부 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input full">
|
<input type="text" name="wr_1" value="<?php echo $write['wr_1']; ?>" id="wr_1" required
|
||||||
<div class="btn_confirm txt-right">
|
class="date full frm_input required" size="21" maxlength="8" placeholder="날짜">
|
||||||
<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>
|
</p>
|
||||||
<?if($is_secret){?><label for="secret" id="wr_secret"><input type="checkbox" id="secret" value="secret" name="secret"> 비밀글 </label><?}?>
|
</div>
|
||||||
<input type="submit" value="입력" id="btn_submit" accesskey="s" class="ui-btn point">
|
<section class="options">
|
||||||
</div>
|
<input type="text" name="wr_4" id="wr_4" value="<?= $write['wr_4'] ?>"
|
||||||
</section>
|
placeholder="<?= $board['bo_5'] ? $board['bo_5'] : "날씨"; ?>"><input type="text" name="wr_3" id="wr_3"
|
||||||
</form>
|
value="<?= $write['wr_3'] ?>" placeholder="<?= $board['bo_6'] ? $board['bo_6'] : "무드"; ?>">
|
||||||
|
</section>
|
||||||
</section>
|
<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">
|
||||||
<script>
|
<div class="btn_confirm txt-right">
|
||||||
$(function(){
|
<label id="file_del" for="bf_file_del0" class="sound_only"><input type="checkbox" id="bf_file_del0"
|
||||||
$(".date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yymmdd", showButtonPanel: true, yearRange: "c-99:c+99" });
|
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 } ?>
|
||||||
function html_auto_br(obj)
|
<input type="submit" value="입력" id="btn_submit" accesskey="s" class="ui-btn point">
|
||||||
{
|
</div>
|
||||||
if (obj.checked) {
|
</section>
|
||||||
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
|
</form>
|
||||||
if (result)
|
|
||||||
obj.value = "html2";
|
</section>
|
||||||
else
|
<!-- 게시물 작성/수정 끝 -->
|
||||||
obj.value = "html1";
|
|
||||||
}
|
<script>
|
||||||
else
|
$(function () {
|
||||||
obj.value = "";
|
$(".date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yymmdd", showButtonPanel: true, yearRange: "c-99:c+99" });
|
||||||
}
|
});
|
||||||
|
|
||||||
function fwrite_submit(f)
|
function html_auto_br(obj) {
|
||||||
{
|
if (obj.checked) {
|
||||||
|
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
|
||||||
var frdate="<?=$fr_date?>";
|
if (result)
|
||||||
var subject = "";
|
obj.value = "html2";
|
||||||
var content = "";
|
else
|
||||||
$.ajax({
|
obj.value = "html1";
|
||||||
url: g5_bbs_url+"/ajax.filter.php",
|
}
|
||||||
type: "POST",
|
else
|
||||||
data: {
|
obj.value = "";
|
||||||
"subject": f.wr_subject.value,
|
}
|
||||||
"content": f.wr_content.value
|
|
||||||
},
|
function fwrite_submit(f) {
|
||||||
dataType: "json",
|
|
||||||
async: false,
|
var frdate = "<?= $fr_date ?>";
|
||||||
cache: false,
|
var subject = "";
|
||||||
success: function(data, textStatus) {
|
var content = "";
|
||||||
subject = data.subject;
|
$.ajax({
|
||||||
content = data.content;
|
url: g5_bbs_url + "/ajax.filter.php",
|
||||||
}
|
type: "POST",
|
||||||
});
|
data: {
|
||||||
|
"subject": f.wr_subject.value,
|
||||||
if (subject) {
|
"content": f.wr_content.value
|
||||||
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
|
},
|
||||||
f.wr_subject.focus();
|
dataType: "json",
|
||||||
return false;
|
async: false,
|
||||||
}
|
cache: false,
|
||||||
|
success: function (data, textStatus) {
|
||||||
if (content) {
|
subject = data.subject;
|
||||||
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
|
content = data.content;
|
||||||
if (typeof(ed_wr_content) != "undefined")
|
}
|
||||||
ed_wr_content.returnFalse();
|
});
|
||||||
else
|
|
||||||
f.wr_content.focus();
|
if (subject) {
|
||||||
return false;
|
alert("제목에 금지단어('" + subject + "')가 포함되어있습니다");
|
||||||
}
|
f.wr_subject.focus();
|
||||||
if (document.getElementById("char_count")) {
|
return false;
|
||||||
if (char_min > 0 || char_max > 0) {
|
}
|
||||||
var cnt = parseInt(check_byte("wr_content", "char_count"));
|
|
||||||
if (char_min > 0 && char_min > cnt) {
|
if (content) {
|
||||||
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
|
alert("내용에 금지단어('" + content + "')가 포함되어있습니다");
|
||||||
return false;
|
if (typeof (ed_wr_content) != "undefined")
|
||||||
}
|
ed_wr_content.returnFalse();
|
||||||
else if (char_max > 0 && char_max < cnt) {
|
else
|
||||||
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
|
f.wr_content.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
if (document.getElementById("char_count")) {
|
||||||
}
|
if (char_min > 0 || char_max > 0) {
|
||||||
document.getElementById("btn_submit").disabled = "disabled";
|
var cnt = parseInt(check_byte("wr_content", "char_count"));
|
||||||
|
if (char_min > 0 && char_min > cnt) {
|
||||||
return true;
|
alert("내용은 " + char_min + "글자 이상 쓰셔야 합니다.");
|
||||||
}
|
return false;
|
||||||
</script>
|
}
|
||||||
|
else if (char_max > 0 && char_max < cnt) {
|
||||||
|
alert("내용은 " + char_max + "글자 이하로 쓰셔야 합니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById("btn_submit").disabled = "disabled";
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
<?
|
<?php
|
||||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
if (!defined("_GNUBOARD_"))
|
||||||
|
exit; // 개별 페이지 접근 불가
|
||||||
// 자신만의 코드를 넣어주세요.
|
|
||||||
|
// 자신만의 코드를 넣어주세요.
|
||||||
if($wr_etc){
|
|
||||||
$etc=implode("||",$wr_etc);
|
if ($wr_etc) {
|
||||||
$etc.="||";
|
$etc = implode("||", $wr_etc);
|
||||||
$sql = " update {$write_table}
|
$etc .= "||";
|
||||||
set wr_4='{$etc}'
|
$sql = " update {$write_table}
|
||||||
where wr_id = '{$wr_id}' ";
|
set wr_4='{$etc}'
|
||||||
sql_query($sql);
|
where wr_id = '{$wr_id}' ";
|
||||||
}
|
sql_query($sql);
|
||||||
goto_url("./board.php?bo_table=$bo_table");
|
}
|
||||||
?>
|
|
||||||
|
goto_url("./board.php?bo_table=$bo_table");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue