This commit is contained in:
shim
2023-04-17 11:06:08 +09:00
parent d0b393aa97
commit 76264e09ad
4686 changed files with 552713 additions and 0 deletions

5
modules/bbs/README.md Normal file
View File

@@ -0,0 +1,5 @@
# 게시판 모듈
## Copyright and license
Copyright 2020 Redblock, Inc.
Licensed under the [RBL](https://kimsq.com/p/rbl) License

0
modules/bbs/_main.css Normal file
View File

51
modules/bbs/_main.js Normal file
View File

@@ -0,0 +1,51 @@
function fontFace(layer,fontbox)
{
var x = getId(fontbox);
if (x.style.display == 'block')
{
x.style.display = 'none';
}
else {
var s = '';
s+= '<ul>';
s+= '<li style="font-family:dotum;border-bottom:#dfdfdf solid 1px;background:#ECF0F6;" onclick="aplyFont(\''+layer+'\',\''+fontbox+'\',0);">기본글꼴</li>';
s+= '<li style="font-family:malgun gothic;" onclick="aplyFont(\''+layer+'\',\''+fontbox+'\',this);">맑은고딕</li>';
s+= '<li style="font-family:gulim;" onclick="aplyFont(\''+layer+'\',\''+fontbox+'\',this);">굴림</li>';
s+= '<li style="font-family:dotum;" onclick="aplyFont(\''+layer+'\',\''+fontbox+'\',this);">돋움</li>';
s+= '<li style="font-family:batang;" onclick="aplyFont(\''+layer+'\',\''+fontbox+'\',this);">바탕</li>';
s+= '</ul>';
x.innerHTML = s;
x.style.display = 'block';
}
}
function aplyFont(layer,fontbox,obj)
{
if (!obj)
{
getId(layer).style.fontFamily = 'gulim';
getId(layer).style.fontSize = '12px';
setCookie('myFontFamily',getId(layer).style.fontFamily,1);
setCookie('myFontSize',getId(layer).style.fontSize,1);
}
else {
getId(layer).style.fontFamily = obj.style.fontFamily;
setCookie('myFontFamily',obj.style.fontFamily,1);
}
getId(fontbox).style.display = 'none';
}
function fontResize(layer,type)
{
var l = getId(layer);
var nSize = l.style.fontSize ? l.style.fontSize : '12px';
var iSize = parseInt(nSize.replace('px',''));
if (type == '+')
{
if (iSize < 20) l.style.fontSize = (iSize + 1) + 'px';
}
else {
if (iSize > 6) l.style.fontSize = (iSize - 1) + 'px';
}
setCookie('myFontSize',l.style.fontSize,1);
}

View File

@@ -0,0 +1,165 @@
<?php
if(!defined('__KIMS__')) exit;
//게시판리스트
$_tmp = db_query( "select count(*) from ".$table[$module.'list'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'list']." (
uid INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
gid INT DEFAULT '0' NOT NULL,
site INT DEFAULT '0' NOT NULL,
id VARCHAR(30) DEFAULT '' NOT NULL,
name VARCHAR(200) DEFAULT '' NOT NULL,
category TEXT NOT NULL,
num_r INT DEFAULT '0' NOT NULL,
d_last VARCHAR(14) DEFAULT '' NOT NULL,
d_regis VARCHAR(14) DEFAULT '' NOT NULL,
imghead VARCHAR(100) DEFAULT '' NOT NULL,
imgfoot VARCHAR(100) DEFAULT '' NOT NULL,
puthead VARCHAR(20) DEFAULT '' NOT NULL,
putfoot VARCHAR(20) DEFAULT '' NOT NULL,
addinfo TEXT NOT NULL,
writecode TEXT NOT NULL,
KEY gid(gid),
KEY id(id)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'list'],$DB_CONNECT);
}
//게시판인덱스
$_tmp = db_query( "select count(*) from ".$table[$module.'idx'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'idx']." (
site INT DEFAULT '0' NOT NULL,
notice TINYINT DEFAULT '0' NOT NULL,
bbs INT DEFAULT '0' NOT NULL,
gid double(11,2) DEFAULT '0.00' NOT NULL,
KEY site(site),
KEY notice(notice),
KEY bbs(bbs,gid),
KEY gid(gid)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'idx'],$DB_CONNECT);
}
//게시판데이터
$_tmp = db_query( "select count(*) from ".$table[$module.'data'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'data']." (
uid INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
site INT DEFAULT '0' NOT NULL,
gid double(11,2) DEFAULT '0.00' NOT NULL,
bbs INT DEFAULT '0' NOT NULL,
bbsid VARCHAR(30) DEFAULT '' NOT NULL,
depth TINYINT DEFAULT '0' NOT NULL,
parentmbr INT DEFAULT '0' NOT NULL,
display TINYINT DEFAULT '0' NOT NULL,
hidden TINYINT DEFAULT '0' NOT NULL,
notice TINYINT DEFAULT '0' NOT NULL,
name VARCHAR(30) DEFAULT '' NOT NULL,
nic VARCHAR(50) DEFAULT '' NOT NULL,
mbruid INT DEFAULT '0' NOT NULL,
id VARCHAR(16) DEFAULT '' NOT NULL,
pw VARCHAR(50) DEFAULT '' NOT NULL,
category VARCHAR(100) DEFAULT '' NOT NULL,
subject VARCHAR(200) DEFAULT '' NOT NULL,
content MEDIUMTEXT NOT NULL,
html VARCHAR(4) DEFAULT '' NOT NULL,
tag VARCHAR(200) DEFAULT '' NOT NULL,
hit INT DEFAULT '0' NOT NULL,
down INT DEFAULT '0' NOT NULL,
comment INT DEFAULT '0' NOT NULL,
oneline INT DEFAULT '0' NOT NULL,
likes INT DEFAULT '0' NOT NULL,
dislikes INT DEFAULT '0' NOT NULL,
report INT DEFAULT '0' NOT NULL,
point1 INT DEFAULT '0' NOT NULL,
point2 INT DEFAULT '0' NOT NULL,
point3 INT DEFAULT '0' NOT NULL,
point4 INT DEFAULT '0' NOT NULL,
d_regis VARCHAR(14) DEFAULT '' NOT NULL,
d_modify VARCHAR(14) DEFAULT '' NOT NULL,
d_comment VARCHAR(14) DEFAULT '' NOT NULL,
d_select VARCHAR(14) DEFAULT '' NOT NULL,
upload TEXT NOT NULL,
ip VARCHAR(25) DEFAULT '' NOT NULL,
agent VARCHAR(150) DEFAULT '' NOT NULL,
sns VARCHAR(100) DEFAULT '' NOT NULL,
featured_img INT DEFAULT '0' NOT NULL,
location VARCHAR(200) DEFAULT '' NOT NULL,
pin VARCHAR(50) DEFAULT '' NOT NULL,
adddata TEXT NOT NULL,
KEY site(site),
KEY gid(gid),
KEY bbs(bbs),
KEY bbsid(bbsid),
KEY parentmbr(parentmbr),
KEY display(display),
KEY notice(notice),
KEY mbruid(mbruid),
KEY category(category),
KEY subject(subject),
KEY tag(tag),
KEY d_regis(d_regis)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'data'],$DB_CONNECT);
}
//게시판월별수량
$_tmp = db_query( "select count(*) from ".$table[$module.'month'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'month']." (
date CHAR(6) DEFAULT '' NOT NULL,
site INT DEFAULT '0' NOT NULL,
bbs INT DEFAULT '0' NOT NULL,
num INT DEFAULT '0' NOT NULL,
KEY date(date),
KEY site(site),
KEY bbs(bbs)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'month'],$DB_CONNECT);
}
//게시판일별수량
$_tmp = db_query( "select count(*) from ".$table[$module.'day'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'day']." (
date CHAR(8) DEFAULT '' NOT NULL,
site INT DEFAULT '0' NOT NULL,
bbs INT DEFAULT '0' NOT NULL,
num INT DEFAULT '0' NOT NULL,
KEY date(date),
KEY site(site),
KEY bbs(bbs)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'day'],$DB_CONNECT);
}
//확장데이터
$_tmp = db_query( "select count(*) from ".$table[$module.'xtra'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'xtra']." (
parent INT DEFAULT '0' NOT NULL,
site INT DEFAULT '0' NOT NULL,
bbs INT DEFAULT '0' NOT NULL,
down TEXT NOT NULL,
likes TEXT NOT NULL,
dislikes TEXT NOT NULL,
report TEXT NOT NULL,
KEY parent(parent),
KEY site(site),
KEY bbs(bbs)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'xtra'],$DB_CONNECT);
}
?>

View File

@@ -0,0 +1,8 @@
<?php
$table[$module.'list'] = $DB['head'].'_'.$module.'_list'; //게시판리스트
$table[$module.'idx'] = $DB['head'].'_'.$module.'_index'; //게시판인덱스
$table[$module.'data'] = $DB['head'].'_'.$module.'_data'; //게시판데이터
$table[$module.'month']= $DB['head'].'_'.$module.'_month'; //월별수량
$table[$module.'day'] = $DB['head'].'_'.$module.'_day'; //일별수량
$table[$module.'xtra'] = $DB['head'].'_'.$module.'_xtra'; //확장데이터
?>

View File

@@ -0,0 +1,45 @@
<?php
$g['url_host'] = 'http'.($_SERVER['HTTPS']=='on'?'s':'').'://'.$_SERVER['HTTP_HOST'];
$g['path_root']='../../../../';
$g['path_var']=$g['path_root'].'_var/';
$date['today'] = substr(date('YmdHisw'),0,8);
if ($_FILES['file']['name']) {
if (!$_FILES['file']['error']) {
$name = md5(rand(100, 200));
$ext = explode('.', $_FILES['file']['name']);
$filename = $name . '.' . $ext[1];
$upfolder = substr($date['today'],0,8); // 년월일을 업로드 폴더 구분기준으로 설정
$saveDir = '../upload/'; // bbs 게시판 안에 별도의 files 폴더를 둔다. 나중에 포럼모듈이 나오면 충돌을 피하기 위해
$savePath1 = $saveDir.substr($upfolder,0,4);// 년도 폴더 지정 (없으면 아래 for 문으로 만든다)
$savePath2 = $savePath1.'/'.substr($upfolder,4,2); // 월 폴더 지정 (없으면 아래 for 문으로 만든다)
$savePath3 = $savePath2.'/'.substr($upfolder,6,2); // 일 폴더 지정(없으면 아래 for 문으로 만든다)
// 위 폴더가 없으면 새로 만들기
for ($i = 1; $i < 4; $i++)
{
if (!is_dir(${'savePath'.$i}))
{
mkdir(${'savePath'.$i},0707);
@chmod(${'savePath'.$i},0707);
}
}
$sourcePath='./modules/bbs'.str_replace('..','',$savePath3); // 소스에 보여주는 패스트 -- 상대경로를 제거한다.
$destination = $savePath3.'/'.$filename; // 생성된 폴더/파일 --> 파일의 실제 위치
$location = $_FILES["file"]["tmp_name"]; // 서버에 올려진 임시파일
move_uploaded_file($location, $destination);
@chmod($destination,0707); // 권한 신규 부여
echo $sourcePath.'/'.$filename;// 최종적으로 에디터에 넘어가는 값
}
else
{
echo $message = 'Ooops! Your upload triggered the following error: '.$_FILES['file']['error'];
}
}// 파일이 넘어왔는지 체크
?>

View File

@@ -0,0 +1,15 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$R = getDbData($table[$m.'list'],"id='".$bid."'",'*');
if ($R['img'.$dtype])
{
getDbUpdate($table[$m.'list'],"img".$dtype."=''",'uid='.$R['uid']);
unlink($g['dir_module'].'var/files/'.$R['img'.$dtype]);
}
setrawcookie('result_bbs_main', rawurlencode('파일이 삭제 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,10 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$i=0;
foreach($bbsmembers as $val) getDbUpdate($table[$m.'list'],'gid='.($i++),'uid='.$val);
getLink('','','','');
?>

View File

@@ -0,0 +1,48 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
include_once $g['path_module'].'bbs/var/var.php';
include_once $g['path_var'].'bbs/var.'.$bid.'.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$result=array();
$result['error']=false;
$result['isperm'] = true;
//게시물 쓰기 권한체크
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].',')) {
if ($d['bbs']['perm_l_write'] > $my['level'] || strpos('_'.$d['bbs']['perm_g_write'],'['.$my['mygroup'].']')) {
$markup_file = 'permcheck'; //잠김페이지 전달 (테마 내부 _html/permcheck.html)
$result['isperm'] = false;
$skin=new skin($markup_file);
$result['main']=$skin->make();
}
if ($R['uid'] && $reply != 'Y') {
if ($my['uid'] != $R['mbruid']) {
if (!strpos('_'.$_SESSION['module_'.$m.'_pwcheck'],'['.$R['uid'].']')) {
$markup_file = 'pwcheck'; //인증페이지 전달 (테마 내부 _html/pwcheck.html)
$result['isperm'] = false;
$skin=new skin($markup_file);
$result['main']=$skin->make();
}
}
}
}
if ($result['isperm']==true) {
$_SESSION['wcode'] = $date['totime'];
$result['pcode']=$date['totime'];
}
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,25 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$badword = trim($badword);
$badword = str_replace("\r\n","",$badword);
$badword = str_replace("\n","",$badword);
$fdset = array('skin_main','skin_mobile','skin_total','editor_main','editor_mobile','attach_main','attach_mobile','comment_main','comment_mobile','rss','restr','denylikemy','replydel','commentdel','badword','badword_action','badword_escape','singo_del','singo_del_num','singo_del_act','recnum','sbjcut','newtime');
$gfile= $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$fp = fopen($gfile,'w');
fwrite($fp, "<?php\n");
foreach ($fdset as $val)
{
fwrite($fp, "\$d['bbs']['".$val."'] = \"".trim(${$val})."\";\n");
}
fwrite($fp, "?>");
fclose($fp);
@chmod($gfile,0707);
setrawcookie('bbs_config_result', rawurlencode('<i class="fa fa-check" aria-hidden="true"></i> 설정이 변경 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,210 @@
<?php
if(!defined('__KIMS__')) exit;
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) getLink('','','삭제되었거나 존재하지 않는 게시물입니다.','');
$B = getUidData($table[$m.'list'],$R['bbs']);
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
include_once $g['dir_module'].'var/var.php';
include_once $g['path_var'].'bbs/var.'.$B['id'].'.php';
$g['mediasetVarForSite'] = $g['path_var'].'site/'.$r.'/mediaset.var.php';
include_once file_exists($g['mediasetVarForSite']) ? $g['mediasetVarForSite'] : $g['path_module'].'mediaset/var/var.php';
include_once $g['path_core'].'opensrc/aws-sdk-php/v3/aws-autoloader.php';
use Aws\S3\S3Client;
define('S3_KEY', $d['mediaset']['S3_KEY']); //발급받은 키.
define('S3_SEC', $d['mediaset']['S3_SEC'] ); //발급받은 비밀번호.
define('S3_REGION', $d['mediaset']['S3_REGION']); //S3 버킷의 리전.
define('S3_BUCKET', $d['mediaset']['S3_BUCKET']); //버킷의 이름.
$s3 = new S3Client([
'version' => 'latest',
'region' => S3_REGION,
'credentials' => [
'key' => S3_KEY,
'secret' => S3_SEC,
],
]);
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').($c?'c='.$c:'m='.$m),array('bid','skin','iframe','cat','p','sort','orderby','recnum','type','where','keyword'));
if ($my['uid'] != $R['mbruid'] && !$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
{
if (!strstr($_SESSION['module_'.$m.'_pwcheck'],$R['uid']))
{
if ($pw)
{
if (md5($pw) != $R['pw']) getLink('reload','parent.','비밀번호가 일치하지 않습니다.','');
}
else {
getLink($backUrl.'&mod=delete&uid='.$R['uid'],'parent.','','');
}
}
}
if ($d['bbs']['commentdel'])
{
if($R['comment'])
{
getLink('','','댓글이 있는 게시물은 삭제할 수 없습니다.','');
}
}
if ($d['bbs']['replydel'])
{
$_ngid = (int)$R['gid'];
if(getDbRows($table[$m.'data'],'gid > '.$_ngid.' and gid < '.($_ngid+1)) && !$R['depth'])
{
getLink('','','답변글이 있는 게시물은 삭제할 수 없습니다.','');
}
}
//댓글삭제
if ($R['comment'])
{
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
while($_C=db_fetch_array($CCD))
{
if ($_C['upload'])
{
$UPFILES = getArrayString($_C['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['fserver']==2) {
$host_array = explode('//', $U['host']);
$_host_array = explode('.', $host_array[1]);
$S3_BUCKET = $_host_array[0];
$s3->deleteObject([
'Bucket' => $S3_BUCKET,
'Key' => $U['folder'].'/'.$U['tmpname']
]);
} else {
unlink($U['folder'].'/'.$U['tmpname']);
}
}
}
}
if ($_C['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
}
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
if ($_C['point']&&$_C['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
}
}
}
//첨부파일삭제
if ($R['upload'])
{
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['fserver']==2) {
$host_array = explode('//', $U['host']);
$_host_array = explode('.', $host_array[1]);
$S3_BUCKET = $_host_array[0];
$s3->deleteObject([
'Bucket' => $S3_BUCKET,
'Key' => $U['folder'].'/'.$U['tmpname']
]);
} else {
unlink($U['folder'].'/'.$U['tmpname']);
}
}
}
}
//태그삭제
if ($R['tag'])
{
$_tagarr1 = explode(',',$R['tag']);
foreach($_tagarr1 as $_t)
{
if(!$_t) continue;
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and keyword='".$_t."'",'*');
if($_TAG['uid'])
{
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
}
}
}
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbDelete($table[$m.'idx'],'gid='.$R['gid']);
getDbDelete($table[$m.'data'],'uid='.$R['uid']);
getDbDelete($table[$m.'xtra'],'parent='.$R['uid']);
getDbUpdate($table[$m.'list'],'num_r=num_r-1','uid='.$R['bbs']);
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$R['bbs'])."'",'uid='.$cuid);
getDbDelete($table['s_trackback'],"parent='".$R['bbsid'].$R['uid']."'");
if ($R['point1']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point1']."','게시물삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point1'],'memberuid='.$R['mbruid']);
}
if ($send=="ajax") {
$bbsque = 'site='.$s.' and notice=0';
$bbsque .= ' and bbs='.$B['uid'];
$NUM = getDbRows($table[$m.'data'],$bbsque);
$result=array();
$result['error']=false;
$result['num']=$NUM;
echo json_encode($result);
exit;
} else {
if ($g['mobile'] && $_SESSION['pcmode']!='Y') {
$msg_type = 'default';
} else {
$msg_type = 'success';
}
setrawcookie('bbs_action_result', rawurlencode('게시물이 삭제 되었습니다.|'.$msg_type)); // 처리여부 cookie 저장
getLink($backUrl ,'parent.' , $alert , $history);
}
?>

View File

@@ -0,0 +1,176 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$R = getUidData($table[$m.'list'],$uid);
if (!$R['uid']) getLink('','','존재하지 않는 게시판입니다.','');
include_once $g['path_module'].'mediaset/var/var.php';
include_once $g['path_var'].'bbs/var.'.$R['id'].'.php';
$g['mediasetVarForSite'] = $g['path_var'].'site/'.$r.'/mediaset.var.php';
include_once file_exists($g['mediasetVarForSite']) ? $g['mediasetVarForSite'] : $g['path_module'].'mediaset/var/var.php';
include_once $g['path_core'].'opensrc/aws-sdk-php/v3/aws-autoloader.php';
use Aws\S3\S3Client;
define('S3_KEY', $d['mediaset']['S3_KEY']); //발급받은 키.
define('S3_SEC', $d['mediaset']['S3_SEC'] ); //발급받은 비밀번호.
define('S3_REGION', $d['mediaset']['S3_REGION']); //S3 버킷의 리전.
define('S3_BUCKET', $d['mediaset']['S3_BUCKET']); //버킷의 이름.
$s3 = new S3Client([
'version' => 'latest',
'region' => S3_REGION,
'credentials' => [
'key' => S3_KEY,
'secret' => S3_SEC,
],
]);
$RCD = getDbArray($table[$m.'data'],'bbs='.$R['uid'],'*','gid','asc',0,0);
while($_R=db_fetch_array($RCD))
{
//댓글삭제
if ($_R['comment'])
{
$CCD = getDbArray($table['s_comment'],"parent='".$m.$_R['uid']."'",'*','uid','asc',0,0);
while($_C=db_fetch_array($CCD))
{
if ($_C['upload'])
{
$UPFILES = getArrayString($_C['upload']);
foreach($UPFILES as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['fserver']==2) {
$s3->deleteObject([
'Bucket' => S3_BUCKET,
'Key' => $U['folder'].'/'.$U['tmpname']
]);
} else {
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
}
}
}
}
if ($_C['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
}
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
if ($_C['point']&&$_C['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
}
}
}
//첨부파일삭제
if ($_R['upload'])
{
$UPFILES = getArrayString($_R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['fserver']==2) {
$s3->deleteObject([
'Bucket' => S3_BUCKET,
'Key' => $U['folder'].'/'.$U['tmpname']
]);
} else {
unlink($U['folder'].'/'.$U['tmpname']);
}
}
}
}
//태그삭제
if ($_R['tag'])
{
$_tagdate = substr($_R['d_regis'],0,8);
$_tagarr1 = explode(',',$_R['tag']);
foreach($_tagarr1 as $_t)
{
if(!$_t) continue;
$_TAG = getDbData($table['s_tag'],"site=".$_R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
if($_TAG['uid'])
{
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
}
}
}
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($_R['d_regis'],0,6)."' and site=".$_R['site'].' and bbs='.$_R['bbs']);
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($_R['d_regis'],0,8)."' and site=".$_R['site'].' and bbs='.$_R['bbs']);
getDbDelete($table['s_trackback'],"parent='".$_R['bbsid'].$_R['uid']."'");
if ($_R['point1']&&$_R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_R['mbruid']."','0','-".$_R['point1']."','게시물삭제(".getStrCut($_R['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_R['point1'],'memberuid='.$_R['mbruid']);
}
}
getDbDelete($table[$m.'idx'],'bbs='.$R['uid']);
getDbDelete($table[$m.'data'],'bbs='.$R['uid']);
getDbDelete($table[$m.'list'],'uid='.$R['uid']);
getDbDelete($table[$m.'xtra'],'bbs='.$R['uid']);
getDbDelete($table['s_seo'],'rel=3 and parent='.$R['uid']);
unlink($g['path_var'].'bbs/var.'.$R['id'].'.php');
if ($R['imghead'] && is_file($g['dir_module'].'var/files/'.$R['imghead']))
{
unlink($g['dir_module'].'var/files/'.$R['imghead']);
}
if ($R['imgfoot'] && is_file($g['dir_module'].'var/files/'.$R['imgfoot']))
{
unlink($g['dir_module'].'var/files/'.$R['imgfoot']);
}
$mfile = $g['dir_module'].'var/code/'.$R['id'];
if (is_file($mfile.'.header.php'))
{
unlink($mfile.'.header.php');
}
if (is_file($mfile.'.footer.php'))
{
unlink($mfile.'.footer.php');
}
setrawcookie('result_bbs_main', rawurlencode($R['name'].' 게시판이 삭제되었습니다.|success')); // 처리여부 cookie 저장
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=main','parent.','','');
?>

View File

@@ -0,0 +1,98 @@
<?php
if(!defined('__KIMS__')) exit;
include_once $g['dir_module'].'var/var.php';
$R=getUidData($table['s_upload'],$uid);
if (!$R['uid']) getLink('','','정상적인 요청이 아닙니다.','');
$filename = getUTFtoKR($R['name']);
$filetmpname = getUTFtoKR($R['tmpname']);
if ($R['url']==$d['upload']['ftp_urlpath'])
{
$filepath = $d['upload']['ftp_urlpath'].$R['folder'].'/'.$filetmpname;
$filesize = $R['size'];
}
else {
$filepath = '.'.$R['url'].$R['folder'].'/'.$filetmpname;
$filesize = filesize($filepath);
}
if (!strstr($_SERVER['HTTP_REFERER'],'module=upload'))
{
//동기화
$cyncArr = getArrayString($R['cync']);
$fdexp = explode(',',$cyncArr['data'][2]);
if($fdexp[0]&&$fdexp[1]&&$cyncArr['data'][3])
{
if ($cyncArr['data'][0] == 'bbs' && $cyncArr['data'][1])
{
$AT = getUidData($table[$cyncArr['data'][0].'data'],$cyncArr['data'][1]);
include_once $g['path_var'].$cyncArr['data'][0].'/var.'.$AT['bbsid'].'.php';
$B['var'] = $d['bbs'];
if (!$my['admin'] && $my['uid'] != $AT['mbruid'])
{
if ($B['var']['perm_l_down'] > $my['level'] || strstr($B['var']['perm_g_down'],'['.$my['mygroup'].']'))
{
getLink('','','다운로드 권한이 없습니다.','-1');
}
}
if ($B['var']['point3'])
{
if (!$my['uid']) getLink('','','다운로드 권한이 없습니다.','-1');
$UT = getDbData($table[$cyncArr['data'][0].'xtra'],'parent='.$AT['uid'],'*');
if (!strpos('_'.$UT['down'],'['.$my['uid'].']') && !strpos('_'.$_SESSION['module_'.$cyncArr['data'][0].'_dncheck'],'['.$AT['uid'].']'))
{
if ($confirm == 'Y' && $my['point'] >= $B['var']['point3'])
{
if (!$my['admin'] && $my['uid'] != $AT['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','-".$B['var']['point3']."','다운로드(".getStrCut($AT['subject'],15,'').")','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$B['var']['point3'].',usepoint=usepoint+'.$B['var']['point3'],'memberuid='.$my['uid']);
if (!$UT['parent'])
{
getDbInsert($table[$cyncArr['data'][0].'xtra'],'parent,site,bbs,down',"'".$AT['uid']."','".$s."','".$AT['bbs']."','[".$my['uid']."]'");
}
else {
getDbUpdate($table[$cyncArr['data'][0].'xtra'],"down='".$UT['down']."[".$my['uid']."]'",'parent='.$AT['uid']);
}
}
$_SESSION['module_'.$cyncArr['data'][0].'_dncheck'] = $_SESSION['module_'.$cyncArr['data'][0].'_dncheck'].'['.$AT['uid'].']';
getLink('','','결제되었습니다. 다운로드 받으세요.','close');
}
else {
getWindow($g['s'].'/?iframe=Y&r='.$r.'&m='.$cyncArr['data'][0].'&bid='.$AT['bbsid'].'&mod=down&dfile='.$uid.'&uid='.$AT['uid'],'','width=550px,height=350px,status=yes,toolbar=no,scrollbars=no',$_SERVER['HTTP_REFERER'].'#attach','');
exit;
}
}
}
}
$cyncQue = $fdexp[1].'='.$fdexp[1].'+1';
getDbUpdate($cyncArr['data'][3],$cyncQue,$fdexp[0].'='.$cyncArr['data'][1]);
}
getDbUpdate($table['s_upload'],'down=down+1','uid='.$R['uid']);
getDbUpdate($table['s_numinfo'],'download=download+1',"date='".$date['today']."' and site=".$s);
}
header("Content-Type: application/octet-stream");
header("Content-Length: " .$filesize);
header('Content-Disposition: attachment; filename="'.$filename.'"');
header("Cache-Control: private, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");
if ($R['url']==$d['upload']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
$filepath = $g['path_tmp'].'session/'.$filetmpname;
ftp_get($FTP_CONNECT,$filepath,$d['upload']['ftp_folder'].$R['folder'].'/'.$filetmpname,FTP_BINARY);
ftp_close($FTP_CONNECT);
$fp = fopen($filepath, 'rb');
if (!fpassthru($fp)) fclose($fp);
unlink($filepath);
}
else {
$fp = fopen($filepath, 'rb');
if (!fpassthru($fp)) fclose($fp);
}
exit;
?>

View File

@@ -0,0 +1,9 @@
<?php
if(!defined('__KIMS__')) exit;
if(!strpos('_score1,score2',$f)) exit;
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) exit;
getDbUpdate($table[$m.'data'],$f.'='.$f.'+1','uid='.$R['uid']);
exit;
?>

View File

@@ -0,0 +1,94 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
include_once $g['dir_module'].'var/var.php';
$result=array();
$result['error']=false;
$B = getDbData($table[$m.'list'],"id='".$bid."' and site=".$s,'*');
if (!$B['uid']) {
$result['error']='존재하지 않는 게시판 입니다.';
echo json_encode($result);
exit;
}
$sort='uid';
$orderby='desc';
$recnum=0;
$p=0;
include_once $g['path_var'].'bbs/var.'.$bid.'.php';
include_once $g['dir_module'].'mod/_list.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$mbruid = $my['uid'];
$html='';
foreach ($NCD as $R) {
$TMPL['title']=$B['name'];
$TMPL['subject']=htmlspecialchars($R['subject']);
$TMPL['uid']=$R['uid'];
$TMPL['name']=$R['name'];
$TMPL['d_regis']=getDateFormat($R['d_regis'],'Y-m-d');
if ($collapse) $TMPL['article'] = getContents($R['content'],$R['html']);
$skin_item=new skin('list-item-notice');
$html.=$skin_item->make();
}
foreach ($RCD as $R) {
$TMPL['title']=$B['name'];
$TMPL['subject']=htmlspecialchars($R['subject']);
$TMPL['uid']=$R['uid'];
$TMPL['name']=$R['name'];
$TMPL['d_regis']=getDateFormat($R['d_regis'],'Y-m-d');
if ($collapse) $TMPL['article'] = getContents($R['content'],$R['html']);
$skin_item=new skin('list-item');
$html.=$skin_item->make();
}
$TMPL['items']=$html;
if($my['admin'] || $my['uid']==$R['mbruid']) { // 수정,삭제 버튼 출력여부를 위한 참조
$result['bbsadmin'] = 1;
}
if ($NUM) $markup_file = 'list'; // 기본 마크업 페이지 전달 (테마 내부 _html/view.html)
else $markup_file = 'none';
if ($B['category']) {
$_catexp = explode(',',$B['category']);
$_catnum=count($_catexp);
$category='<option value="" data-bid="'.$bid.'" data-collapse="'.$collapse.'">'.$_catexp[0].'</option>';
for ($i = 1; $i < $_catnum; $i++) {
if(!$_catexp[$i])continue;
$category.= '<option value="'.$_catexp[$i].'"';
$category.= 'data-bid="'.$bid.'"';
$category.= ' data-collapse="'.$collapse.'"';
$category.= 'data-markup="'.$markup_file.'"';
if ($_catexp[$i]==$cat) $category.= ' selected';
$category.= '>';
$category.= $_catexp[$i];
$category.= '</option>';
}
$result['category']=$category;
}
// 최종 결과값 추출 (sys.class.php)
$skin=new skin($markup_file);
$result['list']=$skin->make();
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,52 @@
<?php
if(!defined('__KIMS__')) exit;
$result=array();
$result['error']=false;
$bid = $_POST['bid'];
if (!$bid ) exit;
//게시판 공통설정 변수
$g['bbsVarForSite'] = $g['path_var'].'site/'.$r.'/bbs.var.php';
include_once file_exists($g['bbsVarForSite']) ? $g['bbsVarForSite'] : $g['path_module'].'bbs/var/var.php';
include_once $g['path_core'].'function/sys.class.php';
include_once $g['path_var'].'bbs/var.'.$bid.'.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
}
$B = getDbData($table['bbslist'],'id="'.$bid.'"','*');
$_catexp = explode(',',$B['category']);
$_catnum=count($_catexp);
$markup_file = ($mod=='write')?'category-list-radio':'category-list-item';
$TMPL['label']=$_catexp[0];
$TMPL['bname']=$B['name'];
$html = '';
for ($i = 1; $i < $_catnum; $i++) {
if(!$_catexp[$i])continue;
$TMPL['category']=$_catexp[$i];
$TMPL['num']=getDbRows($table[$m.'data'],'site='.$s.' and notice=0 and bbs='.$B['uid']." and category='".$_catexp[$i]."'");
$skin_item=new skin($markup_file);
$html.=$skin_item->make();
}
$TMPL['items'] = $html;
$skin=new skin('category-list');
$result['list']=$skin->make();
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,28 @@
<?php
if(!defined('__KIMS__')) exit;
// 넘어온 값 : type & data
//data 배열화 : data=theme+'^^'+parent+'^^'+sort+'^^'+recnum+'^^'+page+'^^'+'+orderby+'^^'+last_cuid;
$data_arr=explode('^^',$data);
$theme=$data_arr[0];
$parent=$data_arr[1];
$c_sort=$data_arr[2];
$c_recnum=$data_arr[3];
$c_page=$data_arr[4];
$c_orderby=$data_arr[5];
$last_sort=$data_arr[6];
$_where=$c_sort."<>0";
if($type=='more')
{
if($c_orderby=='asc') $_where .=" and ".$c_sort.">".$last_sort;
else $_where .=" and ".$c_sort."<".$last_sort;
}
include $theme.'comment/function.php';
?>
[RESULT:
<?php getCommentList($theme,$m.$parent,$_where,$c_recnum,$c_sort,$orderby1,$c_orderby,$c_page);?>
:RESULT]
<?php
exit;
?>

View File

@@ -0,0 +1,66 @@
<?php
if(!defined('__KIMS__')) exit;
$result=array();
$result['error']=false;
$bid = $_POST['bid'];
$mod = $_POST['mod'];
$B = getDbData($table['bbslist'],'id="'.$bid.'"','*');
if (!$B['uid']) {
$result['error']='존재하지 않는 게시판 입니다.';
echo json_encode($result);
exit;
}
//게시판 공통설정 변수
$g['bbsVarForSite'] = $g['path_var'].'site/'.$r.'/bbs.var.php';
include_once file_exists($g['bbsVarForSite']) ? $g['bbsVarForSite'] : $g['path_module'].'bbs/var/var.php';
include_once $g['path_var'].'bbs/var.'.$bid.'.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
include_once $g['path_core'].'function/sys.class.php';
$bbsque = 'site='.$s.' and notice=0';
$bbsque .= ' and bbs='.$B['uid'];
$recnum = $d['bbs']['recnum'];
$NUM = getDbRows($table[$m.'data'],$bbsque);
$TPG = getTotalPage($NUM,$recnum);
//게시물 쓰기 권한체크
$check_permWrite = true;
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].',')) {
if ($d['bbs']['perm_l_write'] > $my['level'] || strpos('_'.$d['bbs']['perm_g_write'],'['.$my['mygroup'].']')) {
$check_permWrite = false;
}
}
$TMPL['show_bbs_category'] = $B['category']?'':'d-none';
$TMPL['show_bbs_search'] = $d['theme']['search']==1?'':'d-none';
$TMPL['show_bbs_write'] = $check_permWrite?'':'d-none';
$TMPL['bbs_name'] = $B['name'];
$TMPL['bbs_id'] = $bid;
$TMPL['bbs_write'] = '/b/'.$bid.'/write';
$skin=new skin('bar-tab'); //게시판 테마폴더 > _html > bar-tab.html
$result['bar_tab']=$skin->make();
$result['theme'] = $theme;
$result['sort'] = 'gid';
$result['orderby'] = 'asc';
$result['recnum'] = $recnum;
$result['NUM'] = $NUM;
$result['TPG'] = $TPG;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,91 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
$bbs = $_GET['bbs']; // 게시퍈 UID
$sort = $_GET['sort']; // 정렬 기준
$orderby = $_GET['orderby']; // 정렬순서
$recnum = $_GET['recnum']; // 출력갯수
$page = $_GET['page']; // 처음엔 무조건 1
$bbs_view = $_GET['bbs_view'];
$where = 'site='.$s.' and bbs='.$bbs.' and notice=0'; // 출력 조건
$B = getUidData($table[$m.'list'],$bbs);
include_once $g['path_module'].'bbs/var/var.php';
include_once $g['path_var'].'bbs/var.'.$B['id'].'.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$result=array();
$result['error'] = false;
$RCD = getDbArray($table['bbsdata'],$where,'*',$sort,$orderby,$recnum,$page);
$html='';
$markup_file = 'moreList'; // 기본 마크업 페이지 전달 (테마 내부 _html/moreList.html)
$skin=new skin($markup_file);
while($R = db_fetch_array($RCD)){
$TMPL['category'] = $R['category'];
$TMPL['subject'] = $R['subject'];
$TMPL['bname'] = $B['name'];
$TMPL['bid'] = $B['id'];
$TMPL['uid'] = $R['uid'];
$TMPL['name'] = $R[$_HS['nametype']];
$TMPL['comment'] = $R['comment'];
$TMPL['oneline'] = $R['oneline']?'+'.$R['oneline']:'';
$TMPL['category'] = $R['category'];
$TMPL['hit'] = $R['hit'];
$TMPL['likes'] = $R['likes'];
$TMPL['d_regis'] = getDateFormat($R['d_regis'],'Y.m.d');
$TMPL['bbs_view_url'] = $bbs_view.$R['uid'];
$TMPL['datetime'] = getDateFormat($R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'84');
$TMPL['featured_img'] = getPreviewResize(getUpImageSrc($R),'120x120');
$TMPL['check_secret'] = $R['hidden']?' secret':'';
$TMPL['check_hidden'] = $R['hidden']?'':' d-none';
$TMPL['check_new'] = getNew($R['d_regis'],24)?'':' d-none';
$TMPL['check_notice'] = $R['notice']?'':' d-none';
$TMPL['check_upload'] = $R['upload']?'':' d-none';
$TMPL['check_category'] = $R['category']?'':' d-none';
$TMPL['check_timeago'] = $d['theme']['timeago']?'data-plugin="timeago"':'';
$TMPL['check_depth'] = $R['depth']?' rb-reply rb-reply-0'.$R['depth']:'';
// 미디어 오브젝트 (아바타=1/대표이미지=2/감춤=0)
if ($d['theme']['media_object']=='1' && !$R['depth']) {
$TMPL['check_avatar'] = '';
$TMPL['check_preview'] = 'd-none';
$TMPL['check_replay'] = 'd-none';
} elseif ($d['theme']['media_object']=='2' && !$R['depth']) {
$TMPL['check_avatar'] = 'd-none';
$TMPL['check_replay'] = 'd-none';
if (getUpImageSrc($R)) $TMPL['check_preview'] = '';
else $TMPL['check_preview'] = 'd-none';
} else {
$TMPL['check_avatar'] = 'd-none';
$TMPL['check_preview'] = 'd-none';
$TMPL['check_replay'] = '';
}
$html.=$skin->make();
}
$result['content'] = $html;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,11 @@
<?php
if(!defined('__KIMS__')) exit;
include $theme.'comment/function.php';
?>
[RESULT:
<?php echo getOnelineList($theme,$parent)?>
:RESULT]
<?php
exit;
?>

View File

@@ -0,0 +1,50 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
include_once $g['dir_module'].'var/var.php';
$result=array();
$result['error']=false;
$R = getUidData($table['bbsdata'],$uid);
include_once $g['path_module'].'bbs/var/var.php';
include_once $g['path_var'].'bbs/var.'.$R['bbsid'].'.php';
$result['uid'] = $R['uid'];
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
$device = 'mobile';
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
$device = 'desktop';
}
$sort = 'uid';
$orderby = 'desc';
$recnum = 20;
$where = 'module="'.$m.'" and opinion="'.$opinion.'" and entry='.$uid; // 출력 조건
$RCD = getDbArray($table['s_opinion'],$where,'*',$sort,$orderby,$recnum,1);
$NUM = getDbRows($table['s_opinion'],$where);
$html='';
foreach ($RCD as $R) {
$M = getUidData($table['s_mbrid'],$R['mbruid']);
$M1 = getDbData($table['s_mbrdata'],'memberuid='.$R['mbruid'],'nic');
$TMPL['nic']=$M1['nic'];
$TMPL['id']=$M['id'];
$TMPL['mbruid']=$R['mbruid'];
$TMPL['avatar']=getAvatarSrc($R['mbruid'],'150');
$TMPL['d_regis']=getDateFormat($R['d_regis'],'Y-m-d H:i');
$skin_item=new skin('opinion-item');
$html.=$skin_item->make();
}
$result['num']=$NUM;
$result['list']=$html;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,187 @@
<?php
if(!defined('__KIMS__')) exit;
$result=array();
$result['error']=false;
$uid = $_POST['uid'];
$mod = $_POST['mod'];
$R = getUidData($table['bbsdata'],$uid);
$B = getUidData($table['bbslist'],$R['bbs']);
//게시판 공통설정 변수
$g['bbsVarForSite'] = $g['path_var'].'site/'.$r.'/bbs.var.php';
include_once file_exists($g['bbsVarForSite']) ? $g['bbsVarForSite'] : $g['path_module'].'bbs/var/var.php';
if ($bid) include_once $g['path_var'].'bbs/var.'.$bid.'.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme_attachFile= $d['bbs']['a_mskin']?$d['bbs']['a_mskin']:$d['bbs']['attach_mobile'];
} else {
$theme_attachFile= $d['bbs']['a_skin']?$d['bbs']['a_skin']:$d['bbs']['attach_main'];
}
include_once $g['dir_module'].'lib/action.func.php';
$mbruid = $my['uid'];
$result['uid'] = $R['uid'];
if ($mod=='view') {
require_once $g['path_core'].'function/sys.class.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
$device = 'mobile';
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
$device = 'desktop';
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$check_like_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."' and opinion='like'";
$check_dislike_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."' and opinion='dislike'";
$check_saved_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."'";
$is_post_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_post_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
$is_post_saved = getDbRows($table['s_saved'],$check_saved_qry);
$TMPL['s']=$rooturl;
$TMPL['r']=$raccount;
$TMPL['m']=$m;
$TMPL['bid']=$B['id'];
$TMPL['uid']=$uid;
$TMPL['subject'] = $R['subject'];
$TMPL['category'] = $R['category'];
$TMPL['article'] = getContents($R['content'],$R['html']);
$TMPL['date'] = getDateFormat($R['d_regis'],$d['theme']['date_viewf']);
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'150');
$TMPL['name'] = $R[$_HS['nametype']];
$result['content'] = getContents($R['content'],$R['html']);
$TMPL['featured_img'] = getPreviewResize(getUpImageSrc($R),'480x270');
$result['featured_img_sm'] = getPreviewResize(getUpImageSrc($R),'240x180');
$result['featured_img'] = getPreviewResize(getUpImageSrc($R),'480x270');
$result['featured_img_lg'] = getPreviewResize(getUpImageSrc($R),'686x386');
$result['featured_img_sq_200'] = getPreviewResize(getUpImageSrc($R),'200x200');
$result['featured_img_sq_300'] = getPreviewResize(getUpImageSrc($R),'300x300');
$result['featured_img_sq_600'] = getPreviewResize(getUpImageSrc($R),'600x600');
$TMPL['hit'] = $R['hit'];
$TMPL['likes'] = $R['likes'];
$TMPL['dislikes'] = $R['dislikes'];
$TMPL['tag'] = getPostTag($R['tag'],$bid);
if ($is_post_liked) $result['is_post_liked'] = 1;
if ($is_post_disliked) $result['is_post_disliked'] = 1;
if ($is_post_saved) $result['is_post_saved'] = 1;
if ($R['tag']) $result['is_post_tag'] = 1;
if($R['upload']) {
if ($AttachListType == 'object') {
$result['photo'] = getAttachObjectArray($R,'photo');
} else {
$result['attachNum'] = _getAttachNum($R['upload'],'view');
//$result['linkNum'] = getLinkNum($R['upload'],'view');
}
$result['theme_attachFile'] = $theme_attachFile;
}
if($my['admin'] || $my['uid']==$R['mbruid']) { // 수정,삭제 버튼 출력여부를 위한 참조
$result['mypost'] = 1;
}
//개별 게시판 설정
$result['bbs_c_hidden'] = $d['bbs']['c_hidden'];
// 테마설정
$result['theme'] = $theme;
$result['theme_use_reply'] = $d['theme']['use_reply'];
$result['theme_show_tag'] = $d['theme']['show_tag'];
$result['theme_show_upfile'] = $d['theme']['show_upfile'] ;
$result['theme_show_saved'] = $d['theme']['show_saved'];
$result['theme_show_like'] = $d['theme']['show_like'];
$result['theme_show_dislike'] = $d['theme']['show_dislike'];
$result['theme_show_share'] = $d['theme']['show_share'];
$markup_file = $markup_file?$markup_file:'view'; // 기본 마크업 페이지 전달 (테마 내부 _html/view.html)
if ($R['hidden']) { // 비밀글의 경우
if ($my['uid'] != $R['mbruid'] && $my['uid'] != $R['pw'] && !$my['admin']) {
$markup_file = 'lock'; //잠김페이지 전달 (테마 내부 _html/lock.html)
$result['hidden'] = 1;
}
}
//게시물 보기 권한체크
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].',')) {
if ($d['bbs']['perm_l_view'] > $my['level'] || strpos('_'.$d['bbs']['perm_g_view'],'['.$my['mygroup'].']')) {
$markup_file = 'permcheck'; //잠김페이지 전달 (테마 내부 _html/permcheck.html)
$result['hidden'] = 1;
}
}
//첨부파일 권한체크
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].',')) {
if ($d['bbs']['perm_l_down'] > $my['level'] || (strpos($d['bbs']['perm_g_down'],'['.$my['mygroup'].']')!== false)) {
$result['hidden_attach'] = 1;
}
}
$d['bbs']['isperm'] = true;
if ($d['bbs']['isperm'] && ($d['bbs']['hitcount'] || !strpos('_'.$_SESSION['module_'.$m.'_view'],'['.$uid.']')))
{
if ($R['point2'])
{
// $g['main'] = $g['dir_module'].'mod/_pointcheck.php';
$markup_file = 'pointcheck';
$d['bbs']['isperm'] = false;
}
else {
getDbUpdate($table[$m.'data'],'hit=hit+1','uid='.$uid);
$_SESSION['module_'.$m.'_view'] .= '['.$uid.']';
}
}
// 최종 결과값 추출 (sys.class.php)
$skin=new skin($markup_file);
$result['article']=$skin->make();
} else {
//글쓰기 수정모드 일때
$result['subject'] = $R['subject'];
$result['content'] = getContents($R['content'],$R['html']);
$result['hidden'] = $R['hidden'];
$result['notice'] = $R['notice'];
$result['category'] = $R['category'];
$result['tag'] = $R['tag'];
$result['adddata'] = $R['adddata'];
$result['theme'] = $theme;
if($R['upload']) {
$result['attachNum'] = _getAttachNum($R['upload'],'modify');
$result['theme_attachFile'] = $theme_attachFile;
}
}
if ($R['oneline']) {
$TMPL['comment'] = $R['comment'].'+'.$R['oneline'];
$result['total_comment'] = $R['comment'].'+'.$R['oneline']; // 댓글,한줄의견 등록시 현재댓글수를 내려주기 위함
} else {
$TMPL['comment'] = $R['comment'];
$result['total_comment'] = $R['comment']; // 댓글,한줄의견 등록시 현재댓글수를 내려주기 위함
}
$result['bname']=$B['name'];
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,156 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
include_once $g['dir_module'].'var/var.php';
$result=array();
$result['error']=false;
$B = getDbData($table[$m.'list'],"id='".$bid."' and site=".$s,'*');
if (!$B['uid']) {
$result['error']='존재하지 않는 게시판 입니다.';
echo json_encode($result);
exit;
}
include_once $g['path_var'].'bbs/var.'.$bid.'.php';
include_once $g['dir_module'].'mod/_list.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$mbruid = $my['uid'];
$html='';
$TMPL['r']=$r;
$TMPL['bname']=$B['name'];
$TMPL['bid']=$B['id'];
$TMPL['cat']=$cat;
$TMPL['keyword']=$keyword;
$TMPL['num']=$NUM;
$result['num_notice']=$NUM_NOTICE;
$result['num']=$NUM;
$result['page']=$p;
if ($NUM_NOTICE) {
foreach ($NCD as $R) {
$TMPL['subject']=$R['subject'];
$TMPL['uid']=$R['uid'];
$TMPL['mbruid']=$R['mbruid'];
$TMPL['name']=$R[$_HS['nametype']];
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['d_regis']=getDateFormat($R['d_regis'],'Y-m-d');
$TMPL['d_regis_c']=getDateFormat($R['d_regis'],'c');
$TMPL['new']=getNew($R['d_regis'],24)?'':'d-none';
$TMPL['hidden']=$R['hidden']?'':'d-none';
$TMPL['notice']=$R['notice']?'':'d-none';
$TMPL['upload']=$R['upload']?'':'d-none';
$TMPL['category']=$R['category'];
$TMPL['timeago']=$d['theme']['timeago']?'data-plugin="timeago"':'';
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'84');
$TMPL['featured_img'] = getPreviewResize(getUpImageSrc($R),'480x270');
$TMPL['has_featured_img'] = getUpImageSrc($R)=='/files/noimage.png'?'d-none':'';
$TMPL['url'] = '/'.$r.'/b/'.$bid.'/'.$R['uid'];
if ($collapse) $TMPL['article'] = getContents($R['content'],$R['html']);
$skin_item=new skin('list-item-notice');
$html.=$skin_item->make();
$TMPL['items']=$html;
}
$skin=new skin('list');
$result['list_notice']=$skin->make();
} else {
$result['list_notice']='';
}
$html='';
if ($NUM) {
foreach ($RCD as $R) {
$TMPL['subject']=$R['subject'];
$TMPL['uid']=$R['uid'];
$TMPL['mbruid']=$R['mbruid'];
$TMPL['name']= getStrCut($R[$_HS['nametype']],10,'..');
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['d_regis']=getDateFormat($R['d_regis'],'Y.m.d H:i');
$TMPL['d_regis_c']=getDateFormat($R['d_regis'],'c');
$TMPL['new']=getNew($R['d_regis'],24)?'':'d-none';
$TMPL['hidden']=$R['hidden']?'':'d-none';
$TMPL['notice']=$R['notice']?'':'d-none';
$TMPL['upload']=$R['upload']?'':'d-none';
$TMPL['category']=$R['category'];
$TMPL['timeago']=$d['theme']['timeago']?'data-plugin="timeago"':'';
$TMPL['avatar']=getAvatarSrc($R['mbruid'],'150');
$TMPL['featured_img_sm'] = getPreviewResize(getUpImageSrc($R),'240x180');
$TMPL['featured_img'] = getPreviewResize(getUpImageSrc($R),'480x270'); //16:9
$TMPL['featured_img_lg'] = getPreviewResize(getUpImageSrc($R),'686x386');
$TMPL['featured_img_1by1_200'] = getPreviewResize(getUpImageSrc($R),'200x200');
$TMPL['featured_img_1by1_300'] = getPreviewResize(getUpImageSrc($R),'300x300');
$TMPL['featured_img_1by1_600'] = getPreviewResize(getUpImageSrc($R),'600x600');
$TMPL['has_featured_img'] = getUpImageSrc($R)=='/files/noimage.png'?'d-none':'';
$TMPL['url'] = '/'.$r.'/b/'.$bid.'/'.$R['uid'];
//업로드 파일갯수
$d['upload'] = getArrayString($R['upload']);
$TMPL['upload_count'] = $d['upload']['count'];
if ($collapse) $TMPL['article'] = getContents($R['content'],$R['html']);
$skin_item=new skin($markup_item);
$html.=$skin_item->make();
}
$TMPL['items']=$html;
if ($p==1) {
$TMPL['page']=$p;
$skin=new skin($markup_list);
$result['list_post']=$skin->make();
} else {
$result['list_post']=$html;
}
} else {
$skin_item=new skin('none');
$result['list_post']=$skin_item->make();
}
if($my['admin'] || $my['uid']==$R['mbruid']) { // 수정,삭제 버튼 출력여부를 위한 참조
$result['bbsadmin'] = 1;
}
if ($B['category']) {
$_catexp = explode(',',$B['category']);
$_catnum=count($_catexp);
$category='<option value="" data-bid="'.$bid.'" data-collapse="'.$collapse.'">'.$_catexp[0].'</option>';
for ($i = 1; $i < $_catnum; $i++) {
if(!$_catexp[$i])continue;
$category.= '<option value="'.$_catexp[$i].'"';
$category.= 'data-bid="'.$bid.'"';
$category.= ' data-collapse="'.$collapse.'"';
$category.= 'data-markup="'.$markup_file.'"';
if ($_catexp[$i]==$cat) $category.= ' selected';
$category.= '>';
$category.= $_catexp[$i];
$category.= '</option>';
}
$result['category']=$category;
}
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,45 @@
<?php
if(!defined('__KIMS__')) exit;
include_once $g['path_core'].'function/sys.class.php';
require_once $g['dir_module'].'lib/base.class.php';
require_once $g['dir_module'].'lib/module.class.php';
$result=array();
$result['error']=false;
$bid = $_POST['bid'];
$B = getDbData($table['bbslist'],'id="'.$bid.'"','*');
//게시판 공통설정 변수
$g['bbsVarForSite'] = $g['path_var'].'site/'.$r.'/bbs.var.php';
include_once file_exists($g['bbsVarForSite']) ? $g['bbsVarForSite'] : $g['path_module'].'bbs/var/var.php';
include_once $g['path_var'].'bbs/var.'.$bid.'.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$bbs = new Bbs();
$bbs->theme_name = $theme;
$TMPL['bid']=$bid;
$html = '';
$html .= $bbs->getHtml('write-meta-tag');
if ($B['category']) $html .= $bbs->getHtml('write-meta-category');
if ($d['theme']['use_hidden']==1) $html .= $bbs->getHtml('write-meta-hidden');
if ($my['admin']) $html .= $bbs->getHtml('write-meta-notice');
$result['has_category']=$B['category']?true:false;
$result['list']=$html;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,183 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$id = $id ? trim($id) : $bid;
$name = trim($name);
$codhead = trim($codhead);
$codfoot = trim($codfoot);
$category = trim($category);
$addinfo = trim($addinfo);
$writecode = trim($writecode);
$puthead = $inc_head_list.$inc_head_view.$inc_head_write;
$putfoot = $inc_foot_list.$inc_foot_view.$inc_foot_write;
if ($send_mod=='ajax') {
$_HS = getDbData($table['s_site'],"id='".$r."'",'uid');
$site = $_HS['uid'];
$result=array();
$result['error']=false;
}
if (!$name) getLink('','','게시판이름을 입력해 주세요.','');
if (!$id) getLink('','','아이디를 입력해 주세요.','');
if ($bid)
{
$R = getDbData($table[$m.'list'],"id='".$bid."'",'*');
$imghead = $R['imghead'];
$imgfoot = $R['imgfoot'];
$imgset = array('head','foot');
for ($i = 0; $i < 2; $i++)
{
$tmpname = $_FILES['img'.$imgset[$i]]['tmp_name'];
$realname = $_FILES['img'.$imgset[$i]]['name'];
$fileExt = strtolower(getExt($realname));
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
$userimg = $R['id'].'_'.$imgset[$i].'.'.$fileExt;
$saveFile = $g['dir_module'].'var/files/'.$userimg;
if (is_uploaded_file($tmpname))
{
if (!strstr('[gif][jpg][png]',$fileExt))
{
getLink('','','헤더/풋터파일은 gif/jpg/png 파일만 등록할 수 있습니다.','');
}
move_uploaded_file($tmpname,$saveFile);
@chmod($saveFile,0707);
${'img'.$imgset[$i]} = $userimg;
}
}
$QVAL = "site='$site',name='$name',category='$category',imghead='$imghead',imgfoot='$imgfoot',puthead='$puthead',putfoot='$putfoot',addinfo='$addinfo',writecode='$writecode'";
getDbUpdate($table[$m.'list'],$QVAL,"id='".$bid."'");
$vfile = $g['dir_module'].'var/code/'.$R['id'];
if (trim($codhead))
{
$fp = fopen($vfile.'.header.php','w');
fwrite($fp, trim(stripslashes($codhead)));
fclose($fp);
@chmod($vfile.'.header.php',0707);
}
else {
if(is_file($vfile.'.header.php'))
{
unlink($vfile.'.header.php');
}
}
if (trim($codfoot))
{
$fp = fopen($vfile.'.footer.php','w');
fwrite($fp, trim(stripslashes($codfoot)));
fclose($fp);
@chmod($vfile.'.footer.php',0707);
}
else {
if(is_file($vfile.'.footer.php'))
{
unlink($vfile.'.footer.php');
}
}
$backUrl = $g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=makebbs&iframe=Y&uid='.$R['uid'];
}
else {
if (getDbRows($table[$m.'list'],"id='".$id."'")) {
if ($send_mod=='ajax') {
$result['error']='id_exists';
echo json_encode($result);
exit;
} else {
getLink('','','이미 같은 아이디의 게시판이 존재합니다.','');
}
}
$imgset = array('head','foot');
for ($i = 0; $i < 2; $i++)
{
$tmpname = $_FILES['img'.$imgset[$i]]['tmp_name'];
$realname = $_FILES['img'.$imgset[$i]]['name'];
$fileExt = strtolower(getExt($realname));
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
$userimg = $id.'_'.$imgset[$i].'.'.$fileExt;
$saveFile = $g['dir_module'].'var/files/'.$userimg;
if (is_uploaded_file($tmpname))
{
if (!strstr('[gif][jpg][png][swf]',$fileExt))
{
getLink('','','헤더/풋터파일은 gif/jpg/png/swf 파일만 등록할 수 있습니다.','');
}
move_uploaded_file($tmpname,$saveFile);
@chmod($saveFile,0707);
${'img'.$imgset[$i]} = $userimg;
}
}
$Ugid = getDbCnt($table[$m.'list'],'max(gid)','') + 1;
$QKEY = "gid,site,id,name,category,num_r,d_last,d_regis,imghead,imgfoot,puthead,putfoot,addinfo,writecode";
$QVAL = "'$Ugid','".$site."','$id','$name','$category','0','','".$date['totime']."','$imghead','$imgfoot','$puthead','$putfoot','$addinfo','$writecode'";
getDbInsert($table[$m.'list'],$QKEY,$QVAL);
$lastbbs = getDbCnt($table[$m.'list'],'max(uid)','');
$mfile = $g['dir_module'].'var/code/'.$id;
if (trim($codhead))
{
$fp = fopen($mfile.'.header.php','w');
fwrite($fp, trim(stripslashes($codhead)));
fclose($fp);
@chmod($mfile.'.header.php',0707);
}
if (trim($codfoot))
{
$fp = fopen($mfile.'.footer.php','w');
fwrite($fp, trim(stripslashes($codfoot)));
fclose($fp);
@chmod($mfile.'.footer.php',0707);
}
$backUrl = $g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=makebbs&iframe=Y&uid='.getDbCnt($table[$m.'list'],'max(uid)','');
}
$fdset = array('layout','m_layout','skin','m_skin','editor','m_editor','a_skin','a_mskin','c_skin','c_mskin','c_hidden',
'perm_g_list','perm_g_view','perm_g_write','perm_g_down','perm_l_list','perm_l_view','perm_l_write','perm_l_down',
'admin','hitcount','recnum','sbjcut','newtime','rss','sosokmenu','point1','point2','point3','display','hidelist','snsconnect',
'noti_notice','noti_newpost','noti_opinion','noti_mention','noti_report');
if (!is_dir($g['path_var'].'bbs')) mkdir($g['path_var'].'bbs');
$gfile= $g['path_var'].'bbs/var.'.$id.'.php';
$fp = fopen($gfile,'w');
fwrite($fp, "<?php\n");
foreach ($fdset as $val)
{
fwrite($fp, "\$d['bbs']['".$val."'] = \"".trim(${$val})."\";\n");
}
fwrite($fp, "?>");
fclose($fp);
@chmod($gfile,0707);
if ($bid) {
setrawcookie('result_bbs_main', rawurlencode($name.' 게시판 등록정보가 변경 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
} else {
if ($send_mod=='ajax') {
echo json_encode($result);
exit;
} else {
setrawcookie('result_bbs_main', rawurlencode($name.' 게시판이 생성 되었습니다.|success')); // 처리여부 cookie 저장
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=main_detail&uid='.$lastbbs,'parent.','','');
}
}
?>

View File

@@ -0,0 +1,13 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
foreach ($bbs_members as $val)
{
$R = getUidData($table[$m.'list'],$val);
if (!$R['uid']) continue;
getDbUpdate($table[$m.'list'],"name='".trim(${'name_'.$R['uid']})."'",'uid='.$R['uid']);
}
getLink('reload','parent.','수정되었습니다.','');
?>

View File

@@ -0,0 +1,269 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$g['mediasetVarForSite'] = $g['path_var'].'site/'.$r.'/mediaset.var.php';
include_once file_exists($g['mediasetVarForSite']) ? $g['mediasetVarForSite'] : $g['path_module'].'mediaset/var/var.php';
include $g['path_core'].'function/rss.func.php';
include_once $g['path_core'].'opensrc/aws-sdk-php/v3/aws-autoloader.php';
use Aws\S3\S3Client;
define('S3_KEY', $d['mediaset']['S3_KEY']); //발급받은 키.
define('S3_SEC', $d['mediaset']['S3_SEC'] ); //발급받은 비밀번호.
define('S3_REGION', $d['mediaset']['S3_REGION']); //S3 버킷의 리전.
define('S3_BUCKET', $d['mediaset']['S3_BUCKET']); //버킷의 이름.
$s3 = new S3Client([
'version' => 'latest',
'region' => S3_REGION,
'credentials' => [
'key' => S3_KEY,
'secret' => S3_SEC,
],
]);
$str_month = '';
$str_today = '';
$B = getUidData($table[$m.'list'],$bid);
$fserver = $d['mediaset']['use_fileserver'];
sort($post_members);
reset($post_members);
foreach ($post_members as $val)
{
$R = getUidData($table[$m.'data'],$val);
if (!$R['uid']) continue;
$mingid = getDbCnt($table[$m.'data'],'min(gid)','');
$gid = $mingid ? $mingid-1 : 100000000.00;
if (!$inc_comment)
{
$R['comment'] = 0;
$R['oneline'] = 0;
}
if (!$inc_upload)
{
$R['upload'] = '';
}
$month = substr($R['d_regis'],0,6);
$today = substr($R['d_regis'],0,8);
//게시물복사
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
$QKEY.= "hit,down,comment,oneline,likes,dislikes,report,point1,point2,point3,point4,d_regis,d_modify,d_comment,upload,ip,agent,sns,location,pin,adddata";
$QVAL = "'".$R['site']."','$gid','".$B['uid']."','".$B['id']."','".$R['depth']."','".$R['parentmbr']."','".$R['display']."','".$R['hidden']."','".$R['notice']."',";
$QVAL.= "'".addslashes($R['name'])."','".addslashes($R['nic'])."','".$R['mbruid']."','".$R['id']."','".$R['pw']."','".addslashes($R['category'])."','".addslashes($R['subject'])."',";
$QVAL.= "'".addslashes($R['content'])."','".$R['html']."','".addslashes($R['tag'])."',";
$QVAL.= "'".$R['hit']."','".$R['down']."','".$R['comment']."','".$R['oneline']."','".$R['likes']."','".$R['dislikes']."','".$R['report']."','0','".$R['point2']."','".$R['point3']."','".$R['point4']."',";
$QVAL.= "'".$R['d_regis']."','".$R['d_modify']."','".$R['d_comment']."','".$R['upload']."','".$R['ip']."','".$R['agent']."','".$R['sns']."','".$R['location']."','".$R['pin']."','".addslashes($R['adddata'])."'";
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'".$R['site']."','".$R['notice']."','".$B['uid']."','$gid'");
getDbUpdate($table[$m.'list'],"num_r=num_r+1",'uid='.$B['uid']);
if(!strstr($str_month,'['.$month.']') && !getDbRows($table[$m.'month'],"date='".$month."' and site=".$R['site'].' and bbs='.$B['uid']))
{
getDbInsert($table[$m.'month'],'date,site,bbs,num',"'".$month."','".$R['site']."','".$B['uid']."','1'");
$str_month .= '['.$month.']';
}
else {
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$month."' and site=".$R['site'].' and bbs='.$B['uid']);
}
if(!strstr($str_today,'['.$today.']') && !getDbRows($table[$m.'day'],"date='".$today."' and site=".$site.' and bbs='.$bbsuid))
{
getDbInsert($table[$m.'day'],'date,site,bbs,num',"'".$today."','".$R['site']."','".$B['uid']."','1'");
$str_today .= '['.$today.']';
}
else {
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$today."' and site=".$R['site'].' and bbs='.$B['uid']);
}
$NOWUID = getDbCnt($table[$m.'data'],'max(uid)','');
//댓글복사
if ($inc_comment && $R['comment'])
{
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','desc',0,0);
while($_C=db_fetch_array($CCD))
{
$comment_minuid = getDbCnt($table['s_comment'],'min(uid)','');
$comment_uid = $comment_minuid ? $comment_minuid-1 : 100000000;
$comment_sync = '['.$m.']['.$NOWUID.'][uid,comment,oneline,d_comment]['.$table[$m.'data'].']['.$_C['parentmbr'].'][m:'.$m.',bid:'.$B['id'].',uid:'.$NOWUID.']';
$QKEY = "uid,site,parent,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,subject,content,html,";
$QKEY.= "hit,down,oneline,likes,dislikes,report,d_regis,d_modify,d_oneline,upload,ip,agent,sync,sns,adddata";
$QVAL = "'$comment_uid','".$_C['site']."','".$m.$NOWUID."','".$_C['parentmbr']."','".$_C['display']."','".$_C['hidden']."','".$_C['notice']."','".addslashes($_C['name'])."','".addslashes($_C['nic'])."',";
$QVAL.= "'".$_C['mbruid']."','".$_C['id']."','".$_C['pw']."','".addslashes($_C['subject'])."','".addslashes($_C['content'])."','".$_C['html']."',";
$QVAL.= "'".$_C['hit']."','".$_C['down']."','".$_C['oneline']."','".$_C['likes']."','".$_C['dislikes']."','".$_C['report']."','".$_C['d_regis']."','".$_C['d_modify']."','".$_C['d_oneline']."',";
$QVAL.= "'".$_C['upload']."','".$_C['ip']."','".$_C['agent']."','$comment_sync','".$_C['sns']."','".addslashes($_C['adddata'])."'";
getDbInsert($table['s_comment'],$QKEY,$QVAL);
getDbUpdate($table['s_numinfo'],'comment=comment+1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
if ($_C['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
$oneline_maxuid = getDbCnt($table['s_oneline'],'max(uid)','');
$oneline_uid = $oneline_maxuid ? $oneline_maxuid+1 : 1;
$QKEY = "uid,site,parent,parentmbr,hidden,name,nic,mbruid,id,content,html,likes,dislikes,report,d_regis,d_modify,ip,agent,adddata";
$QVAL = "'$oneline_uid','".$_O['site']."','$comment_uid','".$_O['parentmbr']."','".$_O['hidden']."','".addslashes($_O['name'])."','".addslashes($_O['nic'])."','".$_O['mbruid']."',";
$QVAL.= "'".$_O['id']."','".addslashes($_O['content'])."','".$_O['html']."','".$_O['likes']."','".$_O['dislikes']."','".$_O['report']."','".$_O['d_regis']."','".$_O['d_modify']."','".$_O['ip']."','".$_O['agent']."',";
$QVAL.= "'".addslashes($_O['adddata'])."'";
getDbInsert($table['s_oneline'],$QKEY,$QVAL);
getDbUpdate($table['s_numinfo'],'oneline=oneline+1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
}
}
if ($inc_upload && $_C['upload'])
{
$UPFILES = getArrayString($_C['upload']);
$tmpupload = '';
$_content = $_C['content'];
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
$_tmpname = md5($U['tmpname']).'.'.getExt($U['tmpname']);
if ($fserver==2)
{
$_downfile = getUrlData($U['src'],10);
$saveFile = $g['path_tmp'].'session/'.$U['tmpname'];
$fp = fopen($saveFile,'w');
fwrite($fp,$_downfile);
fclose($fp);
@chmod($saveFile,0707);
$upload_host= 'https://'.S3_BUCKET.'.s3.'.S3_REGION.'.amazonaws.com';
$upload_src = $upload_host.'/'.$U['folder'].'/'.$_tmpname;
try {
$s3->putObject(Array(
'ACL'=>'public-read',
'SourceFile'=>$saveFile,
'Bucket'=>S3_BUCKET,
'Key'=>$U['folder'].'/'.$_tmpname,
));
@unlink($saveFile);
} catch (Aws\S3\Exception\S3Exception $e) {
$result['error'] = 'AwS S3에 파일을 업로드하는 중 오류가 발생했습니다.';
}
}
else {
copy('./'.$U['folder'].'/'.$U['tmpname'],'./'.$U['folder'].'/'.$_tmpname);
$upload_src = '/'.$U['folder'].'/'.$_tmpname;
}
$upload_mingid = getDbCnt($table['s_upload'],'min(gid)','');
$upload_gid = $upload_mingid ? $upload_mingid - 1 : 100000000;
$QKEY = "gid,hidden,tmpcode,site,mbruid,type,ext,fserver,host,folder,name,tmpname,src,size,width,heigth,caption,down,d_regis,d_update,sync";
$QVAL = "'".$upload_gid."','".$U['hidden']."','','".$U['site']."','".$U['mbruid']."','".$U['type']."','".$U['ext']."','".$U['fserver']."','".$U['host']."','".$U['folder']."',";
$QVAL.= "'".addslashes($U['name'])."','".$_tmpname."','".$upload_src."','".$U['size']."','".$U['width']."','".$U['height']."','".addslashes($U['caption'])."',";
$QVAL.= "'".$U['down']."','".$U['d_regis']."','".$U['d_update']."',''";
getDbInsert($table['s_upload'],$QKEY,$QVAL);
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
$tmpupload .= '['.getDbCnt($table['s_upload'],'max(uid)','').']';
$_content = str_replace($U['tmpname'],$_tmpname,$_content);
}
}
getDbUpdate($table['s_comment'],"content='".addslashes($_content)."',upload='".$tmpupload."'",'uid='.$comment_uid);
}
}
}
//첨부파일복사
if ($inc_upload && $R['upload'])
{
$UPFILES = getArrayString($R['upload']);
$tmpupload = '';
$_content1 = $R['content'];
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
$_tmpname = md5($U['tmpname']).'.'.getExt($U['tmpname']);
if ($fserver==2)
{
$_downfile = getUrlData($U['src'],10);
$saveFile = $g['path_tmp'].'session/'.$U['tmpname'];
$fp = fopen($saveFile,'w');
fwrite($fp,$_downfile);
fclose($fp);
@chmod($saveFile,0707);
$upload_host= 'https://'.S3_BUCKET.'.s3.'.S3_REGION.'.amazonaws.com';
$upload_src = $upload_host.'/'.$U['folder'].'/'.$_tmpname;
try {
$s3->putObject(Array(
'ACL'=>'public-read',
'SourceFile'=>$saveFile,
'Bucket'=>S3_BUCKET,
'Key'=>$U['folder'].'/'.$_tmpname,
));
@unlink($saveFile);
} catch (Aws\S3\Exception\S3Exception $e) {
$result['error'] = 'AwS S3에 파일을 업로드하는 중 오류가 발생했습니다.';
}
}
else {
copy('./'.$U['folder'].'/'.$U['tmpname'],'./'.$U['folder'].'/'.$_tmpname);
$upload_src = '/'.$U['folder'].'/'.$_tmpname;
}
$upload_mingid = getDbCnt($table['s_upload'],'min(gid)','');
$upload_gid = $upload_mingid ? $upload_mingid - 1 : 100000000;
$QKEY = "gid,hidden,tmpcode,site,mbruid,type,ext,fserver,host,folder,name,tmpname,size,width,height,caption,down,src,d_regis,d_update,sync";
$QVAL = "'$upload_gid','".$U['hidden']."','','".$U['site']."','".$U['mbruid']."','".$U['type']."','".$U['ext']."','".$U['fserver']."','".$U['host']."',";
$QVAL.= "'".$U['folder']."','".addslashes($U['name'])."','".$_tmpname."','".$U['size']."','".$U['width']."','".$U['height']."',";
$QVAL.= "'".addslashes($U['caption'])."','".$U['down']."','".$upload_src."','".$U['d_regis']."','".$U['d_update']."',''";
getDbInsert($table['s_upload'],$QKEY,$QVAL);
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
$tmpupload .= '['.getDbCnt($table['s_upload'],'max(uid)','').']';
$_content1 = str_replace($U['tmpname'],$_tmpname,$_content1);
}
}
getDbUpdate($table[$m.'data'],"content='".addslashes($_content1)."',upload='".$tmpupload."'",'uid='.$NOWUID);
}
$_SESSION['BbsPost'.$type] = str_replace('['.$R['uid'].']','',$_SESSION['BbsPost'.$type]);
}
$referer = $g['s'].'/?r='.$r.'&iframe=Y&m=admin&module='.$m.'&front=movecopy&type='.$type;
getLink($referer,'parent.','실행되었습니다.','');
?>

View File

@@ -0,0 +1,164 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$g['mediasetVarForSite'] = $g['path_var'].'site/'.$r.'/mediaset.var.php';
include_once file_exists($g['mediasetVarForSite']) ? $g['mediasetVarForSite'] : $g['path_module'].'mediaset/var/var.php';
include $g['path_core'].'function/rss.func.php';
include_once $g['path_core'].'opensrc/aws-sdk-php/v3/aws-autoloader.php';
use Aws\S3\S3Client;
define('S3_KEY', $d['mediaset']['S3_KEY']); //발급받은 키.
define('S3_SEC', $d['mediaset']['S3_SEC'] ); //발급받은 비밀번호.
define('S3_REGION', $d['mediaset']['S3_REGION']); //S3 버킷의 리전.
define('S3_BUCKET', $d['mediaset']['S3_BUCKET']); //버킷의 이름.
$s3 = new S3Client([
'version' => 'latest',
'region' => S3_REGION,
'credentials' => [
'key' => S3_KEY,
'secret' => S3_SEC,
],
]);
foreach ($post_members as $val)
{
$R = getUidData($table[$m.'data'],$val);
if (!$R['uid']) continue;
$B = getUidData($table[$m.'list'],$R['bbs']);
if (!$B['uid']) continue;
//댓글삭제
if ($R['comment'])
{
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
while($_C=db_fetch_array($CCD))
{
if ($_C['upload'])
{
$UPFILES = getArrayString($_C['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['fserver']==2)
{
$host_array = explode('//', $U['host']);
$_host_array = explode('.', $host_array[1]);
$S3_BUCKET = $_host_array[0];
$s3->deleteObject([
'Bucket' => $S3_BUCKET,
'Key' => $U['folder'].'/'.$U['tmpname']
]);
}
else {
unlink($U['folder'].'/'.$U['tmpname']);
}
}
}
}
if ($_C['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
}
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
if ($_C['point']&&$_C['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
}
}
}
//첨부파일삭제
if ($R['upload'])
{
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['fserver']==2)
{
$host_array = explode('//', $U['host']);
$_host_array = explode('.', $host_array[1]);
$S3_BUCKET = $_host_array[0];
$s3->deleteObject([
'Bucket' => $S3_BUCKET,
'Key' => $U['folder'].'/'.$U['tmpname']
]);
}
else {
unlink($U['folder'].'/'.$U['tmpname']);
}
}
}
}
//태그삭제
if ($R['tag'])
{
$_tagdate = substr($R['d_regis'],0,8);
$_tagarr1 = explode(',',$R['tag']);
foreach($_tagarr1 as $_t)
{
if(!$_t) continue;
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
if($_TAG['uid'])
{
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
}
}
}
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbDelete($table[$m.'idx'],'gid='.$R['gid']);
getDbDelete($table[$m.'data'],'uid='.$R['uid']);
getDbDelete($table[$m.'xtra'],'parent='.$R['uid']);
getDbUpdate($table[$m.'list'],'num_r=num_r-1','uid='.$R['bbs']);
getDbDelete($table['s_trackback'],"parent='".$R['bbsid'].$R['uid']."'");
if ($R['point1']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point1']."','게시물삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point1'],'memberuid='.$R['mbruid']);
}
}
setrawcookie('bbs_post_result', rawurlencode('게시물이 삭제 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,11 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$referer = $g['s'].'/?r='.$r.'&iframe=Y&m=admin&module='.$m.'&front=movecopy&type='.$type;
$_SESSION['BbsPost'.$type] = '';
getLink($referer,'parent.','','');
?>

View File

@@ -0,0 +1,22 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
include_once $g['path_module'].'mediaset/var/var.php';
foreach ($post_members as $val)
{
$R = getUidData($table[$m.'data'],$val);
if (!$R['uid']) continue;
getDbUpdate($table[$m.'data'],'display=0','uid='.$val);
}
getLink('reload','parent.','선택한 게시물이 모두 숨김처리 되었습니다. ','');
?>

View File

@@ -0,0 +1,100 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$str_month = '';
$str_today = '';
$B = getUidData($table[$m.'list'],$bid);
sort($post_members);
reset($post_members);
foreach ($post_members as $val)
{
$R = getUidData($table[$m.'data'],$val);
if (!$R['uid']) continue;
if ($R['bbs']==$B['uid']) continue;
$month = substr($R['d_regis'],0,6);
$today = substr($R['d_regis'],0,8);
//게시물이동
getDbUpdate($table[$m.'data'],'bbs='.$B['uid'].",bbsid='".$B['id']."'",'uid='.$R['uid']);
getDbUpdate($table[$m.'idx'],'bbs='.$B['uid'],'gid='.$R['gid']);
getDbUpdate($table[$m.'list'],"num_r=num_r-1",'uid='.$R['bbs']);
getDbUpdate($table[$m.'list'],"num_r=num_r+1",'uid='.$B['uid']);
getDbUpdate($table[$m.'month'],'num=num-1',"date='".$month."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbUpdate($table[$m.'day'],'num=num-1',"date='".$today."' and site=".$R['site'].' and bbs='.$R['bbs']);
if(!strstr($str_month,'['.$month.']') && !getDbRows($table[$m.'month'],"date='".$month."' and site=".$R['site'].' and bbs='.$B['uid']))
{
getDbInsert($table[$m.'month'],'date,site,bbs,num',"'".$month."','".$R['site']."','".$B['uid']."','1'");
$str_month .= '['.$month.']';
}
else {
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$month."' and site=".$R['site'].' and bbs='.$B['uid']);
}
if(!strstr($str_today,'['.$today.']') && !getDbRows($table[$m.'day'],"date='".$today."' and site=".$site.' and bbs='.$bbsuid))
{
getDbInsert($table[$m.'day'],'date,site,bbs,num',"'".$today."','".$R['site']."','".$B['uid']."','1'");
$str_today .= '['.$today.']';
}
else {
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$today."' and site=".$R['site'].' and bbs='.$B['uid']);
}
//댓글이동
if ($R['comment'])
{
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','desc',0,0);
while($_C=db_fetch_array($CCD))
{
$comment_sync = '['.$m.']['.$R['uid'].'][uid,comment,oneline,d_comment]['.$table[$m.'data'].']['.$_C['parentmbr'].'][m:'.$m.',bid:'.$B['id'].',uid:'.$R['uid'].']';
getDbUpdate($table['s_comment'],"sync='$comment_sync'",'uid='.$_C['uid']);
if ($_C['upload'])
{
$UPFILES = getArrayString($_C['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_upload'],"sync=''",'uid='.$U['uid']);
}
}
}
}
}
//첨부파일이동
if ($R['upload'])
{
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_upload'],"sync=''",'uid='.$U['uid']);
}
}
}
$_SESSION['BbsPost'.$type] = str_replace('['.$R['uid'].']','',$_SESSION['BbsPost'.$type]);
}
$referer = $g['s'].'/?r='.$r.'&iframe=Y&m=admin&module='.$m.'&front=movecopy&type='.$type;
getLink($referer,'parent.','실행되었습니다.','');
?>

View File

@@ -0,0 +1,149 @@
<?php
if(!defined('__KIMS__')) exit;
include_once $g['path_module'].'mediaset/var/var.php';
include_once $g['dir_module'].'var/var.php';
foreach ($post_members as $val)
{
$R = getUidData($table[$m.'data'],$val);
if (!$R['uid']) continue;
$B = getUidData($table[$m.'list'],$R['bbs']);
if (!$B['uid']) continue;
if ($my['uid'] != $R['mbruid'])
{
}
//댓글삭제
if ($R['comment'])
{
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
while($_C=db_fetch_array($CCD))
{
if ($_C['upload'])
{
$UPFILES = getArrayString($_C['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['host']==$d['upload']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
ftp_close($FTP_CONNECT);
}
else {
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
}
}
}
}
if ($_C['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
}
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
if ($_C['point']&&$_C['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
}
}
}
//첨부파일삭제
if ($R['upload'])
{
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['host']==$d['upload']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
ftp_close($FTP_CONNECT);
}
else {
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
}
}
}
}
//태그삭제
if ($R['tag'])
{
$_tagdate = substr($R['d_regis'],0,8);
$_tagarr1 = explode(',',$R['tag']);
foreach($_tagarr1 as $_t)
{
if(!$_t) continue;
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
if($_TAG['uid'])
{
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
}
}
}
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbDelete($table[$m.'idx'],'gid='.$R['gid']);
getDbDelete($table[$m.'data'],'uid='.$R['uid']);
getDbUpdate($table[$m.'list'],'num_r=num_r-1','uid='.$R['bbs']);
getDbDelete($table['s_trackback'],"parent='".$R['bbsid'].$R['uid']."'");
if ($R['point1']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point1']."','게시물삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point1'],'memberuid='.$R['mbruid']);
}
}
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,23 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$fdset = array('noti_title','noti_body','noti_button');
$vfile = $g['path_var'].$m.'/noti/'.$type.'.php';
if (!is_dir($g['path_var'].$m.'/noti')) mkdir($g['path_var'].$m.'/noti');
$fp = fopen($vfile,'w');
fwrite($fp, "<?php\n");
foreach ($fdset as $val)
{
fwrite($fp, "\$d['bbs']['".$val."'] = \"".trim(${$val})."\";\n");
}
fwrite($fp, "?>");
fclose($fp);
@chmod($vfile,0707);
setrawcookie('msgdoc_result', rawurlencode('수정 되었습니다.|success'));
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,210 @@
<?php
if(!defined('__KIMS__')) exit;
$R = getUidData($table[$m.'data'],$uid);
if (!$bid) getLink('','','게시판 아이디가 지정되지 않았습니다.','');
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
include_once $g['dir_module'].'var/var.php';
include_once $g['path_var'].'bbs/var.'.$B['id'].'.php';
if ($send=='ajax') {
$result=array();
if (!$my['uid']) {
$result['error']=true;
$result['msg'] = '로그인해 주세요.';
$result['msgType'] = 'danger';
echo json_encode($result);
exit;
}
if (!$R['uid']) {
$result['error']=true;
$result['msg'] = '잘못된 접근입니다.';
$result['msgType'] = 'danger';
echo json_encode($result);
exit;
}
if ($d['bbs']['denylikemy'] && ($R['mbruid']==$my['uid'])) {
$result['error']=true;
$result['msg'] = '자신 글은 평가할 수 없습니다.';
$result['msgType'] = 'danger';
echo json_encode($result);
exit;
}
} else {
if (!$my['uid']) {
echo '<script type="text/javascript">';
echo 'parent.$("#modal-login").modal();';
echo '</script>';
exit;
}
if (!$R['uid']) exit;
if ($d['bbs']['denylikemy'] && ($R['mbruid']==$my['uid'])) getLink('','','자신 글은 평가할 수 없습니다.','');
}
$mbruid = $my['uid'];
$check_like_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."' and opinion='like'";
$check_dislike_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."' and opinion='dislike'";
$is_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
// 로그인한 사용자가 좋아요를 했는지 여부 체크하여 처리
if ($opinion=='like') {
$opinion_type = '좋아요';
if($is_liked){ // 좋아요를 했던 경우
$opinion_act = '취소';
getDbDelete($table['s_opinion'],$check_like_qry);
getDbUpdate($table[$m.'data'],'likes=likes-1','uid='.$uid);
}else{ // 좋아요 안한 경우 추가
$opinion_act = '추가';
$QKEY = "mbruid,module,entry,opinion,d_regis";
$QVAL = "'$mbruid','$m','$uid','like','".$date['totime']."'";
getDbInsert($table['s_opinion'],$QKEY,$QVAL);
getDbUpdate($table[$m.'data'],'likes=likes+1','uid='.$uid);
if ($is_disliked) {
getDbDelete($table['s_opinion'],$check_dislike_qry);
getDbUpdate($table[$m.'data'],'dislikes=dislikes-1','uid='.$uid);
}
}
}
// 로그인한 사용자가 싫어요를 했는지 여부 체크하여 처리
if ($opinion=='dislike') {
$opinion_type = '싫어요';
if($is_disliked){ // 싫어요를 했던 경우
$opinion_act = '취소';
getDbDelete($table['s_opinion'],$check_dislike_qry);
getDbUpdate($table[$m.'data'],'dislikes=dislikes-1','uid='.$uid);
}else{ // 싫어요를 안한 경우 추가
$opinion_act = '추가';
$QKEY = "mbruid,module,entry,opinion,d_regis";
$QVAL = "'$mbruid','$m','$uid','dislike','".$date['totime']."'";
getDbInsert($table['s_opinion'],$QKEY,$QVAL);
getDbUpdate($table[$m.'data'],'dislikes=dislikes+1','uid='.$uid);
if ($is_liked) {
getDbDelete($table['s_opinion'],$check_like_qry);
getDbUpdate($table[$m.'data'],'likes=likes-1','uid='.$uid);
}
}
}
// 게시물 등록자에게 알림전송
if ($d['bbs']['noti_opinion']) {
$B = getDbData($table['bbslist'],'id="'.$R['bbsid'].'"','name');
$referer = $g['url_http'].'/'.$r.'/b/'.$bid.'/'.$uid;
include $g['dir_module'].'var/noti/_'.$a.'.php'; // 알림메시지 양식
$noti_title = $d['bbs']['noti_title'];
$noti_title = str_replace('{BBS}',$name,$noti_title);
$noti_title = str_replace('{OPINION_TYPE}',$opinion_type,$noti_title);
$noti_title = str_replace('{OPINION_ACT}',$opinion_act,$noti_title);
$noti_title = str_replace('{MEMBER}',$my[$_HS['nametype']],$noti_title);
$noti_body = $d['bbs']['noti_body'];
$noti_body = str_replace('{MEMBER}',$my[$_HS['nametype']],$noti_body);
$noti_body = str_replace('{SUBJECT}',$R['subject'],$noti_body);
$noti_referer = $g['url_http'].'/?r='.$r.'&mod=settings&page=noti';
$noti_button = '게시물 확인';
$noti_tag = '';
$noti_skipEmail = 0;
$noti_skipPush = 0;
putNotice($R['mbruid'],$m,$my['uid'],$noti_title,$noti_body,$noti_referer,$noti_button,$noti_tag,$noti_skipEmail,$noti_skipPush);
}
$R = getUidData($table[$m.'data'],$uid);
// getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','2','글추천 포인트 by ".$my['nic']."님 (".getStrCut($R['subject'],15,'').")','".$date['totime']."'");
// getDbUpdate($table['s_mbrdata'],'point=point+2','memberuid='.$R['mbruid']);
if ($send=='ajax') {
$result['error']=false;
if ($is_liked) $result['is_post_liked'] = 1;
else $result['is_post_liked'] = 0;
if ($is_disliked) $result['is_post_disliked'] = 1;
else $result['is_post_disliked'] = 0;
$result['likes'] = $R['likes'];
$result['dislikes'] = $R['dislikes'];
echo json_encode($result);
exit;
}
?>
<script>
<?php if ($opinion=='like'): ?>
<?php if ($is_liked): ?>
parent.$("[data-role=btn_post_like]").removeClass("active <?php echo $effect ?>");
<?php else: ?>
parent.$("[data-role=btn_post_like]").addClass("active <?php echo $effect ?>");
<?php endif; ?>
<?php if ($is_disliked): ?>
parent.$("[data-role=btn_post_dislike]").removeClass("active <?php echo $effect ?>");
<?php endif; ?>
<?php endif; ?>
<?php if ($opinion=='dislike'): ?>
<?php if ($is_disliked): ?>
parent.$("[data-role=btn_post_dislike]").removeClass("active <?php echo $effect ?>");
<?php else: ?>
parent.$("[data-role=btn_post_dislike]").addClass("active <?php echo $effect ?>");
<?php endif; ?>
<?php if ($is_liked ): ?>
parent.$("[data-role=btn_post_like]").removeClass("active");
<?php endif; ?>
<?php endif; ?>
parent.$("[data-role='likes_<?php echo $uid?>']").text('<?php echo $R['likes']?>');
parent.$("[data-role='dislikes_<?php echo $uid?>']").text('<?php echo $R['dislikes']?>');
window.parent.$.notify({
<?php if ($opinion=='like'): ?>
<?php if ($is_liked): ?>
message: "'좋아요'가 취소 되었습니다."
<?php else:?>
message: "'좋아요'가 추가 되었습니다."
<?php endif; ?>
<?php else: ?> // 싫어요
<?php if ($is_disliked): ?>
message: "'싫어요'가 취소 되었습니다."
<?php else:?>
message: "'싫어요'가 추가 되었습니다."
<?php endif; ?>
<?php endif; ?>
},{
placement: {
from: "bottom",
align: "center"
},
allow_dismiss: false,
offset: 20,
type: "success",
timer: 100,
delay: 1500,
animate: {
enter: "animated fadeInUp",
exit: "animated fadeOutDown"
}
});
</script>
<?php
exit;
?>

View File

@@ -0,0 +1,37 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid']) getLink('','','잘못된 요청입니다.','');
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) exit;
if (!$my['admin'] && $my['uid'] != $R['mbruid'])
{
if ($my['point'] < $R['point2'])
{
getLink('','','회원님의 보유포인트가 열람포인트보다 적습니다.','');
}
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','-".$R['point2']."','게시물열람(".getStrCut($R['subject'],15,'').")','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point2'].',usepoint=usepoint+'.$R['point2'],'memberuid='.$my['uid']);
getDbUpdate($table[$m.'data'],'hit=hit+1','uid='.$R['uid']);
$_SESSION['module_'.$m.'_view'] .= '['.$R['uid'].']';
getLink('reload','parent.','결제되었습니다.','');
}
else {
getDbUpdate($table[$m.'data'],'hit=hit+1','uid='.$R['uid']);
$_SESSION['module_'.$m.'_view'] .= '['.$R['uid'].']';
if ($my['uid'] == $R['mbruid'])
{
getLink('reload','parent.','게시물 등록회원님으로 인증되셨습니다.','');
}
else
{
getLink('reload','parent.','관리자님으로 인증되셨습니다.','');
}
}
?>

View File

@@ -0,0 +1,14 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$pw) getLink('','','비밀번호를 입력해 주세요.','');
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) getLink('reload','parent.','존재하지 않거나 삭제된 글입니다.','');
if (md5($pw) != $R['pw']) getLink('reload','parent.','비밀번호가 일치하지 않습니다.','');
$_SESSION['module_'.$m.'_pwcheck'] .= '['.$R['uid'].']';
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,172 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid']) getLink('','','로그인해 주세요.','');
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) getLink('','','삭제되었거나 존재하지 않는 게시물입니다.','');
$B = getUidData($table[$m.'list'],$R['bbs']);
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
include_once $g['dir_module'].'var/var.php';
include_once $g['path_module'].'mediaset/var/var.php';
if ($d['bbs']['report_del'] && $d['bbs']['report_del_num'] <= $R['report'])
{
if ($d['bbs']['report_del_act'] == 1)
{
//댓글삭제
if ($R['comment'])
{
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
while($_C=db_fetch_array($CCD))
{
if ($_C['upload'])
{
$UPFILES = getArrayString($_C['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['host']==$d['upload']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
ftp_close($FTP_CONNECT);
}
else {
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
}
}
}
}
if ($_C['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
}
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
if ($_C['point']&&$_C['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
}
}
}
//첨부파일삭제
if ($R['upload'])
{
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['host']==$d['upload']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
ftp_close($FTP_CONNECT);
}
else {
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
}
}
}
}
//태그삭제
if ($R['tag'])
{
$_tagdate = substr($R['d_regis'],0,8);
$_tagarr1 = explode(',',$R['tag']);
foreach($_tagarr1 as $_t)
{
if(!$_t) continue;
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
if($_TAG['uid'])
{
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
}
}
}
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbDelete($table[$m.'idx'],'gid='.$R['gid']);
getDbDelete($table[$m.'data'],'uid='.$R['uid']);
getDbDelete($table[$m.'xtra'],'parent='.$R['uid']);
getDbUpdate($table[$m.'list'],'num_r=num_r-1','uid='.$R['bbs']);
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$R['bbs'])."'",'uid='.$cuid);
getDbDelete($table['s_trackback'],"parent='".$R['bbsid'].$R['uid']."'");
if ($R['point1']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point1']."','게시물삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point1'],'memberuid='.$R['mbruid']);
}
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').($c?'c='.$c:'m='.$m),array('bid','skin','iframe','cat','p','sort','orderby','recnum','type','where','keyword'));
getLink($backUrl ,'parent.' , '신고건수 누적으로 삭제처리 되었습니다.' , $history);
}
else {
getDbUpdate($table[$m.'data'],'hidden=1','uid='.$R['uid']);
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').($c?'c='.$c:'m='.$m),array('bid','skin','iframe','cat','p','sort','orderby','recnum','type','where','keyword'));
getLink($backUrl ,'parent.' , '신고건수 누적으로 게시제한처리 되었습니다.' , $history);
}
}
else {
$UT = getDbData($table[$m.'xtra'],'parent='.$R['uid'],'*');
if (!strpos('_'.$UT['report'],'['.$my['uid'].']'))
{
getDbUpdate($table[$m.'data'],'report=report+1','uid='.$R['uid']);
if (!$UT['parent'])
{
getDbInsert($table[$m.'xtra'],'parent,site,bbs,report',"'".$R['uid']."','".$s."','".$R['bbs']."','[".$my['uid']."]'");
}
else {
getDbUpdate($table[$m.'xtra'],"report='[".$my['uid']."]'",'parent='.$R['uid']);
}
getLink('','','신고처리 되었습니다.','');
}
else {
getLink('','','이미 신고하신 게시물입니다.','');
}
}
?>

View File

@@ -0,0 +1,110 @@
<?php
if(!defined('__KIMS__')) exit;
$R = getUidData($table[$m.'data'],$uid);
$B = getUidData($table[$m.'list'],$R['bbs']);
if ($send=='ajax') {
$result=array();
if (!$my['uid']) {
$result['error']=true;
$result['msg'] = '로그인해 주세요.';
$result['msgType'] = 'danger';
echo json_encode($result);
exit;
}
if (!$R['uid']) {
$result['error']=true;
$result['msg'] = '삭제되었거나 존재하지 않는 게시물입니다.';
$result['msgType'] = 'danger';
echo json_encode($result);
exit;
}
if (!$B['uid']) {
$result['error']=true;
$result['msg'] = '존재하지 않는 게시판입니다.';
$result['msgType'] = 'danger';
echo json_encode($result);
exit;
}
} else {
if (!$my['uid']) {
echo '<script type="text/javascript">';
echo 'parent.$("#modal-login").modal();';
echo '</script>';
exit;
}
if (!$R['uid']) getLink('','','삭제되었거나 존재하지 않는 게시물입니다.','');
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
}
$mbruid = $my['uid'];
$module = $m;
$category = $_HM['name']?$_HM['name']:$B['name'];
$entry = $R['uid'];
$subject = addslashes($R['subject']);
$url = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').($c?'c='.$c:'m='.$m),array('bid','uid','skin','iframe'));
$d_regis = $date['totime'];
$check_saved_qry = "mbruid='".$mbruid."' and module='".$module."' and entry='".$entry."'";
$is_saved = getDbRows($table['s_saved'],$check_saved_qry);
if ($is_saved){ // 이미 저장했던 경우
getDbDelete($table['s_saved'],$check_saved_qry);
}else{ // 저장을 안한 경우 추가
$_QKEY = 'mbruid,module,category,entry,subject,url,d_regis';
$_QVAL = "'$mbruid','$module','$category','$entry','$subject','$url','$d_regis'";
getDbInsert($table['s_saved'],$_QKEY,$_QVAL);
}
if ($send=='ajax') {
$result['error']=false;
if ($is_saved) $result['is_post_saved'] = 1;
else $result['is_post_saved'] = 0;
echo json_encode($result);
exit;
}
?>
<script>
<?php if ($is_saved): ?>
parent.$("[data-role=btn_post_saved]").removeClass("active");
<?php else: ?>
parent.$("[data-role=btn_post_saved]").addClass("active");
<?php endif; ?>
window.parent.$.notify({
<?php if ($is_saved): ?>
message: "게시물이 저장함에서 삭제되었습니다."
<?php else:?>
message: "게시물이 저장함에 추가되었습니다."
<?php endif; ?>
},{
placement: {
from: "bottom",
align: "center"
},
allow_dismiss: false,
offset: 20,
type: "success",
timer: 100,
delay: 1500,
animate: {
enter: "animated fadeInUp",
exit: "animated fadeOutDown"
}
});
</script>
<?php
exit;
?>

View File

@@ -0,0 +1,48 @@
<?php
if(!defined('__KIMS__')) exit;
$useGUEST = 0; //비회원도 접근허용할 경우 1로 변경
$score_limit = 1; //점수한계치(이 점수보다 높은 갚을 임의로 보낼 경우 제한)
$score = $score ? $score : 1;
if ($score > $score_limit) $score = $score_limit;
if (!$useGUEST)
{
if (!$my['uid']) getLink('','','로그인해 주세요.','');
$scorelog = '['.$my['uid'].']';
}
else {
$scorelog = '['.$_SERVER['REMOTE_ADDR'].']';
if ($my['uid']) $scorelog .= '['.$my['uid'].']';
}
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) getLink('','','존재하지 않는 게시물입니다.','');
$UT = getDbData($table[$m.'xtra'],'parent='.$R['uid'],'*');
$scoreset = array('good'=>'score1','bad'=>'score2');
// 공감,비공감 또는 추천,비추천 등 2개이상의 체크가 가능할 경우 둘중 하나라도 체크했을때 중복을 제한하려면 주석을 풀어주세요.
//if (strpos('_'.$UT['score1'],'['.$my['uid'].']') || strpos('_'.$UT['score1'],'['.$_SERVER['REMOTE_ADDR'].']') || strpos('_'.$UT['score2'],'['.$my['uid'].']') || strpos('_'.$UT['score2'],'['.$_SERVER['REMOTE_ADDR'].']'))
//{
// getLink('','','이미 반영된 글입니다.','');
//}
if (!strpos('_'.$UT[$scoreset[$value]],'['.$my['uid'].']') && !strpos('_'.$UT[$scoreset[$value]],'['.$_SERVER['REMOTE_ADDR'].']'))
{
getDbUpdate($table[$m.'data'],$scoreset[$value].'='.$scoreset[$value].'+'.$score,'uid='.$R['uid']);
if (!$UT['parent'])
{
getDbInsert($table[$m.'xtra'],'parent,site,bbs,'.$scoreset[$value],"'".$R['uid']."','".$s."','".$R['bbs']."','".$scorelog."'");
}
else {
getDbUpdate($table[$m.'xtra'],$scoreset[$value]."='".$UT[$scoreset[$value]].$scorelog."'",'parent='.$R['uid']);
}
}
else {
getLink('','','이미 반영된 글입니다.','');
}
getLink('','','반영되었습니다.','');
?>

View File

@@ -0,0 +1,13 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$fp = fopen($g['dir_module'].'themes/'.$theme.'/_var.php','w');
fwrite($fp,trim(stripslashes($theme_var)));
fclose($fp);
@chmod($g['dir_module'].'themes/'.$theme.'/_var.php',0707);
setrawcookie('result_bbs_theme', rawurlencode('저장 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,12 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if (trim($theme) && is_dir($g['dir_module'].'theme/'.$theme))
{
include_once $g['path_core'].'function/dir.func.php';
DirDelete($g['dir_module'].'theme/'.$theme);
}
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=skin','parent.','','');
?>

View File

@@ -0,0 +1,106 @@
<?php
$g=array();
$g['url_host'] = 'http'.($_SERVER['HTTPS']=='on'?'s':'').'://'.$_SERVER['HTTP_HOST'];
$g['path_root']='../../../';
$g['path_var']=$g['path_root'].'_var/';
$g['path_core']=$g['path_root'].'_core/';
$g['path_module']=$g['path_root'].'modules/';
require $g['path_var'].'db.info.php';
require $g['path_var'].'table.info.php';
require $g['path_core'].'function/db.mysql.func.php';
require $g['path_core'].'function/sys.func.php';
require $g['path_core'].'function/thumb.func.php';
include $g['path_module'].'mediaset/var/var.php'; // 미디어셋 설정내용
$DB_CONNECT = isConnectedToDB($DB);
$date['today']=date('Ymd');
$date['totime']=date('YmdHis');
if ($_FILES['file']['name']) {
if (!$_FILES['file']['error']) {
if (!$d['mediaset']['ext_cut'] && !strstr($d['mediaset']['ext_cut'],$fileExt)){
$tmpcode = time();
$s=$_POST['s'];
$mbruid=$_POST['mbruid'];
$fserver = $d['meidaset']['use_fileserver'];
$url = $fserver ? $d['meidaset']['ftp_urlpath'] : $g['url_host'].'/modules/bbs/upload/';
$name = strtolower($_FILES['file']['name']);
$size = $_FILES['file']['size'];
$width = 0;
$height = 0;
$caption = trim($caption);
$down = 0;
$d_regis = $date['totime'];
$d_update = '';
$fileExt = getExt($name);
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
$type = getFileType($fileExt);
$tmpname = md5($name).substr($date['totime'],8,14);
$tmpname = $type == 2 ? $tmpname.'.'.$fileExt : $tmpname;
$hidden = $type == 2 ? 1 : 0;
$upfolder = substr($date['today'],0,8); // 년월일을 업로드 폴더 구분기준으로 설정
$saveDir = '../upload/'; // bbs 게시판 안에 별도의 files 폴더를 둔다. 나중에 포럼모듈이 나오면 충돌을 피하기 위해
$savePath1 = $saveDir.substr($upfolder,0,4);// 년도 폴더 지정 (없으면 아래 for 문으로 만든다)
$savePath2 = $savePath1.'/'.substr($upfolder,4,2); // 월 폴더 지정 (없으면 아래 for 문으로 만든다)
$savePath3 = $savePath2.'/'.substr($upfolder,6,2); // 일 폴더 지정(없으면 아래 for 문으로 만든다)
$folder = substr($date['today'],0,4).'/'.substr($date['today'],4,2).'/'.substr($date['today'],6,2);
// 위 폴더가 없으면 새로 만들기
for ($i = 1; $i < 4; $i++)
{
if (!is_dir(${'savePath'.$i}))
{
mkdir(${'savePath'.$i},0707);
@chmod(${'savePath'.$i},0707);
}
}
$saveFile = $savePath3.'/'.$tmpname; // 생성된 폴더/파일 --> 파일의 실제 위치
if($Overwrite=='true' || !is_file($saveFile))
{
move_uploaded_file($_FILES["file"]["tmp_name"], $saveFile);
if ($type == 2)
{
$thumbname = md5($tmpname).'.'.$fileExt;
$thumbFile = $savePath3.'/'.$thumbname;
ResizeWidth($saveFile,$thumbFile,150);
@chmod($thumbFile,0707);
$IM = getimagesize($saveFile);
$width = $IM[0];
$height= $IM[1];
}
@chmod($saveFile,0707);
}
$mingid = getDbCnt($table['bbsupload'],'min(gid)','');
$gid = $mingid ? $mingid - 1 : 100000000;
$QKEY = "gid,hidden,tmpcode,site,mbruid,type,ext,fserver,url,folder,name,tmpname,thumbname,size,width,height,caption,down,d_regis,d_update,cync";
$QVAL = "'$gid','$hidden','$tmpcode','$s','$mbruid','$type','$fileExt','$fserver','$url','$folder','$name','$tmpname','$thumbname','$size','$width','$height','$caption','$down','$d_regis','$d_update','$cync'";
getDbInsert($table['bbsupload'],$QKEY,$QVAL);
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".$date['today']."' and site=".$s);
$lastuid= getDbCnt($table['bbsupload'],'max(uid)','');
$sourcePath='./modules/bbs'.str_replace('..','',$savePath3); // 소스에 보여주는 패스트 -- 상대경로를 제거한다.
$code='100';
$src=$sourcePath.'/'.$tmpname;
$result=array($code,$src,$lastuid); // 이미지 path 및 이미지 uid 값
echo json_encode($result);// 최종적으로 에디터에 넘어가는 값
}else{
$code='200';
$msg = '업로드금지 확장자입니다.';
$result=array($code,$msg);
echo json_encode($result);// 최종적으로 에디터에 넘어가는 값
}
}else{
$code='300';
$msg = '파일 에러입니다.: '.$_FILES['file']['error'];
$result=array($code,$msg);
echo json_encode($result);// 최종적으로 에디터에 넘어가는 값
}
}// 파일이 넘어왔는지 체크
?>

View File

@@ -0,0 +1,325 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
if (!$_SESSION['wcode']||$_SESSION['wcode']!=$pcode) exit;
if (!$bid) getLink('','','게시판 아이디가 지정되지 않았습니다.','');
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
if (!$subject) getLink('reload','parent.','제목이 입력되지 않았습니다.','');
$g['bbsVarForSite'] = $g['path_var'].'site/'.$r.'/bbs.var.php';
include_once file_exists($g['bbsVarForSite']) ? $g['bbsVarForSite'] : $g['dir_module'].'var/var.php';
include_once $g['path_var'].'bbs/var.'.$B['id'].'.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['bbs']['m_skin']?$d['bbs']['m_skin']:$d['bbs']['skin_mobile'];
} else {
$theme = $d['bbs']['skin']?$d['bbs']['skin']:$d['bbs']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$bbsuid = $B['uid'];
$bbsid = $B['id'];
$mbruid = $my['uid'];
$id = $my['id'];
$name = $my['uid'] ? $my['name'] : trim($name);
$nic = $my['uid'] ? $my['nic'] : $name;
$category = trim($category);
$subject = str_replace('"','“',$subject);
$subject = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
$content = trim($content);
$html = $html ? $html : 'HTML';
$tag = trim($tag);
$d_regis = $date['totime'];
$d_comment = '';
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$upload = $upfiles;
$adddata = trim($adddata);
$hidden = $hidden ? intval($hidden) : 0;
$notice = $notice ? intval($notice) : 0;
$display = $d['bbs']['display'] || $hidepost || $hidden ? 0 : 1;
$parentmbr = 0;
$point1 = trim($d['bbs']['point1']);
$point2 = trim($d['bbs']['point2']);
$point3 = $point3 ? filterstr(trim($point3)) : 0;
$point4 = $point4 ? filterstr(trim($point4)) : 0;
if ($d['bbs']['badword_action']) {
$badwordarr = explode(',' , $d['bbs']['badword']);
$badwordlen = count($badwordarr);
for($i = 0; $i < $badwordlen; $i++)
{
if(!$badwordarr[$i]) continue;
if(strstr($subject,$badwordarr[$i]) || strstr($content,$badwordarr[$i]))
{
if ($d['bbs']['badword_action'] == 1)
{
getLink('','','등록이 제한된 단어를 사용하셨습니다.','');
}
else {
$badescape = strCopy($badwordarr[$i],$d['bbs']['badword_escape']);
$content = str_replace($badwordarr[$i],$badescape,$content);
$subject = str_replace($badwordarr[$i],$badescape,$subject);
}
}
}
}
if (!$uid || $reply == 'Y') {
if(!getDbRows($table[$m.'day'],"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid))
getDbInsert($table[$m.'day'],'date,site,bbs,num',"'".$date['today']."','".$s."','".$bbsuid."','0'");
if(!getDbRows($table[$m.'month'],"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid))
getDbInsert($table[$m.'month'],'date,site,bbs,num',"'".$date['month']."','".$s."','".$bbsuid."','0'");
}
if ($uid) {
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) getLink('','','존재하지 않는 게시물입니다.','');
if ($reply == 'Y') {
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].',')) {
if ($d['bbs']['perm_l_write'] > $my['level'] || strstr($d['bbs']['perm_g_write'],'['.$my['mygroup'].']')) {
getLink('','','정상적인 접근이 아닙니다.','');
}
}
$RNUM = getDbRows($table[$m.'idx'],'gid >= '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
if ($RNUM > 98) getLink('','','죄송합니다. 더이상 답글을 달 수 없습니다.','');
getDbUpdate($table[$m.'idx'],'gid=gid+0.01','gid > '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
getDbUpdate($table[$m.'data'],'gid=gid+0.01','gid > '.$R['gid'].' and gid < '.(intval($R['gid'])+1));
if ($R['hidden'] && $hidden) {
if ($R['mbruid']) {
$pw = $R['mbruid'];
} else {
$pw = $my['uid'] ? $R['pw'] : ($pw == $R['pw'] ? $R['pw'] : md5($pw));
}
} else {
$pw = $pw ? md5($pw) : '';
}
$gid = $R['gid']+0.01;
$depth = $R['depth']+1;
$parentmbr = $R['mbruid'];
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
$QKEY.= "hit,down,comment,oneline,likes,dislikes,report,point1,point2,point3,point4,d_regis,d_modify,d_comment,upload,ip,agent,sns,featured_img,location,pin,adddata";
$QVAL = "'$s','$gid','$bbsuid','$bbsid','$depth','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$category','$subject','$content','$html','$tag',";
$QVAL.= "'0','0','0','0','0','0','0','$point1','$point2','$point3','$point4','$d_regis','','','$upload','$ip','$agent','','$featured_img','$location','$pin','$adddata'";
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'$s','$notice','$bbsuid','$gid'");
getDbUpdate($table[$m.'list'],"num_r=num_r+1,d_last='".$d_regis."'",'uid='.$bbsuid);
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid);
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid);
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$bbsuid)."',d_last='".$d_regis."'",'uid='.$cuid);
if ($point1&&$my['uid']) {
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point1."','게시물(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point+'.$point1,'memberuid='.$my['uid']);
}
} else {
if ($my['uid'] != $R['mbruid'] && !$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].',')) {
if (!strstr($_SESSION['module_'.$m.'_pwcheck'],$R['uid'])) getLink('','','정상적인 접근이 아닙니다.','');
}
$pw = !$R['pw'] && !$R['hidden'] && $hidden && $R['mbruid'] ? $R['mbruid'] : $R['pw'];
$QVAL = "display='$display',hidden='$hidden',notice='$notice',pw='$pw',category='$category',subject='$subject',content='$content',html='$html',tag='$tag',point3='$point3',point4='$point4',d_modify='$d_regis',upload='$upload',featured_img='$featured_img',location='$location',pin='$pin',adddata='$adddata'";
getDbUpdate($table[$m.'data'],$QVAL,'uid='.$R['uid']);
getDbUpdate($table[$m.'idx'],'notice='.$notice,'gid='.$R['gid']);
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$R['site'].' and bbs='.$R['bbs'])."'",'uid='.$cuid);
}
} else {
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].',')) {
if ($d['bbs']['perm_l_write'] > $my['level'] || strstr($d['bbs']['perm_g_write'],'['.$my['mygroup'].']')) {
getLink('','','정상적인 접근이 아닙니다.','');
}
}
$pw = $hidden && $my['uid'] ? $my['uid'] : ($pw ? md5($pw) : '');
$mingid = getDbCnt($table[$m.'data'],'min(gid)','');
$gid = $mingid ? $mingid-1 : 100000000.00;
$QKEY = "site,gid,bbs,bbsid,depth,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,category,subject,content,html,tag,";
$QKEY.= "hit,down,comment,oneline,likes,dislikes,report,point1,point2,point3,point4,d_regis,d_modify,d_comment,upload,ip,agent,sns,featured_img,location,pin,adddata";
$QVAL = "'$s','$gid','$bbsuid','$bbsid','$depth','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$category','$subject','$content','$html','$tag',";
$QVAL.= "'0','0','0','0','0','0','0','$point1','$point2','$point3','$point4','$d_regis','','','$upload','$ip','$agent','','$featured_img','$location','$pin','$adddata'";
getDbInsert($table[$m.'data'],$QKEY,$QVAL);
getDbInsert($table[$m.'idx'],'site,notice,bbs,gid',"'$s','$notice','$bbsuid','$gid'");
getDbUpdate($table[$m.'list'],"num_r=num_r+1,d_last='".$d_regis."'",'uid='.$bbsuid);
getDbUpdate($table[$m.'month'],'num=num+1',"date='".$date['month']."' and site=".$s.' and bbs='.$bbsuid);
getDbUpdate($table[$m.'day'],'num=num+1',"date='".$date['today']."' and site=".$s.' and bbs='.$bbsuid);
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
if ($cuid) getDbUpdate($table['s_menu'],"num='".getDbCnt($table[$m.'month'],'sum(num)','site='.$s.' and bbs='.$bbsuid)."',d_last='".$d_regis."'",'uid='.$cuid);
if ($point1&&$my['uid']) {
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point1."','게시물(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point+'.$point1,'memberuid='.$my['uid']);
}
if ($gid == 100000000.00) {
db_query("OPTIMIZE TABLE ".$table[$m.'idx'],$DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$m.'data'],$DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$m.'month'],$DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$m.'day'],$DB_CONNECT);
}
}
$NOWUID = $LASTUID ? $LASTUID : $R['uid'];
if ($tag || $R['tag']) {
$_tagarr1 = array();
$_tagarr2 = explode(',',$tag);
$_tagdate = $date['today'];
if ($R['uid'] && $reply != 'Y') {
$_tagdate = substr($R['d_regis'],0,8);
$_tagarr1 = explode(',',$R['tag']);
foreach($_tagarr1 as $_t) {
if(!$_t || in_array($_t,$_tagarr2)) continue;
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
if($_TAG['uid']) {
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
}
}
}
foreach($_tagarr2 as $_t) {
if(!$_t || in_array($_t,$_tagarr1)) continue;
$_TAG = getDbData($table['s_tag'],'site='.$s." and date='".$_tagdate."' and keyword='".$_t."'",'*');
if($_TAG['uid']) getDbUpdate($table['s_tag'],'hit=hit+1','uid='.$_TAG['uid']);
else getDbInsert($table['s_tag'],'site,date,keyword,hit',"'".$s."','".$_tagdate."','".$_t."','1'");
}
}
$_SESSION['bbsback'] = $backtype;
if ($reply == 'Y') $msg = '답변';
else if ($uid) $msg = '수정';
else $msg = '등록';
//알림 전송 (게시물 등록: 신규 게시물 등록시, 게시판 관리자에게 알림발송)
if ($d['bbs']['noti_newpost'] && !$my['admin']){
$cfile = $g['path_var'].$m.'/noti/_new.post.php';
$gfile = $g['dir_module'].'var/noti/_new.post.php';
if (is_file($cfile)) {
include $cfile;
} else {
include $gfile;
}
$sendAdmins_array = explode(',',trim($d['bbs']['admin']));
if (is_array($sendAdmins_array)) {
foreach($sendAdmins_array as $val) {
$_M = getDbData($table['s_mbrid'],'id="'.$val.'"','uid');
$__M = getDbData($table['s_mbrdata'],'memberuid='.$_M['uid'],'memberuid,email,name,nic');
if (!$_M['uid']) continue;
$noti_title = $d['bbs']['noti_title'];
$noti_title = str_replace('{BBS}',$B['name'],$noti_title);
$noti_body = $d['bbs']['noti_body'];
$noti_body = str_replace('{MEMBER}',$my[$_HS['nametype']],$noti_body);
$noti_body = str_replace('{SUBJECT}',$subject,$noti_body);
$noti_referer = $g['url_host'].RW('m='.$m.'&bid='.$bbsid);
$noti_button = $d['bbs']['noti_button'];
$noti_tag = '';
$noti_skipEmail = 0;
$noti_skipPush = 0;
putNotice($_M['uid'],$m,$my['uid'],$noti_title,$noti_body,$noti_referer,$noti_button,$noti_tag,$noti_skipEmail,$noti_skipPush);
}
}
}
if ($backtype == "ajax") {
$result=array();
$result['error']=false;
$R = getUidData($table['bbsdata'],$NOWUID);
if (!$uid) {
$TMPL['category'] = $R['category'];
$TMPL['subject'] = $R['subject'];
$TMPL['bname'] = $B['name'];
$TMPL['bid'] = $B['id'];
$TMPL['uid'] = $R['uid'];
$TMPL['name'] = $R[$_HS['nametype']];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['hit'] = $R['hit'];
$TMPL['likes'] = $R['likes'];
$TMPL['d_regis'] = getDateFormat($R['d_regis'],'Y.m.d');
$TMPL['d_regis_c']=getDateFormat($R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'84');
$TMPL['url'] = '/'.$r.'/b/'.$R['bbsid'].'/'.$R['uid'];
$TMPL['featured_img_sm'] = getPreviewResize(getUpImageSrc($R),'240x180');
$TMPL['featured_img'] = getPreviewResize(getUpImageSrc($R),'480x270');
$TMPL['featured_img_lg'] = getPreviewResize(getUpImageSrc($R),'686x386');
$TMPL['featured_img_sq_200'] = getPreviewResize(getUpImageSrc($R),'200x200');
$TMPL['featured_img_sq_300'] = getPreviewResize(getUpImageSrc($R),'300x300');
$TMPL['featured_img_sq_600'] = getPreviewResize(getUpImageSrc($R),'600x600');
$TMPL['has_featured_img'] = getUpImageSrc($R)=='/files/noimage.png'?'d-none':'';
$TMPL['new']=getNew($R['d_regis'],24)?'':'d-none';
$TMPL['hidden']=$R['hidden']?'':'d-none';
$TMPL['notice']=$R['notice']?'':'d-none';
$TMPL['upload']=$R['upload']?'':'d-none';
$TMPL['timeago']=$d['theme']['timeago']?'data-plugin="timeago"':'';
if (!$list_wrapper) {
$skin_item=new skin($markup.'-item');
$TMPL['items']=$skin_item->make();
$skin=new skin($markup.'-list');
$result['item']=$skin->make();
} else {
if ($notice) $skin=new skin('list-item-notice');
else $skin=new skin($markup.'-item');
$result['item']=$skin->make();
}
$result['notice']=$R['notice'];
$result['uid']=$NOWUID;
$result['depth']=$R['depth'];
$result['media_object']=$d['theme']['media_object'];
} else {
$result['notice']=$R['notice'];
$result['uid']=$NOWUID;
$result['subject'] = $R['subject'];
$result['content'] = getContents($R['content'],$R['html']);
}
echo json_encode($result);
exit;
} else {
setrawcookie('bbs_action_result', rawurlencode('게시물이 '.$msg.' 되었습니다.')); // 처리여부 cookie 저장
if (!$backtype || $backtype == 'list') {
getLink($nlist,'parent.','','');
} else if ($backtype == 'view') {
if ($_HS['rewrite']&&!strstr($nlist,'&')) {
getLink($nlist.'/'.$NOWUID,'parent.','','');
} else {
getLink($nlist.'&mod=view&uid='.$NOWUID,'parent.','','');
}
} else {
getLink('reload','parent.','','');
}
}
?>

4
modules/bbs/admin.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
if(!defined('__KIMS__')) exit;
include $g['path_module'].$module.'/admin/'.$front.'.php';
?>

View File

@@ -0,0 +1,209 @@
<!--
// makebbs.php 의 추가설정 부분
-->
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">게시판 관리자</label>
<div class="col-lg-10 col-xl-9">
<div class="input-group">
<input class="form-control" placeholder="" type="text" name="admin" value="<?php echo $d['bbs']['admin']?>">
<div class="input-group-append">
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#bbs_admin-guide" data-tooltip="tooltip" title="도움말">
<i class="fa fa-question-circle fa-lg"></i>
</button>
</div>
</div>
<p class="help-block collapse" id="bbs_admin-guide">
<small class="form-text text-muted">
게시판에 대해서 관리자권한을 별도로 부여할 회원이 있을경우
회원아이디를 콤마(,) 구분해서 등록해 주세요.<br />
관리자로 지정될 경우 열람/수정/삭제등의 모든권한을 얻게 됩니다.
</small>
</p>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">최근글 제외</label>
<div class="col-lg-10 col-xl-9">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="display" name="display" value="1" <?php if($d['bbs']['display']):?> checked<?php endif?>>
<label class="custom-control-label" for="display">최근글 추출에서 제외합니다.</label>
</div>
<div class="help-text">
<small class="text-muted">
<a data-toggle="collapse" href="#bbs_display-guide"><i class="fa fa-question-circle fa-fw"></i>도움말</a>
</small>
</div>
<p class="help-block collapse" id="bbs_display-guide">
<small class="form-text text-muted">
최근글 추출제외는 게시물등록시에 이 설정값을 따르므로 설정값을 중간에 변경하면 이전 게시물에 대해서는 적용되지 않습니다.
최근글 제외설정은 게시판 서비스전에 확정하여 주세요.<br />
최근글에서 제외하면 통합검색에서도 제외됩니다.
</small>
</p>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">쿼리 생략</label>
<div class="col-lg-10 col-xl-9">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="hidelist" name="hidelist" value="1" <?php if($d['bbs']['hidelist']):?> checked<?php endif?>>
<label class="custom-control-label" for="hidelist">게시물가공 기본쿼리를 생략합니다.</label>
</div>
<div class="help-text">
<small class="text-muted">
<a data-toggle="collapse" href="#bbs_hidelist-guide"><i class="fa fa-question-circle fa-fw"></i>도움말</a>
</small>
</div>
<p class="help-block collapse" id="bbs_hidelist-guide">
<small class="form-text text-muted">
종종 기본쿼리가 아닌 테마자체에서 데이터를 가공해야 하는 경우가 있습니다.<br />
1:1상담게시판,일정관리 등 특수한 테마의 경우 쿼리생략이 요구되기도 합니다.<br />
쿼리생략이 요구되는 테마를 사용할 경우 체크해 주세요.<br />
</small>
</p>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">RSS 발행</label>
<div class="col-lg-10 col-xl-9">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="rss" name="rss" value="1" <?php if($d['bbs']['rss']):?> checked<?php endif?>>
<label class="custom-control-label" for="rss">RSS발행을 허용합니다. (개별게시판별 RSS발행은 개별게시판 설정을 따름)</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">조회수 증가</label>
<div class="col-lg-10 col-xl-9">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="hitcount_1" name="hitcount" value="1" <?php if($d['bbs']['hitcount']):?> checked<?php endif?> class="custom-control-input">
<label class="custom-control-label" for="hitcount_1">무조건 증가</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="hitcount_0" name="hitcount" value="0"<?php if(!$d['bbs']['hitcount']):?> checked<?php endif?> class="custom-control-input">
<label class="custom-control-label" for="hitcount_0">1회만 증가</label>
</div>
</div><!-- .col-lg-10 col-xl-9 -->
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">게시물 출력</label>
<div class="col-lg-10 col-xl-9">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="text" name="recnum" value="<?php echo $d['bbs']['recnum']?$d['bbs']['recnum']:20?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">개</span>
</div>
</div>
</div>
<div class="col-sm-5 form-control-static text-muted">
<small>한페이지에 출력할 게시물의 수</small>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">제목 끊기</label>
<div class="col-lg-10 col-xl-9">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="text" name="sbjcut" value="<?php echo $d['bbs']['sbjcut']?$d['bbs']['sbjcut']:40?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">자</span>
</div>
</div>
</div>
<div class="col-sm-5 form-control-static text-muted">
<small>제목이 길 경우 보여줄 글자 수 </small>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">새글 유지시간</label>
<div class="col-lg-10 col-xl-9">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="text" name="newtime" value="<?php echo $d['bbs']['newtime']?$d['bbs']['newtime']:24?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">시간</span>
</div>
</div>
</div>
<div class="col-sm-5 text-muted form-control-static">
<small> 새글로 인식되는 시간 </small>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">등록 포인트</label>
<div class="col-lg-10 col-xl-9">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="text" name="point1" value="<?php echo $d['bbs']['point1']?$d['bbs']['point1']:0?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">포인트 지급</span>
</div>
</div>
</div>
<div class="col-sm-5 text-muted form-control-static">
<small> 게시물 삭제시 환원됩니다. </small>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">열람 포인트</label>
<div class="col-lg-10 col-xl-9">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="text" name="point2" value="<?php echo $d['bbs']['point2']?$d['bbs']['point2']:0?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">포인트 차감</span>
</div>
</div>
</div>
<div class="col-sm-5 text-muted form-control-static">
<small> </small>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">다운 포인트</label>
<div class="col-lg-10 col-xl-9">
<div class="row">
<div class="col-sm-4">
<div class="input-group">
<input type="text" name="point3" value="<?php echo $d['bbs']['point3']?$d['bbs']['point3']:0?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">포인트 차감</span>
</div>
</div>
</div>
<div class="col-sm-5 text-muted form-control-static">
<small> </small>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">부가필드</label>
<div class="col-lg-10 col-xl-9">
<textarea name="addinfo" class="form-control" rows="3"><?php echo htmlspecialchars($R['addinfo'])?></textarea>
<small class="form-text text-muted">
이 게시판에 대해서 추가적인 정보가 필요할 경우 사용합니다.<br />
필드명은 <code>[addinfo]</code> 입니다.
</small>
</div>
</div>

View File

@@ -0,0 +1,49 @@
<!--
// makebbs.php 의 픗터삽입 부분
-->
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">픗터 파일</label>
<div class="col-lg-10 col-xl-9">
<input type="file" name="imgfoot">
<?php if($R['imgfoot']):?>
<p class="form-control-static">
<a class="btn bnt-link" href="<?php echo $g['s']?>/?m=<?php echo $module?>&amp;a=bbs_file_delete&amp;bid=<?php echo $R['id']?>&amp;dtype=foot" target="_action_frame_admin" onclick="return hrefCheck(this,true,'정말로 삭제하시겠습니까?');">삭제</a>
<a class="btn btn-link" href="<?php echo $g['s']?>/modules/<?php echo $module?>/var/files/<?php echo $R['imgfoot']?>" target="_blank">등록파일 보기</a>
</p>
<?php else:?>
<small class="help-block">(gif/jpg/png 가능)</small>
<?php endif?>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">
픗터 코드
</label>
<div class="col-lg-10 col-xl-9">
<p>
<textarea name="codfoot" id="codfootArea" class="form-control" rows="5"><?php if(is_file($g['path_module'].$module.'/var/code/'.$R['id'].'.footer.php')) echo htmlspecialchars(implode('',file($g['path_module'].$module.'/var/code/'.$R['id'].'.footer.php')))?></textarea>
</p>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">
노출 위치
</label>
<div class="col-lg-10 col-xl-9">
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="inc_foot_list" name="inc_foot_list" value="[l]"<?php if(strstr($R['putfoot'],'[l]')):?> checked <?php endif?>>
<label class="custom-control-label" for="inc_foot_list">목록</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="inc_foot_view" name="inc_foot_view" value="[v]"<?php if(strstr($R['putfoot'],'[v]')):?> checked <?php endif?>>
<label class="custom-control-label" for="inc_foot_view">본문</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="inc_foot_write" name="inc_foot_write" value="[w]"<?php if(strstr($R['putfoot'],'[w]')):?> checked <?php endif?>>
<label class="custom-control-label" for="inc_foot_write">쓰기</label>
</div>
</div>
</div>

View File

@@ -0,0 +1,48 @@
<!--
// makebbs.php 의 헤더삽입 부분
-->
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right" >헤더 파일</label>
<div class="col-lg-10 col-xl-9">
<input type="file" name="imghead">
<?php if($R['imghead']):?>
<p class="form-control-static">
<a class="btn bnt-link" href="<?php echo $g['s']?>/?m=<?php echo $module?>&amp;a=bbs_file_delete&amp;bid=<?php echo $R['id']?>&amp;dtype=head" target="_action_frame_admin" onclick="return hrefCheck(this,true,'정말로 삭제하시겠습니까?');">삭제</a>
<a class="btn btn-link" href="<?php echo $g['s']?>/modules/<?php echo $module?>/var/files/<?php echo $R['imghead']?>" target="_blank">등록파일 보기</a>
</p>
<?php else:?>
<small class="help-block">(gif/jpg/png 가능)</small>
<?php endif?>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">
헤더 코드
</label>
<div class="col-lg-10 col-xl-9">
<p>
<textarea name="codhead" id="codheadArea" class="form-control" rows="5"><?php if(is_file($g['path_module'].$module.'/var/code/'.$R['id'].'.header.php')) echo htmlspecialchars(implode('',file($g['path_module'].$module.'/var/code/'.$R['id'].'.header.php')))?></textarea>
</p>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">
노출 위치
</label>
<div class="col-lg-10 col-xl-9">
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="inc_head_list" name="inc_head_list" value="[l]"<?php if(strstr($R['puthead'],'[l]')):?> checked <?php endif?>>
<label class="custom-control-label" for="inc_head_list">목록</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="inc_head_view" name="inc_head_view" value="[v]"<?php if(strstr($R['puthead'],'[v]')):?> checked <?php endif?>>
<label class="custom-control-label" for="inc_head_view">본문</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="inc_head_write" name="inc_head_write" value="[w]"<?php if(strstr($R['puthead'],'[w]')):?> checked <?php endif?>>
<label class="custom-control-label" for="inc_head_write">쓰기</label>
</div>
</div>
</div>

View File

@@ -0,0 +1,29 @@
<?php
$license_local = $g['path_module'].$module.'/LICENSE';
$license_global = $g['path_root'].'LICENSE';
if (file_exists($license_local)) $license = $license_local;
else $license = $license_global;
?>
<link href="<?php echo $g['s']?>/_core/css/github-markdown.css" rel="stylesheet">
<?php getImport('jquery-markdown','jquery.markdown','0.0.10','js')?>
<?php @include $g['path_module'].$module.'/var/var.moduleinfo.php' ?>
<article class="rb-docs markdown-body px-5 pt-3">
<h1><?php echo sprintf('%s 모듈정보',ucfirst($MD['name']))?></h1>
<div class="pb-5 readme">
<?php readfile($g['path_module'].$module.'/README.md')?>
</div>
<div class="pb-5">
<h2>라이센스</h2>
<textarea class="form-control" rows="10"><?php readfile($license)?></textarea>
</div>
</article>
<script type="text/javascript">
$(".markdown-body .readme").markdown();
</script>

View File

@@ -0,0 +1,39 @@
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">게시물 등록</label>
<div class="col-lg-10 col-xl-9 pt-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="noti_newpost" name="noti_newpost" value="1" <?php if($d['bbs']['noti_newpost']):?> checked<?php endif?>>
<label class="custom-control-label small text-muted" for="noti_newpost">신규 게시물 등록시, 게시판 관리자에게 알림발송</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">좋아요 등록</label>
<div class="col-lg-10 col-xl-9 pt-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="noti_opinion" name="noti_opinion" value="1" <?php if($d['bbs']['noti_opinion']):?> checked<?php endif?>>
<label class="custom-control-label small text-muted" for="noti_opinion">게시물에 좋아요(싫어요) 등록(취소)시, 게시물 등록회원에게 알림발송</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">게시물 신고</label>
<div class="col-lg-10 col-xl-9 pt-2">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="noti_report" name="noti_report" value="1" <?php if($d['bbs']['noti_report']):?> checked<?php endif?>>
<label class="custom-control-label small text-muted" for="noti_report">게시물 신고시, 게시판 관리자에게 알림발송</label>
</div>
</div>
</div>
<div class="form-group row d-none">
<label class="col-lg-2 col-form-label text-lg-right">회원 언급</label>
<div class="col-lg-10 col-xl-9 pt-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="noti_mention" name="noti_mention" value="1" <?php if($d['bbs']['noti_mention']):?> checked<?php endif?>>
<label class="custom-control-label small text-muted" for="noti_mention">게시물에 언급시, 언급된 회원(들)에게 알림발송</label>
</div>
</div>
</div>

View File

@@ -0,0 +1,122 @@
<!--
// makebbs.php 의 권한설정 부분
-->
<fieldset>
<legend><span class="badge badge-pill badge-primary">목록접근</span></legend>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">허용등급</label>
<div class="col-lg-10 col-xl-9">
<select name="perm_l_list" class="form-control custom-select">
<option value="0">&nbsp;+ 전체허용</option>
<option value="0">--------------------------------</option>
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
<?php while($_L=db_fetch_array($_LEVEL)):?>
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==$d['bbs']['perm_l_list']):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
<?php if($_L['gid'])break; endwhile?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">차단그룹</label>
<div class="col-lg-10 col-xl-9">
<select name="_perm_g_list" class="form-control custom-select" multiple size="5">
<option value=""<?php if(!$d['bbs']['perm_g_list']):?> selected="selected"<?php endif?>>ㆍ차단안함</option>
<?php $_SOSOK=getDbArray($table['s_mbrgroup'],'','*','gid','asc',0,1)?>
<?php while($_S=db_fetch_array($_SOSOK)):?>
<option value="<?php echo $_S['uid']?>"<?php if(strstr($d['bbs']['perm_g_list'],'['.$_S['uid'].']')):?> selected="selected"<?php endif?>>ㆍ<?php echo $_S['name']?>(<?php echo number_format($_S['num'])?>)</option>
<?php endwhile?>
</select>
</div>
</div>
</fieldset>
<fieldset class="mt-4">
<legend><span class="badge badge-pill badge-primary">본문열람</span></legend>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">허용등급</label>
<div class="col-lg-10 col-xl-9">
<select name="perm_l_view" class="form-control custom-select">
<option value="0">&nbsp;+ 전체허용</option>
<option value="0">--------------------------------</option>
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
<?php while($_L=db_fetch_array($_LEVEL)):?>
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==$d['bbs']['perm_l_view']):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
<?php if($_L['gid'])break; endwhile?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">차단그룹</label>
<div class="col-lg-10 col-xl-9">
<select name="_perm_g_view" class="form-control custom-select" multiple size="5">
<option value=""<?php if(!$d['bbs']['perm_g_view']):?> selected="selected"<?php endif?>>ㆍ차단안함</option>
<?php $_SOSOK=getDbArray($table['s_mbrgroup'],'','*','gid','asc',0,1)?>
<?php while($_S=db_fetch_array($_SOSOK)):?>
<option value="<?php echo $_S['uid']?>"<?php if(strstr($d['bbs']['perm_g_view'],'['.$_S['uid'].']')):?> selected="selected"<?php endif?>>ㆍ<?php echo $_S['name']?>(<?php echo number_format($_S['num'])?>)</option>
<?php endwhile?>
</select>
</div>
</div>
</fieldset>
<fieldset class="mt-4">
<legend><span class="badge badge-pill badge-primary">글쓰기</span></legend>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">허용등급</label>
<div class="col-lg-10 col-xl-9">
<?php if (!$uid): ?>
<input type="hidden" name="perm_l_write" value="1">
<?php else: ?>
<select name="perm_l_write" class="form-control custom-select">
<option value="0">&nbsp;+ 전체허용</option>
<option value="0">--------------------------------</option>
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
<?php while($_L=db_fetch_array($_LEVEL)):?>
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==$d['bbs']['perm_l_write']):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
<?php if($_L['gid'])break; endwhile?>
</select>
<?php endif; ?>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">차단그룹</label>
<div class="col-lg-10 col-xl-9">
<select name="_perm_g_write" class="form-control custom-select" multiple size="5">
<option value=""<?php if(!$d['bbs']['perm_g_write']):?> selected="selected"<?php endif?>>ㆍ차단안함</option>
<?php $_SOSOK=getDbArray($table['s_mbrgroup'],'','*','gid','asc',0,1)?>
<?php while($_S=db_fetch_array($_SOSOK)):?>
<option value="<?php echo $_S['uid']?>"<?php if(strstr($d['bbs']['perm_g_write'],'['.$_S['uid'].']')):?> selected="selected"<?php endif?>>ㆍ<?php echo $_S['name']?>(<?php echo number_format($_S['num'])?>)</option>
<?php endwhile?>
</select>
</div>
</div>
</fieldset>
<fieldset class="mt-4">
<legend><span class="badge badge-pill badge-primary">다운로드</span></legend>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">허용등급</label>
<div class="col-lg-10 col-xl-9">
<select name="perm_l_down" class="form-control custom-select">
<option value="0">&nbsp;+ 전체허용</option>
<option value="0">--------------------------------</option>
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
<?php while($_L=db_fetch_array($_LEVEL)):?>
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==$d['bbs']['perm_l_down']):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
<?php if($_L['gid'])break; endwhile?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">차단그룹</label>
<div class="col-lg-10 col-xl-9">
<select name="_perm_g_down" class="form-control custom-select" multiple size="5">
<option value=""<?php if(!$d['bbs']['perm_g_down']):?> selected="selected"<?php endif?>>ㆍ차단안함</option>
<?php $_SOSOK=getDbArray($table['s_mbrgroup'],'','*','gid','asc',0,1)?>
<?php while($_S=db_fetch_array($_SOSOK)):?>
<option value="<?php echo $_S['uid']?>"<?php if(strstr($d['bbs']['perm_g_down'],'['.$_S['uid'].']')):?> selected="selected"<?php endif?>>ㆍ<?php echo $_S['name']?>(<?php echo number_format($_S['num'])?>)</option>
<?php endwhile?>
</select>
</div>
</div>
</fieldset>

View File

@@ -0,0 +1,379 @@
<?php
//동기화URL
function getCyncUrl($cync)
{
if (!$cync) return $GLOBALS['g']['r'];
$_r = getArrayString($cync);
$_r = $_r['data'][5];
if ($GLOBALS['_HS']['rewrite']&&strpos('_'.$_r,'m:bbs,bid:'))
{
$_r = str_replace('m:bbs','b',$_r);
$_r = str_replace(',bid:','/',$_r);
$_r = str_replace(',uid:','/',$_r);
$_r = str_replace(',CMT:','/',$_r);
$_r = str_replace(',s:','/s',$_r);
return $GLOBALS['g']['r'].'/'.$_r;
}
else return $GLOBALS['g']['s'].'/?'.($GLOBALS['_HS']['usescode']?'r='.$GLOBALS['_HS']['id'].'&amp;':'').str_replace(':','=',str_replace(',','&amp;',$_r));
}
$SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1);
$sort = $sort ? $sort : 'uid';
$orderby= $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
$_WHERE='uid>0';
if($account) $_WHERE .=' and site='.$account;
if ($d_start) $_WHERE .= ' and d_regis > '.str_replace('/','',$d_start).'000000';
if ($d_finish) $_WHERE .= ' and d_regis < '.str_replace('/','',$d_finish).'240000';
if ($bid) $_WHERE .= ' and bbs='.$bid;
if ($category) $_WHERE .= " and category ='".$category."'";
if ($notice) $_WHERE .= ' and notice=1';
if ($hidden) $_WHERE .= ' and hidden=1';
if ($where && $keyw)
{
if (strstr('[name][nic][id][ip]',$where)) $_WHERE .= " and ".$where."='".$keyw."'";
else $_WHERE .= getSearchSql($where,$keyw,$ikeyword,'or');
}
$RCD = getDbArray($table['s_comment'],$_WHERE,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table['s_comment'],$_WHERE);
$TPG = getTotalPage($NUM,$recnum);
?>
<div class="page-header">
<h4>댓글 리스트 </h4>
</div>
<form name="procForm" action="<?php echo $g['s']?>/" method="get" class="form-horizontal rb-form">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $m?>" />
<input type="hidden" name="module" value="<?php echo $module?>" />
<input type="hidden" name="front" value="<?php echo $front?>" />
<div class="rb-heading well well-sm">
<div class="form-group">
<label class="col-sm-1 control-label">필터 </label>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-3">
<select name="account" class="form-control input-sm" onchange="this.form.submit();">
<option value="">+ 전체사이트</option>
<option value="">--------------------</option>
<?php while($S = db_fetch_array($SITES)):?>
<option value="<?php echo $S['uid']?>"<?php if($account==$S['uid']):?> selected="selected"<?php endif?>>ㆍ<?php echo $S['name']?></option>
<?php endwhile?>
<?php if(!db_num_rows($SITES)):?>
<option value="">등록된 사이트가 없습니다.</option>
<?php endif?>
</select>
</div>
</div> <!-- .row -->
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<!-- 고급검색 시작 -->
<div id="search-more" class="collapse<?php if($_SESSION['sh_bbspost']):?> in<?php endif?>">
<div class="form-group">
<label class="col-sm-1 control-label">옵션 </label>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-2">
<label class="checkbox" style="margin-top:0">
<input type="checkbox" name="notice" value="Y"<?php if($notice=='Y'):?> checked<?php endif?> onclick="this.form.submit();" class="form-control"> <i></i>공지글
</label>
</div>
<div class="col-sm-2">
<label class="checkbox" style="margin-top:0">
<input type="checkbox" name="hidden" value="Y"<?php if($hidden=='Y'):?> checked<?php endif?> onclick="this.form.submit();" class="form-control"><i></i>비밀글
</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">기간</label>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-5">
<div class="input-daterange input-group input-group-sm" id="datepicker">
<input type="text" class="form-control" name="d_start" placeholder="시작일 선택" value="<?php echo $d_start?>">
<span class="input-group-addon">~</span>
<input type="text" class="form-control" name="d_finish" placeholder="종료일 선택" value="<?php echo $d_finish?>">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">기간적용</button>
</span>
</div>
</div>
<div class="col-sm-3 hidden-xs">
<span class="input-group-btn">
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>','<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>');">어제</button>
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo getDateFormat($date['today'],'Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">오늘</button>
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-7,substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">일주</button>
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">한달</button>
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo getDateFormat(substr($date['today'],0,6).'01','Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">당월</button>
<button class="btn btn-default" type="button" onclick="dropDate('<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>01','<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>31');">전월</button>
<button class="btn btn-default" type="button" onclick="dropDate('','');">전체</button>
</span>
</div>
</div>
</div>
</div>
<div class="form-group hidden-xs">
<label class="col-sm-1 control-label">정렬</label>
<div class="col-sm-10">
<div class="btn-toolbar">
<div class="btn-group btn-group-sm" data-toggle="buttons">
<label class="btn btn-default<?php if($sort=='gid'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="uid" name="sort"<?php if($sort=='uid'):?> checked<?php endif?>> 등록일
</label>
<label class="btn btn-default<?php if($sort=='hit'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="hit" name="sort"<?php if($sort=='hit'):?> checked<?php endif?>> 조회
</label>
<label class="btn btn-default<?php if($sort=='down'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="down" name="sort"<?php if($sort=='down'):?> checked<?php endif?>> 다운
</label>
<label class="btn btn-default<?php if($sort=='oneline'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="oneline" name="sort"<?php if($sort=='oneline'):?> checked<?php endif?>> 한줄의견
</label>
<label class="btn btn-default<?php if($sort=='score1'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="score1" name="sort"<?php if($sort=='score1'):?> checked<?php endif?>> 점수1
</label>
<label class="btn btn-default<?php if($sort=='score2'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="score2" name="sort"<?php if($sort=='score2'):?> checked<?php endif?>> 점수2
</label>
<label class="btn btn-default<?php if($sort=='report'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="report" name="sort"<?php if($sort=='report'):?> checked<?php endif?>> 신고
</label>
</div>
<div class="btn-group btn-group-sm" data-toggle="buttons">
<label class="btn btn-default<?php if($orderby=='desc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="desc" name="orderby"<?php if($orderby=='desc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-desc"></i>역순
</label>
<label class="btn btn-default<?php if($orderby=='asc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="asc" name="orderby"<?php if($orderby=='asc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-asc"></i>정순
</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">검색</label>
<div class="col-sm-10">
<div class="input-group input-group-sm">
<span class="input-group-btn hidden-xs" style="width:165px">
<select name="where" class="form-control btn btn-default">
<option value="subject"<?php if($where=='subject'):?> selected="selected"<?php endif?>>제목</option>
<option value="content"<?php if($where=='content'):?> selected="selected"<?php endif?>>본문</option>
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>이름</option>
<option value="nic"<?php if($where=='nic'):?> selected="selected"<?php endif?>>닉네임</option>
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
<option value="ip"<?php if($where=='ip'):?> selected="selected"<?php endif?>>아이피</option>
</select>
</span>
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">검색</button>
</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">출력</label>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-2">
<select name="recnum" onchange="this.form.submit();" class="form-control input-sm">
<option value="20"<?php if($recnum==20):?> selected="selected"<?php endif?>>20</option>
<option value="35"<?php if($recnum==35):?> selected="selected"<?php endif?>>35</option>
<option value="50"<?php if($recnum==50):?> selected="selected"<?php endif?>>50</option>
<option value="75"<?php if($recnum==75):?> selected="selected"<?php endif?>>75</option>
<option value="90"<?php if($recnum==90):?> selected="selected"<?php endif?>>90</option>
</select>
</div>
<div class="col-sm-2">
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-1 col-sm-10">
<button type="button" class="btn btn-link rb-advance<?php if(!$_SESSION['sh_bbspost']):?> collapsed<?php endif?>" data-toggle="collapse" data-target="#search-more" onclick="sessionSetting('sh_bbspost','1','','1');">고급검색<small></small></button>
<a href="<?php echo $g['adm_href']?>" class="btn btn-link">초기화</a>
</div>
</div>
</div>
</form>
<div class="page-header">
<h4>
<small><?php echo number_format($NUM)?> 개 ( <?php echo $p?>/<?php echo $TPG.($TPG>1?'pages':'page')?> )</small>
</h4>
</div>
<form name="listForm" action="<?php echo $g['s']?>/" method="post">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th><label data-tooltip="tooltip" title="선택"><input type="checkbox" class="checkAll-post-user"></label></th>
<th>번호</th>
<th>제목</th>
<th>이름</th>
<th>조회</th>
<th>다운</th>
<th>점수1</th>
<th>점수2</th>
<th>신고</th>
<th>날짜</th>
</tr>
</thead>
<tbody>
<?php while($R=db_fetch_array($RCD)):?>
<?php $R['mobile']=isMobileConnect($R['agent'])?>
<tr>
<td><input type="checkbox" name="comment_members[]" value="<?php echo $R['uid']?>" class="rb-post-user" onclick="checkboxCheck();"/></td>
<td>
<?php echo $NUM-((($p-1)*$recnum)+$_rec++)?>
</td>
<td>
<?php if($R['notice']):?><i class="fa fa-volume-up"></i><?php endif?>
<?php if($R['mobile']):?><i class="fa fa-mobile f-lg"></i><?php endif?>
<a href="<?php echo getCyncUrl($R['cync'].',CMT:'.$R['uid'].',s:'.$R['site'])?>#CMT" target="_blank"><?php echo $R['subject']?></a>
<?php if(strstr($R['content'],'.jpg')):?><i class="fa fa-picture-o"></i><?php endif?>
<?php if($R['upload']):?><i class="glyphicon glyphicon-floppy-disk"></i><?php endif?>
<?php if($R['hidden']):?><i class="fa fa-lock fa-lg"></i><?php endif?>
<?php if($R['oneline']):?><span class="comment">[<?php echo $R['oneline']?>]</span><?php endif?>
<?php if(getNew($R['d_regis'],24)):?><small class="label label-danger">new</small><?php endif?>
</td>
<?php if($R['id']):?>
<td><a href="javascript:OpenWindow('<?php echo $g['s']?>/?r=<?php echo $r?>&iframe=Y&m=member&front=manager&page=post&mbruid=<?php echo $R['mbruid']?>');" title="게시정보"><?php echo $R[$_HS['nametype']]?></a></td>
<?php else:?>
<td><?php echo $R[$_HS['nametype']]?></td>
<?php endif?>
<td><strong><?php echo $R['hit']?></strong></td>
<td><?php echo $R['down']?></td>
<td><?php echo $R['score1']?></td>
<td><?php echo $R['score2']?></td>
<td><?php echo $R['report']?></td>
<td><?php echo getDateFormat($R['d_regis'],'Y.m.d H:i')?></td>
</tr>
<?php endwhile?>
</tbody>
</table>
<?php if(!$NUM):?>
<div class="rb-none">게시물이 없습니다.</div>
<?php endif?>
<div class="rb-footer clearfix">
<div class="pull-right">
<ul class="pagination">
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
<?php //echo getPageLink(5,$p,$TPG,'')?>
</ul>
</div>
<div>
<button type="button" onclick="chkFlag('comment_members[]');checkboxCheck();" class="btn btn-default btn-sm">선택/해제 </button>
<button type="button" onclick="actCheck('comment_multi_delete');" class="btn btn-default btn-sm rb-action-btn" disabled>삭제</button>
</div>
</div>
</form>
</div>
<!-- Modal -->
<div class="modal fade" id="MoveCopy" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- bootstrap-datepicker, http://eternicode.github.io/bootstrap-datepicker/ -->
<?php getImport('bootstrap-datepicker','css/datepicker3',false,'css')?>
<?php getImport('bootstrap-datepicker','js/bootstrap-datepicker',false,'js')?>
<?php getImport('bootstrap-datepicker','js/locales/bootstrap-datepicker.kr',false,'js')?>
<style type="text/css">
.datepicker {z-index: 1151 !important;}
</style>
<script>
$('.input-daterange').datepicker({
format: "yyyy/mm/dd",
todayBtn: "linked",
language: "kr",
calendarWeeks: true,
todayHighlight: true,
autoclose: true
});
</script>
<script type="text/javascript">
//<![CDATA[
// 선택박스 체크 이벤트 핸들러
$(".checkAll-post-user").click(function(){
$(".rb-post-user").prop("checked",$(".checkAll-post-user").prop("checked"));
checkboxCheck();
});
// 선택박스 체크시 액션버튼 활성화 함수
function checkboxCheck()
{
var f = document.listForm;
var l = document.getElementsByName('comment_members[]');
var n = l.length;
var i;
var j=0;
for (i = 0; i < n; i++)
{
if (l[i].checked == true) j++;
}
if (j) $('.rb-action-btn').prop("disabled",false);
else $('.rb-action-btn').prop("disabled",true);
}
// 기간 검색 적용 함수
function dropDate(date1,date2)
{
var f = document.procForm;
f.d_start.value = date1;
f.d_finish.value = date2;
f.submit();
}
function actCheck(act)
{
var f = document.listForm;
var l = document.getElementsByName('comment_members[]');
var n = l.length;
var j = 0;
var i;
var s = '';
for (i = 0; i < n; i++)
{
if(l[i].checked == true)
{
j++;
s += '['+l[i].value+']';
}
}
if (!j)
{
alert('선택된 게시물이 없습니다. ');
return false;
}
if (act == 'comment_multi_delete')
{
if(confirm('정말로 삭제하시겠습니까? '))
{
getIframeForAction(f);
f.a.value = act;
f.submit();
}
}
return false;
}
//]]>
</script>

View File

@@ -0,0 +1,436 @@
<form class="p-4" role="form" name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="config">
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
<i class="fa fa-columns fa-fw" aria-hidden="true"></i> 게시판 대표 테마
</label>
<div class="col-md-10 col-xl-9">
<select name="skin_main" class="form-control custom-select">
<option value="">선택하세요</option>
<option value="" disabled>--------------------------------</option>
<optgroup label="데스크탑">
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['skin_main']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="모바일">
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['skin_main']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
<small class="form-text text-muted">
지정된 대표테마는 게시판설정시 별도의 테마지정없이 자동으로 적용됩니다.
가장 많이 사용하는 테마를 지정해 주세요.
</small>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
<span class="badge badge-dark">게시판 모바일 대표테마</span>
</label>
<div class="col-md-10 col-xl-9">
<select name="skin_mobile" class="form-control custom-select">
<option value="">모바일 테마 사용안함</option>
<option value="" disabled>--------------------------------</option>
<optgroup label="모바일">
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['skin_mobile']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="데스크탑">
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['skin_mobile']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
<small class="form-text text-muted">
선택하지 않으면 데스크탑 대표테마로 설정됩니다.
</small>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
통합보드테마
</label>
<div class="col-md-10 col-xl-9">
<select name="skin_total" class="form-control custom-select">
<option value="">통합보드 사용안함</option>
<option value="" disabled>--------------------------------</option>
<optgroup label="데스크탑">
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['skin_main']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="모바일">
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['skin_main']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
<small class="form-text text-muted">
통합보드란 모든 게시판의 전체 게시물을 하나의 게시판으로 출력해 주는 서비스입니다.<br>
사용하시려면 통합보드용 테마를 지정해 주세요.<br>
통합보드의 호출은 <code><a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>" target="_blank"><?php echo $g['r']?>/?m=<?php echo $module?></a></code> 입니다.
</small>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<hr>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
<i class="fa fa-pencil-square-o fa-fw" aria-hidden="true"></i> 대표 에디터
</label>
<div class="col-md-10 col-xl-9">
<select name="editor_main" class="form-control custom-select">
<?php $dirs = opendir($g['path_plugin'])?>
<?php while(false !== ($tpl = readdir($dirs))):?>
<?php if(!is_file($g['path_plugin'].$tpl.'/import.desktop.php'))continue?>
<option value="<?php echo $tpl?>"<?php if($d['bbs']['editor_main']==$tpl):?> selected<?php endif?>>
ㆍ<?php echo getFolderName($g['path_plugin'].$tpl)?> (<?php echo $tpl?>)
</option>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
<span class="badge badge-dark">모바일 대표테마</span>
</label>
<div class="col-md-10 col-xl-9">
<input type="hidden" name="editor_mobile" value="">
<input type="text" readonly class="form-control-plaintext" value="모바일 기본형">
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<hr>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
<i class="fa fa-paperclip fa-fw" aria-hidden="true"></i> 파일첨부 대표 테마
</label>
<div class="col-md-10 col-xl-9">
<select name="attach_main" class="form-control custom-select">
<option value="">사용안함</option>
<option value="" disabled>--------------------------------</option>
<optgroup label="데스크탑">
<?php $mdir = $g['path_module'].'mediaset/themes/_desktop/'?>
<?php $dirs = opendir($mdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($mdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['attach_main']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($mdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="모바일">
<?php $mdir = $g['path_module'].'mediaset/themes/_mobile/'?>
<?php $dirs = opendir($mdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($mdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['attach_main']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($mdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
<small class="form-text text-muted">
지정된 대표테마는 게시판설정시 별도의 테마지정없이 자동으로 적용됩니다.
가장 많이 사용하는 테마를 지정해 주세요.
</small>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
<span class="badge badge-dark">모바일 대표테마</span>
</label>
<div class="col-md-10 col-xl-9">
<select name="attach_mobile" class="form-control custom-select">
<option value="">사용안함</option>
<option value="" disabled>--------------------------------</option>
<optgroup label="모바일">
<?php $mmdir = $g['path_module'].'mediaset/themes/_mobile/'?>
<?php $dirs = opendir($mmdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($mmdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['attach_mobile']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($mmdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="데스크탑">
<?php $mmdir = $g['path_module'].'mediaset/themes/_desktop/'?>
<?php $dirs = opendir($mmdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($mmdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['attach_mobile']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($mmdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
<small class="form-text text-muted">
선택하지 않으면 데스크탑 대표테마로 설정됩니다.
</small>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<hr>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
<i class="fa fa-comments-o fa-fw" aria-hidden="true"></i> 댓글 대표 테마
</label>
<div class="col-md-10 col-xl-9">
<select name="comment_main" class="form-control custom-select">
<option value="">사용안함</option>
<option value="" disabled>--------------------------------</option>
<optgroup label="데스크탑">
<?php $cdir = $g['path_module'].'comment/themes/_desktop/'?>
<?php $dirs = opendir($cdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($cdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['comment_main']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($cdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="모바일">
<?php $cdir = $g['path_module'].'comment/themes/_mobile/'?>
<?php $dirs = opendir($cdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($cdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['comment_main']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($cdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
<small class="form-text text-muted">
지정된 대표테마는 게시판설정시 별도의 테마지정없이 자동으로 적용됩니다.
가장 많이 사용하는 테마를 지정해 주세요.
</small>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
<span class="badge badge-dark">모바일 대표테마</span>
</label>
<div class="col-md-10 col-xl-9">
<select name="comment_mobile" class="form-control custom-select">
<option value="">사용안함</option>
<option value="" disabled>--------------------------------</option>
<optgroup label="모바일">
<?php $cmdir = $g['path_module'].'comment/themes/_mobile/'?>
<?php $dirs = opendir($cmdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($cmdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['comment_mobile']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($cmdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="데스크탑">
<?php $cmdir = $g['path_module'].'comment/themes/_desktop/'?>
<?php $dirs = opendir($cmdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($cmdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['comment_mobile']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($cmdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
<small class="form-text text-muted">
선택하지 않으면 데스크탑 대표테마로 설정됩니다.
</small>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<hr>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">RSS 발행</label>
<div class="col-md-10 col-xl-9">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="rss" name="rss" value="1" <?php if($d['bbs']['rss']):?> checked<?php endif?>>
<label class="custom-control-label" for="rss">RSS발행을 허용합니다. <small>(개별게시판별 RSS발행은 개별게시판 설정을 따름)</small></label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">게시물 출력</label>
<div class="col-md-4 col-xl-3">
<div class="input-group">
<input type="text" name="recnum" value="<?php echo $d['bbs']['recnum']?$d['bbs']['recnum']:20?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">개</span>
</div>
</div>
<small class="form-text text-muted">한페이지에 출력할 게시물의 수</small>
</div>
<label class="col-md-2 col-form-label text-md-right">제목 끊기</label>
<div class="col-md-4 col-xl-4">
<div class="input-group">
<input type="text" name="sbjcut" value="<?php echo $d['bbs']['sbjcut']?$d['bbs']['sbjcut']:40?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">자</span>
</div>
</div>
<small class="form-text text-muted">제목이 길 경우 보여줄 글자 수 </small>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">새글 유지시간</label>
<div class="col-md-4 col-xl-3">
<div class="input-group">
<input type="text" name="newtime" value="<?php echo $d['bbs']['newtime']?$d['bbs']['newtime']:24?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">시간</span>
</div>
</div>
<small class="form-text text-muted">새글로 인식되는 시간</small>
</div>
<label class="col-md-2 col-form-label text-md-right">답글 인식문자</label>
<div class="col-md-4 col-xl-4">
<input type="text" name="restr" value="<?php echo $d['bbs']['restr']?>" class="form-control">
<small class="form-text text-muted">제목이 길 경우 보여줄 글자 수 </small>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">평가 제한</label>
<div class="col-md-10 col-xl-9">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="denylikemy" name="denylikemy" value="1" <?php if($d['bbs']['denylikemy']):?> checked<?php endif?>>
<label class="custom-control-label" for="denylikemy">내글에 대한 좋아요와 싫어요 참여를 제한합니다.</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">삭제 제한</label>
<div class="col-md-10 col-xl-9">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="replydel" name="replydel" value="1" <?php if($d['bbs']['replydel']):?> checked<?php endif?>>
<label class="custom-control-label" for="replydel">답변글이 있는 원본글의 삭제를 제한합니다.</label>
</div>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="commentdel" name="commentdel" value="1" <?php if($d['bbs']['commentdel']):?> checked<?php endif?>>
<label class="custom-control-label" for="commentdel">댓글이 있는 원본글의 삭제를 제한합니다.</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">불량글 처리</label>
<div class="col-md-10 col-xl-9">
<div class="form-inline">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="singo_del"name="singo_del" value="1" <?php if($d['bbs']['singo_del']):?> checked<?php endif?> >
<label class="custom-control-label" for="singo_del">신고건 수가</label>
</div>
<div class="input-group ml-3">
<input type="text" name="singo_del_num" value="<?php echo $d['bbs']['singo_del_num']?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">건 이상인 경우</span>
</div>
</div>
<select name="singo_del_act" class="form-control custom-select ml-2">
<option value="1"<?php if($d['bbs']['singo_del_act']==1):?> selected="selected"<?php endif?>>자동삭제</option>
<option value="2"<?php if($d['bbs']['singo_del_act']==2):?> selected="selected"<?php endif?>>비밀처리</option>
</select>
</div> <!-- .form-inline -->
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">제한단어</label>
<div class="col-md-10 col-xl-9">
<textarea name="badword" rows="5" class="form-control"><?php echo $d['bbs']['badword']?></textarea>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">제한단어 처리</label>
<div class="col-sm-10">
<div class="custom-control custom-radio">
<input type="radio" id="badword_action_0" class="custom-control-input" name="badword_action" value="0" <?php if($d['bbs']['badword_action']==0):?> checked<?php endif?>>
<label class="custom-control-label" for="badword_action_0">제한단어 체크하지 않음</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="badword_action_1" class="custom-control-input" name="badword_action" value="1"<?php if($d['bbs']['badword_action']==1):?> checked<?php endif?>>
<label class="custom-control-label" for="badword_action_1">등록을 차단함</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="badword_action_2" class="custom-control-input" name="badword_action" value="2"<?php if($d['bbs']['badword_action']==2):?> checked<?php endif?>>
<label class="custom-control-label" for="badword_action_2">
제한단어를 다음의 문자로 치환하여 등록함
<input type="text" name="badword_escape" value="<?php echo $d['bbs']['badword_escape']?>" maxlength="1" class="d-inline form-control form-control-sm">
</label>
</div>
</div><!-- .col-sm-10 -->
</div>
<div class="row">
<div class="offset-md-2 col-md-10 col-xl-9">
<button type="submit" class="btn btn-outline-primary btn-block my-4">저장하기</button>
</div>
</div>
</form>
<script type="text/javascript">
putCookieAlert('bbs_config_result') // 실행결과 알림 메시지 출력
$('[data-role="siteSelector"]').removeClass('d-none') //사이트 셀렉터 출력
function saveCheck(f)
{
if (f.skin_main.value == '')
{
alert('대표테마를 선택해 주세요. ');
f.skin_main.focus();
return false;
}
// if (f.skin_mobile.value == '')
// {
// alert('모바일테마를 선택해 주세요. ');
// f.skin_mobile.focus();
// return false;
// }
getIframeForAction(f);
f.submit();
}
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

View File

@@ -0,0 +1 @@
h6 {text-align: left;width: auto;line-height: 160%}

417
modules/bbs/admin/main.php Normal file
View File

@@ -0,0 +1,417 @@
<?php
include $g['path_module'].$module.'/var/var.php';
$bbs_time=$d['bbs']['time']; // 아래 $d 배열과 충돌을 피하기 위해서 별도로 지정
$sort = $sort ? $sort : 'gid';
$orderby= $orderby ? $orderby : 'desc';
$recnum = $recnum && $recnum < 301 ? $recnum : 30;
$bbsque = 'uid';
$account = $SD['uid'];
if ($account) $bbsque .= ' and site='.$account;
if ($where && $keyw)
{
if (strstr('[id]',$where)) $bbsque .= " and ".$where."='".$keyw."'";
else $bbsque .= getSearchSql($where,$keyw,$ikeyword,'or');
}
$RCD = getDbArray($table[$module.'list'],$bbsque,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table[$module.'list'],$bbsque);
$TPG = getTotalPage($NUM,$recnum);
$_LEVELNAME = array('l0'=>'전체허용');
$_LEVELDATA=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1);
while($_L=db_fetch_array($_LEVELDATA)) $_LEVELNAME['l'.$_L['uid']] = $_L['name'].' 이상';
$SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1);
$SITEN = db_num_rows($SITES);
?>
<div class="row">
<div class="col-sm-4 col-md-4 col-xl-3 d-none sidebar">
<div id="accordion" role="tablist" style="height: calc(100vh - 10rem);">
<form name="procForm" action="<?php echo $g['s']?>/" method="get">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="module" value="<?php echo $module?>">
<input type="hidden" name="front" value="<?php echo $front?>">
<div class="card">
<div class="card-header p-0">
<a class="d-block muted-link collapsed" href="#collapse-sort" data-toggle="collapse" role="button" aria-expanded="true" aria-controls="collapse-sort">
정렬
</a>
</div>
<div id="collapse-sort" class="collapse" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
<div class="btn-group btn-group-toggle btn-group-sm mb-2" data-toggle="buttons">
<label class="btn btn-light<?php if($sort=='gid'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="gid" name="sort"<?php if($sort=='gid'):?> checked<?php endif?>> 지정순서
</label>
<label class="btn btn-light<?php if($sort=='uid'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="uid" name="sort"<?php if($sort=='uid'):?> checked<?php endif?>> 개설일
</label>
<label class="btn btn-light<?php if($sort=='num_r'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="num_r" name="sort"<?php if($sort=='num_r'):?> checked<?php endif?>> 게시물수
</label>
<label class="btn btn-light<?php if($sort=='d_last'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="d_last" name="sort"<?php if($sort=='d_last'):?> checked<?php endif?>> 최근게시
</label>
</div>
<div class="btn-group btn-group-toggle btn-group-sm mb-3" data-toggle="buttons">
<label class="btn btn-light<?php if($orderby=='desc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="desc" name="orderby"<?php if($orderby=='desc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-desc"></i> 정순
</label>
<label class="btn btn-light<?php if($orderby=='asc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="asc" name="orderby"<?php if($orderby=='asc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-asc"></i> 역순
</label>
</div>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">출력수</span>
</div>
<select name="recnum" onchange="this.form.submit();" class="form-control custom-select">
<option value="20"<?php if($recnum==20):?> selected="selected"<?php endif?>>20 개</option>
<option value="35"<?php if($recnum==35):?> selected="selected"<?php endif?>>35 개</option>
<option value="50"<?php if($recnum==50):?> selected="selected"<?php endif?>>50 개</option>
<option value="75"<?php if($recnum==75):?> selected="selected"<?php endif?>>75 개</option>
<option value="90"<?php if($recnum==90):?> selected="selected"<?php endif?>>90 개</option>
</select>
</div>
</div>
</div>
</div> <!-- .card -->
<div class="card">
<div class="card-header p-0">
<a class="collapsed d-block muted-link" href="#collapse-search" data-toggle="collapse" href="#collapse-search" role="button" aria-expanded="false" aria-controls="collapse-search">
게시판 검색
</a>
</div>
<div class="collapse<?php if($_SESSION['sh_mediaset']):?> show<?php endif?>" id="collapse-search">
<div class="card-body">
<div class="input-group mb-3">
<select name="where" class="form-control custom-select" style="width: 30px">
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>게시판명</option>
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
</select>
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control">
</div>
<button class="btn btn-outline-secondary" type="submit">검색</button>
</div>
</div>
</div>
<!-- 고급검색 시작 -->
<div id="search-more" class="collapse<?php if($_SESSION['sh_mediaset']):?> in<?php endif?>">
<div class="form-group">
<label class="col-sm-1 control-label">검색</label>
<div class="col-sm-10">
<div class="input-group input-group-sm">
<span class="input-group-btn hidden-xs" style="width:165px">
<select name="where" class="form-control btn btn-light">
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>게시판명</option>
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
</select>
</span>
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control">
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">검색</button>
</span>
<span class="input-group-btn">
<button class="btn btn-light" type="button" onclick="location.href='<?php echo $g['adm_href']?>';">리셋</button>
</span>
</div>
</div>
</div> <!-- .form-group -->
</div>
<!-- 고급검색 끝 -->
<div class="form-group">
<div class="col-sm-offset-1 col-sm-10">
<button type="button" class="btn btn-link rb-advance<?php if(!$_SESSION['sh_mediaset']):?> collapsed<?php endif?>" data-toggle="collapse" data-target="#search-more" onclick="sessionSetting('sh_mediaset','1','','1');">고급검색 <small></small></button>
</div>
</div>
</form>
</div> <!-- .rb-heading well well-sm : 검색영역 회색 박스 -->
<?php if($NUM):?>
<div class="p-2">
<a href="<?php echo $g['adm_href']?>" class="btn btn-light btn-block">검색조건 초기화</a>
<a href="<?php echo $g['adm_href']?>&amp;front=main_detail" class="btn btn-outline-primary btn-block">
<i class="fa fa-plus"></i> 새 게시판 만들기
</a>
</div>
<?php endif?>
</div><!-- /.sidebar -->
<div class="col-sm-12 col-md-12 col-xl-12">
<div class="card p-2 mb-0 bg-dark d-flex justify-content-between pr-4">
<form class="form-inline" name="procForm" action="<?php echo $g['s']?>/" method="get">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="module" value="<?php echo $module?>">
<input type="hidden" name="front" value="<?php echo $front?>">
<select class="form-control custom-select" name="sort" onchange="this.form.submit();">
<option value="gid" selected="selected">지정순서</option>
<option value="uid">개설일</option>
<option value="num_r">게시물수</option>
<option value="d_last">최근게시</option>
</select>
<select class="form-control custom-select" name="orderby" onchange="this.form.submit();">
<option value="desc">역순</option>
<option value="asc" selected="selected">정순</option>
</select>
<select class="form-control custom-select mr-sm-2" name="recnum" onchange="this.form.submit();">
<option value="30" selected="selected">30개</option>
<option value="60">60개</option>
<option value="90">90개</option>
<option value="120">120개</option>
<option value="150">150개</option>
<option value="180">180개</option>
<option value="210">210개</option>
<option value="240">240개</option>
<option value="270">270개</option>
<option value="300">300개</option>
</select>
<select class="form-control custom-select mr-sm-1" name="where">
<option value="name">게시판명</option>
<option value="id">아이디</option>
</select>
<label class="sr-only" for="inlineFormInputName2">검색</label>
<input type="text" class="form-control mr-sm-2" placeholder="" name="keyw" value="<?php echo stripslashes($keyw)?>" >
<button type="submit" class="btn btn-light">검색</button>
<button type="button" class="btn btn-light" onclick="location.href='<?php echo $g['adm_href']?>';">리셋</button>
<?php if ($NUM): ?>
<a href="<?php echo $g['adm_href']?>&amp;front=main_detail" class="btn btn-outline-primary ml-auto">
<i class="fa fa-plus"></i> 새 게시판 만들기
</a>
<?php endif; ?>
</form>
</div>
<?php if($NUM):?>
<!-- 리스트 시작 -->
<form class="card rounded-0 border-0" name="listForm" action="<?php echo $g['s']?>/" method="post">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="">
<div class="table-responsive">
<table class="table table-striped text-center mb-0">
<thead class="small text-muted">
<tr>
<th class="py-0"><label data-tooltip="tooltip" title="선택"><input type="checkbox" class="checkAll-email-user"></label></th>
<th>번호</th>
<th>아이디</th>
<th>게시판명</th>
<th>게시물</th>
<th>최근게시</th>
<th>분류</th>
<th>연결</th>
<th>레이아웃</th>
<th>접근권한</th>
<th>포인트</th>
<th>관리</th>
</tr>
</thead>
<?php while($R=db_fetch_array($RCD)):?>
<?php $L=getOverTime($date['totime'],$R['d_last'])?>
<?php $d=array();include $g['path_var'].$module.'/var.'.$R['id'].'.php';?>
<?php
$sbj_tooltip.='최신글제외 : '.($d['bbs']['display']?'Yes':'No').'<br />';
$sbj_tooltip.='쿼리생략 : '.($d['bbs']['hidelist']?'Yes':'No').'<br />';
$sbj_tooltip.='RSS발행 : '.($d['bbs']['rss']?'Yes':'No').'<br />';
$sbj_tooltip.='조회수증가 : '.($d['bbs']['hitcount']?'계속증가':'1회만증가(세션적용)').'<br />';
$sbj_tooltip.='게시물출력수 : '.$d['bbs']['recnum'].'개<br />';
$sbj_tooltip.='제목끊기 : '.$d['bbs']['sbjcut'].'자<br />';
$sbj_tooltip.='새글유지 : '.$d['bbs']['newtime'].'시간<br />';
$sbj_tooltip.='추가관리자 : '.($d['bbs']['admin']?$d['bbs']['admin']:'없음').'<br />';
$lay_tooltip .='레이아웃 : '.($d['bbs']['layout']?'':'사이트 대표레이아웃').'<br />';
$lay_tooltip .='게시판테마(desktop) : '.($d['bbs']['skin']?getFolderName($g['path_module'].$module.'/theme/'.$d['bbs']['skin']).'('.basename($d['bbs']['skin']).')':'대표테마').'<br />';
$lay_tooltip .='게시판테마(mobile) : '.($d['bbs']['m_skin']?getFolderName($g['path_module'].$module.'/theme/'.$d['bbs']['m_skin']).'('.basename($d['bbs']['m_skin']).')':'대표테마').'<br />';
$lay_tooltip .='댓글테마(desktop) : '.($d['bbs']['cskin']?getFolderName( $g['path_module'].'comment/theme/'.$d['bbs']['cskin']).'('.basename($d['bbs']['cskin']).')':'대표테마').'<br />';
$lay_tooltip .='댓글테마(mobile) : '.($d['bbs']['c_mskin']?getFolderName($g['path_module'].'comment/theme/'.$d['bbs']['c_mskin']).'('.basename($d['bbs']['c_mskin']).')':'대표테마').'<br />';
$perm_tooltip .='목록 : '.$_LEVELNAME['l'.$d['bbs']['perm_l_list']].'<br />';
$perm_tooltip .='열람 : '.$_LEVELNAME['l'.$d['bbs']['perm_l_view']].'<br />';
$perm_tooltip .='쓰기 : '.$_LEVELNAME['l'.$d['bbs']['perm_l_write']].'<br />';
$perm_tooltip .='다운 : '.$_LEVELNAME['l'.$d['bbs']['perm_l_down']].'<br />';
$point_tooltip .='등록 : '.number_format($d['bbs']['point1']).'P 지급<br />';
$point_tooltip .='열람 : '.number_format($d['bbs']['point2']).'P 차감<br />';
$point_tooltip .='다운 : '.number_format($d['bbs']['point3']).'P 차감';
?>
<tr>
<td><input type="checkbox" name="bbs_members[]" value="<?php echo $R['uid']?>" class="rb-email-user" onclick="checkboxCheck();"/></td>
<td><?php echo $NUM-((($p-1)*$recnum)+$_rec++)?></td>
<td><a href="<?php echo RW('m='.$module.'&bid='.$R['id'])?>" target="_blank"><?php echo $R['id']?></a></td>
<td><input class="form-control" type="text" name="name_<?php echo $R['uid']?>" value="<?php echo $R['name']?>" data-toggle="popover" data-content="<?php echo $sbj_tooltip?>"></td>
<td>
<span class="badge badge-pill badge-dark"><?php echo number_format($R['num_r'])?></span>
</td>
<td>
<time class="small text-muted" data-plugin="timeago" datetime="<?php echo getDateFormat($R['d_last'],'c')?>">
<?php echo getDateFormat($R['d_last'],'Y.m.d')?>
</time>
<?php if(getNew($R['d_last'],24)):?> <small class="text-danger">N</small><?php endif?>
</td>
<td>
<span class="badge badge-pill badge-dark"><?php echo $R['category']?'Y':'N'?></span>
</td>
<td>
<span class="badge badge-pill badge-dark"><?php echo $d['bbs']['sosokmenu']?'<span>Y</span>':'N'?></span>
</td>
<td><span data-toggle="popover" data-content="<?php echo $lay_tooltip?>" class="badge badge-pill badge-dark"><?php echo $d['bbs']['layout']?'<i>Y</i>':'N'?> / <?php echo $d['bbs']['skin']?'<i>Y</i>':'N'?> / <?php echo $d['bbs']['c_skin']?'<i>Y</i>':'N'?></span></td>
<td><span data-toggle="popover" data-content="<?php echo $perm_tooltip?>" class="badge badge-pill badge-dark"><?php echo $d['bbs']['perm_l_list']?> / <?php echo $d['bbs']['perm_l_view']?> / <?php echo $d['bbs']['perm_l_write']?></span></td>
<td><span data-toggle="popover" data-content="<?php echo $point_tooltip?>" class="badge badge-pill badge-dark"><?php echo number_format($d['bbs']['point1'])?> / <?php echo number_format($d['bbs']['point2'])?> / <?php echo number_format($d['bbs']['point3'])?></span></td>
<td>
<a class="btn btn-light" href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>&amp;a=deletebbs&amp;uid=<?php echo $R['uid']?>" onclick="return hrefCheck(this,true,'삭제하시면 모든 게시물이 지워지며 복구할 수 없습니다.\n정말로 삭제하시겠습니까?');" class="del">삭제</a>
<a class="btn btn-light" href="<?php echo $g['adm_href']?>&amp;front=main_detail&amp;uid=<?php echo $R['uid']?>&amp;account=<?php echo $account?>">설정</a>
</td>
</tr>
<?php endwhile?>
</table>
</div><!-- /.table-responsive -->
<div class="card-footer d-flex justify-content-between">
<div>
<button type="button" onclick="chkFlag('bbs_members[]');checkboxCheck();" class="btn btn-sm btn-light">선택/해제</button>
<button type="button" onclick="actCheck('multi_config');" class="btn btn-sm btn-light" id="rb-action-btn">수정</button>
</div>
<ul class="pagination">
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
<?php //echo getPageLink(5,$p,$TPG,'')?>
</ul>
</div><!-- .card-footer -->
</form><!-- .card -->
<?php else: ?>
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 10rem);">
<div><i class="fa fa-exclamation-circle fa-3x mb-3" aria-hidden="true"></i>
<p>등록된 게시판이 없습니다.</p>
<a href="<?php echo $g['adm_href']?>&amp;front=main_detail" class="btn btn-outline-primary btn-block">
<i class="fa fa-plus"></i> 새 게시판 만들기
</a>
</div>
</div>
<?php endif?>
</div>
</div><!-- /.row -->
<!-- timeago -->
<?php getImport('jquery-timeago','jquery.timeago','1.6.1','js')?>
<?php getImport('jquery-timeago','locales/jquery.timeago.ko','1.6.1','js')?>
<!-- basic -->
<script>
$(function () {
//사이트 셀렉터 출력
$('[data-role="siteSelector"]').removeClass('d-none')
$('[data-plugin="timeago"]').timeago();
$('[data-toggle="popover"]').popover({
html: true,
trigger: 'hover'
})
putCookieAlert('result_bbs_main') // 실행결과 알림 메시지 출력
})
$(".checkAll-file-user").click(function(){
$(".rb-file-user").prop("checked",$(".checkAll-file-user").prop("checked"));
checkboxCheck();
});
function checkboxCheck()
{
var f = document.listForm;
var l = document.getElementsByName('bbs_members[]');
var n = l.length;
var i;
var j=0;
for (i = 0; i < n; i++)
{
if (l[i].checked == true) j++;
}
if (j) getId('rb-action-btn').disabled = false;
else getId('rb-action-btn').disabled = true;
}
function dropDate(date1,date2)
{
var f = document.procForm;
f.d_start.value = date1;
f.d_finish.value = date2;
f.submit();
}
function actCheck(act)
{
var f = document.listForm;
var l = document.getElementsByName('bbs_members[]');
var n = l.length;
var j = 0;
var i;
for (i = 0; i < n; i++)
{
if(l[i].checked == true)
{
j++;
}
}
if (!j)
{
alert('선택된 게시판이 없습니다. ');
return false;
}
if (act == 'multi_config')
{
if (confirm('정말로 실행하시겠습니까? '))
{
getIframeForAction(f);
f.a.value = act;
f.submit();
}
}
return false;
}
</script>

View File

@@ -0,0 +1,804 @@
<?php
$SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1);
$sort = $sort ? $sort : 'gid';
$orderby= $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 301 ? $recnum : 20;
$bbsque ='uid>0';
$account = $SD['uid'];
if ($account) $bbsque .= ' and site='.$account;
// 키원드 검색 추가
if ($keyw)
{
$bbsque .= " and (id like '%".$keyw."%' or name like '%".$keyw."%')";
}
$RCD = getDbArray($table[$module.'list'],$bbsque,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table[$module.'list'],$bbsque);
$TPG = getTotalPage($NUM,$recnum);
if ($uid)
{
$R = getUidData($table[$module.'list'],$uid);
if ($R['uid'])
{
include_once $g['path_module'].$module.'/var/var.php';
include_once $g['path_var'].$module.'/var.'.$R['id'].'.php';
}
}
?>
<div class="row no-gutters">
<div class="col-sm-4 col-md-4 col-xl-3 d-none d-sm-block sidebar">
<div id="accordion" role="tablist">
<div class="card border-0">
<div class="card-header p-0" role="tab" id="headingOne">
<a class="muted-link d-block" data-toggle="collapse" href="#collapseOne" role="button" aria-expanded="true" aria-controls="collapseOne">
게시판 목록
</a>
</div>
<div id="collapseOne" class="collapse show" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
<div class="list-group list-group-flush" style="height: calc(100vh - 17rem);">
<?php if($NUM):?>
<?php $_i=1;while($BR = db_fetch_array($RCD)):?>
<a href="<?php echo $g['adm_href']?>&amp;recnum=<?php echo $recnum?>&amp;p=<?php echo $p?>&amp;uid=<?php echo $BR['uid']?>&amp;account=<?php echo $account?>" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center<?php if($uid==$BR['uid']):?> active<?php endif?>">
<?php echo $BR['name']?>(<?php echo $BR['id']?>)
<span class="badge badge-dark badge-pill ml-auto"><?php echo number_format($BR['num_r'])?></span>
</a>
<?php $_i++;endwhile?>
<?php else:?>
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 15.6rem);">
<div><i class="fa fa-exclamation-circle fa-3x mb-2" aria-hidden="true"></i> <br>등록된 게시판이 없습니다. </div>
</div>
<?php endif?>
</div>
<div class="card-footer p-1">
<a href="" class="btn btn-link btn-sm btn-block muted-link"><i class="fa fa-cog"></i> 게시판 정열 및 검색</a>
</div>
<div class="card-footer">
<a href="<?php echo $g['adm_href']?>&amp;front=main_detail" class="btn btn-outline-primary btn-block"><i class="fa fa-plus"></i> 새 게시판 만들기</a>
</div>
</div>
</div>
<div class="card">
<div class="card-header p-0" role="tab" id="headingTwo">
<a class="d-block collapsed muted-link" data-toggle="collapse" href="#collapseTwo" role="button" aria-expanded="false" aria-controls="collapseTwo">
순서변경
</a>
</div>
<div id="collapseTwo" class="collapse" role="tabpanel" aria-labelledby="headingTwo" data-parent="#accordion">
<?php if($NUM):?>
<form name="bbsform" role="form" action="<?php echo $g['s']?>/" method="post" target="_orderframe_">
<input type="hidden" name="account" value="<?php echo $account?>" />
<input type="hidden" name="m" value="<?php echo $module?>" />
<input type="hidden" name="a" value="bbsorder_update" />
<div class="dd" id="nestable-menu">
<ul class="dd-list list-unstyled">
<?php $_i=1;while($BR = db_fetch_array($RCD)):?>
<li class="dd-item" data-id="<?php echo $_i?>">
<input type="checkbox" name="bbsmembers[]" value="<?php echo $BR['uid']?>" checked class="hidden"/>
<span class="dd-handle <?php if($BR['uid']==$R['uid']):?>alert alert-info<?php endif?>" ><i class="fa fa-arrows fa-fw"></i>
<?php echo $BR['name']?>(<?php echo $BR['id']?>)
</span>
<span title="<?php echo number_format($BR['num_r'])?>개" data-tootip="tooltip">
<a href="<?php echo $g['adm_href']?>&amp;recnum=<?php echo $recnum?>&amp;p=<?php echo $p?>&amp;uid=<?php echo $BR['uid']?>" data-tooltip="tooltip" title="수정하기">
<i class="glyphicon glyphicon-edit"></i>
</a>
</span>
</li>
<?php $_i++;endwhile?>
</ul>
</div>
</form>
<!-- nestable : https://github.com/dbushell/Nestable -->
<?php getImport('nestable','jquery.nestable',false,'js') ?>
<script>
$('#nestable-menu').nestable();
$('.dd').on('change', function() {
var f = document.bbsform;
getIframeForAction(f);
f.submit();
});
</script>
<?php else:?>
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 15.6rem);">
<div><i class="fa fa-exclamation-circle fa-3x mb-2" aria-hidden="true"></i> <br>등록된 게시판이 없습니다. </div>
</div>
<?php endif?>
</div>
</div>
</div>
<div class="card d-none"> <!-- 메뉴 리스트 패털 시작 -->
<!-- 메뉴 패널 헤더 : 아이콘 & 제목 -->
<div class="card-header">
<h4>게시판 리스트</h4>
<span class="pull-right">
<button type="button" class="btn btn-light btn-xs<?php if(!$_SESSION['sh_site_bbs_search']):?> collapsed<?php endif?>" data-toggle="collapse" data-target="#panel-search" data-tooltip="tooltip" title="검색필터" onclick="sessionSetting('sh_site_bbs_search','1','','1');getSearchFocus();">
<i class="fa fa-search"></i>
</button>
</span>
</div>
<div id="panel-search" class="collapse<?php if($_SESSION['sh_site_bbs_search']):?> in<?php endif?>">
<form role="form" action="<?php echo $g['s']?>/" method="get">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="module" value="<?php echo $module?>">
<input type="hidden" name="front" value="<?php echo $front?>">
<div class="panel-heading rb-search-box">
<div class="input-group">
<div class="input-group-addon"><small>출력수</small></div>
<div class="input-group-btn">
<select class="form-control" name="recnum" onchange="this.form.submit();">
<option value="15"<?php if($recnum==15):?> selected<?php endif?>>15</option>
<option value="30"<?php if($recnum==30):?> selected<?php endif?>>30</option>
<option value="60"<?php if($recnum==60):?> selected<?php endif?>>60</option>
<option value="100"<?php if($recnum==100):?> selected<?php endif?>>100</option>
</select>
</div>
</div>
</div>
<div class="rb-keyword-search input-group input-group-sm">
<input type="text" name="keyw" class="form-control" value="<?php echo $keyw?>" placeholder="아이디 or 이름">
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">검색</button>
</span>
</div>
</form>
</div>
<div class="panel-body" style="border-top:1px solid #DEDEDE;">
</div>
<div class="card-footer">
<ul class="pagination justify-content-center">
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
<?php //echo getPageLink(5,$p,$TPG,'')?>
</ul>
</div>
<div class="card-footer">
<a href="<?php echo $g['adm_href']?>&amp;front=main_detail" class="btn btn-outline-primary btn-block">
<i class="fa fa-plus"></i> 새 게시판 만들기
</a>
</div>
</div> <!-- 좌측 패널 끝 -->
</div><!-- 좌측 내용 끝 -->
<!-- 우측 내용 시작 -->
<div id="tab-content-view" class="col-sm-8 col-md-8 ml-sm-auto col-xl-9">
<form name="procForm" class="card rounded-0 border-0" role="form" action="<?php echo $g['s']?>/" method="post" enctype="multipart/form-data" onsubmit="return saveCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="makebbs">
<input type="hidden" name="bid" value="<?php echo $R['id']?>">
<?php if (!$uid): ?><input type="hidden" name="site" value="<?php echo $account?>"><?php endif; ?>
<input type="hidden" name="perm_g_list" value="<?php echo $R['perm_g_list']?>">
<input type="hidden" name="perm_g_view" value="<?php echo $R['perm_g_view']?>">
<input type="hidden" name="perm_g_write" value="<?php echo $R['perm_g_write']?>">
<input type="hidden" name="perm_g_down" value="<?php echo $R['perm_g_down']?>">
<div class="card-header d-flex justify-content-between align-items-center">
<?php if($R['uid']):?>
<span>게시판 등록정보 <span class="badge badge-primary badge-pill align-text-bottom"><?php echo $R['name']?></span></span>
<?php else:?>
새 게시판 만들기
<?php endif?>
<a href="<?php echo $g['adm_href']?>&amp;front=main">
게시판 목록
</a>
</div>
<div class="card-body">
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">게시판 이름 <small class="text-danger">*</small></label>
<div class="col-lg-10 col-xl-9">
<div class="input-group">
<input class="form-control" placeholder="" type="text" name="name" value="<?php echo $R['name']?>"<?php if(!$R['uid']):?> autofocus<?php endif?> required autocomplete="off">
<?php if($R['uid']):?>
<div class="input-group-append">
<a href="<?php echo RW('m='.$module.'&bid='.$R['id'])?>" target="_blank" class="btn btn-light" data-tooltip="tooltip" title="게시판 보기">
<i class="fa fa-link fa-lg"></i>
</a>
</div>
<?php endif?>
</div>
<small class="form-text text-muted">게시판제목에 해당되며 한글,영문등 자유롭게 등록할 수 있습니다.</small>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">게시판 아이디 <small class="text-danger">*</small></label>
<div class="col-lg-10 col-xl-9">
<div class="input-group">
<input class="form-control" placeholder="" type="text" name="id" value="<?php echo $R['id']?>" <?php if($R['uid']):?>readonly<?php endif?> required autocomplete="off">
<?php if($R['uid']):?>
<div class="input-group-append">
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>&amp;a=deletebbs&amp;uid=<?php echo $R['uid']?>" onclick="return hrefCheck(this,true,'삭제하시면 모든 게시물이 지워지며 복구할 수 없습니다.\n정말로 삭제하시겠습니까?');" class="btn btn-light" data-tooltip="tooltip" title="삭제하기">
<i class="fa fa-trash-o fa-lg"></i>
</a>
</div>
<?php endif?>
</div>
<small class="form-text text-muted">영문 대소문자+숫자+_ 조합으로 만듭니다.</small>
</div>
</div>
<div<?php echo $uid?'':' class="d-none"' ?>>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">카테고리</label>
<div class="col-lg-10 col-xl-9">
<input class="form-control" placeholder="" type="text" name="category" value="<?php echo $R['category']?>">
<small class="form-text text-muted">
분류를 <strong>콤마(,)</strong>로 구분해 주세요. <strong>첫분류는 분류제목</strong>이 됩니다.<br>
보기)<strong>구분</strong>,유머,공포,엽기,무협,기타
</small>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">레이아웃</label>
<div class="col-lg-10 col-xl-9">
<select name="layout" class="form-control custom-select">
<option value="">사이트 대표 레이아웃</option>
<option disabled>--------------------</option>
<?php $dirs = opendir($g['path_layout'])?>
<?php while(false !== ($tpl = readdir($dirs))):?>
<?php if($tpl=='.' || $tpl == '..' || $tpl == '_blank' || is_file($g['path_layout'].$tpl))continue?>
<?php $dirs1 = opendir($g['path_layout'].$tpl)?>
<optgroup label="<?php echo getFolderName($g['path_layout'].$tpl)?>">
<?php while(false !== ($tpl1 = readdir($dirs1))):?>
<?php if(!strstr($tpl1,'.php') || $tpl1=='_main.php')continue?>
<option value="<?php echo $tpl?>/<?php echo $tpl1?>"<?php if($d['bbs']['layout']==$tpl.'/'.$tpl1):?> selected="selected"<?php endif?>><?php echo $tpl?> &gt; <?php echo str_replace('.php','',$tpl1)?></option>
<?php endwhile?>
</optgroup>
<?php closedir($dirs1)?>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">
<span class="badge badge-dark">모바일 접속</span>
</label>
<div class="col-lg-10 col-xl-9">
<?php if ($R['uid']): ?>
<select name="m_layout" class="form-control custom-select" id="" tabindex="-1">
<?php if ($_HS['m_layout']): ?>
<option value="0">사이트 레이아웃</option>
<?php else: ?>
<option value="0">&nbsp;사용안함 (기본 레이아웃 적용)</option>
<?php endif; ?>
<option disabled>--------------------</option>
<?php $dirs = opendir($g['path_layout'])?>
<?php while(false !== ($tpl = readdir($dirs))):?>
<?php if($tpl=='.' || $tpl == '..' || $tpl == '_blank' || is_file($g['path_layout'].$tpl))continue?>
<?php $dirs1 = opendir($g['path_layout'].$tpl)?>
<optgroup label="<?php echo getFolderName($g['path_layout'].$tpl)?>">
<?php while(false !== ($tpl1 = readdir($dirs1))):?>
<?php if(!strstr($tpl1,'.php') || $tpl1=='_main.php')continue?>
<option value="<?php echo $tpl?>/<?php echo $tpl1?>"<?php if($d['bbs']['m_layout']==$tpl.'/'.$tpl1):?> selected="selected"<?php endif?>><?php echo $tpl?> &gt; <?php echo str_replace('.php','',$tpl1)?></option>
<?php endwhile?>
</optgroup>
<?php closedir($dirs1)?>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
<?php else: ?>
<!-- 게시판 신규생성시 모바일 레이아웃을 blank.php를 기본값으로 적용 -->
<?php
$_m_layoutExp1=explode('/',$_HS['m_layout']);
$m_layout_bbs = $_m_layoutExp1[0].'/blank-drawer.php';
?>
<input type="hidden" name="m_layout" value="<?php echo $m_layout_bbs ?>">
<?php endif; ?>
</div>
</div>
<hr>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right"><i class="fa fa-columns fa-lg fa-fw" aria-hidden="true"></i> 테마 </label>
<div class="col-lg-10 col-xl-9">
<select name="skin" class="form-control custom-select">
<?php $_skinHexp=explode('/',$d['bbs']['skin_main'])?>
<option value="">게시판 대표테마 (<?php echo $d['bbs']['skin_main']?$_skinHexp[1]:'사용안함'?>)</option>
<option disabled>--------------------</option>
<optgroup label="데스크탑">
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['skin']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="모바일">
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['skin']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right"><span class="badge badge-dark">모바일 접속</span></label>
<div class="col-lg-10 col-xl-9">
<select name="m_skin" class="form-control custom-select">
<?php $_skinmHexp=explode('/',$d['bbs']['skin_mobile'])?>
<option value="">게시판 모바일 대표테마 (<?php echo $d['bbs']['skin_mobile']?$_skinmHexp[1]:'사용안함'?>)</option>
<option disabled>--------------------</option>
<optgroup label="모바일">
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['m_skin']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="데스크탑">
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['m_skin']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<hr>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right"><i class="fa fa-pencil-square-o fa-lg fa-fw" aria-hidden="true"></i> 에디터</label>
<div class="col-lg-10 col-xl-9">
<select name="editor" class="form-control custom-select">
<option value="">테마 지정안함</option>
<option disabled>--------------------</option>
<?php $dirs = opendir($g['path_plugin'])?>
<?php while(false !== ($tpl = readdir($dirs))):?>
<?php if(!is_file($g['path_plugin'].$tpl.'/import.desktop.php'))continue?>
<option value="<?php echo $tpl?>"<?php if($d['bbs']['editor']==$tpl):?> selected<?php endif?>>
ㆍ<?php echo getFolderName($g['path_plugin'].$tpl)?> (<?php echo $tpl?>)
</option>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right"><span class="badge badge-dark">모바일 접속</span></label>
<div class="col-lg-10 col-xl-9">
<input type="hidden" name="m_editor" value="">
<input type="text" readonly class="form-control-plaintext" value="모바일 기본형">
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<hr>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right"><i class="fa fa-paperclip fa-fw fa-lg" aria-hidden="true"></i> 파일첨부</label>
<div class="col-lg-10 col-xl-9">
<select name="a_skin" class="form-control custom-select">
<?php $_attachHexp=explode('/',$d['bbs']['attach_main'])?>
<option value="">테마 지정안함</option>
<option disabled>--------------------</option>
<optgroup label="데스크탑">
<?php $a_dir = $g['path_module'].'mediaset/themes/_desktop/'?>
<?php $dirs = opendir($a_dir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($a_dir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['a_skin']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($a_dir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="모바일">
<?php $a_dir = $g['path_module'].'mediaset/themes/_mobile/'?>
<?php $dirs = opendir($a_dir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($a_dir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['a_skin']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($a_dir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right"><span class="badge badge-dark">모바일 접속</span></label>
<div class="col-lg-10 col-xl-9">
<select name="a_mskin" class="form-control custom-select">
<?php $_attachmHexp=explode('/',$d['bbs']['attach_mobile'])?>
<option value="">테마 지정안함</option>
<option disabled>--------------------</option>
<optgroup label="모바일">
<?php $a_mdir = $g['path_module'].'mediaset/themes/_mobile/'?>
<?php $dirs = opendir($a_mdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($a_mdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['a_mskin']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($a_mdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="데스크탑">
<?php $a_mdir = $g['path_module'].'mediaset/themes/_desktop/'?>
<?php $dirs = opendir($a_mdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($a_mdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['a_mskin']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($a_mdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<hr>
<div class="collapse<?php if(!$d['bbs']['c_hidden']):?> show<?php endif?>" id="show-comment">
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right"><i class="fa fa-comments-o fa-fw fa-lg" aria-hidden="true"></i> 댓글</label>
<div class="col-lg-10 col-xl-9">
<select name="c_skin" class="form-control custom-select">
<?php $_commentHexp=explode('/',$d['bbs']['comment_main'])?>
<option value="">테마 지정안함</option>
<option disabled>--------------------</option>
<optgroup label="데스크탑">
<?php $c_dir = $g['path_module'].'comment/themes/_desktop/'?>
<?php $dirs = opendir($c_dir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($c_dir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['c_skin']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($c_dir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="모바일">
<?php $c_dir = $g['path_module'].'comment/themes/_mobile/'?>
<?php $dirs = opendir($c_dir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($c_dir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['c_skin']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($c_dir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right"><span class="badge badge-dark">모바일 접속</span></label>
<div class="col-lg-10 col-xl-9">
<select name="c_mskin" class="form-control custom-select">
<?php $_commentmHexp=explode('/',$d['bbs']['comment_mobile'])?>
<option value="">테마 지정안함</option>
<option disabled>--------------------</option>
<optgroup label="모바일">
<?php $c_mdir = $g['path_module'].'comment/themes/_mobile/'?>
<?php $dirs = opendir($c_mdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($c_mdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['c_mskin']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($c_mdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="데스크탑">
<?php $c_mdir = $g['path_module'].'comment/themes/_desktop/'?>
<?php $dirs = opendir($c_mdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($c_mdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['bbs']['c_mskin']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($c_mdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
</div><!-- /.collapse -->
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">
<?php if($d['bbs']['c_hidden']):?><i class="fa fa-comments-o fa-fw fa-lg" aria-hidden="true"></i> 댓글<?php endif?>
</label>
<div class="col-lg-10 col-xl-9">
<div class="custom-control custom-checkbox mt-2" data-toggle="collapse" data-target="#show-comment">
<input type="checkbox" class="custom-control-input" name="c_hidden" id="c_hidden" value="1"<?php if($d['bbs']['c_hidden']):?> checked<?php endif?>>
<label class="custom-control-label" for="c_hidden">댓글 사용안함</label>
</div>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<hr>
<?php if ($uid): ?>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">사이트</label>
<div class="col-lg-10 col-xl-9">
<select name="site" class="form-control custom-select">
<?php $_SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1); ?>
<?php while($S = db_fetch_array($_SITES)):?>
<option value="<?php echo $S['uid']?>"<?php if($R['site']==$S['uid']):?> selected="selected"<?php endif?>>ㆍ<?php echo $S['label']?></option>
<?php endwhile?>
<?php if(!db_num_rows($SITES)):?>
<option value="">등록된 사이트가 없습니다.</option>
<?php endif?>
</select>
<small class="form-text text-muted">
사이트 전용 게시판이 필요할 경우 지정해 주세요.
</small>
</div>
</div>
<?php endif; ?>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">연결메뉴</label>
<div class="col-lg-10 col-xl-9">
<select name="sosokmenu" class="form-control custom-select">
<option value="">사용 안함</option>
<option disabled>--------------------</option>
<?php include_once $g['path_core'].'function/menu1.func.php'?>
<?php $cat=$d['bbs']['sosokmenu']?>
<?php getMenuShowSelect($s,$table['s_menu'],0,0,0,0,0,'')?>
</select>
<small class="form-text text-muted">
이 게시판을 메뉴에 연결하였을 경우 해당메뉴를 지정해 주세요.<br>
연결메뉴를 지정하면 게시물수,로케이션이 동기화됩니다.
</small>
</div>
</div>
<!-- 추가설정 시작 : panel-group 으로 각각의 panel 을 묶는다.-->
<div id="bbs-settings" class="panel-group">
<div id="bbs-settings-noti" class="card mb-2">
<div class="card-header p-0">
<a onclick="sessionSetting('bbs_settings_collapse','noti','','');"
href="#bbs-settings-noti-body"
data-toggle="collapse"
class="d-block collapsed muted-link pl-2<?php if($_SESSION['bbs_settings_collapse']!='noti'):?> collapsed<?php endif?>">
알림설정
</a>
</div> <!-- .card-header -->
<div class="collapse<?php if($_SESSION['bbs_settings_collapse']=='noti'):?> show<?php endif?>" id="bbs-settings-noti-body" data-parent="#bbs-settings">
<div class="card-body">
<?php include $g['path_module'].$module.'/admin/_noti_fgroup.php';?>
</div>
</div>
</div><!-- /.알림설정 -->
<div id="bbs-settings-add" class="card mb-2"> <!-- 추가설정-->
<div class="card-header p-0">
<a onclick="sessionSetting('bbs_settings_collapse','add','','');"
href="#bbs-settings-add-body"
data-toggle="collapse"
class="d-block collapsed muted-link pl-2<?php if($_SESSION['bbs_settings_collapse']!='add'):?> collapsed<?php endif?>">
추가설정
</a>
</div> <!-- .card-header -->
<div class="collapse<?php if($_SESSION['bbs_settings_collapse']=='add'):?> show<?php endif?>" id="bbs-settings-add-body" data-parent="#bbs-settings" >
<div class="card-body">
<!-- .form-group 나열 -->
<?php include $g['path_module'].$module.'/admin/_add_fgroup.php';?>
</div>
<div class="card-footer">
<small class="text-muted">
<i class="fa fa-info-circle fa-lg fa-fw"></i> 이상 추가설정 내용입니다.
</small>
</div>
</div> <!-- .panel-body & .panel-footer : 숨겼다 보였다 하는 내용 -->
</div> <!-- .panel 전체 -->
<div id="bbs-settings-right" class="card mb-2"><!--권한설정-->
<div class="card-header p-0">
<a onclick="sessionSetting('bbs_settings_collapse','right','','');"
href="#bbs-settings-right-body"
data-toggle="collapse"
class="collapsed d-block collapsed muted-link pl-2<?php if($_SESSION['bbs_settings_collapse']!='right'):?> collapsed<?php endif?>">
권한설정
</a>
</div>
<div class="collapse<?php if($_SESSION['bbs_settings_collapse']=='right'):?> show<?php endif?>" id="bbs-settings-right-body" data-parent="#bbs-settings" >
<div class="card-body">
<!-- .form-group 나열 -->
<?php include $g['path_module'].$module.'/admin/_right_fgroup.php';?>
</div>
<div class="card-footer">
<small class="text-muted">
<i class="fa fa-info-circle fa-lg fa-fw"></i> 이상 권한설정 내용입니다.
</small>
</div>
</div> <!-- .panel-body & .panel-footer : 숨겼다 보였다 하는 내용 -->
</div> <!-- .panel 전체 -->
<div id="bbs-settings-hcode" class="card mb-2"><!--헤더삽입-->
<div class="card-header p-0">
<a onclick="sessionSetting('bbs_settings_collapse','hcode','','');"
href="#bbs-settings-hcode-body"
data-toggle="collapse"
class="collapsed d-block collapsed muted-link pl-2<?php if($_SESSION['bbs_settings_collapse']!='hcode'):?> collapsed<?php endif?>">
헤더삽입
</a>
</div>
<div class="collapse<?php if($_SESSION['bbs_settings_collapse']=='hcode'):?> show<?php endif?>" id="bbs-settings-hcode-body" data-parent="#bbs-settings" >
<div class="card-body">
<!-- .form-group 나열 -->
<?php include $g['path_module'].$module.'/admin/_header_fgroup.php';?>
</div>
<div class="card-footer">
<small class="text-muted">
<i class="fa fa-info-circle fa-lg fa-fw"></i> 이상 헤더삽입 내용입니다.
</small>
</div>
</div> <!-- .panel-body & .panel-footer : 숨겼다 보였다 하는 내용 -->
</div> <!-- .panel 전체 -->
<div id="bbs-settings-fcode" class="card mb-2"><!--풋터삽입-->
<div class="card-header p-0">
<a onclick="sessionSetting('bbs_settings_collapse','fcode','','');"
href="#bbs-settings-fcode-body"
data-toggle="collapse"
class="collapsed d-block collapsed muted-link pl-2<?php if($_SESSION['bbs_settings_collapse']!='fcode'):?> collapsed<?php endif?>">
풋터삽입
</a>
</div>
<div class="collapse<?php if($_SESSION['bbs_settings_collapse']=='fcode'):?> show<?php endif?>" id="bbs-settings-fcode-body" data-parent="#bbs-settings" >
<div class="card-body">
<!-- .form-group 나열 -->
<?php include $g['path_module'].$module.'/admin/_footer_fgroup.php';?>
</div>
<div class="card-footer">
<small class="text-muted">
<i class="fa fa-info-circle fa-lg fa-fw"></i> 이상 풋터삽입 내용입니다.
</small>
</div>
</div> <!-- .panel-body & .panel-footer : 숨겼다 보였다 하는 내용 -->
</div> <!-- .panel 전체 -->
</div> <!-- .panel-group -->
</div><!-- /.d-none -->
<div class="form-group">
<div class="col-sm-12">
<button type="submit" class="btn btn-outline-primary btn-block btn-lg my-4">
<?php echo $R['uid']?'게시판속성 변경':'새 게시판 만들기'?>
</button>
</div>
</div>
</div><!-- /.card-body -->
</form>
</div> <!-- 우측내용 끝 -->
</div> <!-- .row 전체 box -->
<iframe hidden name="_orderframe_"></iframe>
<script type="text/javascript">
//사이트 셀렉터 출력
$('[data-role="siteSelector"]').removeClass('d-none')
putCookieAlert('result_bbs_main') // 실행결과 알림 메시지 출력
function saveCheck(f)
{
var l1 = f._perm_g_list;
var n1 = l1.length;
var l2 = f._perm_g_view;
var n2 = l2.length;
var l3 = f._perm_g_write;
var n3 = l3.length;
var l4 = f._perm_g_down;
var n4 = l4.length;
var i;
var s1 = '';
var s2 = '';
var s3 = '';
var s4 = '';
for (i = 0; i < n1; i++)
{
if (l1[i].selected == true && l1[i].value != '')
{
s1 += '['+l1[i].value+']';
}
}
for (i = 0; i < n2; i++)
{
if (l2[i].selected == true && l2[i].value != '')
{
s2 += '['+l2[i].value+']';
}
}
for (i = 0; i < n3; i++)
{
if (l3[i].selected == true && l3[i].value != '')
{
s3 += '['+l3[i].value+']';
}
}
for (i = 0; i < n4; i++)
{
if (l4[i].selected == true && l4[i].value != '')
{
s4 += '['+l4[i].value+']';
}
}
f.perm_g_list.value = s1;
f.perm_g_view.value = s2;
f.perm_g_write.value = s3;
f.perm_g_down.value = s4;
if (f.name.value == '')
{
alert('게시판이름을 입력해 주세요. ');
f.name.focus();
return false;
}
if (f.bid.value == '')
{
if (f.id.value == '')
{
alert('게시판아이디를 입력해 주세요. ');
f.id.focus();
return false;
}
if (!chkFnameValue(f.id.value))
{
alert('게시판아이디는 영문 대소문자/숫자/_ 만 사용가능합니다. ');
f.id.value = '';
f.id.focus();
return false;
}
}
getIframeForAction(f);
f.submit();
}
$(document).ready(function(){
<?php if (!$uid): ?>
$('[name="name"]').focus()
<?php endif; ?>
});
</script>

View File

@@ -0,0 +1,237 @@
<?php
//게시물링크
function getPostLink2($arr)
{
return RW('m=bbs&bid='.$arr['bbsid'].'&uid='.$arr['uid'].($GLOBALS['s']!=$arr['site']?'&s='.$arr['site']:''));
}
$postarray1 = array();
$postarray2 = array();
$postarray1 = getArrayString($postuid);
foreach($postarray1['data'] as $val)
{
if (!strstr($_SESSION['BbsPost'.$type],'['.$val.']'))
{
$_SESSION['BbsPost'.$type] .= '['.$val.']';
}
}
$postarray2 = getArrayString($_SESSION['BbsPost'.$type]);
rsort($postarray2['data']);
reset($postarray2['data']);
?>
<form name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $module?>" />
<input type="hidden" name="type" value="<?php echo $type?>" />
<input type="hidden" name="a" value="" />
<div id="toolbox" class="p-3">
<header class="d-flex justify-content-between mb-2">
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link<?php if($type=='multi_move'):?> active<?php endif?>" href="<?php echo $g['adm_href']?>&amp;iframe=<?php echo $iframe?>&amp;type=multi_move">게시물 이동</a>
</li>
<li class="nav-item">
<a class="nav-link<?php if($type=='multi_copy'):?> active<?php endif?>" href="<?php echo $g['adm_href']?>&amp;iframe=<?php echo $iframe?>&amp;type=multi_copy">게시물 복사</a>
</li>
</ul>
<a class="btn btn-link" href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>&amp;a=multi_empty&amp;type=<?php echo $type?>" target="_action_frame_<?php echo $m?>" onclick="return confirm('정말로 대기리스트를 비우시겠습니까? ');">비우기</a>
</header>
<table class="table table-sm f13 text-center mb-0 border-bottom">
<colgroup>
<col width="30">
<col width="80">
<col>
<col width="50">
<col width="90">
</colgroup>
<thead class="thead-light">
<tr>
<th scope="col">
<button type="button" class="btn btn-sm btn-link p-0" onclick="chkFlag('post_members[]');">선택</button>
</th>
<th scope="col">게시판</th>
<th scope="col">제목</th>
<th scope="col">조회</th>
<th scope="col" class="side2">날짜</th>
</tr>
</thead>
<tbody>
<?php foreach($postarray2['data'] as $val):?>
<?php $R=getUidData($table[$module.'data'],$val)?>
<?php $R['mobile']=isMobileConnect($R['agent'])?>
<?php $B = getUidData($table[$module.'list'],$R['bbs']); ?>
<tr>
<td class="text-center">
<div class="custom-control custom-checkbox custom-control-inline mr-0">
<input type="checkbox" class="custom-control-input" id="post_members_<?php echo $R['uid']?>" name="post_members[]" value="<?php echo $R['uid']?>" checked="checked">
<label class="custom-control-label" for="post_members_<?php echo $R['uid']?>"></label>
</div>
</td>
<td class="bbsid"><?php echo $B['name'] ?></td>
<td class="text-left">
<?php if($R['notice']):?><span class="badge badge-light">공지</span><?php endif?>
<?php if($R['mobile']):?><span class="badge badge-light"><i class="fa fa-mobile fa-lg"></i></span><?php endif?>
<?php if($R['category']):?><span class="badge badge-light"><?php echo $R['category']?></span><?php endif?>
<a href="<?php echo getPostLink2($R)?>" target="_blank" class="muted-link"><?php echo $R['subject']?></a>
<?php if(strstr($R['content'],'.jpg')):?>
<span class="badge badge-light" data-toggle="tooltip" title="사진">
<i class="fa fa-camera-retro fa-lg"></i>
</span>
<?php endif?>
<?php if($R['upload']):?>
<span class="badge badge-light" data-toggle="tooltip" title="첨부파일">
<i class="fa fa-paperclip fa-lg"></i>
</span>
<?php endif?>
<?php if($R['hidden']):?>
<span class="badge badge-light" data-toggle="tooltip" title="비밀글"><i class="fa fa-lock fa-lg"></i></span>
<?php endif?>
<?php if($R['comment']):?><span class="badge badge-light"><?php echo $R['comment']?><?php if($R['oneline']):?>+<?php echo $R['oneline']?><?php endif?></span><?php endif?>
<?php if(getNew($R['d_regis'],24)):?><span class="rb-new"></span><?php endif?>
</td>
<td class="small"><?php echo $R['hit']?></td>
<td><?php echo getDateFormat($R['d_regis'],'Y.m.d H:i')?></td>
</tr>
<?php endforeach?>
<?php if(!$postarray2['count']):?>
<tr>
<td class="text-center py-4 text-muted" colspan="5">게시물이 없습니다.</td>
</tr>
<?php endif?>
</tbody>
</table>
<footer class="footer mt-5">
<?php if($type == 'multi_copy'):?>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right">게시판 선택</label>
<div class="col-sm-10">
<select name="bid" class="form-control custom-select w-50">
<option value="">&nbsp;+ 선택하세요</option>
<option value="" disabled>---------------------------</option>
<?php $_BBSLIST = getDbArray($table[$module.'list'],'','*','gid','asc',0,1)?>
<?php while($_B=db_fetch_array($_BBSLIST)):?>
<option value="<?php echo $_B['uid']?>"<?php if($_B['uid']==$bid):?> selected="selected"<?php endif?>>ㆍ<?php echo $_B['name']?>(<?php echo $_B['id']?> - <?php echo number_format($_B['num_r'])?>)</option>
<?php endwhile?>
<?php if(!db_num_rows($_BBSLIST)):?>
<option value="">등록된 게시판이 없습니다.</option>
<?php endif?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right">복사옵션</label>
<div class="col-sm-10 pt-2">
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="inc_upload" name="inc_upload" value="1" checked="checked">
<label class="custom-control-label" for="inc_upload">첨부파일포함</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="inc_comment" name="inc_comment" value="1" checked="checked">
<label class="custom-control-label" for="inc_upload">댓글/한줄의견포함</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right"></label>
<div class="col-sm-10">
<input type="button" value="복사" class="btn btn-primary" onclick="actQue('multi_copy');" />
<input type="button" value="닫기" class="btn btn-light" onclick="top.close();" />
</div>
</div>
<?php else:?>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right">게시판 선택</label>
<div class="col-sm-10">
<select name="bid" class="form-control custom-select w-50">
<option value="">&nbsp;+ 선택하세요</option>
<option value="" disabled>---------------------------</option>
<?php $_BBSLIST = getDbArray($table[$module.'list'],'','*','gid','asc',0,1)?>
<?php while($_B=db_fetch_array($_BBSLIST)):?>
<option value="<?php echo $_B['uid']?>"<?php if($_B['uid']==$bid):?> selected="selected"<?php endif?>>ㆍ<?php echo $_B['name']?>(<?php echo $_B['id']?> - <?php echo number_format($_B['num_r'])?>)</option>
<?php endwhile?>
<?php if(!db_num_rows($_BBSLIST)):?>
<option value="">등록된 게시판이 없습니다.</option>
<?php endif?>
</select>
<small class="form-text text-muted mt-2">
동일게시판의 게시물은 제외됨
</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right"></label>
<div class="col-sm-10">
<input type="button" value="이동" class="btn btn-primary" onclick="actQue('multi_move');" />
<input type="button" value="닫기" class="btn btn-light" onclick="top.close();" />
</div>
</div>
<?php endif?>
</footer>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
function actQue(act)
{
var f = document.procForm;
var l = document.getElementsByName('post_members[]');
var n = l.length;
var j = 0;
var i;
for (i = 0; i < n; i++)
{
if(l[i].checked == true)
{
j++;
}
}
if (!j)
{
alert('선택된 게시물이 없습니다. ');
return false;
}
if (f.bid.value == '')
{
alert('게시판을 선택해 주세요. ');
f.bid.focus();
return false;
}
if (confirm('정말로 실행하시겠습니까? '))
{
f.a.value = act;
f.submit();
}
return false;
}
document.title = "게시물 <?php echo $type=='multi_move'?'이동':'복사'?>";
self.resizeTo(650,650);
//]]>
</script>

View File

@@ -0,0 +1,188 @@
<?php
function getMDname($id)
{
global $typeset;
if ($typeset[$id]) return $typeset[$id];
else return $id;
}
$typeset = array
(
'_opinion'=>'좋아요/싫어요',
'_mention'=>'회원언급',
'_new.post'=>'새글 등록',
'_report'=>'게시물 신고'
);
$type = $type ? $type : '_opinion';
?>
<div class="row no-gutters">
<div class="col-sm-4 col-md-3 col-xl-3 d-none d-sm-block sidebar" id="tab-content-list">
<div class="card border-0">
<div class="card-header">
양식목록
</div>
<div class="collapse<?php if(!$_SESSION['member_msgdoc_collapse']):?> show<?php endif?>" id="notidoc">
<div class="list-group list-group-flush">
<?php $tdir = $g['path_module'].$module.'/var/noti/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..')continue?>
<?php $_type = str_replace('.php','',$skin)?>
<a href="<?php echo $g['adm_href']?>&amp;type=<?php echo $_type?>" class="list-group-item d-flex justify-content-between align-items-center list-group-item-action <?php if($_type==$type):?>active<?php endif?> doc-style pl-4">
<?php echo getMDname($_type)?>
<span class="badge badge-dark"><?php echo $_type?></span>
</a>
<?php endwhile?>
<?php closedir($dirs)?>
</div>
</div><!-- /.collapse -->
</div><!-- /.card -->
</div>
<div class="col-sm-8 col-md-9 ml-sm-auto col-xl-9" id="tab-content-view">
<form class="card border-0" name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="notidoc_regis">
<input type="hidden" name="type" value="<?php echo $type?>">
<div class="card-header page-body-header">
<?php if ($doc=='email'): ?><i class="fa fa-envelope-o fa-fw"></i><?php else: ?><i class="fa fa-bell-o fa-lg fa-fw"></i><?php endif; ?>
<span><?php echo getMDname($type)?> <span class="badge badge-primary badge-pill">양식수정</span></span>
</div>
<div class="card-body">
<?php
$cfile = $g['path_var'].$module.'/noti/'.$type.'.php';
$gfile = $g['path_module'].$module.'/var/noti/'.$type.'.php';
if (is_file($cfile)) {
include_once $cfile;
} else {
include_once $gfile;
}
?>
<div class="card">
<div class="card-header">
<i class="fa fa-bell-o mr-1" aria-hidden="true"></i> 알림 메시지 편집
</div>
<div class="card-body" id="noti-msg">
<div class="media">
<img class="mr-3" src="<?php echo $g['s'].'/files/avatar/0.svg' ?>" alt="회원 아바타" style="width: 100px">
<div class="media-body">
<div class="form-group">
<label class="sr-only">타이틀</label>
<input type="text" class="form-control" name="noti_title" value="<?php echo $d['bbs']['noti_title'] ?>" placeholder="알림 제목을 입력해 주세요.">
<small class="form-text text-muted">
회원이름 : <code>{MEMBER}</code> / 닉네임 <code>{NICK}</code> / 게시판명 <code>{BBS}</code>/ 좋아요(싫어요) <code>{OPINION_TYPE}</code>
</small>
</div>
<div class="form-group">
<label class="sr-only">메세지 입력</label>
<textarea name="noti_body" class="form-control" placeholder="알림내용을 입력해 주세요." rows="5"><?php echo $d['bbs']['noti_body'] ?></textarea>
<small class="form-text text-muted">
회원이름 : <code>{MEMBER}</code> / 게시판명 <code>{BBS}</code> / 게시물제목 <code>{SUBJECT}</code>
</small>
</div>
<div class="form-group mb-0">
<label>연결링크 버튼명</label>
<input type="text" class="form-control" name="noti_button" value="<?php echo $d['bbs']['noti_button'] ?>" placeholder="버튼명을 입력해 주세요.">
</div>
</div>
</div>
</div>
<div class="card-footer">
<?php if ($type=='_opinion'): ?>
<dl class="row small text-muted mb-0">
<dt class="col-2">발송시점</dt>
<dd class="col-10">게시물에 좋아요(싫어요)를 추가(취소) 시</dd>
<dt class="col-2">수신대상</dt>
<dd class="col-10">게시물 등록회원</dd>
<dl>
<?php endif; ?>
<?php if ($type=='_new.post'): ?>
<dl class="row small text-muted mb-0">
<dt class="col-2">발송시점</dt>
<dd class="col-10">게시판 신규 게시물 등록시</dd>
<dt class="col-2">수신대상</dt>
<dd class="col-10">게시판 관리자</dd>
<dl>
<?php endif; ?>
<?php if ($type=='_report'): ?>
<dl class="row small text-muted mb-0">
<dt class="col-2">발송시점</dt>
<dd class="col-10">게시물 신고시</dd>
<dt class="col-2">수신대상</dt>
<dd class="col-10">게시판 관리자</dd>
<dl>
<?php endif; ?>
<?php if ($type=='_new.notice'): ?>
<dl class="row small text-muted mb-0">
<dt class="col-2">발송시점</dt>
<dd class="col-10">게시판 공지글 등록시</dd>
<dt class="col-2">수신대상</dt>
<dd class="col-10">알림수신을 허용한 전체회원</dd>
<dl>
<?php endif; ?>
<?php if ($type=='_mention'): ?>
<dl class="row small text-muted mb-0">
<dt class="col-2">발송시점</dt>
<dd class="col-10">게시글에 회원언급 등록시</dd>
<dt class="col-2">수신대상</dt>
<dd class="col-10">언급된 회원(들)</dd>
<dl>
<?php endif; ?>
</div>
</div><!-- /.card -->
</div><!-- /.card-body -->
<div class="card-footer">
<div class="form-row">
<div class="col">
<button type="submit" class="btn btn-outline-primary btn-block">수정</button>
</div>
</div>
</div><!-- /.card-footer -->
</form><!-- /.card -->
</div>
</div>
<script type="text/javascript">
function saveCheck(f) {
if (f.content.value == '')
{
$('.note-editable').focus();
alert('내용을 입력해 주세요. ');
return false;
}
}
$(document).ready(function() {
putCookieAlert('msgdoc_result') // 실행결과 알림 메시지 출력
$('[data-toggle=tooltip]').tooltip();
});
</script>

109
modules/bbs/admin/post.css Normal file
View File

@@ -0,0 +1,109 @@
.table-sm td, .table-sm th {
padding: .4rem;
font-size: 12px;
font-weight: normal;
}
#uplist .table th,
#uplist .table td {
text-align: center;
}
#uplist .table th.rb-left,
#uplist .table td.rb-left {
text-align: left;
}
#uplist .rb-none {
text-align: center;
color: #999
}
#uplist .row {
margin-right: -5px;
margin-left: -5px;
}
#uplist .row [class*="col-"] {
padding-right: 5px !important;
padding-left: 5px !important;
}
@media (max-width: 767px) {
#uplist .row [class*="col-"] {
margin-bottom: 10px
}
}
#uplist .pagination {
margin: 0
}
#uplist .rb-heading .btn {
font-size: 12px;
}
#uplist .rb-heading {
margin-bottom: 20px
}
#uplist .rb-heading > .form-group:last-child {
margin-bottom: 0
}
#uplist .rb-heading .rb-advance.btn.collapsed small:before {
content: "▼";
}
#uplist .rb-heading .rb-advance.btn small:before {
content: "▲";
}
#uplist .rb-footer {
border-top: 1px solid #eee;
margin: 20px 0;
padding: 20px 0
}
@media (max-width: 479px) {
#uplist .rb-footer div {
float: none !important
}
}
@media (min-width: 768px) {
#uplist .rb-year,
#uplist .rb-month,
#uplist .rb-day {
display: block;
}
}
@media (min-width: 768px) {
#uplist .rb-year {
float: left;
width: 100px;
margin-right: 5px
}
#uplist .rb-month {
float: left;
width: 80px;
margin-right: 5px
}
#uplist .rb-day {
float: left;
width: 100px;
margin-right: 5px
}
}
.datepicker {z-index: 1151 !important;}

426
modules/bbs/admin/post.php Normal file
View File

@@ -0,0 +1,426 @@
<?php
$SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1);
$SITEN = db_num_rows($SITES);
$sort = $sort ? $sort : 'gid';
$orderby= $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
$_WHERE='uid>0';
$account = $SD['uid'];
if($account) $_WHERE .=' and site='.$account;
if ($d_start) $_WHERE .= ' and d_regis > '.str_replace('/','',$d_start).'000000';
if ($d_finish) $_WHERE .= ' and d_regis < '.str_replace('/','',$d_finish).'240000';
if ($bid) $_WHERE .= ' and bbs='.$bid;
if ($category) $_WHERE .= " and category ='".$category."'";
if ($notice) $_WHERE .= ' and notice=1';
if ($hidden) $_WHERE .= ' and hidden=1';
if ($where && $keyw)
{
if (strstr('[name][nic][id][ip]',$where)) $_WHERE .= " and ".$where."='".$keyw."'";
else $_WHERE .= getSearchSql($where,$keyw,$ikeyword,'or');
}
$RCD = getDbArray($table[$module.'data'],$_WHERE,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table[$module.'data'],$_WHERE);
$TPG = getTotalPage($NUM,$recnum);
?>
<div class="row no-gutters">
<nav class="col-sm-4 col-md-4 col-xl-3 d-none d-sm-block sidebar sidebar-right">
<form name="procForm" action="<?php echo $g['s']?>/" method="get">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="module" value="<?php echo $module?>">
<input type="hidden" name="front" value="<?php echo $front?>">
<div id="accordion" role="tablist">
<div class="card border-0">
<div class="card-header p-0" role="tab">
<a class="d-block muted-link<?php if($_SESSION['bbs_post_collapse']!='filter'):?> collapsed<?php endif?>" data-toggle="collapse" href="#collapse-filter" role="button" aria-expanded="true" aria-controls="collapseOne" onclick="sessionSetting('bbs_post_collapse','filter','','');">
필터
</a>
</div>
<div id="collapse-filter" class="collapse<?php if($_SESSION['bbs_post_collapse']=='filter'):?> show<?php endif?>" role="tabpanel" data-parent="#accordion">
<div class="card-body">
<select name="bid" class="form-control custom-select mb-2" onchange="this.form.submit();">
<option value="">사이트 전체 게시판</option>
<?php $_BBSLIST = getDbArray($table[$module.'list'],'site='.$account,'*','gid','asc',0,1)?>
<?php while($_B=db_fetch_array($_BBSLIST)):?>
<option value="<?php echo $_B['uid']?>"<?php if($_B['uid']==$bid):?> selected="selected"<?php endif?>>ㆍ<?php echo $_B['name']?>(<?php echo $_B['id']?> - <?php echo number_format($_B['num_r'])?>)</option>
<?php endwhile?>
<?php if(!db_num_rows($_BBSLIST)):?>
<option value="">등록된 게시판이 없습니다.</option>
<?php endif?>
</select>
<select name="category" onchange="this.form.submit();" class="form-control custom-select mb-2">
<?php $getCate=db_query("select * from rb_bbs_data where bbs='".$bid."' and category<>'' group by category",$DB_CONNECT)?>
<option value="0">전체 카테고리</option>
<?php while($ct=db_fetch_array($getCate)):?>
<option value="<?php echo $ct['category']?>" <?php if($category==$ct['category']):?> selected="selected"<?php endif?>><?php echo $ct['category']?></option>
<?php endwhile?>
<?php if(!db_num_rows($getCate)):?>
<option value="">등록된 카테고리가 없습니다.</option>
<?php endif?>
</select>
<div class="mb-2">
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="notice" name="notice" value="Y"<?php if($notice=='Y'):?> checked<?php endif?> onclick="this.form.submit();">
<label class="custom-control-label" for="notice">공지글</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="hidden" name="hidden" value="Y"<?php if($hidden=='Y'):?> checked<?php endif?> onclick="this.form.submit();">
<label class="custom-control-label" for="hidden">비밀글</label>
</div>
</div>
<div class="input-daterange input-group input-group-sm mb-2" id="datepicker">
<input type="text" class="form-control" name="d_start" placeholder="시작일 선택" value="<?php echo $d_start?>">
<input type="text" class="form-control" name="d_finish" placeholder="종료일 선택" value="<?php echo $d_finish?>">
<span class="input-group-append">
<button class="btn btn-light" type="submit">기간적용</button>
</span>
</div>
<span class="btn-group btn-group-toggle">
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>','<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-1,substr($date['today'],0,4)))?>');">어제</button>
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo getDateFormat($date['today'],'Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">오늘</button>
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-7,substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">일주</button>
</span>
<span class="btn-group btn-group-toggle">
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/d',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">한달</button>
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo getDateFormat(substr($date['today'],0,6).'01','Y/m/d')?>','<?php echo getDateFormat($date['today'],'Y/m/d')?>');">당월</button>
<button class="btn btn-light" type="button" onclick="dropDate('<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>01','<?php echo date('Y/m/',mktime(0,0,0,substr($date['today'],4,2)-1,substr($date['today'],6,2),substr($date['today'],0,4)))?>31');">전월</button>
<button class="btn btn-light" type="button" onclick="dropDate('','');">전체</button>
</span>
</div>
</div>
</div>
<div class="card">
<div class="card-header p-0" role="tab">
<a class="d-block muted-link<?php if($_SESSION['bbs_post_collapse']!='sort'):?> collapsed<?php endif?>" data-toggle="collapse" href="#collapse-sort" role="button" aria-expanded="false" aria-controls="collapseTwo" onclick="sessionSetting('bbs_post_collapse','sort','','');">
정렬
</a>
</div>
<div id="collapse-sort" class="collapse<?php if($_SESSION['bbs_post_collapse']=='sort'):?> show<?php endif?>" role="tabpanel" data-parent="#accordion">
<div class="card-body">
<div class="btn-toolbar">
<div class="btn-group btn-group-sm btn-group-toggle mb-2" data-toggle="buttons">
<label class="btn btn-light<?php if($sort=='gid'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="gid" name="sort"<?php if($sort=='gid'):?> checked<?php endif?>> 등록일
</label>
<label class="btn btn-light<?php if($sort=='hit'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="hit" name="sort"<?php if($sort=='hit'):?> checked<?php endif?>> 조회
</label>
<label class="btn btn-light<?php if($sort=='down'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="down" name="sort"<?php if($sort=='down'):?> checked<?php endif?>> 다운
</label>
<label class="btn btn-light<?php if($sort=='comment'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="comment" name="sort"<?php if($sort=='comment'):?> checked<?php endif?>> 댓글
</label>
<label class="btn btn-light<?php if($sort=='oneline'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="oneline" name="sort"<?php if($sort=='oneline'):?> checked<?php endif?>> 한줄의견
</label>
</div>
<div class="btn-group btn-group-sm btn-group-toggle mb-2" data-toggle="buttons">
<label class="btn btn-light<?php if($sort=='likes'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="likes" name="sort"<?php if($sort=='likes'):?> checked<?php endif?>> 좋아요
</label>
<label class="btn btn-light<?php if($sort=='dislikes'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="dislikes" name="sort"<?php if($sort=='dislikes'):?> checked<?php endif?>> 비좋아요
</label>
<label class="btn btn-light<?php if($sort=='report'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="report" name="sort"<?php if($sort=='report'):?> checked<?php endif?>> 신고
</label>
</div>
<div class="btn-group btn-group-sm btn-group-toggle mb-2" data-toggle="buttons">
<label class="btn btn-light<?php if($orderby=='desc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="desc" name="orderby"<?php if($orderby=='desc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-desc"></i>역순
</label>
<label class="btn btn-light<?php if($orderby=='asc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="asc" name="orderby"<?php if($orderby=='asc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-asc"></i>정순
</label>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header p-0" role="tab">
<a class="d-block muted-link<?php if($_SESSION['bbs_post_collapse']!='search'):?> collapsed<?php endif?>" data-toggle="collapse" href="#collapse-search" role="button" aria-expanded="false" aria-controls="collapseTwo" onclick="sessionSetting('bbs_post_collapse','search','','');">
검색
</a>
</div>
<div id="collapse-search" class="collapse<?php if($_SESSION['bbs_post_collapse']=='search'):?> show<?php endif?>" role="tabpanel" data-parent="#accordion">
<div class="card-body">
<select name="where" class="form-control custom-select mb-2">
<option value="subject|tag"<?php if($where=='subject|tag'):?> selected="selected"<?php endif?>>제목+태그</option>
<option value="content"<?php if($where=='content'):?> selected="selected"<?php endif?>>본문</option>
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>이름</option>
<option value="nic"<?php if($where=='nic'):?> selected="selected"<?php endif?>>닉네임</option>
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
<option value="ip"<?php if($where=='ip'):?> selected="selected"<?php endif?>>아이피</option>
</select>
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control mb-2">
<button class="btn btn-light btn-block" type="submit">검색</button>
</div>
</div>
</div>
</div>
<div class="p-3">
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<label class="input-group-text">출력수</label>
</div>
<select name="recnum" onchange="this.form.submit();" class="form-control custom-select">
<option value="20"<?php if($recnum==20):?> selected="selected"<?php endif?>>20개</option>
<option value="35"<?php if($recnum==35):?> selected="selected"<?php endif?>>35개</option>
<option value="50"<?php if($recnum==50):?> selected="selected"<?php endif?>>50개</option>
<option value="75"<?php if($recnum==75):?> selected="selected"<?php endif?>>75개</option>
<option value="90"<?php if($recnum==90):?> selected="selected"<?php endif?>>90개</option>
</select>
</div>
<?php if($NUM):?>
<div style="padding: .74rem">
<a href="<?php echo $g['adm_href']?>" class="btn btn-block btn-light<?php echo $keyw?' active':'' ?>">검색조건 초기화</a>
</div>
<?php endif?>
</div>
</form>
</nav>
<div class="col-sm-8 col-md-8 mr-sm-auto col-xl-9">
<?php if($NUM):?>
<form class="card rounded-0 border-0" name="listForm" action="<?php echo $g['s']?>/" method="post">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="">
<div class="card-header border-0 page-body-header">
<?php echo number_format($NUM)?> 개
<span class="badge badge-pill badge-dark"><?php echo $p?>/<?php echo $TPG?> 페이지</span>
</div>
<div class="table-responsive">
<table class="table table-sm table-striped text-center mb-0">
<thead class="small text-muted">
<tr>
<th><label data-tooltip="tooltip" title="선택"><input type="checkbox" class="checkAll-post-user"></label></th>
<th>번호</th>
<th>게시판</th>
<th>제목</th>
<th>이름</th>
<th>조회</th>
<th>다운</th>
<th>좋아요</th>
<th>신고</th>
<th>날짜</th>
</tr>
</thead>
<tbody class="text-muted">
<?php while($R=db_fetch_array($RCD)):?>
<?php $R['mobile']=isMobileConnect($R['agent'])?>
<?php $B = getUidData($table[$module.'list'],$R['bbs']); ?>
<tr>
<td><input type="checkbox" name="post_members[]" value="<?php echo $R['uid']?>" class="rb-post-user" onclick="checkboxCheck();"/></td>
<td>
<small class="text-muted"><?php echo $NUM-((($p-1)*$recnum)+$_rec++)?></small>
</td>
<td>
<small class="text-muted"><?php echo $B['name'] ?></small>
</td>
<td class="text-left">
<?php if($R['notice']):?><i class="fa fa-volume-up"></i><?php endif?>
<?php if($R['mobile']):?><i class="fa fa-mobile f-lg"></i><?php endif?>
<?php if($R['category']):?><span class="badge badge-pill badge-dark"><?php echo $R['category']?></span><?php endif?>
<a class="muted-link" href="<?php echo getBbsPostLink($R)?>" target="_blank">
<?php echo getStrCut($R['subject'],'30','..')?>
</a>
<?php if(strstr($R['content'],'.jpg')):?>
<span class="badge badge-dark" data-toggle="tooltip" title="사진"><i class="fa fa-camera-retro fa-lg"></i></span>
<?php endif?>
<?php if($R['upload']):?>
<span class="badge badge-dark" data-toggle="tooltip" title="첨부파일">
<i class="fa fa-paperclip fa-lg"></i>
</span>
<?php endif?>
<?php if($R['hidden']):?><i class="fa fa-lock fa-lg"></i><?php endif?>
<?php if($R['comment']):?><span class="badge badge-pill badge-dark"><?php echo $R['comment']?><?php if($R['oneline']):?>+<?php echo $R['oneline']?><?php endif?></span><?php endif?>
<?php if(getNew($R['d_regis'],24)):?><small class="text-danger">new</small><?php endif?>
</td>
<?php if($R['id']):?>
<td>
<a href="#" data-toggle="modal" data-target="#modal_window" class="rb-modal-mbrinfo muted-link" onmousedown="mbrIdDrop('<?php echo $R['mbruid']?>','post');">
<?php echo $R[$_HS['nametype']]?>
</a>
</td>
<?php else:?>
<td><?php echo $R[$_HS['nametype']]?></td>
<?php endif?>
<td><strong><?php echo $R['hit']?></strong></td>
<td><?php echo $R['down']?></td>
<td><?php echo $R['likes']?></td>
<td><?php echo $R['report']?></td>
<td>
<small class="text-muted"><?php echo getDateFormat($R['d_regis'],'Y.m.d H:i')?></small>
</td>
</tr>
<?php endwhile?>
</tbody>
</table>
</div><!-- /.table-responsive -->
<div class="card-footer d-flex justify-content-between">
<div>
<button type="button" onclick="chkFlag('post_members[]');checkboxCheck();" class="btn btn-light btn-sm">선택/해제 </button>
<button type="button" onclick="actCheck('multi_delete');" class="btn btn-light btn-sm rb-action-btn" disabled>삭제</button>
<button type="button" onclick="actCheck('multi_copy');" class="btn btn-light btn-sm rb-action-btn" disabled >복사</button>
<button type="button" onclick="actCheck('multi_move');" class="btn btn-light btn-sm rb-action-btn" disabled >이동</button>
</div>
<ul class="pagination mb-0">
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
</ul>
</div>
</form>
<?php else: ?>
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 10rem);">
<div><i class="fa fa-exclamation-circle fa-3x mb-3" aria-hidden="true"></i>
<p>등록된 게시글이 없습니다.</p>
</div>
</div>
<?php endif?>
</div>
</div><!-- /.row -->
<!-- bootstrap-datepicker, http://eternicode.github.io/bootstrap-datepicker/ -->
<?php getImport('bootstrap-datepicker','css/datepicker3',false,'css')?>
<?php getImport('bootstrap-datepicker','js/bootstrap-datepicker',false,'js')?>
<?php getImport('bootstrap-datepicker','js/locales/bootstrap-datepicker.kr',false,'js')?>
<?php include $g['path_module'].'member/admin/_modal.php';?>
<script>
putCookieAlert('bbs_post_result') // 실행결과 알림 메시지 출력
$('.input-daterange').datepicker({
format: "yyyy/mm/dd",
todayBtn: "linked",
language: "kr",
calendarWeeks: true,
todayHighlight: true,
autoclose: true
});
//사이트 셀렉터 출력
$('[data-role="siteSelector"]').removeClass('d-none')
// 선택박스 체크 이벤트 핸들러
$(".checkAll-post-user").click(function(){
$(".rb-post-user").prop("checked",$(".checkAll-post-user").prop("checked"));
checkboxCheck();
});
// 선택박스 체크시 액션버튼 활성화 함수
function checkboxCheck()
{
var f = document.listForm;
var l = document.getElementsByName('post_members[]');
var n = l.length;
var i;
var j=0;
for (i = 0; i < n; i++)
{
if (l[i].checked == true) j++;
}
if (j) $('.rb-action-btn').prop("disabled",false);
else $('.rb-action-btn').prop("disabled",true);
}
// 기간 검색 적용 함수
function dropDate(date1,date2)
{
var f = document.procForm;
f.d_start.value = date1;
f.d_finish.value = date2;
f.submit();
}
function actCheck(act)
{
var f = document.listForm;
var l = document.getElementsByName('post_members[]');
var n = l.length;
var j = 0;
var i;
var s = '';
for (i = 0; i < n; i++)
{
if(l[i].checked == true)
{
j++;
s += '['+l[i].value+']';
}
}
if (!j)
{
alert('선택된 게시물이 없습니다. ');
return false;
}
if (act == 'multi_delete')
{
if(confirm('정말로 삭제하시겠습니까? '))
{
getIframeForAction(f);
f.a.value = act;
f.submit();
}
}
else {
OpenWindow('<?php echo $g['s']?>/?r=<?php echo $r?>&iframe=Y&m=<?php echo $m?>&module=<?php echo $module?>&front=movecopy&type='+act+'&postuid='+s);
}
return false;
}
// 회원 이름,닉네임 클릭시 uid & mod( 탭 정보 : info, main, post 등) 지정하는 함수
var _mbrModalUid;
var _mbrModalMod;
function mbrIdDrop(uid,mod)
{
_mbrModalUid = uid;
_mbrModalMod = mod;
}
// 회원정보 modal 호출하는 함수 : 위에서 지정한 회원 uid & mod 로 호출한다 .
$('.rb-modal-mbrinfo').on('click',function() {
modalSetting('modal_window','<?php echo getModalLink('&amp;m=admin&amp;module=member&amp;front=modal.mbrinfo&amp;uid=')?>'+_mbrModalUid+'&amp;tab='+_mbrModalMod);
});
</script>

View File

@@ -0,0 +1,4 @@
.nav-tabs .editor .nav-link.active {
background-color: #252822;
border-bottom-color: #252822
}

233
modules/bbs/admin/theme.php Normal file
View File

@@ -0,0 +1,233 @@
<link href="<?php echo $g['s']?>/_core/css/github-markdown.css" rel="stylesheet">
<style>
#__code__ {
font-weight: normal;
font-family: Menlo,Monaco,Consolas,"Courier New",monospace !important;
}
</style>
<?php getImport('jquery-markdown','jquery.markdown','0.0.10','js')?>
<?php getImport('codemirror','lib/codemirror',false,'css')?>
<?php getImport('codemirror','lib/codemirror',false,'js')?>
<?php getImport('codemirror','theme/'.$d['admin']['codeeidt'],false,'css')?>
<?php getImport('codemirror','addon/display/fullscreen',false,'css')?>
<?php getImport('codemirror','addon/display/fullscreen',false,'js')?>
<?php getImport('codemirror','mode/htmlmixed/htmlmixed',false,'js')?>
<?php getImport('codemirror','mode/xml/xml',false,'js')?>
<?php getImport('codemirror','mode/javascript/javascript',false,'js')?>
<?php getImport('codemirror','mode/css/css',false,'js')?>
<?php getImport('codemirror','mode/htmlmixed/htmlmixed',false,'js')?>
<?php getImport('codemirror','mode/clike/clike',false,'js')?>
<?php getImport('codemirror','mode/php/php',false,'js')?>
<div class="row no-gutters">
<div class="col-sm-4 col-md-4 col-xl-3 d-none d-sm-block sidebar"><!-- 좌측영역 시작 -->
<div class="card border-0">
<div class="card-header f13">
테마 리스트
</div>
<div class="list-group list-group-flush">
<?php $i=0?>
<?php $xdir = $g['path_module'].$module.'/themes/'?>
<?php $tdir = $xdir.'_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<?php $i++?>
<a href="<?php echo $g['adm_href']?>&amp;theme=_desktop/<?php echo $skin?>" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center<?php if($theme=='_desktop/'.$skin):?> border border-primary<?php endif?>">
<span><?php echo getFolderName($tdir.$skin)?></span>
<span class="badge badge-<?php echo $theme=='_desktop/'.$skin?'primary':'dark' ?> badge-pill"><?php echo $skin?></span>
</a>
<?php endwhile?>
<?php closedir($dirs)?>
<?php $tdir = $xdir.'_mobile/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<?php $i++?>
<a href="<?php echo $g['adm_href']?>&amp;theme=_mobile/<?php echo $skin?>" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center<?php if($theme=='_mobile/'.$skin):?> border border-primary<?php endif?>">
<span><?php echo getFolderName($tdir.$skin)?></span>
<span class="badge badge-<?php echo $theme=='_mobile/'.$skin?'primary':'dark' ?> badge-pill"><?php echo $skin?></span>
</a>
<?php endwhile?>
<?php closedir($dirs)?>
</div>
<?php if(!$i):?>
<div class="none">등록된 테마가 없습니다.</div>
<?php endif?>
</div> <!-- 좌측 card 끝 -->
</div> <!-- 좌측 영역 끝 -->
<div class="col-sm-8 col-md-8 ml-sm-auto col-xl-9">
<?php if($theme):?>
<form class="card rounded-0 border-0" name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $module?>" />
<input type="hidden" name="a" value="theme_config" />
<input type="hidden" name="theme" value="<?php echo $theme?>" />
<div class="card-header p-0 page-body-header">
<ol class="breadcrumb rounded-0 mb-0 bg-transparent text-muted">
<?php $_theme =explode('/' , $theme); ?>
<li class="breadcrumb-item">root</li>
<li class="breadcrumb-item">modules</li>
<li class="breadcrumb-item"><?php echo $module?></li>
<li class="breadcrumb-item">themes</li>
<li class="breadcrumb-item"><?php echo $_theme[0]?></li>
<li class="breadcrumb-item"><?php echo $_theme[1]?></li>
</ol>
</div>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link js-tooltip<?php if(!$_COOKIE['moduleBbsThemeTab']||$_COOKIE['moduleBbsThemeTab']=='readme'):?> active<?php endif?>" href="#readme" data-toggle="tab" onclick="setCookie('moduleBbsThemeTab','readme',1);" title="README.md" data-placement="bottom">
안내문서
</a>
</li>
<li class="nav-item editor">
<a class="nav-link js-tooltip<?php if($_COOKIE['moduleBbsThemeTab']=='editor'):?> active<?php endif?>" href="#var" data-toggle="tab" onclick="setCookie('moduleBbsThemeTab','editor','1');" title="_var.php" data-placement="bottom">
설정 변수
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane <?php if(!$_COOKIE['moduleBbsThemeTab']||$_COOKIE['moduleBbsThemeTab']=='readme'):?> show active<?php endif?>" id="readme" role="tabpanel" aria-labelledby="readme-tab">
<?php if (is_file($g['path_module'].$module.'/themes/'.$theme.'/README.md')): ?>
<div class="markdown-body px-4 py-0 readme">
<?php readfile($g['path_module'].$module.'/themes/'.$theme.'/README.md')?>
</div>
<?php else: ?>
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 10rem);">
<div><i class="fa fa-exclamation-circle fa-3x mb-3" aria-hidden="true"></i>
<p>테마 안내문서가 없습니다.</p>
</div>
</div>
<?php endif; ?>
<?php if (is_file($g['path_module'].$module.'/themes/'.$theme.'/LICENSE')): ?>
<div class="py-5 px-4">
<h5>라이센스</h5>
<textarea class="form-control" rows="10"><?php readfile($g['path_module'].$module.'/themes/'.$theme.'/LICENSE')?></textarea>
</div>
<?php endif; ?>
</div>
<div class="tab-pane pr-2<?php if($_COOKIE['moduleBbsThemeTab']=='editor'):?> show active<?php endif?>" id="var" role="tabpanel" aria-labelledby="var-tab">
<div class="">
<div class="rb-codeview">
<div class="rb-codeview-body">
<textarea name="theme_var" id="__code__" class="form-control f13" rows="30"><?php echo implode('',file($g['path_module'].$module.'/themes/'.$theme.'/_var.php'))?></textarea>
</div>
<div class="rb-codeview-footer p-2">
<div class="form-row mb-2">
<div class="col pt-2 text-muted">
테마명 : <?php echo getFolderName($g['path_module'].$module.'/themes/'.$theme)?>
</div>
<div class="col">
</div>
<div class="col text-right pt-2 text-muted">
<small><?php echo count(file($g['path_module'].$module.'/themes/'.$theme.'/_var.php')).' lines'?></small></li>
<small class="ml-3"><?php echo getSizeFormat(@filesize($g['path_module'].$module.'/themes/'.$theme.'/_var.php'),2)?></small>
</div>
</div>
</div>
</div> <!--.rb-codeview -->
</div> <!--.rb-files -->
<div class="card-footer">
<button type="submit" class="btn btn-outline-primary">저장하기</button>
<span class="ml-3 text-muted">이 테마를 사용하는 모든 게시판에 위의 설정값이 적용됩니다.</span>
<?php if($theme):?>
<div class="pull-right">
<a class="btn btn-outline-danger" href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>&amp;a=theme_delete&amp;theme=<?php echo $theme?>" target="_action_frame_<?php echo $m?>" onclick="return confirm('정말로 이 테마를 삭제하시겠습니까? ');">테마삭제</a>
</div>
<?php endif?>
</div>
</div><!-- /.tab-pane -->
</div><!-- /.tab-content -->
<?php else:?>
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 10rem);">
<div class="">
<i class="fa fa fa-picture-o fa-3x mb-3" aria-hidden="true"></i>
<p>테마를 선택해 주세요.</p>
<p class="small">테마설정은 해당 테마를 사용하는 모든 게시판에 적용됩니다.</p>
<ul class="list list-unstyled small">
<li>테마는 게시판의 외형을 변경할 수 있는 요소입니다.</li>
<li>테마설정은 게시판의 외형만 제어하며 게시판의 내부시스템에는 영향을 주지 않습니다.</li>
<li>테마의 속성을 변경하면 해당테마를 사용하는 모든 게시판에 적용됩니다.</li>
</ul>
</div>
</div>
<?php endif?>
</form>
</div> <!-- 우측영역 끝 -->
</div> <!--.row -->
<?php if($d['admin']['codeeidt'] && $theme):?>
<!-- codemirror -->
<script>
(function() {
putCookieAlert('result_bbs_theme') // 실행결과 알림 메시지 출력
$(".markdown-body").markdown();
var editor = CodeMirror.fromTextArea(getId('__code__'), {
mode: "application/x-httpd-php",
indentUnit: 2,
lineNumbers: true,
matchBrackets: true,
indentWithTabs: true,
theme: '<?php echo $d['admin']['codeeidt']?>'
});
editor.setSize('100%','500px');
_isCodeEdit = true;
})
();
</script>
<!-- @codemirror -->
<?php endif?>
<script type="text/javascript">
//<![CDATA[
function saveCheck(f)
{
return confirm('정말로 실행하시겠습니까? ');
}
//]]>
</script>

View File

@@ -0,0 +1,311 @@
<?php
$recnum = 10;
$catque = 'uid and site='.$s;
if ($_keyw) $catque .= " and ".$where." like '".$_keyw."%'";
$PAGES = getDbArray($table[$smodule.'list'],$catque,'*','gid','asc',$recnum,$p);
$NUM = getDbRows($table[$smodule.'list'],$catque);
$TPG = getTotalPage($NUM,$recnum);
$tdir = $g['path_module'].$smodule.'/theme/';
?>
<div id="mjointbox">
<div class="title">
<form name="bbsSform" class="form-inline" action="<?php echo $g['s']?>/" method="get">
<input type="hidden" name="system" value="<?php echo $system?>">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="iframe" value="<?php echo $iframe?>">
<input type="hidden" name="dropfield" value="<?php echo $dropfield?>">
<input type="hidden" name="smodule" value="<?php echo $smodule?>">
<input type="hidden" name="cmodule" value="<?php echo $cmodule?>">
<input type="hidden" name="p" value="<?php echo $p?>">
<input type="hidden" name="newboard" value="<?php echo $newboard?>">
<select name="where" class="form-control custom-select" >
<option value="name"<?php if($where == 'name'):?> selected="selected"<?php endif?>>게시판제목</option>
<option value="id"<?php if($where == 'id'):?> selected="selected"<?php endif?>>게시판ID</option>
</select>
<div class="input-group ml-2">
<input type="text" name="_keyw" size="15" value="<?php echo addslashes($_keyw)?>" class="form-control" />
<div class="input-group-append">
<input type="submit" value=" 검색 " class="btn btn-light">
<input type="button" value=" 리셋 " class="btn btn-light" onclick="thisReset();">
</div>
<!--<input type="button" value=" 새 게시판 " class="btn<?php echo $newboard?'gray':'blue'?>" onclick="this.form.newboard.value=1;this.form.submit();" />-->
</div> <!--.input-group-->
</form>
</div>
<?php if($newboard):?>
<form name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $smodule?>" />
<input type="hidden" name="a" value="makebbs" />
<input type="hidden" name="backUrl" value="<?php echo $g['s']?>/?r=<?php echo $r?>&system=<?php echo $system?>&iframe=<?php echo $iframe?>&dropfield=<?php echo $dropfield?>&smodule=<?php echo $smodule?>&cmodule=<?php echo $cmodule?>" />
<input type="hidden" name="hitcount" value="0">
<input type="hidden" name="recnum" value="20">
<input type="hidden" name="sbjcut" value="40">
<input type="hidden" name="newtime" value="24">
<input type="hidden" name="point1" value="0">
<input type="hidden" name="point2" value="0">
<input type="hidden" name="perm_l_list" value="0">
<input type="hidden" name="perm_l_view" value="0">
<input type="hidden" name="snsconnect" value="0">
<table>
<tr>
<td class="td1">
게시판이름
</td>
<td class="td2">
<input type="text" name="name" value="" class="input sname" />
아이디 <input type="text" name="id" value="" class="input sname2" />
<div id="guide_bbsidname" class="guide hide">
<span class="b">게시판이름</span> : 한글,영문등 자유롭게 등록할 수 있습니다.<br />
<span class="b">아이디</span> : 영문 대소문자+숫자+_ 조합으로 만듭니다.<br />
</div>
</td>
</tr>
<tr>
<td class="td1">
카 테 고 리
<img src="<?php echo $g['img_core']?>/_public/ico_q.gif" alt="도움말" title="도움말" class="hand" onclick="layerShowHide('guide_category','block','none');" />
</td>
<td class="td2">
<input type="text" name="category" value="" class="input sname1" />
<div id="guide_category" class="guide hide">
<span class="b">콤마(,)</span>로 구분해 주세요. <span class="b">첫분류는 분류제목</span>이 됩니다.<br />
보기)<span class="b">구분</span>,유머,공포,엽기,무협,기타
</div>
</td>
</tr>
<tr>
<td class="td1">레 이 아 웃</td>
<td class="td2">
<select name="layout" class="form-control custom-select">
<option value="">&nbsp;+ 사이트 대표레이아웃</option>
<?php $dirs = opendir($g['path_layout'])?>
<?php while(false !== ($tpl = readdir($dirs))):?>
<?php if($tpl=='.' || $tpl == '..' || $tpl == '_blank' || is_file($g['path_layout'].$tpl))continue?>
<?php $dirs1 = opendir($g['path_layout'].$tpl)?>
<option value="" disabled>--------------------------------</option>
<?php while(false !== ($tpl1 = readdir($dirs1))):?>
<?php if(!strstr($tpl1,'.php') || $tpl1=='_main.php')continue?>
<option value="<?php echo $tpl?>/<?php echo $tpl1?>">ㆍ<?php echo getFolderName($g['path_layout'].$tpl)?>(<?php echo str_replace('.php','',$tpl1)?>)</option>
<?php endwhile?>
<?php closedir($dirs1)?>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</td>
</tr>
<tr>
<td class="td1">게시판테마</td>
<td class="td2">
<select name="skin" class="form-control custom-select">
<option value="">&nbsp;+ 게시판 대표테마</option>
<option value="" disabled>--------------------------------</option>
<?php $tdir = $g['path_module'].$smodule.'/themes/_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>">ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</td>
</tr>
<tr>
<td class="td1 sfont1">(모바일접속)</td>
<td class="td2">
<select name="m_skin" class="form-control custom-select">
<option value="">&nbsp;+ 모바일 대표테마</option>
<option value="" disabled>--------------------------------</option>
<?php $tdir = $g['path_module'].$smodule.'/themes/_mobile/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>">ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</td>
</tr>
<tr>
<td class="td1">
연 결 메 뉴
<img src="<?php echo $g['img_core']?>/_public/ico_q.gif" alt="도움말" title="도움말" class="hand" onclick="layerShowHide('guide_sosokmenu','block','none');" />
</td>
<td class="td2">
<select name="sosokmenu" class="form-control custom-select">
<option value="">&nbsp;+ 사용안함</option>
<option value="" disabled>--------------------------------</option>
<?php include_once $g['path_core'].'function/menu1.func.php'?>
<?php $cat=$d['bbs']['sosokmenu']?>
<?php getMenuShowSelect($s,$table['s_menu'],0,0,0,0,0,'')?>
</select>
<div id="guide_sosokmenu" class="guide hide">
이 게시판을 연결할 메뉴를 지정해 주세요.<br />
연결메뉴를 지정하면 게시물수,로케이션이 동기화됩니다.<br />
</div>
</td>
</tr>
<tr>
<td class="td1">글쓰기권한</td>
<td class="td2">
<select name="perm_l_write" class="form-control custom-select">
<option value="0">&nbsp;+ 전체허용</option>
<option value="0" disabled>--------------------------------</option>
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
<?php while($_L=db_fetch_array($_LEVEL)):?>
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==1):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
<?php if($_L['gid'])break; endwhile?>
</select>
</td>
</tr>
</table>
<div class="mt-3">
<input type="submit" class="btn btn-primary" value="새게시판 만들기">
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=admin&amp;module=<?php echo $smodule?>&amp;front=main&amp;type=makebbs" target="_blank">더 자세히</a>
<a href="#." class="btn btn-light" onclick="thisReset();">취소</a>
</div>
</form>
<?php else:?>
<?php if($NUM):?>
<table class="table table-sm table-hover">
<colgroup>
<col width="30%">
<col>
<col width="32%">
</colgroup>
<tr>
<td class="name">
<a href="<?php echo $g['r']?>/?m=<?php echo $smodule?>" target="_blank" class="muted-link">
전체게시물
</a>
</td>
<td>
<?php include $g['path_module'].$smodule.'/var/var.php';?>
<select class="form-control custom-select form-control-sm">
<option><?php echo getFolderName($tdir.$d['bbs']['skin_total'])?></option>
</select>
</td>
<td class="text-right pr-2">
<button class="btn btn-light btn-sm" onclick="dropJoint('<?php echo $g['s']?>/?m=<?php echo $smodule?>');" /><i class="fa fa-link"></i> 연결하기</button>
</td>
</tr>
<?php while($R = db_fetch_array($PAGES)):?>
<?php include $g['path_var'].$smodule.'/var.'.$R['id'].'.php'?>
<tr<?php if($R['id']==$id):?> class="madetr"<?php endif?>>
<td class="align-middle">
<?php if($R['category']):?>
<select id="cat<?php echo $R['id']?>" class="form-control custom-select form-control-sm" title="<?php echo $R['id']?>">
<option value="">&nbsp;+ <?php echo $R['name']?></option>
<?php $_catexp = explode(',',$R['category']);$_catnum=count($_catexp)?>
<option value="" disabled>--------------------------------</option>
<?php for($i = 1; $i < $_catnum; $i++):if(!$_catexp[$i])continue;?>
<option value="<?php echo $_catexp[$i]?>">ㆍ<?php echo $_catexp[$i]?></option>
<?php endfor?>
</select>
<?php else:?>
<input type="hidden" id="cat<?php echo $R['id']?>" value="" class="form-control">
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $smodule?>&amp;bid=<?php echo $R['id']?>" target="_blank" title="게시판보기" class="muted-link">
<?php echo $R['name']?>
</a>
<span class="badge badge-light badge-pill"><?php echo $R['id']?></span>
<?php endif?>
</td>
<td class="align-middle">
<select class="form-control form-control-sm custom-select">
<option><?php echo $d['bbs']['skin'] ? getFolderName($tdir.$d['bbs']['skin']) : '게시판 대표테마'?></option>
</select>
</td>
<td class="align-middle text-right pr-2">
<button class="btn btn-light btn-sm" onclick="dropJoint('<?php echo $g['s']?>/?m=<?php echo $smodule?>&bid=<?php echo $R['id']?>'+(getId('cat<?php echo $R['id']?>').value?'&cat='+getId('cat<?php echo $R['id']?>').value:''));" /><i class="fa fa-link"></i> 연결하기</button>
</td>
</tr>
<?php endwhile?>
</table>
<div class="mt-3">
<ul class="pagination pagination-sm justify-content-center">
<script type="text/javascript">getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
</ul>
</div>
<?php else:?>
<div class="alert alert-warning">
<?php if($_keyw):?>
<i class="fa fa-exclamation-triangle"></i> 검색결과에 해당되는 게시판이 없습니다.
<?php else:?>
<i class="fa fa-exclamation-triangle"></i> 아직 게시판이 만들어지지 않았습니다. 게시판을 만들어주세요.
<?php endif?>
</div>
<?php endif?>
<?php endif?>
</div>
<style type="text/css">
#mjointbox {}
#mjointbox .title {padding:0 0 20px 0;}
#mjointbox table .name a {font-weight:bold;}
#mjointbox table .name a,
#mjointbox table .name span {position:relative;top:8px;}
#mjointbox table .name span {font-size:11px;color:#c0c0c0;padding-left:3px;}
#mjointbox .rb-page-box {text-align:center;border-top:#dfdfdf solid 1px;margin:20px 0 20px 0;}
.table td.text-right {padding-right: 0}
</style>
<script type="text/javascript">
//<![CDATA[
function thisReset()
{
var f = document.bbsSform;
f.newboard.value = '';
f.p.value = 1;
f._keyw.value = '';
f.submit();
}
function saveCheck(f)
{
if (f.name.value == '')
{
alert('게시판이름을 입력해 주세요. ');
f.name.focus();
return false;
}
if (f.bid.value == '')
{
if (f.id.value == '')
{
alert('게시판아이디를 입력해 주세요. ');
f.id.focus();
return false;
}
if (!chkFnameValue(f.id.value))
{
alert('게시판아이디는 영문 대소문자/숫자/_ 만 사용가능합니다. ');
f.id.value = '';
f.id.focus();
return false;
}
}
return confirm('정말로 새 게시판을 만드시겠습니까? ');
}
//]]>
</script>

View File

@@ -0,0 +1,7 @@
<?php
$d['amenu']['config'] = '기초환경';
$d['amenu']['main'] = '게시판 관리';
$d['amenu']['post'] = '게시물 관리';
$d['amenu']['notidoc'] = '알림 양식';
$d['amenu']['theme'] = '테마';
?>

View File

@@ -0,0 +1,130 @@
<?php
/**************************************************************
아래의 변수를 이용합니다.
$_iscallpage 통합검색 이거나 더보기일경우 true 아니면 false
$where 검색위치
$keyword 검색키워드
$orderby (desc 최신순 / asc 오래된순)
$d['search']['num1'] 전체검색 출력수
$d['search']['num2'] 전용검색 한 페이당 출력수
$d['search']['term'] 검색기간(월단위)
검색결과 DIV id 정의방법 : <div id="rb-search-모듈id-검색파일명"> ... </div>
***************************************************************
검색결과 추출 예제 ::
$sqlque = ''; // 검색용 SQL 초기화
if ($keyword)
{
$sqlque .= getSearchSql('검색필드',$keyword,'','or'); //검색필드 설정방법 : 1개의 필드 -> 필드명 , 복수의 필드 -> 필드명을 |(파이프) 로 구분
}
// 더보기 검색일 경우에만 실행함
if ($swhere == $_key)
{
$sort = 'uid'; // 기본 정렬필드
$RCD = getDbArray($table['테이블명'],$sqlque,'*',$sort,$orderby,$d['search']['num'.($swhere=='all'?1:2)],$p);
while($_R = db_fetch_array($RCD))
{
echo $_R['필드네임'];
}
}
$_ResultArray['num'][$_key] = getDbRows($table['테이블명'],$sqlque); // 검색어에 해당되는 결과갯수 <- 무조건 실행해야 됨
**************************************************************
아래의 예제는 실제로 페이지를 검색하는 샘플입니다.
페이징,더보기,검색결과 없을경우 안내등은 모두 자동으로 처리되니 결과 리스트만 출력해 주시면 됩니다.
최초 설치시 "이용약관" 이나 "개인정보" 로 검색하시면 결과값을 얻으실 수 있습니다.
**************************************************************/
?>
<?php
$sqlque = 'uid';
if ($d_start) $sqlque .= ' and d_regis > '.str_replace('/','',$d_start).'000000';
if ($d_finish) $sqlque .= ' and d_regis < '.str_replace('/','',$d_finish).'240000';
$sqlque .= getSearchSql('subject|tag',$q,'','or'); // 게시물 제목과 태그 검색
$orderby = 'desc';
if($_iscallpage):
$RCD = getDbArray($table['bbsdata'],$sqlque,'*','uid',$orderby,$d['search']['num'.($swhere=='all'?1:2)],$p);
include_once $g['path_module'].'bbs/var/var.php';
$g['url_module_skin'] = $g['s'].'/modules/bbs/themes/'.$d['bbs']['skin_main'];
$g['dir_module_skin'] = $g['path_module'].'bbs/themes/'.$d['bbs']['skin_main'].'/';
include_once $g['dir_module_skin'].'_widget.php';
?>
<article>
<ul class="list-group list-group-flush mb-0" data-role="bbs-list">
<?php while($_R=db_fetch_array($RCD)):?>
<?php $B = getUidData($table['bbslist'],$_R['bbs']); ?>
<li class="list-group-item d-flex justify-content-between align-items-center" id="item-<?php echo $_R['uid'] ?>">
<div class="media">
<?php if ($_R['featured_img']): ?>
<a class="mr-3" href="<?php echo getBbsPostLink($_R)?>" >
<img class="border" src="<?php echo getPreviewResize(getUpImageSrc($_R),'s') ?>" alt="" width="64" height="64">
</a>
<?php endif; ?>
<div class="media-body">
<strong class="d-block mb-1">
<?php if($_R['category']):?>
<span class="badge badge-light"><?php echo $_R['category']?></span>
<?php endif?>
<a class="muted-link" href="<?php echo getBbsPostLink($_R)?>">
<?php echo $_R['subject']?>
<?php if($_R['upload']):?>
<span class="badge badge-light" title="첨부파일">
<i class="fa fa-paperclip fa-lg"></i>
</span>
<?php endif?>
<?php if(getNew($_R['d_regis'],24)):?><span class="rb-new ml-1"></span><?php endif?>
</a>
</strong>
<p class="small text-muted mb-2">
<?php echo getStrCut(str_replace('&nbsp;',' ',strip_tags($_R['content'])),60,'..')?>
</p>
<ul class="list-inline text-muted mb-0 small">
<li class="list-inline-item">
<span class="badge badge-pill badge-light"><?php echo $B['name'] ?></span>
</li>
<li class="list-inline-item">
<time class="text-muted small" data-plugin="timeago" datetime="<?php echo getDateFormat($_R['d_regis'],'c')?>">
<?php echo getDateFormat($_R['d_regis'],'Y.m.d')?>
</time>
</li>
<li class="list-inline-item">
<i class="fa fa-heart-o" aria-hidden="true"></i>
<?php echo $_R['likes']?>
</li>
<li class="list-inline-item">
<i class="fa fa-eye" aria-hidden="true"></i>
<?php echo $_R['hit']?>
</li>
<li class="list-inline-item">
<i class="fa fa-comment-o" aria-hidden="true"></i>
<?php echo $_R['comment']?>
</li>
<li class="list-inline-item">
<?php echo $_R[$_HS['nametype']]?>
</li>
<li class="list-inline-item">
<i class="fa fa-tag" aria-hidden="true"></i>
<?php echo $_R['tag']?>
</li>
</ul>
</div>
</div>
</li>
<?php endwhile?>
</ul>
</article>
<?php
endif;
$_ResultArray['num'][$_key] = getDbRows($table['bbsdata'],$sqlque);
?>

View File

@@ -0,0 +1,120 @@
<?php
/**************************************************************
아래의 변수를 이용합니다.
$_iscallpage 통합검색 이거나 더보기일경우 true 아니면 false
$where 검색위치
$keyword 검색키워드
$orderby (desc 최신순 / asc 오래된순)
$d['search']['num1'] 전체검색 출력수
$d['search']['num2'] 전용검색 한 페이당 출력수
$d['search']['term'] 검색기간(월단위)
검색결과 DIV id 정의방법 : <div id="rb-search-모듈id-검색파일명"> ... </div>
***************************************************************
검색결과 추출 예제 ::
$sqlque = ''; // 검색용 SQL 초기화
if ($keyword)
{
$sqlque .= getSearchSql('검색필드',$keyword,'','or'); //검색필드 설정방법 : 1개의 필드 -> 필드명 , 복수의 필드 -> 필드명을 |(파이프) 로 구분
}
// 더보기 검색일 경우에만 실행함
if ($swhere == $_key)
{
$sort = 'uid'; // 기본 정렬필드
$RCD = getDbArray($table['테이블명'],$sqlque,'*',$sort,$orderby,$d['search']['num'.($swhere=='all'?1:2)],$p);
while($_R = db_fetch_array($RCD))
{
echo $_R['필드네임'];
}
}
$_ResultArray['num'][$_key] = getDbRows($table['테이블명'],$sqlque); // 검색어에 해당되는 결과갯수 <- 무조건 실행해야 됨
**************************************************************
아래의 예제는 실제로 페이지를 검색하는 샘플입니다.
페이징,더보기,검색결과 없을경우 안내등은 모두 자동으로 처리되니 결과 리스트만 출력해 주시면 됩니다.
최초 설치시 "이용약관" 이나 "개인정보" 로 검색하시면 결과값을 얻으실 수 있습니다.
**************************************************************/
?>
<?php
$sqlque = 'uid';
$sqlque .= getSearchSql('subject|content|tag',$keyword,'','or'); // 게시물 제목과 내용 검색
$orderby = 'desc';
if($_iscallpage):
$RCD = getDbArray($table['bbsdata'],$sqlque,'*','uid',$orderby,$d['search']['num'.($swhere=='all'?1:2)],$p);
include_once $g['path_module'].'bbs/var/var.php';
$g['url_module_skin'] = $g['s'].'/modules/bbs/themes/'.$d['bbs']['skin_mobile'];
$g['dir_module_skin'] = $g['path_module'].'bbs/themes/'.$d['bbs']['skin_mobile'].'/';
include_once $g['dir_module_skin'].'_widget.php';
?>
<ul class="table-view table-view-full mb-0 bg-white" data-role="bbs-list">
<?php while($_R=db_fetch_array($RCD)):?>
<?php $B = getUidData($table['bbslist'],$_R['bbs']); ?>
<li class="table-view-cell media" id="item-<?php echo $_R['uid'] ?>">
<a class=""
href="#modal-bbs-view" data-toggle="modal"
data-bid="<?php echo $B['id'] ?>"
data-uid="<?php echo $_R['uid'] ?>"
data-url="<?php echo getBbsPostLink($_R)?>"
data-cat="<?php echo $_R['category'] ?>"
data-title="<?php echo $B['name'] ?>"
data-subject="<?php echo $_R['subject'] ?>">
<?php if (getUpImageSrc($_R)): ?>
<img class="media-object pull-left border" src="<?php echo getPreviewResize(getUpImageSrc($_R),'q') ?>" width="64" height="64">
<?php endif; ?>
<div class="media-body">
<div class="">
<span class="badge badge-pill badge-light"><?php echo $B['name'] ?></span>
<time class="text-muted small ml-2" data-plugin="timeago" datetime="<?php echo getDateFormat($_R['d_regis'],'c')?>">
<?php echo getDateFormat($_R['d_regis'],'Y.m.d')?>
</time>
<?php if(getNew($_R['d_regis'],24)):?><span class="rb-new ml-1"></span><?php endif?>
</div>
<?php echo $_R['subject']?>
<p class="small">
<span class="badge badge-default badge-inverted">
<i class="fa fa-heart-o mr-1" aria-hidden="true"></i>
<?php echo $_R['likes']?>
</span>
<span class="badge badge-default badge-inverted ml-1">
<i class="fa fa-eye mr-1" aria-hidden="true"></i>
<?php echo $_R['hit']?>
</span>
<span class="badge badge-default badge-inverted ml-1">
<i class="fa fa-comment-o mr-1" aria-hidden="true"></i>
<?php echo $_R['comment']?>
</span>
<span class="badge badge-default badge-inverted ml-1">
<?php echo $_R[$_HS['nametype']]?>
</span>
<span class="badge badge-default badge-inverted ml-1">
<i class="fa fa-tag" aria-hidden="true"></i>
<?php echo $_R['tag']?>
</span>
</p>
</div>
</a>
</li>
<?php endwhile?>
</ul>
<?php
endif;
$_ResultArray['num'][$_key] = getDbRows($table['bbsdata'],$sqlque);
?>

View File

@@ -0,0 +1,413 @@
<?php
// 게시물 태그추출 함수
function getPostTag($tag,$bid){
global $g,$r;
$_tags=explode(',',$tag);
$_tagn=count($_tags);
$html='';
$bbs_list = $g['url_root'].'/?r='.$r.'&m=bbs&bid='.$bid;
$i=0;
for($i = 0; $i < $_tagn; $i++):;
$_tagk=trim($_tags[$i]);
if (!$g['mobile']||$_SESSION['pcmode']=='Y') {
$html.='<a href="'.$bbs_list.'&amp;where=subject|tag&amp;keyword='.$_tagk.'" class="badge badge-primary badge-outline">';
$html.=$_tagk;
$html.='</a>';
} else {
$html.='<span class="badge badge-primary badge-outline" data-act="tag" data-tag="'.$_tagk.'">';
$html.=$_tagk;
$html.='</span>';
}
endfor;
return $html;
}
// 첨부파일 리스트 갯수 추출 함수
function _getAttachNum($upload,$mod){
global $table;
$attach = getArrayString($upload);
$attach_file_num=0;// 첨부파일 수량
$hidden_file_num=0; // 숨김파일(다운로드 방지) 수량
foreach($attach['data'] as $val)
{
$U = getUidData($table['s_upload'],$val);
if($U['fileonly']==1) $attach_file_num++; // 전체 첨부파일 수량 증가
if($U['hidden']==1) $hidden_file_num++; // 숨김파일 수량 증가
}
$down_file_num=$attach_file_num-$hidden_file_num; // 다운로드 가능한 첨부파일
$result=array();
$result['modify']=$attach_file_num;
$result['view']=$down_file_num;
return $result[$mod];
}
// 첨부파일 리스트 추출 함수 (전체)
/*
$parent_data : 해당 포스트의 row 배열
$mod : upload or modal ==> 실제 업로드 모드 와 모달을 띄워서 본문에 삽입용도로 쓰거나
*/
function _getAttachFileList($parent_data,$mod,$type,$device){
global $table;
$upload=$parent_data['upload'];
$featured_img_uid=$parent_data['featured_img'];// 대표이미지 uid
$featured_video_uid=$parent_data['featured_video'];// 대표비디오 uid
$featured_audio_uid=$parent_data['featured_audio'];// 대표오디오 uid
if($type=='file') $sql='type=1 and hidden=0';
else if($type=='photo') $sql='type=2 and hidden=0';
else if($type=='audio') $sql='type=4 and hidden=0';
else if($type=='video') $sql='type=5 and hidden=0';
else if($type=='doc') $sql='type=6 and hidden=0';
else if($type=='zip') $sql='type=7 and hidden=0';
else $sql='type=1';
$attach = getArrayString($upload);
$uid_q='(';
foreach($attach['data'] as $uid)
{
$uid_q.='uid='.$uid.' or ';
}
$uid_q=substr($uid_q,0,-4).')';
$sql=$sql.' and '.$uid_q;
$RCD=getDbArray($table['s_upload'],$sql,'*','gid','asc','',1);
$html='';
while($R=db_fetch_array($RCD)){
$U=getUidData($table['s_upload'],$R['uid']);
if ($device =='mobile') {
if($type=='file') $html.=_getAttachFile_m($U,$mod,$featured_img_uid);
else if($type=='photo') $html.=_getAttachPhoto_m($U,$mod,$featured_img_uid);
else if($type=='audio') $html.=_getAttachAudio_m($U,$mod,$featured_audio_uid);
else if($type=='video') $html.=_getAttachVideo_m($U,$mod,$featured_video_uid);
else $html.=_getAttachFile_m($U,$mod,$featured_img_uid);;
} else {
if($type=='file') $html.=_getAttachFile($U,$mod,$featured_img_uid);
else if($type=='photo') $html.=_getAttachPhoto($U,$mod,$featured_img_uid);
else if($type=='audio') $html.=_getAttachAudio($U,$mod,$featured_audio_uid);
else if($type=='video') $html.=_getAttachVideo($U,$mod,$featured_video_uid);
else $html.=_getAttachFile($U,$mod,$featured_img_uid);;
}
}
return $html;
}
function _getAttachObjectArray($parent_data,$type){
global $table;
$upload=$parent_data['upload'];
$featured_img_uid=$parent_data['featured_img'];// 대표이미지 uid
$featured_video_uid=$parent_data['featured_video'];// 대표비디오 uid
$featured_audio_uid=$parent_data['featured_audio'];// 대표오디오 uid
if($type=='file') $sql='type=1 and hidden=0';
else if($type=='photo') $sql='type=2 and hidden=0';
else if($type=='audio') $sql='type=4 and hidden=0';
else if($type=='video') $sql='type=5 and hidden=0';
else if($type=='doc') $sql='type=6 and hidden=0';
else if($type=='zip') $sql='type=7 and hidden=0';
else $sql='type=1';
$attachArray = [];
$attach = getArrayString($upload);
$uid_q='(';
foreach($attach['data'] as $uid)
{
$uid_q.='uid='.$uid.' or ';
}
$uid_q=substr($uid_q,0,-4).')';
$sql=$sql.' and '.$uid_q;
$RCD=getDbArray($table['s_upload'],$sql,'*','gid','asc','',1);
// Loop through query and push results into $someArray;
// while ($R = mysqli_fetch_assoc($query)) {
while($R=db_fetch_array($RCD)){
$U=getUidData($table['s_upload'],$R['uid']);
$src = $U['src'];
array_push($attachArray, [
'src' => $src,
'w' => $U['width'],
'h' => $U['height'],
'title' => $U['caption']
]);
}
return $attachArray;
}
// 첨부파일 리스트 추출 함수 (데스크탑,사진)
function _getAttachPhoto($R,$mod,$featured_img_uid) {
global $g,$r;
$fileName=explode('.',$R['name']);
$file_name=$fileName[0]; // 파일명만 분리
$caption=$R['caption']?$R['caption']:$file_name;
$img_origin=$R['src'];
$img_origin_size=$R['width'].'x'.$R['height'];
$thumb_list=getPreviewResize($R['src'],'c'); // 미리보기 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$thumb_modal=getPreviewResize($R['src'],'q'); // 정보수정 모달용 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$insert_text='!['.$caption.']('.$g['url_root'].$img_origin.')';
$html='';
$html.='
<figure class="card figure" data-id="'.$R['uid'].'">';
$html.='
<a href="'.$img_origin.'" data-size="'.$img_origin_size.'">
<img class="card-img-top img-fluid" src="'.$img_origin.'" alt="'.$caption.'">
<button type="button" class="btn"><i class="fa fa-search-plus fa-lg" aria-hidden="true"></i></button>
</a>
<figcaption class="figure-caption hidden">'.$caption.'</figcaption>';
$html.='
</div>
</figure>';
return $html;
}
// 첨부파일 리스트 추출 함수 (데스크탑,파일)
function _getAttachFile($R,$mod,$featured_img_uid) {
global $g,$r;
$fileName=explode('.',$R['name']);
$file_name=$fileName[0]; // 파일명만 분리
if ($R['type']==2) {
$type='photo';
} elseif($R['type']==4) {
$type='audio';
} elseif($R['type']==5) {
$type='video';
} else {
$type='file';
}
if($type=='photo'){
$caption=$R['caption']?$R['caption']:$file_name;
$img_origin=$R['src'];
$thumb_list=getPreviewResize($img_origin,'c'); // 미리보기 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$thumb_modal=getPreviewResize($img_origin,'q'); // 정보수정 모달용 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
}else if($type=='file'){
$src=$R['host'].'/'.$R['folder'].'/'.$R['name'];
$download_link=$g['url_root'].'/?r='.$r.'&m=mediaset&a=download&uid='.$R['uid'];
}
$ext_to_fa=array('xls'=>'excel','xlsx'=>'-excel','ppt'=>'powerpoint','pptx'=>'powerpoint','txt'=>'text','pdf'=>'pdf','zip'=>'archive','doc'=>'word');
$ext_icon=in_array($R['ext'],array_keys($ext_to_fa))?'-'.$ext_to_fa[$R['ext']]:'';
$html='';
if($R['type']==2){
$html.='<div class="list-group-item" data-id="'.$R['uid'].'">';
$html.='<div class="media">
<img class="mr-2" src="'.$thumb_list.'" alt="'.$caption.'">
<div class="media-body">';
$html.='<span class="badge badge-default'.($R['uid']==$featured_img_uid?'':' hidden-xs-up').'" data-role="attachList-label-featured" data-id="'.$R['uid'].'">대표</span> ';
$html.='<span class="badge badge-default'.(!$R['hidden']?' hidden-xs-up':'').'" data-role="attachList-label-hidden-'.$R['uid'].'">숨김</span>';
$html.='<a href="'.$download_link.'">'.$R['name'].'</a>
<span class="badge badge-light">'.getSizeFormat($R['size'],2).'</span>
</div></div>';
} else {
$html.='<a class="list-group-item list-group-item-action d-flex justify-content-between align-items-center" href="'.$download_link.'">';
$html.='<span><i class="fa fa-file'.$ext_icon.'-o fa-fw fa-lg"></i> '.$R['name'].'</span>';
$html.='<span><span class="badge badge-light">'.getSizeFormat($R['size'],2).'</span> <span class="badge badge-light"><i class="fa fa-download" aria-hidden="true"></i> '.$R['down'].'</span></span></a>';
}
return $html;
}
// 오디오파일 리스트 추출 함수 (데스크탑,오디오)
function _getAttachAudio($R,$mod,$featured_audio_uid) {
global $g,$r;
$fileName=explode('.',$R['name']);
$file_name=$fileName[0]; // 파일명만 분리
$caption=$R['caption']?$R['caption']:$file_name;
$html='';
$html.='
<li class="table-view-cell p-0" data-id="'.$R['uid'].'">';
$html.='<span class="badge badge-default'.($R['uid']==$featured_audio_uid?'':' hidden-xs-up').'" data-role="attachList-label-featured" data-id="'.$R['uid'].'">대표</span> ';
$html.='<span class="badge badge-default'.(!$R['hidden']?' hidden-xs-up':'').'" data-role="attachList-label-hidden-'.$R['uid'].'">숨김</span>';
$html.='
<audio controls data-plugin="mediaelement" class="w-100"><source src="'.$R['host'].'/'.$R['folder'].'/'.$R['tmpname'].'" type="audio/mpeg"></audio>';
$html.='</li>';
return $html;
}
// 비디오파일 리스트 추출 함수 (데스크탑,비디오)
function _getAttachVideo($R,$mod,$featured_video_uid) {
global $g,$r;
$fileName=explode('.',$R['name']);
$file_name=$fileName[0]; // 파일명만 분리
$caption=$R['caption']?$R['caption']:$file_name;
$html='';
$html.='
<div class="card bg-white" data-id="'.$R['uid'].'">';
$html.='
<video controls data-plugin="mediaelement" class="card-img-top img-fluid" width="640" height="360" style="max-width:100%;"><source src="'.$R['host'].'/'.$R['folder'].'/'.$R['tmpname'].'" type="video/'.$R['ext'].'"></video>';
$html.='<div class="card-block"><h5 class="card-title">'.$R['name'].'</h5>';
$html.='
<p class="card-text text-muted"><small>'.getSizeFormat($R['size'],2).'</small></p></div></div>';
return $html;
}
// 첨부파일 리스트 추출 함수 (모바일,사진)
function _getAttachPhoto_m($R,$mod,$featured_img_uid) {
global $g,$r;
$fileName=explode('.',$R['name']);
$file_name=$fileName[0]; // 파일명만 분리
$caption=$R['caption']?$R['caption']:$file_name;
$img_origin=$R['src'];
$img_origin_size=$R['width'].'x'.$R['height'];
$thumb_list=getPreviewResize($R['src'],'c'); // 미리보기 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$thumb_modal=getPreviewResize($R['src'],'q'); // 정보수정 모달용 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$insert_text='!['.$caption.']('.$g['url_root'].$img_origin.')';
$html='';
$html.='
<figure class="card figure" data-id="'.$R['uid'].'">';
$html.='
<a href="'.$img_origin.'" data-size="'.$img_origin_size.'">
<img class="card-img-top img-fluid" src="'.$img_origin.'" alt="'.$caption.'">
<button type="button" class="btn"><i class="fa fa-search-plus fa-lg" aria-hidden="true"></i></button>
</a>
<figcaption class="figure-caption hidden">'.$caption.'</figcaption>';
$html.='
</div>
</figure>';
return $html;
}
// 첨부파일 리스트 추출 함수 (모바일,파일)
function _getAttachFile_m($R,$mod,$featured_img_uid) {
global $g,$r;
$fileName=explode('.',$R['name']);
$file_name=$fileName[0]; // 파일명만 분리
if ($R['type']==2) {
$type='photo';
} elseif($R['type']==4) {
$type='audio';
} elseif($R['type']==5) {
$type='video';
} else {
$type='file';
}
if($type=='photo'){
$caption=$R['caption']?$R['caption']:$file_name;
$img_origin=$R['host'].'/'.$R['folder'].'/'.$R['tmpname'];
$thumb_list=getPreviewResize($img_origin,'c'); // 미리보기 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$thumb_modal=getPreviewResize($img_origin,'q'); // 정보수정 모달용 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
}else if($type=='file'){
$src=$R['host'].'/'.$R['folder'].'/'.$R['name'];
$download_link=$g['url_root'].'/?r='.$r.'&m=mediaset&a=download&uid='.$R['uid'];
}
$ext_to_fa=array('xls'=>'excel','xlsx'=>'-excel','ppt'=>'powerpoint','pptx'=>'powerpoint','txt'=>'text','pdf'=>'pdf','zip'=>'archive','doc'=>'word');
$ext_icon=in_array($R['ext'],array_keys($ext_to_fa))?'-'.$ext_to_fa[$R['ext']]:'';
$html='';
$html.='<li class="table-view-cell" data-id="'.$R['uid'].'"><a href="'.$download_link.'">';
$html.='<span class="badge badge-default badge-outline"><i class="fa fa-download" aria-hidden="true"></i> '.$R['down'].'</span>';
if($R['type']==2){
$html.='
<img class="media-object pull-left" src="'.$thumb_list.'" alt="'.$caption.'">
<div class="media-body">';
$html.='<span>'.$R['name'].'</span>
<span class="small">'.getSizeFormat($R['size'],2).'</span>
</div>';
} else {
$html.='
<span class="media-object pull-left pt-1"><i class="fa fa-file'.$ext_icon.'-o fa-fw fa-2x"></i></span>';
$html.='<div class="media-body">';
$html.=$R['name'].'
<span class="badge badge-default badge-inverted ml-2">'.getSizeFormat($R['size'],2).'</span>
</div>';
}
$html.='</a></li>';
return $html;
}
// 오디오파일 리스트 추출 함수 (모바일,오디오)
function _getAttachAudio_m($R,$mod,$featured_audio_uid) {
global $g,$r;
$fileName=explode('.',$R['name']);
$file_name=$fileName[0]; // 파일명만 분리
$caption=$R['caption']?$R['caption']:$file_name;
$html='';
$html.='
<li class="table-view-cell p-0" data-id="'.$R['uid'].'">';
$html.='<span class="badge badge-default'.($R['uid']==$featured_audio_uid?'':' hidden-xs-up').'" data-role="attachList-label-featured" data-id="'.$R['uid'].'">대표</span> ';
$html.='<span class="badge badge-default'.(!$R['hidden']?' hidden-xs-up':'').'" data-role="attachList-label-hidden-'.$R['uid'].'">숨김</span>';
$html.='
<audio controls data-plugin="mediaelement" class="w-100"><source src="'.$R['host'].'/'.$R['folder'].'/'.$R['tmpname'].'" type="audio/mpeg"></audio>';
$html.='</li>';
return $html;
}
// 비디오파일 리스트 추출 함수 (모바일,비디오)
function _getAttachVideo_m($R,$mod,$featured_video_uid) {
global $g,$r;
$fileName=explode('.',$R['name']);
$file_name=$fileName[0]; // 파일명만 분리
$caption=$R['caption']?$R['caption']:$file_name;
$html='';
$html.='
<div class="card bg-white" data-id="'.$R['uid'].'">';
$html.='
<video controls data-plugin="mediaelement" class="card-img-top img-fluid" width="640" height="360" style="max-width:100%;"><source src="'.$R['host'].'/'.$R['folder'].'/'.$R['tmpname'].'" type="video/'.$R['ext'].'"></video>';
$html.='<div class="card-block"><h5 class="card-title">'.$R['name'].'</h5>';
$html.='
<p class="card-text text-muted"><small>'.getSizeFormat($R['size'],2).'</small></p></div></div>';
return $html;
}
// 본문삽입 이미지 uid 얻기 함수
function _getInsertImgUid($upload)
{
global $table;
$u_arr = getArrayString($upload);
$Insert_arr=array();
$i=0;
foreach ($u_arr['data'] as $val) {
$U=getUidData($table['s_upload'],$val);
if(!$U['fileonly']) $Insert_arr[$i]=$val;
$i++;
}
$upfiles='';
// 중괄로로 재조립
foreach ($Insert_arr as $uid) {
$upfiles.='['.$uid.']';
}
return $upfiles;
}
?>

View File

@@ -0,0 +1,127 @@
<?php
// 모듈 기본환경 설정
class Bbs_base {
public $module;
public function __construct() {
global $g,$table;
$this->module = 'bbs';
}
// 테이블명 추출
public function table($lastname){
global $table;
return $table[$this->module.$lastname];
}
// mobile 여부 값 추출
public function is_mobile(){
global $g;
if($g['mobile']&&$_SESSION['pcmode']!='Y') return true;
else return false;
}
// device 정보 추출
public function getUserAgent(){
$device = '';
$result = array();
if( stristr($_SERVER['HTTP_USER_AGENT'],'ipad') ) {
$device = "ipad";
} else if( stristr($_SERVER['HTTP_USER_AGENT'],'iphone') || strstr($_SERVER['HTTP_USER_AGENT'],'iphone') ) {
$device = "iphone";
} else if( stristr($_SERVER['HTTP_USER_AGENT'],'blackberry') ) {
$device = "blackberry";
} else if( stristr($_SERVER['HTTP_USER_AGENT'],'android') ) {
$device = "android";
}
if( $device ) {
return $device;
} return false; {
return false;
}
}
public function getAssoc($query){
$rows=array();
$result=$this->db->query($query);
while ($row=$this->db->fetch_assoc($result)) $rows[]=$row;
return $rows;
}
public function getArray($query){
$rows=array();
$result=$this->db->query($query);
while ($row=$this->db->fetch_array($result)) $rows[]=$row;
return $rows;
}
public function getRows($query){
$result=$this->db->query($query);
$rows=$this->db->num_rows($result);
return $rows;
}
// uid 기준 row 데이타 추출
public function getUidData($table,$uid){
$query= sprintf("SELECT * FROM `%s` WHERE `uid` = %s",$table,$this->db->real_escape_string($uid));
$rows = $this->getArray($query);
return $rows[0];
}
// 숫자 변경 함수
public function formatWithSuffix($input)
{
$suffixes = array('', 'K', 'M', 'G', 'T');
$suffixIndex = 0;
while(abs($input) >= 1000 && $suffixIndex < sizeof($suffixes))
{
$suffixIndex++;
$input /= 1000;
}
return (
$input > 0
// precision of 3 decimal places
? floor($input * 1000) / 1000
: ceil($input * 1000) / 1000
)
. $suffixes[$suffixIndex];
}
// 사용자 입력내용 중 해시태그 분리 함수
public function gethashtags($text)
{
//Match the hashtags
preg_match_all('/(^|[^0-9a-zA-Z가-힣_])#([0-9a-zA-Z가-힣]+)/i', $text, $matchedHashtags);
$hashtag = '';
// For each hashtag, strip all characters but alpha numeric
if(!empty($matchedHashtags[0])) {
foreach($matchedHashtags[0] as $match) {
$hashtag .= preg_replace("/[^0-9a-zA-Z가-힣]+/i", "", $match).',';
}
}
//to remove last comma in a string
return rtrim($hashtag, ',');
}
// 해시태그 분리하여 링크 추가 함수
public function addLink_hashtag($message)
{
global $g;
$parsedMessage = preg_replace(array('/(?i)\b((?:https?:\/\/|www\d{0,3}[.]|[0-9a-zA-Z가-힣.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))/', '/(^|[^0-9a-zA-Z가-힣_])@([0-9a-zA-Z가-힣_]+)/i', '/(^|[^0-9a-zA-Z가-힣_])#([0-9a-zA-Z가-힣_]+)/i'), array('<a href="$1" target="_blank">$1</a>', '$1<a href="">@$2</a>', '$1<a class="hash-alink" href="'.$g['s'].'/?m=sns&mod=search&tag=$2">#$2</a>'), $message);
return $parsedMessage;
}
}
?>

View File

@@ -0,0 +1,43 @@
<?php
class Bbs extends Bbs_base{
public $parent;
public $parent_table;
public $theme_name;
public $recnum; // 출력 기본 값
public $sort;
public $orderby;
public $oneline_recnum = 5;
// 테마 패스 추출함수
public function getThemePath($type){
global $g;
if($type=='relative') $result = $g['path_module'].$this->module.'/themes/'.$this->theme_name;
else if($type=='absolute') $result = $g['url_root'].'/modules/'.$this->module.'/themes/'.$this->theme_name;
return $result;
}
// get html & replace-parse
public function getHtml($fileName) {
global $g,$TMPL;
$theme_path = $this->getThemePath('relative');
$file = sprintf($theme_path.'/_html/%s.html', $fileName);
$fh_skin = fopen($file, 'r');
$skin = @fread($fh_skin, filesize($file));
fclose($fh_skin);
//return $skin;
return $this->getParseHtml($skin);
}
public function getParseHtml($skin) {
global $TMPL;
// $skin = preg_replace_callback('/{\$lng->(.+?)}/i', create_function('$matches', 'global $LNG; return $LNG[$matches[1]];'), $skin);
$skin = preg_replace_callback('/{\$([a-zA-Z0-9_]+)}/', create_function('$matches', 'global $TMPL; return (isset($TMPL[$matches[1]])?$TMPL[$matches[1]]:"");'), $skin);
return $skin;
}
}
?>

230
modules/bbs/main.php Normal file
View File

@@ -0,0 +1,230 @@
<?php
if(!defined('__KIMS__')) exit;
$d['bbs']['skin'] = $d['bbs']['skin_total'];
$d['bbs']['isperm'] = true;
if($uid)
{
$R = $R['uid'] ? $R : getUidData($table[$m.'data'],$uid);
if (!$R['uid']) getLink($g['s'].'/','','존재하지 않는 게시물입니다.','');
$B = getUidData($table[$m.'list'],$R['bbs']);
include_once $g['path_var'].'bbs/var.'.$B['id'].'.php';
include_once $g['dir_module'].'mod/_view.php';
if ($d['bbs']['isperm'])
{
if(strpos('_'.$B['puthead'],'[v]'))
{
$g['add_header_inc'] = $g['dir_module'].'var/code/'.$B['id'].'.header.php';
if($B['imghead']) $g['add_header_img'] = $g['url_module'].'/var/files/'.$B['imghead'];
}
if(strpos('_'.$B['putfoot'],'[v]'))
{
$g['add_footer_inc'] = $g['dir_module'].'var/code/'.$B['id'].'.footer.php';
if($B['imgfoot']) $g['add_footer_img'] = $g['url_module'].'/var/files/'.$B['imgfoot'];
}
if($R['mbruid']) $g['member'] = getDbData($table['s_mbrdata'],'memberuid='.$R['mbruid'],'*');
$g['browtitle'] = strip_tags($R['subject']).' - '.$B['name'].' - '.$_HS['name'];
$g['meta_tit'] = strip_tags($R['subject']).' - '.$B['name'].' - '.$_HS['name'];
$g['meta_sbj'] = str_replace('"','\'',$R['subject']);
$g['meta_key'] = $R['tag'] ? $B['name'].','.$R['tag'] : $B['name'].','.str_replace('"','\'',$R['subject']);
$g['meta_des'] = getStrCut(getStripTags($R['content']),150,'');
$g['meta_cla'] = $R['category'];
$g['meta_rep'] = '';
$g['meta_lan'] = 'kr';
$g['meta_bui'] = getDateFormat($R['d_regis'],'Y.m.d');
// 로그인한 사용자가 게시물에 좋아요/싫어요를 했는지 여부 체크
$check_like_qry = "mbruid='".$my['uid']."' and module='".$m."' and entry='".$uid."' and opinion='like'";
$check_dislike_qry = "mbruid='".$my['uid']."' and module='".$m."' and entry='".$uid."' and opinion='dislike'";
$is_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
// 로그인한 사용자가 게시물을 저장했는지 여부 체크
$check_saved_qry = "mbruid='".$my['uid']."' and module='".$m."' and entry='".$uid."'";
$is_saved = getDbRows($table['s_saved'],$check_saved_qry);
}
}
else {
if($bid)
{
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
if (!$B['uid'])
{
if($_stop=='Y') exit;
getLink($g['s'].'/?r='.$r.'&_stop=Y','','존재하지 않는 게시판입니다.','');
}
include_once $g['path_var'].'bbs/var.'.$B['id'].'.php';
$_SEO = getDbData($table['s_seo'],'rel=3 and parent='.$B['uid'],'*');
if ($_SEO['uid'])
{
$g['meta_tit'] = $_SEO['title'];
$g['meta_sbj'] = $_SEO['subject'];
$g['meta_key'] = $_SEO['keywords'];
$g['meta_des'] = $_SEO['description'];
$g['meta_cla'] = $_SEO['classification'];
$g['meta_rep'] = $_SEO['replyto'];
$g['meta_lan'] = $_SEO['language'];
$g['meta_bui'] = $_SEO['build'];
}
else {
$g['meta_tit'] = $B['name'].' - '.$_HS['name'];
$g['meta_sbj'] = $B['name'];
$g['meta_key'] = $B['name'];
}
if(!$_HM['uid']) $g['browtitle'] = $g['browtitle'] = $B['name'].' - '.$_HS['name'];
}
else {
if (!$d['bbs']['skin_total']) getLink('','','게시판아이디가 지정되지 않았습니다.','-1');
}
}
$mod = $mod ? $mod : 'list';
$sort = $sort ? $sort : 'gid';
$orderby= $orderby && strpos('[asc][desc]',$orderby) ? $orderby : 'asc';
$recnum = $recnum && $recnum < 200 ? $recnum : $d['bbs']['recnum'];
if ($mod == 'list')
{
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
{
if ($d['bbs']['perm_l_list'] > $my['level'] || strpos('_'.$d['bbs']['perm_g_list'],'['.$my['mygroup'].']'))
{
$g['main'] = $g['dir_module'].'mod/_permcheck.php';
$d['bbs']['isperm'] = false;
}
}
if ($d['bbs']['isperm'])
{
if(strpos('_'.$B['puthead'],'[l]'))
{
$g['add_header_inc'] = $g['dir_module'].'var/code/'.$B['id'].'.header.php';
if($B['imghead']) $g['add_header_img'] = $g['url_module'].'/var/files/'.$B['imghead'];
}
if(strpos('_'.$B['putfoot'],'[l]'))
{
$g['add_footer_inc'] = $g['dir_module'].'var/code/'.$B['id'].'.footer.php';
if($B['imgfoot']) $g['add_footer_img'] = $g['url_module'].'/var/files/'.$B['imgfoot'];
}
}
if (!$d['bbs']['hidelist']) include_once $g['dir_module'].'mod/_list.php';
}
else if ($mod == 'write')
{
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
{
if ($d['bbs']['perm_l_write'] > $my['level'] || strpos('_'.$d['bbs']['perm_g_write'],'['.$my['mygroup'].']'))
{
$g['main'] = $g['dir_module'].'mod/_permcheck.php';
$d['bbs']['isperm'] = false;
}
if ($R['uid'] && $reply != 'Y')
{
if ($my['uid'] != $R['mbruid'])
{
if (!strpos('_'.$_SESSION['module_'.$m.'_pwcheck'],'['.$R['uid'].']')) $g['main'] = $g['dir_module'].'mod/_pwcheck.php';
}
}
}
if ($d['bbs']['isperm'])
{
if(strpos('_'.$B['puthead'],'[w]'))
{
$g['add_header_inc'] = $g['dir_module'].'var/code/'.$B['id'].'.header.php';
if($B['imghead']) $g['add_header_img'] = $g['url_module'].'/var/files/'.$B['imghead'];
}
if(strpos('_'.$B['putfoot'],'[w]'))
{
$g['add_footer_inc'] = $g['dir_module'].'var/code/'.$B['id'].'.footer.php';
if($B['imgfoot']) $g['add_footer_img'] = $g['url_module'].'/var/files/'.$B['imgfoot'];
}
}
if ($reply == 'Y') $R['subject'] = $d['bbs']['restr'].$R['subject'];
if (!$R['uid']) $R['content'] = $B['writecode'] ? $B['writecode'] : $R['content'];
$_SESSION['wcode'] = $date['totime'];
}
else if ($mod == 'delete')
{
$g['main'] = $g['dir_module'].'mod/_pwcheck.php';
}
else if ($mod == 'rss')
{
include_once $g['dir_module'].'mod/_rss.php';
exit;
}
$_HM['layout'] = $_HM['layout'] ? $_HM['layout'] : $d['bbs']['layout'];
$d['bbs']['skin'] = $d['bbs']['skin'] ? $d['bbs']['skin'] : $d['bbs']['skin_main'];
$d['bbs']['m_skin'] = $d['bbs']['m_skin'] ? $d['bbs']['m_skin'] : $d['bbs']['skin_mobile'];
$d['bbs']['attach'] = $d['bbs']['a_skin'] ? $d['bbs']['a_skin'] : $d['bbs']['attach_main'];
$d['bbs']['m_attach'] = $d['bbs']['a_mskin'] ? $d['bbs']['a_mskin'] : $d['bbs']['attach_mobile'];
$d['bbs']['c_skin'] = $d['bbs']['c_skin']?$d['bbs']['c_skin']:$d['bbs']['comment_main'];
$d['bbs']['c_mskin'] = $d['bbs']['c_mskin']?$d['bbs']['c_mskin']:$d['bbs']['comment_mobile'];
$d['bbs']['c_skin_modal'] = $d['bbs']['c_skin_modal']?$d['bbs']['c_skin_modal']:$d['bbs']['comment_main_modal'];
$d['bbs']['skin'] = $skin ? $skin : $d['bbs']['skin'];
if ($g['mobile']&&$_SESSION['pcmode']!='Y')
{
$_HM['m_layout'] = $_HM['m_layout'] ? $_HM['m_layout'] : $d['bbs']['m_layout'];
$d['bbs']['skin'] = $d['bbs']['m_skin'] ? $d['bbs']['m_skin'] : ($d['bbs']['skin_mobile']?$d['bbs']['skin_mobile']:$d['bbs']['skin_main']);
}
include_once $g['path_module'].$m.'/themes/'.$d['bbs']['skin'].'/_var.php';
if ($c) $g['bbs_reset'] = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').'c='.$c,array($skin?'skin':'',$iframe?'iframe':'',$cat?'cat':''));
else $g['bbs_reset'] = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').'m='.$m,array($bid?'bid':'',$skin?'skin':'',$iframe?'iframe':'',$cat?'cat':''));
$g['bbs_list'] = $g['bbs_reset'].getLinkFilter('',array($p>1?'p':'',$sort!='gid'?'sort':'',$orderby!='asc'?'orderby':'',$recnum!=$d['bbs']['recnum']?'recnum':'',$type?'type':'',$where?'where':'',$keyword?'keyword':''));
$g['pagelink'] = $g['bbs_list'];
$g['bbs_orign'] = $g['bbs_reset'];
$g['bbs_view'] = $g['bbs_list'].'&amp;uid=';
$g['bbs_write'] = $g['bbs_list'].'&amp;mod=write';
$g['bbs_modify']= $g['bbs_write'].'&amp;uid=';
$g['bbs_reply'] = $g['bbs_write'].'&amp;reply=Y&amp;uid=';
$g['bbs_action']= $g['bbs_list'].'&amp;a=';
$g['bbs_delete']= $g['bbs_action'].'delete&amp;uid=';
$g['bbs_rss'] = $g['bbs_list'].'&amp;mod=rss';
if ($_HS['rewrite'] && $sort == 'gid' && $orderby == 'asc' && $recnum == $d['bbs']['recnum'] && $p==1 && $bid && !$cat && !$skin && !$type && !$iframe)
{
$g['bbs_reset']= $g['r'].'/b/'.$bid;
$g['bbs_list'] = $g['bbs_reset'];
$g['bbs_view'] = $g['bbs_list'].'/';
$g['bbs_write']= $g['bbs_list'].'/write';
}
$g['dir_module_skin'] = $g['dir_module'].'themes/'.$d['bbs']['skin'].'/';
$g['url_module_skin'] = $g['url_module'].'/themes/'.$d['bbs']['skin'];
$g['img_module_skin'] = $g['url_module_skin'].'/image';
$g['dir_module_mode'] = $g['dir_module_skin'].$mod;
$g['url_module_mode'] = $g['url_module_skin'].'/'.$mod;
$g['url_reset'] = $g['s'].'/?r='.$r.'&m='.$m; // 기본링크
$g['push_location'] = '<li class="breadcrumb-item active">'.$_HMD['name'].'</li>'; // 현재위치 셋팅
if($_m != $g['sys_module']&&!$_HM['uid']) $g['location'] .= ' &gt; <a href="'.$g['bbs_reset'].'">'.($B['uid']?$B['name']:'전체게시물').'</a>';
if($d['bbs']['sosokmenu'])
{
$c=substr($d['bbs']['sosokmenu'],-1)=='/'?str_replace('/','',$d['bbs']['sosokmenu']):$d['bbs']['sosokmenu'];
$_CA = explode('/',$c);
$_FHM = getDbData($table['s_menu'],"id='".$_CA[0]."' and site=".$s,'*');
$_tmp['count'] = count($_CA);
$_tmp['split_id'] = '';
for ($_i = 0; $_i < $_tmp['count']; $_i++)
{
$_tmp['location'] = getDbData($table['s_menu'],"id='".$_CA[$_i]."'",'*');
$_tmp['split_id'].= ($_i?'/':'').$_tmp['location']['id'];
$g['location'] .= ' &gt; <a href="'.RW('c='.$_tmp['split_id']).'">'.$_tmp['location']['name'].'</a>';
$_HM['uid'] = $_tmp['location']['uid'];
$_HM['name'] = $_tmp['location']['name'];
$_HM['addinfo'] = $_tmp['location']['addinfo'];
}
}
$g['main'] = $g['main'] ? $g['main'] : $g['dir_module_mode'].'.php';
?>

42
modules/bbs/mod/_list.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
if(!defined('__KIMS__')) exit;
$bbsque0 = 'site='.$s;
$bbsque1 = 'site='.$s.' and notice=1';
$bbsque2 = 'site='.$s.' and notice=0';
if ($B['uid'])
{
$bbsque0 .= ' and bbs='.$B['uid'];
$bbsque1 .= ' and bbs='.$B['uid'];
$bbsque2 .= ' and bbs='.$B['uid'];
}
$RCD = array();
$NCD = array();
$NTC = getDbArray($table[$m.'idx'],$bbsque1,'gid','gid',$orderby,0,0);
while($_R = db_fetch_array($NTC)) $NCD[] = getDbData($table[$m.'data'],'gid='.$_R['gid'],'*');
$NUM_NOTICE = count($NCD);
if ($sort == 'gid' && !$keyword && !$cat)
{
$NUM = getDbCnt($table[$m.'month'],'sum(num)',$bbsque0)-count($NCD);
$TCD = getDbArray($table[$m.'idx'],$bbsque2,'gid',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table[$m.'data'],'gid='.$_R['gid'],'*');
}
else {
if ($cat) $bbsque2 .= " and category='".$cat."'";
if ($where && $keyword)
{
if (strpos('[name][nic][id][ip]',$where)) $bbsque2 .= " and ".$where."='".$keyword."'";
else if ($where == 'term') $bbsque2 .= " and d_regis like '".$keyword."%'";
else $bbsque2 .= getSearchSql($where,$keyword,$ikeyword,'or');
}
$NUM = getDbRows($table[$m.'data'],$bbsque2);
$TCD = getDbArray($table[$m.'data'],$bbsque2,'*',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = $_R;
}
$TPG = getTotalPage($NUM,$recnum);
?>

View File

@@ -0,0 +1,53 @@
<?php if ($g['mobile']&&$_SESSION['pcmode']!='Y'): ?>
<header class="bar bar-nav bar-light bg-faded">
<a class="icon icon-left-nav pull-left" role="button" data-history="back"></a>
<h1 class="title"><?php echo $B['name'] ?></h1>
</header>
<div class="content">
<div class="content-padded text-xs-center text-muted pt-5">
<h3 class="">
<div class="d-block mb-3"><i class="fa fa-exclamation-circle fa-lg fa-2x"></i></div>
서비스 안내
</h3>
<ul class="list-unstyled text-left mt-4 small">
<?php if ($my['uid']): ?>
<li>요청하신 게시판의 접근권한이 없습니다.</li>
<?php else: ?>
<li>요청하신 게시판에는 권한이 있어야 접근하실 수 있습니다.</li>
<li>로그인 후에 이용하세요.</li>
<?php endif; ?>
</ul>
<?php if (!$my['uid']): ?>
<button type="button" class="btn btn-outline-primary btn-block mt-3" data-toggle="modal" data-target="#modal-login">로그인 하기</button>
<?php endif; ?>
<button type="button" class="btn btn-secondary btn-block mt-2" data-history="back">이전가기</button>
</div>
</div><!-- /.content -->
<?php else: ?>
<div class="mt-5 mx-auto w-50 text-center text-center text-muted">
<h3 class="mb-3">
<div class="d-block mb-3"><i class="fa fa-exclamation-circle fa-lg fa-3x"></i></div>
서비스 안내
</h3>
<ul class="list-unstyled my-4">
<?php if ($my['uid']): ?>
<li>요청하신 게시판의 접근권한이 없습니다.</li>
<?php else: ?>
<li>요청하신 게시판에는 권한이 있어야 접근하실 수 있습니다.</li>
<li>로그인 후에 이용하세요.</li>
<?php endif; ?>
</ul>
<?php if (!$my['uid']): ?>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-login">로그인 하기</button>
<?php endif; ?>
<button type="button" class="btn btn-light" onclick="history.back();">이전가기</button>
</div>
<?php endif; ?>

View File

@@ -0,0 +1,87 @@
<div class="card w-75 mx-auto my-5">
<div class="card-header">
<?php echo $R['subject']?> - <?php echo $R[$_HS['nametype']]?>님
</div>
<div class="card-body">
<ul>
<li>요청하신 게시물은 열람시 포인트가 차감됩니다.</li>
<?php if($my['uid']):?>
<li>열람에 필요한 포인트는 <span class="text-danger"><?php echo number_format($R['point2'])?> 포인트</span> 이며 회원님은 현재 <span class="text-primary"><?php echo number_format($my['point'])?> 포인트</span> 보유 중입니다.</li>
<?php else:?>
<li>회원으로 로그인하셔야 이용하실 수 있습니다. 로그인해 주세요.</li>
<?php endif?>
<li>한번 열람한 게시물은 브라우져를 모두 닫을때까지 재결제 없이 열람할 수 있습니다.</li>
<?php if($my['admin']):?>
<li class="b"><?php echo $my[$_HS['nametype']]?>님은 관리자권한으로 포인트는 차감되지 않습니다.</li>
<?php endif?>
<?php if($my['uid']==$R['mbruid']):?>
<li class="b"><?php echo $my[$_HS['nametype']]?>님은 게시물 등록자이므로 실제 포인트는 차감되지 않습니다.</li>
<?php endif?>
</ul>
</div>
<div class="card-footer text-center">
<button type="button" class="btn btn-light btn-lg" onclick="history.back();" >
돌아가기
</button>
<button type="button" class="btn btn-primary btn-lg" onclick="viewArticle();">
열람하기 <span class="badge badge-light"><?php echo number_format($R['point2'])?> 포인트 차감</span>
</button>
</div>
</div><!-- /.card -->
<form name="checkForm" method="post" action="<?php echo $g['s']?>/" target="_action_frame_<?php echo $m?>" onsubmit="return permCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="a" value="point_view" />
<input type="hidden" name="c" value="<?php echo $c?>" />
<input type="hidden" name="cuid" value="<?php echo $_HM['uid']?>" />
<input type="hidden" name="m" value="<?php echo $m?>" />
<input type="hidden" name="bid" value="<?php echo $R['bbsid']?>" />
<input type="hidden" name="uid" value="<?php echo $R['uid']?>" />
<input type="hidden" name="p" value="<?php echo $p?>" />
<input type="hidden" name="cat" value="<?php echo $cat?>" />
<input type="hidden" name="sort" value="<?php echo $sort?>" />
<input type="hidden" name="orderby" value="<?php echo $orderby?>" />
<input type="hidden" name="recnum" value="<?php echo $recnum?>" />
<input type="hidden" name="type" value="<?php echo $type?>" />
<input type="hidden" name="iframe" value="<?php echo $iframe?>" />
<input type="hidden" name="skin" value="<?php echo $skin?>" />
<input type="hidden" name="where" value="<?php echo $where?>" />
<input type="hidden" name="keyword" value="<?php echo $_keyword?>" />
</form>
<script type="text/javascript">
//<![CDATA[
function viewArticle()
{
var f = document.checkForm;
if (memberid == '')
{
alert('로그인하신 후에 이용해 주세요. ');
return false;
}
<?php if($my['point'] < $R['point2']):?>
if (memberid == '')
{
alert('회원님의 보유포인트가 열람포인트보다 적습니다. ');
return false;
}
<?php endif?>
if (confirm('정말로 열람하시겠습니까? '))
{
f.submit();
}
}
//]]>
</script>

View File

@@ -0,0 +1,113 @@
<?php if ($g['mobile']&&$_SESSION['pcmode']!='Y'): ?>
<header class="bar bar-nav bar-light bg-faded">
<a class="icon icon-left-nav pull-left" role="button" data-history="back"></a>
<h1 class="title"><?php echo $B['name'] ?></h1>
</header>
<div class="content">
<form name="checkForm" method="post" class="form-horizontal rb-form" action="<?php echo $g['s']?>/" target="_action_frame_<?php echo $m?>" onsubmit="return permCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="a" value="<?php echo $mod=='delete'?$mod:'pwcheck'?>" />
<input type="hidden" name="c" value="<?php echo $c?>" />
<input type="hidden" name="cuid" value="<?php echo $_HM['uid']?>" />
<input type="hidden" name="m" value="<?php echo $m?>" />
<input type="hidden" name="bid" value="<?php echo $R['bbsid']?$R['bbsid']:$bid?>" />
<input type="hidden" name="uid" value="<?php echo $R['uid']?>" />
<input type="hidden" name="p" value="<?php echo $p?>" />
<input type="hidden" name="cat" value="<?php echo $cat?>" />
<input type="hidden" name="sort" value="<?php echo $sort?>" />
<input type="hidden" name="orderby" value="<?php echo $orderby?>" />
<input type="hidden" name="recnum" value="<?php echo $recnum?>" />
<input type="hidden" name="type" value="<?php echo $type?>" />
<input type="hidden" name="iframe" value="<?php echo $iframe?>" />
<input type="hidden" name="skin" value="<?php echo $skin?>" />
<input type="hidden" name="where" value="<?php echo $where?>" />
<input type="hidden" name="keyword" value="<?php echo $_keyword?>" />
<div class="input-group input-group-lg my-4">
<input type="text" class="form-control" type="password" name="pw">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="submit">확인</button>
</div>
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" onclick="history.go(-1);">취소</button>
</div>
</div>
</form>
</div><!-- /.content -->
<?php else: ?>
<section class="d-flex justify-content-center align-items-center" style="height: 50vh;">
<div class="card w-50">
<div class="card-header">
<i class="fa fa-lock fa-lg"></i> 비밀번호 확인
</div>
<div class="card-body">
<form name="checkForm" method="post" class="form-horizontal rb-form" action="<?php echo $g['s']?>/" target="_action_frame_<?php echo $m?>" onsubmit="return permCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="a" value="<?php echo $mod=='delete'?$mod:'pwcheck'?>" />
<input type="hidden" name="c" value="<?php echo $c?>" />
<input type="hidden" name="cuid" value="<?php echo $_HM['uid']?>" />
<input type="hidden" name="m" value="<?php echo $m?>" />
<input type="hidden" name="bid" value="<?php echo $R['bbsid']?$R['bbsid']:$bid?>" />
<input type="hidden" name="uid" value="<?php echo $R['uid']?>" />
<input type="hidden" name="p" value="<?php echo $p?>" />
<input type="hidden" name="cat" value="<?php echo $cat?>" />
<input type="hidden" name="sort" value="<?php echo $sort?>" />
<input type="hidden" name="orderby" value="<?php echo $orderby?>" />
<input type="hidden" name="recnum" value="<?php echo $recnum?>" />
<input type="hidden" name="type" value="<?php echo $type?>" />
<input type="hidden" name="iframe" value="<?php echo $iframe?>" />
<input type="hidden" name="skin" value="<?php echo $skin?>" />
<input type="hidden" name="where" value="<?php echo $where?>" />
<input type="hidden" name="keyword" value="<?php echo $_keyword?>" />
<div class="input-group input-group-lg my-4">
<input type="text" class="form-control" type="password" name="pw">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="submit">확인</button>
</div>
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" onclick="history.go(-1);">취소</button>
</div>
</div>
</form>
</div> <!-- .panel-body -->
<div class="card-footer text-muted">
게시물 등록시에 입력했던 비밀번호를 입력해 주세요.
</div>
</div>
</section>
<?php endif; ?>
<script type="text/javascript">
//<![CDATA[
var checkFlag = false;
function permCheck(f)
{
if (checkFlag == true)
{
alert('확인중입니다. 잠시만 기다려 주세요. ');
return false;
}
if (f.pw.value == '')
{
alert('비밀번호를 입력해 주세요. ');
f.pw.focus();
return false;
}
checkFlag = true;
}
window.onload = function(){document.checkForm.pw.focus();}
//]]>
</script>

131
modules/bbs/mod/_rss.php Normal file
View File

@@ -0,0 +1,131 @@
<?php
if(!defined('__KIMS__')) exit;
if(!$d['bbs']['rss'])
{
getLink('','','RSS발행을 지원하지 않는 게시판입니다.','close');
}
if($bid)
{
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
}
$sort = 'gid';
$orderby= 'asc';
$recnum = 20;
$_QUE = 'site='.$s.' and hidden=0';
if ($mbruid)
{
$_QUE .= ' and mbruid='.$mbruid;
}
if ($B['uid'])
{
$_QUE .= ' and bbs='.$B['uid'];
}
$RCD = array();
if ($mbruid)
{
$M=getDbData($table['s_mbrdata'],'memberuid='.$mbruid,'*');
$TCD = getDbArray($table[$m.'data'],$_QUE,'*',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = $_R;
}
else {
$TCD = getDbArray($table[$m.'data'],$_QUE,'gid',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table[$m.'data'],'gid='.$_R['gid'],'*');
}
Header("Content-type: text/xml");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version='1.0' encoding='utf-8'?>\r\n\r\n";
if($type == 'rss1') :?>
<rss version='2.0' xmlns:dc='http://purl.org/dc/elements/1.1/'>
<channel>
<title><?php echo $mbruid?$M[$_HS['nametype']].'님의 포스트':(htmlspecialchars($B['name']?$B['name']:$_HS['name']))?></title>
<link><?php echo $g['url_root']?>/?r=<?php echo $r?>&amp;m=<?php echo $m?><?php if($B['uid']):?>&amp;bid=<?php echo $B['id']?><?php endif?></link>
<dc:language><?php echo substr($_HS['lang'],0,2)?></dc:language>
<?php foreach($RCD as $R):?>
<item>
<title><?php echo htmlspecialchars($R['subject'])?></title>
<description><![CDATA[<?php echo getContents($R['content'],$R['html'],'')?>]]></description>
<link><?php echo $g['url_root']?>/?r=<?php echo $r?>&amp;m=<?php echo $m?>&amp;bid=<?php echo $R['bbsid']?>&amp;uid=<?php echo $R['uid']?></link>
<dc:creator><?php echo htmlspecialchars($R[$_HS['nametype']])?></dc:creator>
<category><![CDATA[<?php echo htmlspecialchars($R['category'])?>]]></category>
<?php if($R['tag']):?>
<?php $tags=explode(',',trim($R['tag']))?>
<?php $tagn=count($tags)?>
<?php for($i = 0; $i < $tagn; $i++):if(!$tags[$i])continue?>
<category><![CDATA[<?php echo htmlspecialchars($tags[$i])?>]]></category>
<?php endfor?>
<?php endif?>
<guid><?php echo $g['url_root']?>/?r=<?php echo $r?>&amp;m=<?php echo $m?>&amp;bid=<?php echo $R['bbsid']?>&amp;uid=<?php echo $R['uid']?></guid>
<dc:date><?php echo getDateFormat($R['d_regis'],'r')?></dc:date>
<dc:subject></dc:subject>
</item>
<?php endforeach?>
</channel>
</rss>
<?php elseif($type == 'atom') :?>
<feed version="0.3"
xmlns="http://purl.org/atom/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" >
<title><?php echo $mbruid?$M[$_HS['nametype']].'님의 포스트':(htmlspecialchars($B['name']?$B['name']:$_HS['name']))?></title>
<id><?php echo $g['url_root']?>/?r=<?php echo $r?>&amp;m=<?php echo $m?><?php if($B['uid']):?>&amp;bid=<?php echo $B['id']?><?php endif?></id>
<author><name><?php echo htmlspecialchars($B['name']?$B['name']:$_HS['name'])?></name></author>
<info><![CDATA[<?php echo htmlspecialchars($B['name']?$B['name']:$_HS['name'])?>]]></info>
<?php foreach($RCD as $R):?>
<entry>
<title><?php echo htmlspecialchars($R['subject'])?></title>
<link rel="alternate" type="text/html" href="<?php echo $g['r']?>/?m=<?php echo $m?>&amp;uid=<?php echo $R['uid']?>" />
<id><?php echo $g['url_root']?>/?r=<?php echo $r?>&amp;m=<?php echo $m?>&amp;bid=<?php echo $R['bbsid']?>&amp;uid=<?php echo $R['uid']?></id>
<created><?php echo getDateFormat($R['d_regis'],'r')?></created>
<modified><?php echo getDateFormat($R['d_modify'],'r')?></modified>
<summary type="text/html" mode="escaped"><![CDATA[<?php echo getContents($R['content'],$R['html'],'')?>]]></summary>
</entry>
<?php endforeach?>
</feed>
<?php else :?>
<rss version='2.0' xmlns:dc='http://purl.org/dc/elements/1.1/'>
<channel>
<title><?php echo $mbruid?$M[$_HS['nametype']].'님의 포스트':(htmlspecialchars($B['name']?$B['name']:$_HS['name']))?></title>
<link><?php echo $g['url_root']?>/?r=<?php echo $r?>&amp;m=<?php echo $m?><?php if($B['uid']):?>&amp;bid=<?php echo $B['id']?><?php endif?></link>
<dc:language><?php echo substr($_HS['lang'],0,2)?></dc:language>
<?php foreach($RCD as $R):?>
<item>
<title><?php echo htmlspecialchars($R['subject'])?></title>
<description><![CDATA[<?php echo getContents($R['content'],$R['html'],'')?>]]></description>
<link><?php echo $g['url_root']?>/?r=<?php echo $r?>&amp;m=<?php echo $m?>&amp;bid=<?php echo $R['bbsid']?>&amp;uid=<?php echo $R['uid']?></link>
<dc:creator><?php echo htmlspecialchars($R[$_HS['nametype']])?></dc:creator>
<category><![CDATA[<?php echo htmlspecialchars($R['category'])?>]]></category>
<?php if($R['tag']):?>
<?php $tags=explode(',',trim($R['tag']))?>
<?php $tagn=count($tags)?>
<?php for($i = 0; $i < $tagn; $i++):if(!$tags[$i])continue?>
<category><![CDATA[<?php echo htmlspecialchars($tags[$i])?>]]></category>
<?php endfor?>
<?php endif?>
<guid><?php echo $g['url_root']?>/?r=<?php echo $r?>&amp;m=<?php echo $m?>&amp;bid=<?php echo $R['bbsid']?>&amp;uid=<?php echo $R['uid']?></guid>
<dc:date><?php echo getDateFormat($R['d_regis'],'r')?></dc:date>
<dc:subject></dc:subject>
</item>
<?php endforeach?>
</channel>
</rss>
<?php endif?>

71
modules/bbs/mod/_view.php Normal file
View File

@@ -0,0 +1,71 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
{
if ($d['bbs']['perm_l_view'] > $my['level'] || strpos('_'.$d['bbs']['perm_g_view'],'['.$my['mygroup'].']'))
{
$g['main'] = $g['dir_module'].'mod/_permcheck.php';
$d['bbs']['isperm'] = false;
}
}
if ($R['hidden'])
{
if ($my['uid'] != $R['mbruid'] && $my['uid'] != $R['pw'] && !$my['admin'])
{
if (!strpos('_'.$_SESSION['module_'.$m.'_pwcheck'],'['.$R['uid'].']'))
{
$g['main'] = $g['dir_module'].'mod/_pwcheck.php';
$d['bbs']['isperm'] = false;
}
}
}
if ($d['bbs']['isperm'] && ($d['bbs']['hitcount'] || !strpos('_'.$_SESSION['module_'.$m.'_view'],'['.$R['uid'].']')))
{
if ($R['point2'])
{
$g['main'] = $g['dir_module'].'mod/_pointcheck.php';
$d['bbs']['isperm'] = false;
}
else {
getDbUpdate($table[$m.'data'],'hit=hit+1','uid='.$R['uid']);
$_SESSION['module_'.$m.'_view'] .= '['.$R['uid'].']';
}
}
if ($d['bbs']['isperm'] && $R['upload'])
{
$d['upload'] = array();
$d['upload']['tmp'] = $R['upload'];
$d['_pload'] = getArrayString($R['upload']);
$attach_file_num=0;// 첨부파일 수량 체크 ---------------------------------> 2015.1.1 추가 by kiere.
foreach($d['_pload']['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if (!$U['uid'])
{
$R['upload'] = str_replace('['.$_val.']','',$R['upload']);
$d['_pload']['count']--;
}
else {
$d['upload']['data'][] = $U;
if (!$U['sync'])
{
$_SYNC = "sync='[".$m."][".$R['uid']."][uid,down][".$table[$m.'data']."][".$R['mbruid']."][m:".$m.",bid:".$R['bbsid'].",uid:".$R['uid']."]'";
getDbUpdate($table['s_upload'],$_SYNC,'uid='.$U['uid']);
}
}
if($U['hidden']==0) $attach_file_num++; // 숨김처리 안했으면 수량 ++
}
if ($R['upload'] != $d['upload']['tmp'])
{
// getDbUpdate($table[$m.'data'],"upload='".$R['upload']."'",'uid='.$R['uid']);
}
$d['upload']['count'] = $d['_pload']['count'];
}
// 메타 이미지 세팅 = 해당 포스트의 대표 이미지를 메타 이미지로 적용한다.
if($R['featured_img']){
$g['meta_img']=getPreviewResize(getUpImageSrc($R),'600x450');
}
$mod = $mod ? $mod : 'view';
$bid = $R['bbsid'];
?>

1
modules/bbs/name.txt Normal file
View File

@@ -0,0 +1 @@
게시판

View File

@@ -0,0 +1,3 @@
The RBL License
Copyright (c) 2020 Redblock, Inc.

View File

@@ -0,0 +1,6 @@
# 게시판 테마 입니다.
기본형 데스크탑 목록형 게시판 테마 입니다.
## 주요기능
- 글쓰기 기능

View File

@@ -0,0 +1,148 @@
<!-- 첨부파일 접근권한 -->
<?php if ($d['bbs']['perm_l_down'] <= $my['level'] && (strpos($d['bbs']['perm_g_down'],'['.$my['mygroup'].']') === false)): ?>
<!-- 사진 -->
<?php if ($R['upload']): ?>
<?php
$img_files = array();
$audio_files = array();
$video_files = array();
$down_files = array();
foreach($d['upload']['data'] as $_u){
if($_u['type']==2 and $_u['hidden']==0) array_push($img_files,$_u);
else if($_u['type']==4 and $_u['hidden']==0) array_push($audio_files,$_u);
else if($_u['type']==5 and $_u['hidden']==0) array_push($video_files,$_u);
else if($_u['type']==1 || $_u['type']==6 || $_u['type']==7 and $_u['hidden']==0) array_push($down_files,$_u);
}
$attach_photo_num = count ($img_files);
$attach_video_num = count ($video_files);
$attach_audio_num = count ($audio_files);
$attach_down_num = count ($down_files);
?>
<div class="attach-section clearfix my-5">
<?php if($attach_photo_num>0):?>
<div class="float-left">
<ul class="list-inline mb-1 gallery animated fadeIn delay-1" data-plugin="photoswipe">
<?php foreach($img_files as $_u):?>
<?php
$img_origin=$_u['host'].'/'.$_u['folder'].'/'.$_u['tmpname'];
$thumb_list=getPreviewResize($img_origin,'180x120'); // 미리보기 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$thumb_modal=getPreviewResize($img_origin,'c'); // 정보수정 모달용 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
?>
<figure class="list-inline-item">
<a class="" href="<?php echo $img_origin ?>" data-size="<?php echo $_u['width']?>x<?php echo $_u['height']?>" title="<?php echo $_u['name']?>">
<img src="<?php echo $thumb_list ?>" alt="" class="border">
</a>
<figcaption itemprop="caption description" class="f12 p-3">
<div class="media">
<div class="mr-2"><i class="fa fa-file-image-o fa-lg text-primary" aria-hidden="true"></i></div>
<div class="media-body">
<p class="mb-2 font-weight-bold"><?php echo $_u['name']?></p>
<small data-role="caption"><?php echo $_u['caption']?></small>
<small><?php echo getSizeFormat($_u['size'],1)?></small>
</div>
</div>
</figcaption>
<div class="card__corner">
<div class="card__corner-triangle"></div>
</div>
</figure>
<?php endforeach?>
</ul>
</div>
<?php endif?>
<?php if($attach_down_num>0):?>
<div class="float-left">
<ul class="list-inline mb-1 gallery animated fadeIn delay-1">
<?php foreach($down_files as $_u):?>
<?php
$ext_to_fa=array('xls'=>'excel','xlsx'=>'excel','ppt'=>'powerpoint','pptx'=>'powerpoint','txt'=>'text','pdf'=>'pdf','zip'=>'archive','doc'=>'word');
$ext_icon=in_array($_u['ext'],array_keys($ext_to_fa))?'-'.$ext_to_fa[$_u['ext']]:'';
?>
<li class="list-inline-item">
<div class="card f12" style="width: 180px">
<div class="card__corner">
<div class="card__corner-triangle"></div>
</div>
<div class="card-block d-flex justify-content-center align-items-center" style="height:87px">
<i class="fa fa-3x fa-file<?php echo $ext_icon?>-o text-muted"></i>
</div>
<div class="card-footer p-2 text-truncate text-muted bg-light">
<i class="fa fa-download" aria-hidden="true"></i> <?php echo $_u['name']?>
</div>
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=mediaset&amp;a=download&amp;uid=<?php echo $_u['uid']?>" class="card-img-overlay bg-light text-muted p-3">
<div class="media">
<div class="mr-2"><i class="fa fa-file<?php echo $ext_icon?>-o fa-lg text-primary" aria-hidden="true"></i></div>
<div class="media-body">
<p class="mb-2 font-weight-bold"><?php echo $_u['name']?></p>
<small data-role="caption"><?php echo $_u['caption']?></small>
<small><?php echo getSizeFormat($_u['size'],1)?></small>
<span class="ml-2">
<i class="fa fa-download" aria-hidden="true"></i>
<small class="text-muted"><?php echo number_format($_u['down'])?></small>
</span>
</div>
</div>
</a>
</div>
</li>
<?php endforeach?>
</ul>
</div>
<?php endif?>
</div>
<?php if($attach_video_num>0):?>
<div class="card-deck">
<?php foreach($video_files as $_u):?>
<?php
$ext_to_fa=array('xls'=>'excel','xlsx'=>'excel','ppt'=>'powerpoint','pptx'=>'powerpoint','txt'=>'text','pdf'=>'pdf','zip'=>'archive','doc'=>'word');
$ext_icon=in_array($_u['ext'],array_keys($ext_to_fa))?'-'.$ext_to_fa[$_u['ext']]:'';
?>
<div class="card">
<video width="320" height="240" controls data-plugin="mediaelement" class="card-img-top">
<source src="<?php echo $_u['host']?>/<?php echo $_u['folder']?>/<?php echo $_u['tmpname']?>" type="video/<?php echo $_u['ext']?>">
</video>
<div class="card-body">
<h6 class="card-title"><?php echo $_u['name']?></h6>
<p class="card-text"><small class="text-muted">(<?php echo getSizeFormat($_u['size'],1)?>)</small></p>
</div><!-- /.card-block -->
</div><!-- /.card -->
<?php endforeach?>
</div><!-- /.card-deck -->
<?php endif?>
<?php if($attach_audio_num>0):?>
<div class="card-deck">
<?php foreach($audio_files as $_u):?>
<?php
$ext_to_fa=array('xls'=>'excel','xlsx'=>'excel','ppt'=>'powerpoint','pptx'=>'powerpoint','txt'=>'text','pdf'=>'pdf','zip'=>'archive','doc'=>'word');
$ext_icon=in_array($_u['ext'],array_keys($ext_to_fa))?'-'.$ext_to_fa[$_u['ext']]:'';
?>
<div class="card">
<audio controls data-plugin="mediaelement" class="card-img-top w-100">
<source src="<?php echo $_u['host']?>/<?php echo $_u['folder']?>/<?php echo $_u['tmpname']?>" type="audio/mp3">
</audio>
<div class="card-body">
<h6 class="card-title"><?php echo $_u['name']?></h6>
<p class="card-text"><small class="text-muted">(<?php echo getSizeFormat($_u['size'],1)?>)</small></p>
</div><!-- /.card-block -->
</div><!-- /.card -->
<?php endforeach?>
</div><!-- /.card-deck -->
<?php endif?>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,105 @@
<?php
// 댓글 일반 사항
/*
1) 댓글 저장 테이블 : rb_s_comment
2) 한줄의견 저장 테이블 : rb_s_oneline
3) rb_s_comment 의 parent 필드 저장형식 ==> p_modulep_uid
예를 들어, 게시판 모듈의 uid = 3 인 글의 댓글은 아래와 같이 저장됩니다.
====> bbs3
4) 테마 css 는 테마/css/style.css 이며 댓글박스 가져올때 자동으로 함께 링크를 가져옵니다.
이 css 를 삭제하면 안되며 필요없는 경우 공백으로 처리하는 방법으로 하시기 바랍니다.
현재, notify 부분에 대한 css 가 있어서 삭제하면 안됩니다.
*/
// 댓글 출력 함수
// 함수 호출 방식으로 하면 모달 호출시에도 적용하기 편합니다.
/*
1) module = 부모모듈 : 댓글의 부모 모듈 id ( ex: bbs, post, forum ...)
2) parent_uid = 부모 uid : 댓글의 부모 포스트 uid
3) parent_table = 부모 테이블 : p_uid 가 소속된 테이블명 ( ex : rb_bbs_data, rb_blog_data, rb_chanel_data ...)
(댓글, 한줄의견 추가/삭제시 합계 업데이트시 필요)
*/
?>
<div id="commentting-container">
<!-- 댓글 출력 -->
</div>
<!-- theme css : 삭제금지, 불필요한 경우 해당 파일 내용을 비움. -->
<link href="<?php echo $g['url_root']?>/modules/comment/themes/<?php echo $d['bbs']['c_skin']?>/css/style.css" rel="stylesheet">
<script>
var attach_file_saveDir = '<?php echo $g['path_file']?>comment/';// 파일 업로드 폴더
var attach_module_theme = '<?php echo $d['theme']['upload_theme'] ?>';// attach 모듈 테마
$(function () {
// 댓글 출력 함수 실행
var p_module = '<?php echo $m?>';
var p_table = '<?php echo $table[$m.'data']?>';
var p_uid = '<?php echo $uid?>';
var agent = navigator.userAgent.toLowerCase();
if ((navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) || (agent.indexOf("msie") != -1) ) {
var theme = '_desktop/bs4-classic'; // 인터넷 익스플로러 브라우저, 일반 코멘트 적용
} else {
var theme = '<?php echo $d['bbs']['c_skin'] ?>'; // 인터넷 익스플로러 브라우저가 아닌 경우, ckeditor5 기반 코멘트 적용
}
var commentting_container = $('#commentting-container');
var get_Rb_Comment = function(p_module,p_table,p_uid,theme){
commentting_container.Rb_comment({
moduleName : 'comment', // 댓글 모듈명 지정 (수정금지)
parent : p_module+'-'+p_uid, // rb_s_comment parent 필드에 저장되는 형태가 p_modulep_uid 형태임 참조.(- 는 저장시 제거됨)
parent_table : p_table, // 부모 uid 가 저장된 테이블 (게시판인 경우 rb_bbs_data : 댓글, 한줄의견 추가/삭제시 전체 합계 업데이트용)
theme_name : theme, // 댓글 테마
containerClass :'rb-commentting', // 본 엘리먼트(#commentting-container)에 추가되는 class
recnum: 15, // 출력갯수
commentPlaceHolder : '댓글을 입력해 주세요..',
noMoreCommentMsg : '댓글 없음 ',
commentLength : 500, // 댓글 입력 글자 수 제한
toolbar : ['imageUpload','bold','link'] // 툴바 항목
});
}
get_Rb_Comment(p_module,p_table,p_uid,theme);
// 댓글이 초기화 된 후
commentting_container.on('shown.rb.comment',function(){
var hash = $(location).attr('hash'); //URL에서 해시추출
if (hash) {
setTimeout(function(){
location.href = hash;
$(hash).addClass('highlight');
}, 500); //해시가 있을 경우, 해당 댓글(한줄의견)으로 이동
}
});
// 댓글이 등록된 후에
commentting_container.on('saved.rb.comment',function(){
$('[data-toggle="tooltip"]').tooltip()
})
// 댓글이 수정된 후에
commentting_container.on('edited.rb.comment',function(){
$.notify({message: '댓글이 수정 되었습니다.'},{type: 'success'});
})
// 한줄의견이 등록된 후에
commentting_container.on('saved.rb.oneline',function(){
$('[data-toggle="tooltip"]').tooltip()
})
commentting_container.on('edited.rb.oneline',function(){
$.notify({message: '의견이 수정 되었습니다.'},{type: 'success'});
})
})
</script>

View File

@@ -0,0 +1,9 @@
<!-- 게시판 픗터 파일 -->
<?php if ($g['add_footer_img']): ?>
<div class="my-3">
<img src="<?php echo $g['add_footer_img'] ?>" alt="" class="img-fluid my-3">
</div>
<?php endif; ?>
<!-- 게시판 픗터 코드 -->
<?php if ($g['add_footer_inc']) include_once $g['add_footer_inc'];?>

View File

@@ -0,0 +1,9 @@
<!-- 게시판 헤더 파일 -->
<?php if ($g['add_header_img']): ?>
<div class="my-3">
<img src="<?php echo $g['add_header_img'] ?>" alt="" class="img-fluid">
</div>
<?php endif; ?>
<!-- 게시판 헤더 코드 -->
<?php if ($g['add_header_inc']) include_once $g['add_header_inc'];?>

View File

@@ -0,0 +1,47 @@
<?php
// seo 데이타 -- 전송되는 타이틀 추출
$_MSEO = getDbData($table['s_seo'],'rel=1 and parent='.$_HM['uid'],'*');
$_PSEO = getDbData($table['s_seo'],'rel=2 and parent='.$_HP['uid'],'*');
$_WTIT=strip_tags($g['meta_tit']);
$_link_url=$g['url_root'].$_SERVER['REQUEST_URI'];
?>
<ul class="list-inline" data-role="linkshare">
<li data-toggle="tooltip" title="페이스북" class="list-inline-item">
<a href="" role="button" onclick="snsWin('f');">
<img src="<?php echo $g['img_core']?>/sns/facebook.png" alt="페이스북공유" class="rounded-circle" width="50">
</a>
</li>
<li data-toggle="tooltip" title="카카오스토리" class="list-inline-item">
<a href="" role="button" onclick="snsWin('ks');">
<img src="<?php echo $g['img_core']?>/sns/kakaostory.png" alt="카카오스토리" class="rounded-circle" width="50">
</a>
</li>
<li data-toggle="tooltip" title="네이버" class="list-inline-item">
<a href="" role="button" onclick="snsWin('n');">
<img src="<?php echo $g['img_core']?>/sns/naver.png" alt="네이버" class="rounded-circle" width="50">
</a>
</li>
<li data-toggle="tooltip" title="트위터" class="list-inline-item">
<a href="" role="button" onclick="snsWin('t');">
<img src="<?php echo $g['img_core']?>/sns/twitter.png" alt="트위터" class="rounded-circle" width="50">
</a>
</li>
</ul>
<script type="text/javascript">
// sns 이벤트
function snsWin(sns) {
var snsset = new Array();
var enc_sbj = "<?php echo urlencode($_WTIT)?>";
var enc_url = "<?php echo urlencode($_link_url)?>";
var enc_tag = "<?php echo urlencode(str_replace(',',' ',$R['tag']))?>";
snsset['t'] = 'https://twitter.com/intent/tweet?url=' + enc_url + '&text=' + enc_sbj;
snsset['f'] = 'http://www.facebook.com/sharer.php?u=' + enc_url;
snsset['n'] = 'http://share.naver.com/web/shareView.nhn?url=' + enc_url + '&title=' + enc_sbj;
snsset['ks'] = 'https://story.kakao.com/share?url=' + enc_url + '&title=' + enc_sbj;
window.open(snsset[sns]);
}
</script>

View File

@@ -0,0 +1,153 @@
@charset "utf-8";
/*!
* kimsQ Rb v2.4.5 데스크탑 기본형 게시판 테마 스타일 (bs4-default)
* Homepage: http://www.kimsq.com
* Copyright 2020 redblock inc
* Licensed under RBL
* Based on Bootstrap v4
*/
/**
* 목차:
*
* 1 - 공통 rb-bbs
* 2 - 목록 rb-bbs-list
* 3 - 보기 rb-bbs-view
* 4 - 쓰기 rb-bbs-write
* 5 - 컴포넌트 Component
* 6 - 유틸리티 Utilities
* ----------------------------------------------------------------------------
*/
/**
* 1 - 공통 rb-bbs
* ----------------------------------------------------------------------------
*/
/**
* 2 - 목록 rb-bbs-list
* ----------------------------------------------------------------------------
*/
.rb-bbs-list .ico-replay::before {
display: inline-block;
width: 13px;
height: 10px;
margin: 4px 4px 0 1px;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAABkCAMAAACvvNBNAAAAclBMVEVMaXEtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUtlvUAAAAtlvXBtxldAAAAJHRSTlMAlgoDD071ePxpN7FZvfDjLRxb/gEGpEL5hxUkyNvqeXyAwuvQ8jQMAAAAqElEQVR42u2R1w7CMAxFu/feu4ze//9FWlRaWlwkBC9IPi+2cpzYSYTPUZwjk7rQaZNk8ENalfAC2pgoctqoRhzRxtKWERxlY+oO4pz2cKUnU7Ww5TkP/Sl/IDVo1srAW04QZBttRfcV0dW7aWHeEx2a9XJHQx1DFI9hz2kqz4tp88rS5Op4KDdr62hAlpDPI13gpkf/elYEhmGYXzAMrL5XO94phvlnbrKzELi3OthbAAAAAElFTkSuQmCC) 0 -30px no-repeat;
background-size: 13px 50px;
vertical-align: top;
content: '';
}
/* 포커스된 아이템 강조표시 */
[data-role="bbs-list"] tr:focus {
background-color: #F5FFFE !important;
}
[data-role="bbs-list"] tr a:focus {
outline: 0
}
/**
* 3 - 보기 rb-bbs-view
* ----------------------------------------------------------------------------
*/
.rb-bbs-view {
margin-top: 30px
}
.rb-bbs-view header .media-body h1 {
padding: 4px 0 8px 0;
margin: 0;
font-size: 14px;
font-weight: bold;
line-height: 1.5;
border-bottom: #dfdfdf dotted 1px;
}
.rb-bbs-view header .rb-meta {
color: #c0c0c0;
font-family: dotum;
font-size: 11px;
line-height: 20px;
}
.rb-bbs-view header .rb-meta .rb-divider:before {
content: '|';
color: #ddd;
}
.rb-bbs-view [data-role="linkshare"] img {
width: 38px
}
.active .fa-bookmark-o:before {
content: "\f02e" !important;
}
[data-role="btn_post_like"].active .fa-heart-o:before {
content: "\f004";
}
[data-role="btn_post_like"].active .fa,
[data-role="btn_post_dislike"].active .fa {
color: red;
}
[data-role="btn_post_like"].active.heartbeat .fa,
[data-role="btn_post_dislike"].active.heartbeat .fa {
animation: heartbeat .8s;
}
.tag .badge~.badge {
margin-left: .3rem
}
/**
* 4 - 쓰기 rb-bbs-write
* ----------------------------------------------------------------------------
*/
.rb-bbs-write {
margin-top: 30px
}
.rb-bbs-write .ck-editor__editable_inline {
min-height: 350px;
}
/**
* 5 - 컴포넌트 Component
* ----------------------------------------------------------------------------
*/
/**
* 6 - 유틸리티 Utilities
* ----------------------------------------------------------------------------
*/
@keyframes heartbeat
{
0%
{
transform: scale( 1.8 );
}
30%
{
transform: scale( 1 );
}
60%
{
transform: scale( 1.8 );
}
100%
{
transform: scale( 1 );
}
}

View File

@@ -0,0 +1,60 @@
/**
* --------------------------------------------------------------------------
* kimsQ Rb v2.4.5 데스크탑 기본형 게시판 테마 스크립트 (bs4-default): _main.js
* Homepage: http://www.kimsq.com
* Licensed under RBL
* Copyright 2020 redblock inc
* --------------------------------------------------------------------------
*/
$(function () {
// 사용자 액션에 대한 피드백 메시지 제공을 위해 액션 실행후 쿠키에 저장된 결과 메시지를 출력시키고 초기화 시킵니다.
putCookieAlert('bbs_action_result') // 실행결과 알림 메시지 출력
$('[data-toggle="print"]').click(function() {
window.print()
});
$('[data-toggle="actionIframe"]').click(function() {
getIframeForAction('');
frames.__iframe_for_action__.location.href = $(this).attr("data-url");
});
//게시물 목록에서 프로필 풍선(popover) 띄우기
$('[data-toggle="getMemberLayer"]').popover({
container: 'body',
trigger: 'manual',
html: true,
content: function () {
var uid = $(this).attr('data-uid')
var mbruid = $(this).attr('data-mbruid')
var type = 'popover'
$.post(rooturl+'/?r='+raccount+'&m=member&a=get_profileData',{
mbruid : mbruid,
type : type
},function(response){
var result = $.parseJSON(response);
var profile=result.profile;
$('#popover-item-'+uid).html(profile);
});
return '<div id="popover-item-'+uid+'" class="p-1">불러오는 중...</div>';
}
})
.on("mouseenter", function () {
var _this = this;
$(this).popover("show");
$(".popover").on("mouseleave", function () {
$(_this).popover('hide');
});
}).on("mouseleave", function () {
var _this = this;
setTimeout(function () {
if (!$(".popover:hover").length) {
$(_this).popover("hide");
}
}, 300);
});
})

View File

@@ -0,0 +1,39 @@
<div data-role="attach">
<?php if($d['theme']['perm_photo']<=$my['level']):?>
<?php endif?>
<!--
module : 첨부파일 사용 모듈 ,
theme : 첨부파일 테마 ,
attach_handler_file : 파일첨부 실행 엘리먼트 ,
attach_handler_photo : 사진첨부 실행 엘리먼트 ,
parent_data : 수정시 필요한 해당 포스트 데이타 배열 변수,
attach_handler_getModalList : 업로드 리스트 모달로 호출용 엘리먼트 (class 인 경우 . 까지 넘긴다.) -->
<?php
// 설정값 세팅
// $parent_table=$wdgvar['parent_table'];
// $parent_uid=$wdgvar['parent_uid'];
// $parent_field=$wdgvar['parent_field'];
// $attach_mod=$wdgvar['attach_mod']; // main, list...
// $attach_object_type=$wdgvar['attach_object_type'];//첨부 대상에 따른 분류 : photo, file, link, video....
// $attach_tmpcode=$wdgvar['attach_tmpcode'];//첨부 대상에 따른 분류 : photo, file, link, video....
// $attach_featuredImg_form_name=$wdgvar['featuredImg_form_name'];//첨부 대상에 따른 분류 : photo, file, link, video....
// $attach_wdgvar_id=$wdgvar['widget_uid'];
$attachSkin = $d['bbs']['a_skin']?$d['bbs']['a_skin']: ($d['theme']['upload_theme']?$d['theme']['upload_theme']:$d['bbs']['attach_main']); // 업로드 테마
$parent_module=$m; // 첨부파일 사용하는 모듈
$parent_data=$R; // 해당 포스트 데이타 (수정시 필요)
$attach_module_theme=$attachSkin; // 첨부파일 테마
$attach_handler_file='[data-role="attach-handler-file"]'; //파일첨부 실행 엘리먼트 button or 기타 엘리먼트 data-role="" 형태로 하는 것을 권고
$attach_handler_photo='[data-role="attach-handler-photo"]'; // 사진첨부 실행 엘리먼트 button or 기타 엘리먼트 data-role="" 형태로 하는 것을 권고
$attach_handler_getModalList='.getModalList'; // 첨부파일 리스트 호출 handler
$editor_type=$editor_type; // 에디터 타입 : html,markdown
$attach_object_type= 'photo';//첨부 대상에 따른 분류 : photo, file, link, video....
include $g['path_module'].'mediaset/attach.php'; // 함수 인클루드
?>
</div>

View File

@@ -0,0 +1,32 @@
<?php
// 공통
$d['theme']['profile_link'] = "1"; // 회원 프로필 링크 (사용=1/사용안함=0)
//목록
$d['theme']['show_catnum'] = "1"; //분류별등록수출력(출력=1/감춤=0)
$d['theme']['pagenum'] = "5"; //페이지스킵숫자갯수
$d['theme']['search'] = "1"; //검색폼출력(출력=1/감춤=0)
$d['theme']['timeago'] = "0"; //상대시간 표기(사용=1/날짜표기=0)
//본문
$d['theme']['date_viewf'] = "Y.m.d H:i"; //날짜포맷
$d['theme']['show_report'] = "1"; //신고사용(출력=1/감춤=0)
$d['theme']['show_print'] = "1"; //인쇄사용(출력1/감춤=0)
$d['theme']['show_saved'] = "1"; //링크저장사용(출력=1/감춤=0)
$d['theme']['use_reply'] = "1"; //관리자 답변사용(사용=1/사용안함=0)
$d['theme']['show_tag'] = "1"; //태그출력(출력=1/감춤=0)
$d['theme']['show_upfile'] = "1"; //첨부파일출력(출력=1/감춤=0)
$d['theme']['show_like'] = "1"; //좋아요 출력(출력=1/감춤=0)-회원전용
$d['theme']['show_dislike'] = "0"; //싫어요 출력(출력=1/감춤=0)-회원전용
$d['theme']['show_share'] = "1"; //SNS공유출력(출력=1/감춤=0)
$d['theme']['comment_theme'] = "_desktop/bs4-default"; //댓글 테마 (/modules/comment/themes/ 참고)
//글쓰기
$d['theme']['edit_height'] = "350"; //글쓰기폼높이(픽셀)
$d['theme']['show_edittoolbar'] = "1"; //에디터 툴바출력(출력=1/감춤=0)
$d['theme']['show_upload'] = "1"; //파일 업로더 출력 여부 (출력=1/감춤=0)
$d['theme']['upload_theme'] = "_desktop/bs4-default-attach"; //파일 업로드 테마 (/modules/mediaset/themes/ 참고)
$d['theme']['perm_upload'] = "1"; //파일첨부권한(등급이상)
$d['theme']['show_wtag'] = "1"; //태그필드출력(출력=1/감춤=0)
$d['theme']['use_hidden'] = "1"; //비밀글(사용안함=0/유저선택사용=1/무조건비밀글=2)
?>

View File

@@ -0,0 +1,253 @@
<?php include $g['dir_module_skin'].'_header.php'?>
<section class="rb-bbs-list">
<header class="d-flex justify-content-between align-items-center mb-4">
<span class="text-muted">
<small>총게시물 : <strong><?php echo number_format($NUM+count($NCD))?></strong> 건 (<?php echo $p?>/<?php echo $TPG?> page) </small>
</span>
<form class="form-inline" name="bbssearchf" action="<?php echo $g['s']?>/">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="c" value="<?php echo $c?>">
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="bid" value="<?php echo $bid?>">
<input type="hidden" name="cat" value="<?php echo $cat?>">
<input type="hidden" name="sort" value="<?php echo $sort?>">
<input type="hidden" name="orderby" value="<?php echo $orderby?>">
<input type="hidden" name="recnum" value="<?php echo $recnum?>">
<input type="hidden" name="type" value="<?php echo $type?>">
<input type="hidden" name="iframe" value="<?php echo $iframe?>">
<input type="hidden" name="skin" value="<?php echo $skin?>">
<!-- 카테고리 출력부 -->
<?php if($B['category']):$_catexp = explode(',',$B['category']);$_catnum=count($_catexp)?>
<select name="category" class="form-control custom-select mr-2" onchange="document.bbssearchf.cat.value=this.value;document.bbssearchf.submit();">
<option value="">
<?php echo $_catexp[0]?>
</option>
<?php for($i = 1; $i < $_catnum; $i++):if(!$_catexp[$i])continue;?>
<option value="<?php echo $_catexp[$i]?>" <?php if($_catexp[$i]==$cat):?> selected="selected"
<?php endif?>>
<?php echo $_catexp[$i]?>
<?php if($d['theme']['show_catnum']):?>(<?php echo getDbRows($table[$m.'data'],'site='.$s.' and notice=0 and bbs='.$B['uid']." and category='".$_catexp[$i]."'")?>)
<?php endif?>
</option>
<?php endfor?>
</select>
<?php endif?>
<!-- 검색창 출력부 -->
<?php if($d['theme']['search']):?>
<div class="input-group">
<select class="custom-select rounded-0" name="where">
<option value="subject|tag"<?php if($where=='subject|tag'):?> selected="selected"<?php endif?>>제목+태그</option>
<option value="content"<?php if($where=='content'):?> selected="selected"<?php endif?>>본문</option>
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>이름</option>
<option value="nic"<?php if($where=='nic'):?> selected="selected"<?php endif?>>닉네임</option>
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
<option value="term"<?php if($where=='term'):?> selected="selected"<?php endif?>>등록일</option>
</select>
<input type="text" class="form-control" name="keyword" value="<?php echo $_keyword?>" placeholder="검색어를 입력해주세요" style="min-width:200px">
<div class="input-group-append">
<button class="btn btn-light" type="submit">검색</button>
</div>
<?php if ($keyword): ?>
<div class="input-group-append">
<a class="btn btn-primary" href="<?php echo $g['bbs_reset'] ?>">리셋</a>
</div>
<?php endif; ?>
</div>
<?php endif?>
</form>
</header>
<div class="table-responsive-md">
<table class="table text-center bg-white" data-role="bbs-list">
<colgroup>
<col width="7%">
<col>
<col width="15%">
<col width="10%">
<col width="10%">
</colgroup>
<thead class="thead-light">
<tr>
<th scope="col"></th>
<th scope="col">제목</th>
<th scope="col">글쓴이</th>
<th scope="col">조회</th>
<th scope="col">작성일</th>
</tr>
</thead>
<tbody>
<!-- 공지사항 출력부 -->
<?php foreach($NCD as $R):?>
<?php $R['mobile']=isMobileConnect($R['agent'])?>
<tr class="table-light" id="item-<?php echo $R['uid'] ?>">
<td>
<?php if($R['uid'] != $uid):?>
<span class="badge badge-light">공지</span>
<?php else:?>
<span class="now">&gt;&gt;</span>
<?php endif?>
</td>
<td class="text-left">
<?php if($R['mobile']):?><i class="fa fa-mobile fa-lg"></i>
<?php endif?>
<?php if($R['category']):?>
<span class="badge badge-secondary"><?php echo $R['category']?></span>
<?php endif?>
<a href="<?php echo $g['bbs_view'].$R['uid']?>" class="muted-link">
<?php echo getStrCut($R['subject'],$d['bbs']['sbjcut'],'')?>
</a>
<?php if(strstr($R['content'],'.jpg') || strstr($R['content'],'.png')):?>
<span class="badge badge-light" data-toggle="tooltip" title="사진">
<i class="fa fa-camera-retro fa-lg"></i>
</span>
<?php endif?>
<?php if($R['upload']):?>
<span class="badge badge-light" data-toggle="tooltip" title="첨부파일">
<i class="fa fa-paperclip fa-lg"></i>
</span>
<?php endif?>
<?php if($R['hidden']):?><span class="badge badge-light" data-toggle="tooltip" title="비밀글"><i class="fa fa-lock fa-lg"></i></span><?php endif?>
<?php if($R['comment']):?>
<span class="badge badge-light" data-role="total_comment">
<?php echo $R['comment']?><?php echo $R['oneline']?'+'.$R['oneline']:''?>
</span>
<?php endif?>
<?php if(getNew($R['d_regis'],24)):?><span class="rb-new"></span><?php endif?>
</td>
<td>
<?php if ($d['theme']['profile_link']): ?>
<a class="muted-link" href="/@<?php echo $R['id'] ?>"
data-toggle="getMemberLayer"
data-uid="<?php echo $R['uid'] ?>"
data-mbruid="<?php echo $R['mbruid'] ?>">
<?php echo $R[$_HS['nametype']]?>
</a>
<?php else: ?>
<?php echo $R[$_HS['nametype']]?>
<?php endif; ?>
</td>
<td class="text-muted"><?php echo $R['hit']?></td>
<td class="text-muted small">
<time <?php echo $d['theme']['timeago']?'data-plugin="timeago"':'' ?> datetime="<?php echo getDateFormat($R['d_regis'],'c')?>">
<?php echo getDateFormat($R['d_regis'],'Y.m.d')?>
</time>
</td>
</tr>
<?php endforeach?>
<!-- 일반글 출력부 -->
<?php foreach($RCD as $R):?>
<?php $R['mobile']=isMobileConnect($R['agent'])?>
<tr id="item-<?php echo $R['uid'] ?>">
<td class="text-muted small">
<?php if($R['uid'] != $uid):?>
<?php echo $NUM-((($p-1)*$recnum)+$_rec++)?>
<?php else:$_rec++?>
<span class="now">&gt;&gt;</span>
<?php endif?>
</td>
<td class="text-left">
<?php if($R['depth']):?>
<img src="<?php echo $g['img_core']?>/blank.gif" width="<?php echo ($R['depth']-1)*13?>" height="1">
<span class="ico-replay"></span>
<?php endif?>
<?php if($R['mobile']):?>
<span class="badge badge-light"><i class="fa fa-mobile fa-lg"></i></span>
<?php endif?>
<?php if($R['category']):?>
<span class="badge badge-light"><?php echo $R['category']?></span>
<?php endif?>
<a href="<?php echo $g['bbs_view'].$R['uid']?>" class="muted-link">
<?php echo getStrCut($R['subject'],$d['bbs']['sbjcut'],'')?>
</a>
<?php if(strstr($R['content'],'.jpg') || strstr($R['content'],'.png')):?>
<span class="badge badge-light" data-toggle="tooltip" title="사진">
<i class="fa fa-camera-retro fa-lg"></i>
</span>
<?php endif?>
<?php if($R['upload']):?>
<span class="badge badge-light" data-toggle="tooltip" title="첨부파일">
<i class="fa fa-paperclip fa-lg"></i>
</span>
<?php endif?>
<?php if($R['hidden']):?>
<span class="badge badge-light" data-toggle="tooltip" title="비밀글"><i class="fa fa-lock fa-lg"></i></span>
<?php endif?>
<?php if($R['comment']):?>
<span class="badge badge-light" data-role="total_comment">
<?php echo $R['comment']?><?php echo $R['oneline']?'+'.$R['oneline']:''?>
</span>
<?php endif?>
<?php if(getNew($R['d_regis'],24)):?><span class="rb-new ml-1"></span><?php endif?>
</td>
<td>
<?php if ($d['theme']['profile_link']): ?>
<a class="muted-link" href="/@<?php echo $R['id'] ?>"
data-toggle="getMemberLayer"
data-uid="<?php echo $R['uid'] ?>"
data-mbruid="<?php echo $R['mbruid'] ?>">
<?php echo $R[$_HS['nametype']]?>
</a>
<?php else: ?>
<?php echo $R[$_HS['nametype']]?>
<?php endif; ?>
</td>
<td><?php echo $R['hit']?></td>
<td class="text-muted small">
<time <?php echo $d['theme']['timeago']?'data-plugin="timeago"':'' ?> datetime="<?php echo getDateFormat($R['d_regis'],'c')?>">
<?php echo getDateFormat($R['d_regis'],'Y.m.d')?>
</time>
</td>
</tr>
<?php endforeach?>
<?php if(!$NUM):?>
<tr>
<td class="text-muted p-5" colspan="5">
게시물이 없습니다.
</td>
</tr>
<?php endif?>
</tbody>
</table>
</div>
<footer class="d-flex justify-content-between align-items-center my-5">
<div class="btn-group">
<a class="btn btn-light" href="<?php echo $g['bbs_reset']?>">처음목록</a>
<a class="btn btn-light" href="<?php echo $g['bbs_list']?>">새로고침</a>
</div>
<ul class="pagination mb-0">
<?php echo getPageLink($d['theme']['pagenum'],$p,$TPG,'')?>
</ul>
<?php if($B['uid']):?>
<a class="btn btn-light" href="<?php echo $g['bbs_write']?>"><i class="fa fa-pencil"></i> 글쓰기</a>
<?php endif?>
</footer>
</section>
<?php include $g['dir_module_skin'].'_footer.php'?>
<script>
//검색어가 있을 경우 검색어 input focus
<?php if ($keyword): ?>
$('[name="keyword"]').focus()
<?php endif; ?>
</script>

View File

@@ -0,0 +1 @@
부트스트랩 4 리스트 기본형

View File

@@ -0,0 +1,151 @@
<?php include $g['dir_module_skin'].'_header.php'?>
<section class="rb-bbs-view">
<header>
<div class="media">
<span class="mr-3">
<img class="border rounded" src="<?php echo getAvatarSrc($R['mbruid'],'55') ?>" width="55" height="55" alt="">
</span>
<div class="media-body">
<h1 class="h4 mt-0">
<?php if($R['category']):?>
<span class="badge badge-light"><?php echo $R['category']?></span>
<?php endif?>
<?php echo $R['subject']?>
<?php if($R['hidden']):?>
<span class="badge badge-white" data-toggle="tooltip" title="비밀글"><i class="fa fa-lock fa-lg"></i></span>
<?php endif?>
</h1>
<div class="d-flex justify-content-between mt-2">
<ul class="rb-meta list-inline mb-0 text-muted">
<li class="list-inline-item">
<?php if ($d['theme']['profile_link']): ?>
<a class="muted-link" href="#"
data-toggle="getMemberLayer"
data-uid="<?php echo $R['uid'] ?>"
data-mbruid="<?php echo $R['mbruid'] ?>">
<?php echo $R[$_HS['nametype']]?>
</a>
<?php else: ?>
<?php echo $R[$_HS['nametype']]?>
<?php endif; ?>
</li>
<li class="list-inline-item rb-divider"></li>
<li class="list-inline-item"><?php echo getDateFormat($R['d_regis'],$d['theme']['date_viewf'])?></li>
<li class="list-inline-item rb-divider"></li>
<li class="list-inline-item">조회 : <?php echo $R['hit']?></li>
</ul>
<div class="btn-group d-print-none">
<?php if($d['theme']['show_report']):?>
<a class="btn btn-link muted-link" href="<?php echo $g['bbs_action']?>singo&amp;uid=<?php echo $R['uid']?>" target="_action_frame_<?php echo $m?>" onclick="return confirm('정말로 신고하시겠습니까?');">
<i class="fa fa-meh-o"></i> 신고
</a>
<?php endif?>
<?php if($d['theme']['show_saved']):?>
<button type="button" class="btn btn-link muted-link<?php if($is_saved):?> active<?php endif?>"
data-toggle="actionIframe"
data-url="<?php echo $g['bbs_action']?>saved&amp;uid=<?php echo $R['uid']?>"
data-role="btn_post_saved">
<i class="fa fa-bookmark-o"></i> 저장
</button>
<?php endif?>
<?php if($d['theme']['show_print']):?>
<button class="btn btn-link muted-link" data-toggle="print" type="button"><i class="fa fa-print"></i> 인쇄</button>
<?php endif?>
</div>
</div><!-- /.d-flex -->
</div><!-- /.media-body -->
</div><!-- /.media -->
</header>
<!-- 본문 -->
<article class="py-4 rb-article">
<?php echo getContents($R['content'],$R['html'])?>
</article>
<!-- 좋아요 or 싫어요 -->
<div class="text-center d-print-none">
<?php if($d['theme']['show_like']):?>
<button type="button" class="btn btn-light<?php if($is_liked):?> active<?php endif?>"
data-toggle="actionIframe"
data-url="<?php echo $g['bbs_action']?>opinion&amp;opinion=like&amp;uid=<?php echo $R['uid']?>&amp;effect=heartbeat"
data-role="btn_post_like">
<i class="fa fa fa-heart-o fa-fw" aria-hidden="true"></i> <strong></strong>
<span data-role='likes_<?php echo $R['uid']?>' class="badge badge-inverted"><?php echo $R['likes']?></span>
</button>
<?php endif?>
<?php if($d['theme']['show_dislike']):?>
<button type="button" class="btn btn btn-light<?php if($is_disliked):?> active<?php endif?>"
data-toggle="actionIframe"
data-url="<?php echo $g['bbs_action']?>opinion&amp;opinion=dislike&amp;uid=<?php echo $R['uid']?>&amp;effect=heartbeat"
data-role="btn_post_dislike">
<i class="fa fa-thumbs-o-down fa-fw" aria-hidden="true"></i> <strong></strong>
<span data-role='dislikes_<?php echo $R['uid']?>' class="badge badge-inverted"><?php echo $R['dislikes']?></span>
</button>
<?php endif?>
</div>
<!-- 링크 공유 -->
<?php if($d['theme']['show_share']):?>
<div class="mt-4 d-print-none text-center">
<?php include $g['dir_module_skin'].'_linkshare.php'?>
</div>
<?php endif?>
<!-- 태그 -->
<?php if($R['tag']&&$d['theme']['show_tag']):?>
<div class="">
<?php $_tags=explode(',',$R['tag'])?>
<?php $_tagn=count($_tags)?>
<?php $i=0;for($i = 0; $i < $_tagn; $i++):?>
<?php $_tagk=trim($_tags[$i])?>
<a class="badge badge-secondary" href="<?php echo $g['bbs_orign']?>&amp;where=subject|tag&amp;keyword=<?php echo urlencode($_tagk)?>">
<?php echo $_tagk?>
</a>
<?php endfor?>
</div>
<?php endif?>
<!-- 첨부파일 인클루드 -->
<?php if($d['upload']['data']&&$d['theme']['show_upfile']&&$attach_file_num>0):?>
<aside class="mt-4">
<?php include $g['dir_module_skin'].'_attachment.php'?>
</aside>
<?php endif?>
<footer class="d-flex justify-content-between align-items-center mt-3 d-print-none">
<div class="btn-group">
<?php if($my['admin'] || $my['uid']==$R['mbruid']):?>
<a href="<?php echo $g['bbs_modify'].$R['uid']?>" class="btn btn-light">수정</a>
<a href="<?php echo $g['bbs_delete'].$R['uid']?>" target="_action_frame_<?php echo $m?>" onclick="return confirm('정말로 삭제하시겠습니까?');" class="btn btn-light">삭제</a>
<?php endif?>
<?php if($my['admin']&&$d['theme']['use_reply']):?>
<a href="<?php echo $g['bbs_reply'].$R['uid']?>" class="btn btn-light">답변</a>
<?php endif?>
</div>
<a href="<?php echo $g['bbs_list']?>" class="btn btn-light">목록</a>
</footer>
<!-- 댓글 인클루드 -->
<?php if(!$d['bbs']['c_hidden']):?>
<aside class="mt-4">
<?php include $g['dir_module_skin'].'_comment.php'?>
</aside>
<?php endif?>
</section>
<?php include $g['dir_module_skin'].'_footer.php'?>
<?php if($d['theme']['show_list']&&$print!='Y'):?>
<?php include_once $g['dir_module'].'mod/_list.php'?>
<?php include_once $g['dir_module_skin'].'list.php'?>
<?php endif?>

View File

@@ -0,0 +1,253 @@
<?php
if (!$_SESSION['upsescode']) {
$_SESSION['upsescode'] = str_replace('.','',$g['time_start']);
}
$sescode = $_SESSION['upsescode'];
if($R['uid']){
$u_arr = getArrayString($R['upload']);
$_tmp=array();
$i=0;
foreach ($u_arr['data'] as $val) {
$U=getUidData($table['s_upload'],$val);
if(!$U['fileonly']) $_tmp[$i]=$val;
$i++;
}
$insert_array='';
// 중괄로로 재조립
foreach ($_tmp as $uid) {
$insert_array.='['.$uid.']';
}
}
if ($reply == 'Y') {
$submit_btn = '답변';
$submit_msg = '답변 게시물 등록중...';
$title_text = '게시물 답변 · ';
}
else if ($uid) {
$submit_btn = '수정';
$submit_msg = '게시물 수정중...';
$title_text = '게시물 수정 · ';
}
else {
$submit_btn = '등록';
$submit_msg = '게시물 등록중...';
$title_text = '새 게시물';
}
?>
<?php include $g['dir_module_skin'].'_header.php'?>
<section class="rb-bbs-write">
<article>
<form name="writeForm" method="post" action="<?php echo $g['s']?>/" onsubmit="return writeCheck(this);" role="form">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="a" value="write">
<input type="hidden" name="c" value="<?php echo $c?>">
<input type="hidden" name="cuid" value="<?php echo $_HM['uid']?>">
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="bid" value="<?php echo $R['bbsid']?$R['bbsid']:$bid?>">
<input type="hidden" name="uid" value="<?php echo $R['uid']?>">
<input type="hidden" name="reply" value="<?php echo $reply?>">
<input type="hidden" name="nlist" value="<?php echo $g['bbs_list']?>">
<input type="hidden" name="pcode" value="<?php echo $date['totime']?>">
<input type="hidden" name="html" value="HTML">
<input type="hidden" name="upfiles" id="upfilesValue" value="<?php echo $reply=='Y'?'':$R['upload']?>">
<input type="hidden" name="featured_img" value="<?php echo $R['featured_img'] ?>">
<?php if(!$my['id']):?>
<div class="form-group">
<label>이름</label>
<input type="text" name="name" placeholder="이름을 입력해 주세요." value="<?php echo $R['name']?>" id="" class="form-control">
</div>
<?php if(!$R['uid']||$reply=='Y'):?>
<div class="form-group">
<label>암호</label>
<input type="password" name="pw" placeholder="암호는 게시글 수정 및 삭제에 필요합니다." value="<?php echo $R['pw']?>" id="" class="form-control">
<small class="form-text text-muted">비밀답변은 비번을 수정하지 않아야 원게시자가 열람할 수 있습니다.</small>
</div>
<?php endif?>
<?php endif?>
<?php if($B['category']):$_catexp = explode(',',$B['category']);$_catnum=count($_catexp)?>
<div class="form-group">
<label>카테고리</label>
<select name="category" class="form-control custom-select">
<option value="">&nbsp;+ <?php echo $_catexp[0]?>선택</option>
<?php for($i = 1; $i < $_catnum; $i++):if(!$_catexp[$i])continue;?>
<option value="<?php echo $_catexp[$i]?>"<?php if($_catexp[$i]==$R['category']||$_catexp[$i]==$cat):?> selected="selected"<?php endif?>>ㆍ<?php echo $_catexp[$i]?><?php if($d['theme']['show_catnum']):?>(<?php echo getDbRows($table[$m.'data'],'site='.$s.' and notice=0 and bbs='.$B['uid']." and category='".$_catexp[$i]."'")?>)<?php endif?></option>
<?php endfor?>
</select>
</div>
<?php endif?>
<div class="form-group">
<label for="">제목</label>
<input type="text" name="subject" placeholder="제목을 입력해 주세요." value="<?php echo $R['subject']?>" id="" class="form-control form-control-lg" autofocus autocomplete="off">
</div>
<div class="mb-3">
<script>
var attach_file_saveDir = '<?php echo $g['path_file']?>bbs/';// 파일 업로드 폴더
var attach_module_theme = '<?php echo $d['bbs']['a_skin']?$d['bbs']['a_skin']: ($d['theme']['upload_theme']?$d['theme']['upload_theme']:$d['bbs']['attach_main']); ?>';// attach 모듈 테마
</script>
<?php
$__SRC__ = htmlspecialchars($R['content']);
if ($g['broswer']!='MSIE 11' && $g['broswer']!='MSIE 10' && $g['broswer']!='MSIE 9') {
include $g['path_plugin'].'ckeditor5/import.classic.php';
} else {
include $g['path_plugin'].'ckeditor/import.desktop.php';
}
?>
</div>
<div class="form-group">
<label class="sr-only"></label>
<?php if($my['admin']):?>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="notice" name="notice" value="1"<?php if($R['notice']):?> checked="checked"<?php endif?>>
<label class="custom-control-label" for="notice">공지글</label>
</div>
<?php endif?>
<?php if($d['theme']['use_hidden']==1):?>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="hidden" name="hidden" value="1"<?php if($R['hidden']):?> checked<?php endif?>>
<label class="custom-control-label" for="hidden">비밀글</label>
</div>
<?php elseif($d['theme']['use_hidden']==2):?>
<input type="hidden" name="hidden" value="1">
<?php endif?>
</div>
<!-- 첨부파일 업로드 -->
<?php if($d['theme']['show_upload']&&$d['theme']['perm_upload']<=$my['level']):?>
<?php if ($d['bbs']['attach']): ?>
<?php include $g['dir_module_skin'].'_uploader.php'?>
<?php endif; ?>
<?php endif?>
<?php if($d['theme']['show_wtag']):?>
<div class="form-group mt-4">
<label>태그<span class="rb-form-required text-danger"></span></label>
<input class="form-control" type="text" name="tag" placeholder="검색태그를 입력해 주세요." value="<?php echo $R['tag']?>">
<small class="form-text text-muted mt-2">이 게시물을 가장 잘 표현할 수 있는 단어를 콤마(,)로 구분해서 입력해 주세요. 첫번째 항목이 대표 태그로 활용됩니다.</small>
</div>
<?php endif?>
<div class="form-group mt-5">
<label class="mr-3">등록 후</label>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="backtype1" name="backtype" value="list"<?php if(!$_SESSION['bbsback'] || $_SESSION['bbsback']=='list'):?> checked<?php endif?>>
<label class="custom-control-label" for="backtype1">목록으로 이동</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="backtype2" name="backtype" value="view"<?php if($_SESSION['bbsback']=='view'):?> checked<?php endif?>>
<label class="custom-control-label" for="backtype2">본문으로 이동</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="backtype3" name="backtype" value="now"<?php if($_SESSION['bbsback']=='now'):?> checked<?php endif?>>
<label class="custom-control-label" for="backtype3">이 화면 유지</label>
</div>
</div><!-- /.form-group -->
<footer class="text-center my-5">
<button class="btn btn-lg btn-light" type="button" onclick="cancelCheck();">취소</button>
<button class="btn btn-lg btn-primary js-submit" type="submit">
<?php echo $submit_btn ?>
</button>
</footer>
</form>
</article>
</section>
<?php include $g['dir_module_skin'].'_footer.php'?>
<script type="text/javascript">
// 글 등록 함수
var submitFlag = false;
function writeCheck(f) {
if (submitFlag == true) {
alert('게시물을 등록하고 있습니다. 잠시만 기다려 주세요.');
return false;
}
if (f.name && f.name.value == '') {
alert('이름을 입력해 주세요. ');
f.name.focus();
return false;
}
if (f.pw && f.pw.value == '') {
alert('암호를 입력해 주세요. ');
f.pw.focus();
return false;
}
<?php if ($B['category']): ?>
if (f.category && f.category.value == '') {
alert('카테고리를 선택해 주세요. ');
f.category.focus();
return false;
}
<?php endif; ?>
if (f.subject.value == '') {
alert('제목을 입력해 주세요. ');
f.subject.focus();
return false;
}
if (f.notice && f.hidden) {
if (f.notice.checked == true && f.hidden.checked == true) {
alert('공지글은 비밀글로 등록할 수 없습니다. ');
f.hidden.checked = false;
return false;
}
}
var editorData = editor.getData();
$('[name="content"]').val(editorData)
// 대표이미지가 없을 경우, 첫번째 업로드 사진을 지정함
var featured_img_input = $('input[name="featured_img"]'); // 대표이미지 input
var featured_img_uid = $(featured_img_input).val();
if(featured_img_uid ==''){ // 대표이미지로 지정된 값이 없는 경우
var first_attach_img_li = $('.rb-attach-photo li:first'); // 첫번째 첨부된 이미지 리스트 li
var first_attach_img_uid = $(first_attach_img_li).data('id');
featured_img_input.val(first_attach_img_uid);
}
// 첨부파일 uid 를 upfiles 값에 추가하기
var attachfiles=$('input[name="attachfiles[]"]').map(function(){return $(this).val()}).get();
var new_upfiles='';
if(attachfiles){
for(var i=0;i<attachfiles.length;i++) {
new_upfiles+=attachfiles[i];
}
$('input[name="upfiles"]').val(new_upfiles);
}
getIframeForAction(f);
submitFlag = true;
$('.js-submit').addClass('disabled').html('<i class="fa fa-spinner fa-spin"></i> <?php echo $submit_msg?>');
return submitFlag;
}
function cancelCheck() {
if (confirm('정말 취소하시겠습니까? ')){
history.back();
}
}
document.title = '<?php echo $title_text ?> · <?php echo $B['name']?>';
</script>

View File

@@ -0,0 +1,3 @@
The RBL License
Copyright (c) 2020 Redblock, Inc.

View File

@@ -0,0 +1,3 @@
# 게시판 테마 입니다.
기본형 데스크탑 갤러리형 게시판 테마 입니다.

View File

@@ -0,0 +1,437 @@
<?php
$img_files = array();
$audio_files = array();
$video_files = array();
$youtube_files = array();
$down_files = array();
foreach($d['upload']['data'] as $_u){
if($_u['type']==2 and $_u['hidden']==0) array_push($img_files,$_u);
else if($_u['type']==4 and $_u['hidden']==0) array_push($audio_files,$_u);
else if($_u['type']==5 and $_u['hidden']==0) array_push($video_files,$_u);
else if($_u['type']==1 || $_u['type']==6 || $_u['type']==7 and $_u['hidden']==0) array_push($down_files,$_u);
}
$attach_photo_num = count ($img_files);
$attach_video_num = count ($video_files);
$attach_audio_num = count ($audio_files);
$attach_down_num = count ($down_files);
?>
<?php if ($attach_photo_num==0): ?>
<div class="p-5 text-muted text-center border">
표시할 사진이 없습니다.<br>
이미지 숨김 처리여부를 확인해 주세요.
</div>
<?php endif; ?>
<?php if($attach_photo_num>0):?>
<h5>사진 <span class="text-danger"><?php echo $attach_photo_num?></span></h5>
<div class="list-inline mb-3 post-gallery" itemscope itemtype="http://schema.org/ImageGallery">
<?php foreach($img_files as $_u):?>
<?php
$thumb_list=getPreviewResize($_u['src'],$d['theme']['view_thumb']); // 미리보기 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$thumb_modal=getPreviewResize($_u['src'],$_u['width'].'x'.$_u['height']); // 정보수정 모달용 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
?>
<figure class="list-inline-item">
<a href="<?php echo $thumb_modal ?>"
data-size="<?php echo $_u['width']?>x<?php echo $_u['height']?>"
title="<?php echo $_u['name']?>">
<img src="<?php echo $thumb_list ?>" alt="" class="border img-fluid">
</a>
<figcaption itemprop="caption description" hidden><?php echo $_u['caption']?></figcaption>
</figure>
<?php endforeach?>
</div>
<?php endif?>
<?php if($attach_down_num>0):?>
<div class="card">
<div class="card-header">
파일 (<span class="text-danger"><?php echo $attach_down_num ?></span>)
</div>
<ul class="list-group list-group-flush mb-0">
<?php foreach($down_files as $_u):?>
<?php
$ext_to_fa=array('xls'=>'excel','xlsx'=>'excel','ppt'=>'powerpoint','pptx'=>'powerpoint','txt'=>'text','pdf'=>'pdf','zip'=>'archive','doc'=>'word');
$ext_icon=in_array($_u['ext'],array_keys($ext_to_fa))?'-'.$ext_to_fa[$_u['ext']]:'';
?>
<li class="list-group-item d-flex justify-content-between align-items-center">
<div class="">
<i class="fa fa-file<?php echo $ext_icon?>-o fa-lg fa-fw"></i>
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=mediaset&amp;a=download&amp;uid=<?php echo $_u['uid']?>" title="<?php echo $_u['caption']?>">
<?php echo $_u['name']?>
</a>
<small class="text-muted">(<?php echo getSizeFormat($_u['size'],1)?>)</small>
<span title="다운로드 수" data-toggle="tooltip" class="badge badge-light"><?php echo number_format($_u['down'])?></span>
</div>
</li>
<?php endforeach?>
</ul>
</div><!-- /.card -->
<?php endif?>
<?php if($attach_video_num>0):?>
<h5 class="mt-5">비디오 <span class="text-danger"><?php echo $attach_video_num?></span></h5>
<?php foreach($video_files as $_u):?>
<?php
$ext_to_fa=array('xls'=>'excel','xlsx'=>'excel','ppt'=>'powerpoint','pptx'=>'powerpoint','txt'=>'text','pdf'=>'pdf','zip'=>'archive','doc'=>'word');
$ext_icon=in_array($_u['ext'],array_keys($ext_to_fa))?'-'.$ext_to_fa[$_u['ext']]:'';
?>
<div class="card">
<video width="320" height="240" controls class="card-img-top mejs-player">
<source src="<?php echo $_u['url']?><?php echo $_u['folder']?>/<?php echo $_u['tmpname']?>" type="video/<?php echo $_u['ext']?>">
</video>
<div class="card-body">
<h6 class="card-title"><?php echo $_u['name']?></h6>
<p class="card-text"><small class="text-muted">(<?php echo getSizeFormat($_u['size'],1)?>)</small></p>
</div><!-- /.card-block -->
</div><!-- /.card -->
<?php endforeach?>
<?php endif?>
<?php if($attach_audio_num>0):?>
<h5 class="mt-5">오디오 <span class="text-danger"><?php echo $attach_audio_num?></span></h5>
<?php foreach($audio_files as $_u):?>
<?php
$ext_to_fa=array('xls'=>'excel','xlsx'=>'excel','ppt'=>'powerpoint','pptx'=>'powerpoint','txt'=>'text','pdf'=>'pdf','zip'=>'archive','doc'=>'word');
$ext_icon=in_array($_u['ext'],array_keys($ext_to_fa))?'-'.$ext_to_fa[$_u['ext']]:'';
?>
<div class="card">
<audio controls class="card-img-top mejs-player w-100">
<source src="<?php echo $_u['url']?><?php echo $_u['folder']?>/<?php echo $_u['tmpname']?>" type="audio/<?php echo $_u['ext']?>">
</audio>
<div class="card-body">
<h6 class="card-title"><?php echo $_u['name']?></h6>
<p class="card-text"><small class="text-muted">(<?php echo getSizeFormat($_u['size'],1)?>)</small></p>
</div><!-- /.card-block -->
</div><!-- /.card -->
<?php endforeach?>
<?php endif?>
<!-- 일반 포토모달 -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader-active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<script>
var initPhotoSwipeFromDOM = function(gallerySelector) {
var subject= '<?php echo $R['subject']?>'
var orgin_title = document.title
var modal = $('.pswp')
// parse slide data (url, title, size ...) from DOM elements
// (children of gallerySelector)
var parseThumbnailElements = function(el) {
var thumbElements = el.childNodes,
numNodes = thumbElements.length,
items = [],
figureEl,
linkEl,
size,
item;
for (var i = 0; i < numNodes; i++) {
figureEl = thumbElements[i]; // <figure> element
// include only element nodes
if (figureEl.nodeType !== 1) {
continue;
}
linkEl = figureEl.children[0]; // <a> element
size = linkEl.getAttribute('data-size').split('x');
// create slide object
item = {
src: linkEl.getAttribute('href'),
w: parseInt(size[0], 10),
h: parseInt(size[1], 10)
};
if (figureEl.children.length > 1) {
// <figcaption> content
item.title = figureEl.children[1].innerHTML;
}
if (linkEl.children.length > 0) {
// <img> thumbnail element, retrieving thumbnail url
item.msrc = linkEl.children[0].getAttribute('src');
}
item.el = figureEl; // save link to element for getThumbBoundsFn
items.push(item);
}
return items;
};
// find nearest parent element
var closest = function closest(el, fn) {
return el && (fn(el) ? el : closest(el.parentNode, fn));
};
// triggers when user clicks on thumbnail
var onThumbnailsClick = function(e) {
e = e || window.event;
e.preventDefault ? e.preventDefault() : e.returnValue = false;
var eTarget = e.target || e.srcElement;
// find root element of slide
var clickedListItem = closest(eTarget, function(el) {
return (el.tagName && el.tagName.toUpperCase() === 'FIGURE');
});
if (!clickedListItem) {
return;
}
// find index of clicked item by looping through all child nodes
// alternatively, you may define index via data- attribute
var clickedGallery = clickedListItem.parentNode,
childNodes = clickedListItem.parentNode.childNodes,
numChildNodes = childNodes.length,
nodeIndex = 0,
index;
for (var i = 0; i < numChildNodes; i++) {
if (childNodes[i].nodeType !== 1) {
continue;
}
if (childNodes[i] === clickedListItem) {
index = nodeIndex;
break;
}
nodeIndex++;
}
if (index >= 0) {
// open PhotoSwipe if valid index found
openPhotoSwipe(index, clickedGallery);
}
return false;
};
// parse picture index and gallery index from URL (#&pid=1&gid=2)
var photoswipeParseHash = function() {
var hash = window.location.hash.substring(1),
params = {};
if (hash.length < 5) {
return params;
}
var vars = hash.split('&');
for (var i = 0; i < vars.length; i++) {
if (!vars[i]) {
continue;
}
var pair = vars[i].split('=');
if (pair.length < 2) {
continue;
}
params[pair[0]] = pair[1];
}
if (params.gid) {
params.gid = parseInt(params.gid, 10);
}
return params;
};
var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) {
var pswpElement = document.querySelectorAll('.pswp')[0],
gallery,
options,
items;
items = parseThumbnailElements(galleryElement);
// define options (if needed)
options = {
history: true,
focus: false,
closeOnScroll: false,
closeOnVerticalDrag: false,
showAnimationDuration: 0,
hideAnimationDuration: 0,
timeToIdle: 4000,
// define gallery index (for URL)
galleryUID: galleryElement.getAttribute('data-pswp-uid'),
getThumbBoundsFn: function(index) {
// See Options -> getThumbBoundsFn section of documentation for more info
var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail
pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
rect = thumbnail.getBoundingClientRect();
return {
x: rect.left,
y: rect.top + pageYScroll,
w: rect.width
};
}
};
// PhotoSwipe opened from URL
if (fromURL) {
if (options.galleryPIDs) {
// parse real index when custom PIDs are used
// http://photoswipe.com/documentation/faq.html#custom-pid-in-url
for (var j = 0; j < items.length; j++) {
if (items[j].pid == index) {
options.index = j;
break;
}
}
} else {
// in URL indexes start from 1
options.index = parseInt(index, 10) - 1;
}
} else {
options.index = parseInt(index, 10);
}
// exit if index not found
if (isNaN(options.index)) {
return;
}
if (disableAnimation) {
options.showAnimationDuration = 0;
}
// Pass data to PhotoSwipe and initialize it
gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
gallery.init();
//갤러리가 실행된 후에
gallery.listen('imageLoadComplete', function(index, item) {
var counter = '('+modal.find('.pswp__counter').text().replace(/ /g, '')+') ';
document.title = counter+subject+'-'+orgin_title // 브라우저 타이틀 재설정
$('body').addClass('modal-open') // 페이지 스크롤바 원상복귀를 위해
});
//슬라이드 갱신 후에
gallery.listen('afterChange', function() {
var counter = '('+modal.find('.pswp__counter').text().replace(/ /g, '')+') ';
document.title = counter+subject+'-'+orgin_title // 브라우저 타이틀 재설정
});
// 갤러리가 닫힐때
gallery.listen('close', function() {
$('body').removeClass('modal-open') // 페이지 스크롤바 원상복귀를 위해
});
};
// loop through all gallery elements and bind events
var galleryElements = document.querySelectorAll(gallerySelector);
for (var i = 0, l = galleryElements.length; i < l; i++) {
galleryElements[i].setAttribute('data-pswp-uid', i + 1);
galleryElements[i].onclick = onThumbnailsClick;
}
// Parse URL and open gallery if it contains #&pid=3&gid=1
var hashData = photoswipeParseHash();
if (hashData.pid && hashData.gid) {
openPhotoSwipe(hashData.pid, galleryElements[hashData.gid - 1], true, true);
}
};
$(function () {
// execute above function
initPhotoSwipeFromDOM('.post-gallery');
$('.post-gallery figure a').click(function(){
$(this).closest('figure').attr('tabindex','-1').focus();
});
})
</script>

View File

@@ -0,0 +1,88 @@
<?php
// 댓글 일반 사항
/*
1) 댓글 저장 테이블 : rb_s_comment
2) 한줄의견 저장 테이블 : rb_s_oneline
3) rb_s_comment 의 parent 필드 저장형식 ==> p_modulep_uid
예를 들어, 게시판 모듈의 uid = 3 인 글의 댓글은 아래와 같이 저장됩니다.
====> bbs3
4) 테마 css 는 테마/css/style.css 이며 댓글박스 가져올때 자동으로 함께 링크를 가져옵니다.
이 css 를 삭제하면 안되며 필요없는 경우 공백으로 처리하는 방법으로 하시기 바랍니다.
현재, notify 부분에 대한 css 가 있어서 삭제하면 안됩니다.
*/
// 댓글 출력 함수
// 함수 호출 방식으로 하면 모달 호출시에도 적용하기 편합니다.
/*
1) module = 부모모듈 : 댓글의 부모 모듈 id ( ex: bbs, post, forum ...)
2) parent_uid = 부모 uid : 댓글의 부모 포스트 uid
3) parent_table = 부모 테이블 : p_uid 가 소속된 테이블명 ( ex : rb_bbs_data, rb_blog_data, rb_chanel_data ...)
(댓글, 한줄의견 추가/삭제시 합계 업데이트시 필요)
*/
$comment_theme = $d['bbs']['c_skin']?$d['bbs']['c_skin']: ($d['theme']['comment_theme']?$d['theme']['comment_theme']:$d['bbs']['comment_main']);
?>
<div id="commentting-container">
<!-- 댓글 출력 -->
</div>
<link href="<?php echo $g['url_root']?>/modules/comment/themes/<?php echo $comment_theme?>/css/style.css" rel="stylesheet">
<script>
$(function () {
// 댓글 출력 함수 실행
var p_module = 'bbs';
var p_table = '<?php echo $table['bbsdata']?>';
var p_uid = '<?php echo $uid?>';
var theme = '<?php echo $comment_theme ?>';
var commentting_container = $('#commentting-container');
var get_Rb_Comment = function(p_module,p_table,p_uid,theme){
$('#commentting-container').Rb_comment({
moduleName : 'comment', // 댓글 모듈명 지정 (수정금지)
parent : p_module+'-'+p_uid, // rb_s_comment parent 필드에 저장되는 형태가 p_modulep_uid 형태임 참조.(- 는 저장시 제거됨)
parent_table : p_table, // 부모 uid 가 저장된 테이블 (게시판인 경우 rb_bbs_data : 댓글, 한줄의견 추가/삭제시 전체 합계 업데이트용)
theme_name : theme, // 댓글 테마
containerClass :'rb-commentting', // 본 엘리먼트(#commentting-container)에 추가되는 class
recnum: 15, // 출력갯수
commentPlaceHolder : '댓글을 입력해 주세요..',
noMoreCommentMsg : '댓글 없음 ',
commentLength : 500, // 댓글 입력 글자 수 제한
});
}
get_Rb_Comment(p_module,p_table,p_uid,theme);
// 댓글이 등록된 후에
commentting_container.on('saved.rb.comment',function(){
// $.notify({message:'댓글이 등록 되었습니다.'});
$('[data-toggle="tooltip"]').tooltip()
$('[data-role="comment-item"] article').autolink();
$(document).on('click','.add-comment',function(){
var uid = $(this).data('parent')
var textarea = $('[data-role="oneline-input-'+uid+'"]')
setTimeout(function(){ textarea.focus(); }, 200); // 한줄의견 추가시에 textarea focus 처리하기
});
})
// 댓글이 수정된 후에
commentting_container.on('edited.rb.comment',function(){
$.notify({message: '댓글이 수정 되었습니다.'},{type: 'success'});
})
// 한줄의견이 등록된 후에
commentting_container.on('saved.rb.oneline',function(){
$('[data-toggle="tooltip"]').tooltip()
$('[data-role="oneline-item"] article').autolink();
})
commentting_container.on('edited.rb.oneline',function(){
$.notify({message: '의견이 수정 되었습니다.'},{type: 'success'});
})
})
</script>

View File

@@ -0,0 +1,9 @@
<!-- 게시판 픗터 파일 -->
<?php if ($g['add_footer_img']): ?>
<div class="my-3">
<img src="<?php echo $g['add_footer_img'] ?>" alt="" class="img-fluid my-3">
</div>
<?php endif; ?>
<!-- 게시판 픗터 코드 -->
<?php if ($g['add_footer_inc']) include_once $g['add_footer_inc'];?>

View File

@@ -0,0 +1,9 @@
<!-- 게시판 헤더 파일 -->
<?php if ($g['add_header_img']): ?>
<div class="my-3">
<img src="<?php echo $g['add_header_img'] ?>" alt="" class="img-fluid">
</div>
<?php endif; ?>
<!-- 게시판 헤더 코드 -->
<?php if ($g['add_header_inc']) include_once $g['add_header_inc'];?>

View File

@@ -0,0 +1,47 @@
<?php
// seo 데이타 -- 전송되는 타이틀 추출
$_MSEO = getDbData($table['s_seo'],'rel=1 and parent='.$_HM['uid'],'*');
$_PSEO = getDbData($table['s_seo'],'rel=2 and parent='.$_HP['uid'],'*');
$_WTIT=strip_tags($g['meta_tit']);
$_link_url=$g['url_root'].$_SERVER['REQUEST_URI'];
?>
<ul class="list-inline" data-role="linkshare">
<li data-toggle="tooltip" title="페이스북" class="list-inline-item">
<a href="" role="button" onclick="snsWin('f');">
<img src="<?php echo $g['img_core']?>/sns/facebook.png" alt="페이스북공유" class="rounded-circle" width="50">
</a>
</li>
<li data-toggle="tooltip" title="카카오스토리" class="list-inline-item">
<a href="" role="button" onclick="snsWin('ks');">
<img src="<?php echo $g['img_core']?>/sns/kakaostory.png" alt="카카오스토리" class="rounded-circle" width="50">
</a>
</li>
<li data-toggle="tooltip" title="네이버" class="list-inline-item">
<a href="" role="button" onclick="snsWin('n');">
<img src="<?php echo $g['img_core']?>/sns/naver.png" alt="네이버" class="rounded-circle" width="50">
</a>
</li>
<li data-toggle="tooltip" title="트위터" class="list-inline-item">
<a href="" role="button" onclick="snsWin('t');">
<img src="<?php echo $g['img_core']?>/sns/twitter.png" alt="트위터" class="rounded-circle" width="50">
</a>
</li>
</ul>
<script type="text/javascript">
// sns 이벤트
function snsWin(sns) {
var snsset = new Array();
var enc_sbj = "<?php echo urlencode($_WTIT)?>";
var enc_url = "<?php echo urlencode($_link_url)?>";
var enc_tag = "<?php echo urlencode(str_replace(',',' ',$R['tag']))?>";
snsset['t'] = 'https://twitter.com/intent/tweet?url=' + enc_url + '&text=' + enc_sbj;
snsset['f'] = 'http://www.facebook.com/sharer.php?u=' + enc_url;
snsset['n'] = 'http://share.naver.com/web/shareView.nhn?url=' + enc_url + '&title=' + enc_sbj;
snsset['ks'] = 'https://story.kakao.com/share?url=' + enc_url + '&title=' + enc_sbj;
window.open(snsset[sns]);
}
</script>

Some files were not shown because too many files have changed in this diff Show More