first
This commit is contained in:
45
modules/bbs/action/a.ajax_imgupload.php
Normal file
45
modules/bbs/action/a.ajax_imgupload.php
Normal 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'];
|
||||
}
|
||||
}// 파일이 넘어왔는지 체크
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
15
modules/bbs/action/a.bbs_file_delete.php
Normal file
15
modules/bbs/action/a.bbs_file_delete.php
Normal 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.','','');
|
||||
?>
|
||||
10
modules/bbs/action/a.bbsorder_update.php
Normal file
10
modules/bbs/action/a.bbsorder_update.php
Normal 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('','','','');
|
||||
?>
|
||||
48
modules/bbs/action/a.check_permWrite.php
Normal file
48
modules/bbs/action/a.check_permWrite.php
Normal 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;
|
||||
?>
|
||||
25
modules/bbs/action/a.config.php
Normal file
25
modules/bbs/action/a.config.php
Normal 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.','','');
|
||||
?>
|
||||
210
modules/bbs/action/a.delete.php
Normal file
210
modules/bbs/action/a.delete.php
Normal 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.'&':'').($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('&',' ',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);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
176
modules/bbs/action/a.deletebbs.php
Normal file
176
modules/bbs/action/a.deletebbs.php
Normal 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('&',' ',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.','','');
|
||||
?>
|
||||
98
modules/bbs/action/a.download.php
Normal file
98
modules/bbs/action/a.download.php
Normal 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;
|
||||
?>
|
||||
9
modules/bbs/action/a.fupdate.php
Normal file
9
modules/bbs/action/a.fupdate.php
Normal 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;
|
||||
?>
|
||||
94
modules/bbs/action/a.get_bbsList.php
Normal file
94
modules/bbs/action/a.get_bbsList.php
Normal 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;
|
||||
?>
|
||||
52
modules/bbs/action/a.get_categoryList.php
Normal file
52
modules/bbs/action/a.get_categoryList.php
Normal 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;
|
||||
?>
|
||||
28
modules/bbs/action/a.get_commentList.php
Normal file
28
modules/bbs/action/a.get_commentList.php
Normal 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;
|
||||
?>
|
||||
66
modules/bbs/action/a.get_listData.php
Normal file
66
modules/bbs/action/a.get_listData.php
Normal 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;
|
||||
?>
|
||||
91
modules/bbs/action/a.get_moreList.php
Normal file
91
modules/bbs/action/a.get_moreList.php
Normal 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;
|
||||
?>
|
||||
11
modules/bbs/action/a.get_onelineList.php
Normal file
11
modules/bbs/action/a.get_onelineList.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
include $theme.'comment/function.php';
|
||||
?>
|
||||
[RESULT:
|
||||
<?php echo getOnelineList($theme,$parent)?>
|
||||
:RESULT]
|
||||
<?php
|
||||
exit;
|
||||
?>
|
||||
50
modules/bbs/action/a.get_opinionList.php
Normal file
50
modules/bbs/action/a.get_opinionList.php
Normal 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;
|
||||
?>
|
||||
187
modules/bbs/action/a.get_postData.php
Normal file
187
modules/bbs/action/a.get_postData.php
Normal 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;
|
||||
?>
|
||||
156
modules/bbs/action/a.get_postList.php
Normal file
156
modules/bbs/action/a.get_postList.php
Normal 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;
|
||||
?>
|
||||
45
modules/bbs/action/a.get_writeMeta.php
Normal file
45
modules/bbs/action/a.get_writeMeta.php
Normal 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;
|
||||
?>
|
||||
183
modules/bbs/action/a.makebbs.php
Normal file
183
modules/bbs/action/a.makebbs.php
Normal 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.','','');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
13
modules/bbs/action/a.multi_config.php
Normal file
13
modules/bbs/action/a.multi_config.php
Normal 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.','수정되었습니다.','');
|
||||
?>
|
||||
269
modules/bbs/action/a.multi_copy.php
Normal file
269
modules/bbs/action/a.multi_copy.php
Normal 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.','실행되었습니다.','');
|
||||
?>
|
||||
164
modules/bbs/action/a.multi_delete.php
Normal file
164
modules/bbs/action/a.multi_delete.php
Normal 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('&',' ',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.','','');
|
||||
?>
|
||||
11
modules/bbs/action/a.multi_empty.php
Normal file
11
modules/bbs/action/a.multi_empty.php
Normal 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.','','');
|
||||
?>
|
||||
22
modules/bbs/action/a.multi_hide.php
Normal file
22
modules/bbs/action/a.multi_hide.php
Normal 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.','선택한 게시물이 모두 숨김처리 되었습니다. ','');
|
||||
?>
|
||||
100
modules/bbs/action/a.multi_move.php
Normal file
100
modules/bbs/action/a.multi_move.php
Normal 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.','실행되었습니다.','');
|
||||
?>
|
||||
149
modules/bbs/action/a.mypost_multi_delete.php
Normal file
149
modules/bbs/action/a.mypost_multi_delete.php
Normal 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('&',' ',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.','','');
|
||||
?>
|
||||
23
modules/bbs/action/a.notidoc_regis.php
Normal file
23
modules/bbs/action/a.notidoc_regis.php
Normal 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.','','');
|
||||
?>
|
||||
210
modules/bbs/action/a.opinion.php
Normal file
210
modules/bbs/action/a.opinion.php
Normal 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;
|
||||
?>
|
||||
37
modules/bbs/action/a.point_view.php
Normal file
37
modules/bbs/action/a.point_view.php
Normal 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.','관리자님으로 인증되셨습니다.','');
|
||||
}
|
||||
}
|
||||
?>
|
||||
14
modules/bbs/action/a.pwcheck.php
Normal file
14
modules/bbs/action/a.pwcheck.php
Normal 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.','','');
|
||||
?>
|
||||
172
modules/bbs/action/a.report.php
Normal file
172
modules/bbs/action/a.report.php
Normal 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('&',' ',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.'&':'').($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.'&':'').($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('','','이미 신고하신 게시물입니다.','');
|
||||
}
|
||||
}
|
||||
?>
|
||||
110
modules/bbs/action/a.saved.php
Normal file
110
modules/bbs/action/a.saved.php
Normal 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.'&':'').($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;
|
||||
?>
|
||||
48
modules/bbs/action/a.score.php
Normal file
48
modules/bbs/action/a.score.php
Normal 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('','','반영되었습니다.','');
|
||||
?>
|
||||
13
modules/bbs/action/a.theme_config.php
Normal file
13
modules/bbs/action/a.theme_config.php
Normal 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.','','');
|
||||
?>
|
||||
12
modules/bbs/action/a.theme_delete.php
Normal file
12
modules/bbs/action/a.theme_delete.php
Normal 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.','','');
|
||||
?>
|
||||
106
modules/bbs/action/a.upload.php
Normal file
106
modules/bbs/action/a.upload.php
Normal 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);// 최종적으로 에디터에 넘어가는 값
|
||||
}
|
||||
|
||||
}// 파일이 넘어왔는지 체크
|
||||
?>
|
||||
|
||||
|
||||
325
modules/bbs/action/a.write.php
Normal file
325
modules/bbs/action/a.write.php
Normal 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.','','');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user