update and fix code

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

View file

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

View file

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

View file

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

View file

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

View file

@ -21,9 +21,9 @@ if (!($w == '' || $w == 'u' || $w == 'r')) {
if ($w == 'u' || $w == 'r') {
if ($write['wr_id']) {
// 가변 변수로 $wr_1 .. $wr_10 까지 만든다.
for ($i=1; $i<=10; $i++) {
$vvar = "wr_".$i;
$$vvar = $write['wr_'.$i];
for ($i = 1; $i <= 10; $i++) {
$vvar = "wr_" . $i;
$$vvar = $write['wr_' . $i];
}
} else {
alert("글이 존재하지 않습니다.\\n삭제되었거나 이동된 경우입니다.", G5_URL);
@ -32,14 +32,14 @@ if ($w == 'u' || $w == 'r') {
if ($w == '') {
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_id']) {
alert('글을 쓸 권한이 없습니다.');
} else {
alert("글을 쓸 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.", './login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
alert("글을 쓸 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.", './login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
}
}
@ -47,7 +47,7 @@ if ($w == '') {
if ($is_member) {
$tmp_point = ($member['mb_point'] > 0) ? $member['mb_point'] : 0;
if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin) {
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글쓰기('.number_format($board['bo_write_point']).')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글쓰기 해 주십시오.');
alert('보유하신 포인트(' . number_format($member['mb_point']) . ')가 없거나 모자라서 글쓰기(' . number_format($board['bo_write_point']) . ')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글쓰기 해 주십시오.');
}
}
@ -55,18 +55,19 @@ if ($w == '') {
} else if ($w == 'u') {
// 김선용 1.00 : 글쓰기 권한과 수정은 별도로 처리되어야 함
//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']) {
if ($member['mb_id']) {
alert('글을 수정할 권한이 없습니다.');
} else {
alert('글을 수정할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
alert('글을 수정할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
}
}
$len = strlen($write['wr_reply']);
if ($len < 0) $len = 0;
if ($len < 0)
$len = 0;
$reply = substr($write['wr_reply'], 0, $len);
// 원글만 구한다.
@ -86,7 +87,7 @@ if ($w == '') {
and wr_is_comment = 1 ";
$row = sql_fetch($sql);
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 = '글수정';
} else if ($w == 'r') {
@ -94,15 +95,15 @@ if ($w == '') {
if ($member['mb_id'])
alert('글을 답변할 권한이 없습니다.');
else
alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
}
$tmp_point = isset($member['mb_point']) ? $member['mb_point'] : 0;
if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin)
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글답변('.number_format($board['bo_comment_point']).')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글답변 해 주십시오.');
alert('보유하신 포인트(' . number_format($member['mb_point']) . ')가 없거나 모자라서 글답변(' . number_format($board['bo_comment_point']) . ')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글답변 해 주십시오.');
//if (preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board['bo_notice']))
if (in_array((int)$wr_id, $notice_array))
if (in_array((int) $wr_id, $notice_array))
alert('공지에는 답변 할 수 없습니다.');
//----------
@ -144,7 +145,8 @@ if ($w == '') {
$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']}%' ";
if ($reply_array['wr_reply'])
$sql .= " and wr_reply like '{$reply_array['wr_reply']}%' ";
$row = sql_fetch($sql);
if (!$row['reply'])
@ -158,13 +160,13 @@ if ($w == '') {
$title_msg = '글답변';
$write['wr_subject'] = 'Re: '.$write['wr_subject'];
$write['wr_subject'] = 'Re: ' . $write['wr_subject'];
}
// 그룹접근 가능
if (!empty($group['gr_use_access'])) {
if ($is_guest) {
alert("접근 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.", 'login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
alert("접근 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.", 'login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
}
if ($is_admin == 'super' || $group['gr_admin'] == $member['mb_id'] || $board['bo_admin'] == $member['mb_id']) {
@ -182,7 +184,7 @@ if (!empty($group['gr_use_access'])) {
if ($config['cf_cert_use'] && !$is_admin) {
// 인증된 회원만 가능
if ($board['bo_use_cert'] != '' && $is_guest) {
alert('이 게시판은 본인확인 하신 회원님만 글쓰기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', 'login.php?'.$qstr.'&amp;url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table));
alert('이 게시판은 본인확인 하신 회원님만 글쓰기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', 'login.php?' . $qstr . '&amp;url=' . urlencode($_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table));
}
if ($board['bo_use_cert'] == 'cert' && !$member['mb_certify']) {
@ -203,17 +205,14 @@ if ($config['cf_cert_use'] && !$is_admin) {
}
// 글자수 제한 설정값
if ($is_admin || $board['bo_use_dhtml_editor'])
{
if ($is_admin || $board['bo_use_dhtml_editor']) {
$write_min = $write_max = 0;
}
else
{
$write_min = (int)$board['bo_write_min'];
$write_max = (int)$board['bo_write_max'];
} else {
$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;
$notice_checked = '';
@ -225,7 +224,7 @@ if ($is_admin && $w != 'r') {
if ($write['wr_reply']) {
$is_notice = false;
} else {
if (in_array((int)$wr_id, $notice_array)) {
if (in_array((int) $wr_id, $notice_array)) {
$notice_checked = 'checked';
}
}
@ -282,7 +281,7 @@ if ($board['bo_use_file_content']) {
$is_file_content = true;
}
$file_count = (int)$board['bo_upload_count'];
$file_count = (int) $board['bo_upload_count'];
$name = "";
$email = "";
@ -290,7 +289,7 @@ $homepage = "";
if ($w == "" || $w == "r") {
if ($is_member) {
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']));
@ -314,13 +313,13 @@ if ($w == '') {
}
}
$name = get_text(cut_str(stripslashes($write['wr_name']),20));
$name = get_text(cut_str(stripslashes($write['wr_name']), 20));
$email = get_email_address($write['wr_email']);
$homepage = get_text(stripslashes($write['wr_homepage']));
for ($i=1; $i<=G5_LINK_COUNT; $i++) {
$write['wr_link'.$i] = get_text($write['wr_link'.$i]);
$link[$i] = $write['wr_link'.$i];
for ($i = 1; $i <= G5_LINK_COUNT; $i++) {
$write['wr_link' . $i] = get_text($write['wr_link' . $i]);
$link[$i] = $write['wr_link' . $i];
}
if (strstr($write['wr_option'], 'html1')) {
@ -336,7 +335,7 @@ if ($w == '') {
}
$file = get_file($bo_table, $wr_id);
if($file_count < $file['count'])
if ($file_count < $file['count'])
$file_count = $file['count'];
} else if ($w == 'r') {
if (strstr($write['wr_option'], 'secret')) {
@ -346,8 +345,8 @@ if ($w == '') {
$password_required = "required";
for ($i=1; $i<=G5_LINK_COUNT; $i++) {
$write['wr_link'.$i] = get_text($write['wr_link'.$i]);
for ($i = 1; $i <= G5_LINK_COUNT; $i++) {
$write['wr_link' . $i] = get_text($write['wr_link' . $i]);
}
}
@ -365,10 +364,10 @@ if ($w == '') {
} else if ($w == 'r') {
if (!strstr($write['wr_option'], 'html')) {
$content = "\n\n\n &gt; "
."\n &gt; "
."\n &gt; ".str_replace("\n", "\n> ", get_text($write['wr_content'], 0))
."\n &gt; "
."\n &gt; ";
. "\n &gt; "
. "\n &gt; " . str_replace("\n", "\n> ", get_text($write['wr_content'], 0))
. "\n &gt; "
. "\n &gt; ";
}
} else {
@ -387,15 +386,15 @@ else
$is_dhtml_editor = false;
$is_dhtml_editor_use = false;
$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;
// 모바일에서는 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']) {
$is_dhtml_editor = true;
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;
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_html = editor_html('wr_content', $content, $is_dhtml_editor);
$editor_js = '';
@ -405,9 +404,9 @@ $editor_js .= chk_editor_js('wr_content', $is_dhtml_editor);
// 임시 저장된 글 수
$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']).' -->';
include_once ($board_skin_path.'/write.skin.php');
echo '<!-- skin : ' . (G5_IS_MOBILE ? $board['bo_mobile_skin'] : $board['bo_skin']) . ' -->';
include_once($board_skin_path . '/write.skin.php');
?>

View file

@ -1,15 +1,17 @@
<?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('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
?>
<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">
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);"
method="post" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
<input type="hidden" name="w" value="<?php echo $w ?>" id="write_w" >
<input type="hidden" name="w" value="<?php echo $w ?>" id="write_w">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>" id="write_id">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
@ -20,13 +22,15 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<?php
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
$offset=$board['bo_3']? " ".$board['bo_3']." hours" : "";
$today=date('Ymd',strtotime(date('Y/m/d H:i:s').$offset));
if (empty($fr_date)) $fr_date = $today;
if($w=='' ){if ($_GET['fr_date']) {
include_once(G5_PLUGIN_PATH . '/jquery-ui/datepicker.php');
$offset = $board['bo_3'] ? " " . $board['bo_3'] . " hours" : "";
$today = date('Ymd', strtotime(date('Y/m/d H:i:s') . $offset));
if (empty($fr_date))
$fr_date = $today;
if ($w == '') {
if ($_GET['fr_date']) {
$write['wr_1'] = $_GET['fr_date'];
}else{
} else {
$write['wr_1'] = $today;
}
@ -40,13 +44,15 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php if ($is_name) { ?>
<p>
<label for="wr_name">이름<strong class="sound_only">필수</strong></label>
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" size="10" maxlength="20">
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required"
size="10" maxlength="20">
</p>
<?php } ?>
<?php if ($is_password) { ?>
<p>
<label for="wr_password">패스워드<strong class="sound_only">필수</strong></label>
<input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?> class="frm_input <?php echo $password_required ?>" maxlength="20">
<input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?>
class="frm_input <?php echo $password_required ?>" maxlength="20">
</p>
<?php } ?>
<?php if ($option) { ?>
@ -56,25 +62,32 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php } ?>
<?php if ($is_category) { ?>
<p>
<select name="ca_name" id="ca_name" required class="required" >
<select name="ca_name" id="ca_name" required class="required">
<option value="">선택하세요</option>
<?php echo $category_option ?>
</select>
</p>
<?php } ?>
<p>
<input type="hidden" name="wr_subject" value="<?php echo $write['wr_1']; ?>" id="wr_subject" required maxlength="255">
<input type="text" name="wr_1" value="<?php echo $write['wr_1']; ?>" id="wr_1" required class="date full frm_input required" size="21" maxlength="8" placeholder="날짜">
<input type="hidden" name="wr_subject" value="<?php echo $write['wr_1']; ?>" id="wr_subject" required
maxlength="255">
<input type="text" name="wr_1" value="<?php echo $write['wr_1']; ?>" id="wr_1" required
class="date full frm_input required" size="21" maxlength="8" placeholder="날짜">
</p>
</div>
<section class="options">
<input type="text" name="wr_4" id="wr_4" value="<?=$write['wr_4']?>" placeholder="<?=$board['bo_5'] ? $board['bo_5']: "날씨";?>"><input type="text" name="wr_3" id="wr_3" value="<?=$write['wr_3']?>" placeholder="<?=$board['bo_6'] ? $board['bo_6']: "무드";?>">
<input type="text" name="wr_4" id="wr_4" value="<?= $write['wr_4'] ?>"
placeholder="<?= $board['bo_5'] ? $board['bo_5'] : "날씨"; ?>"><input type="text" name="wr_3" id="wr_3"
value="<?= $write['wr_3'] ?>" placeholder="<?= $board['bo_6'] ? $board['bo_6'] : "무드"; ?>">
</section>
<textarea name="wr_content" id="wr_content" maxlength="255" required></textarea>
<input type="file" id="wr_file" name="bf_file[0]" title="파일첨부 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input full">
<input type="file" id="wr_file" name="bf_file[0]" title="파일첨부 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능"
class="frm_file frm_input full">
<div class="btn_confirm txt-right">
<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>
<?if($is_secret){?><label for="secret" id="wr_secret"><input type="checkbox" id="secret" value="secret" name="secret"> 비밀글 </label><?}?>
<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>
<?php if ($is_secret) { ?><label for="secret" id="wr_secret"><input type="checkbox" id="secret" value="secret"
name="secret"> 비밀글 </label><?php } ?>
<input type="submit" value="입력" id="btn_submit" accesskey="s" class="ui-btn point">
</div>
</section>
@ -84,12 +97,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<!-- 게시물 작성/수정 -->
<script>
$(function(){
$(function () {
$(".date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yymmdd", showButtonPanel: true, yearRange: "c-99:c+99" });
});
function html_auto_br(obj)
{
function html_auto_br(obj) {
if (obj.checked) {
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
if (result)
@ -101,14 +113,13 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
obj.value = "";
}
function fwrite_submit(f)
{
function fwrite_submit(f) {
var frdate="<?=$fr_date?>";
var frdate = "<?= $fr_date ?>";
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url+"/ajax.filter.php",
url: g5_bbs_url + "/ajax.filter.php",
type: "POST",
data: {
"subject": f.wr_subject.value,
@ -117,21 +128,21 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
success: function (data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (subject) {
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
alert("제목에 금지단어('" + subject + "')가 포함되어있습니다");
f.wr_subject.focus();
return false;
}
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
if (typeof(ed_wr_content) != "undefined")
alert("내용에 금지단어('" + content + "')가 포함되어있습니다");
if (typeof (ed_wr_content) != "undefined")
ed_wr_content.returnFalse();
else
f.wr_content.focus();
@ -141,11 +152,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
if (char_min > 0 || char_max > 0) {
var cnt = parseInt(check_byte("wr_content", "char_count"));
if (char_min > 0 && char_min > cnt) {
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
alert("내용은 " + char_min + "글자 이상 쓰셔야 합니다.");
return false;
}
else if (char_max > 0 && char_max < cnt) {
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
alert("내용은 " + char_max + "글자 이하로 쓰셔야 합니다.");
return false;
}
}
@ -154,4 +165,4 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
return true;
}
</script>
</script>

View file

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