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

View File

@@ -0,0 +1,15 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$R = getDbData($table[$m.'list'],"id='".$bid."'",'*');
if ($R['img'.$dtype])
{
getDbUpdate($table[$m.'list'],"img".$dtype."=''",'uid='.$R['uid']);
unlink($g['dir_module'].'var/files/'.$R['img'.$dtype]);
}
getLink('reload','parent.','','');
?>

View File

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

View File

@@ -0,0 +1,95 @@
<?php
if(!defined('__KIMS__')) exit;
$R = getUidData($table['s_comment'],$uid);
if (!$R['uid']) echo '[RESULT:존재하지 않는 댓글입니다.:RESULT]';//getLink('','','존재하지 않는 댓글입니다.','');
if ($my['uid'] != $R['mbruid'] && !$my['admin'])
{
if ($pw)
{
if (md5($pw) != $R['pw']) echo '[RESULT:비밀번호가 일치하지 않습니다.:RESULT]';//getLink('','','비밀번호가 일치하지 않습니다.','');
}
else {
echo '[RESULT:비밀번호를 입력해 주세요.:RESULT]';// getLink('','','비밀번호를 입력해 주세요.','');
}
}
include $g['path_module'].'comment/var/var.php';
if ($d['comment']['onelinedel'])
{
if($R['oneline'])
{
echo '[RESULT:한줄의견이 있는 댓글은 삭제할 수 없습니다.:RESULT]';//getLink('','','한줄의견이 있는 댓글은 삭제할 수 없습니다.','');
}
}
//동기화
$cyncArr = getArrayString($R['cync']);
$fdexp = explode(',',$cyncArr['data'][2]);
if ($fdexp[0]&&$fdexp[1]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[1].'='.$fdexp[1].'-1',$fdexp[0].'='.$cyncArr['data'][1]);
if ($fdexp[0]&&$fdexp[2]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-'.$R['oneline'],$fdexp[0].'='.$cyncArr['data'][1]);
//첨부파일삭제
if ($R['upload'])
{
//include $g['path_module'].'upload/var/var.php';
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table[$m.'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[$m.'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) echo '[RESULT:FTP서버 연결에 문제가 발생했습니다.:RESULT]';//getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) echo '[RESULT:FTP서버 아이디나 패스워드가 일치하지 않습니다.:RESULT]';//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']);
unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['thumbname']);
}
}
}
}
//한줄의견삭제
if ($R['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$R['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$R['uid']);
}
getDbDelete($table['s_comment'],'uid='.$R['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
if ($R['point']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','댓글삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
}
echo '[RESULT:ok:RESULT]';
?>

View File

@@ -0,0 +1,78 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
foreach($comment_members as $val)
{
$R = getUidData($table['s_comment'],$val);
if (!$R['uid']) continue;
//동기화
$syncArr = getArrayString($R['sync']);
$fdexp = explode(',',$syncArr['data'][2]);
if ($fdexp[0]&&$fdexp[1]&&$syncArr['data'][3]) getDbUpdate($syncArr['data'][3],$fdexp[1].'='.$fdexp[1].'-1',$fdexp[0].'='.$syncArr['data'][1]);
if ($fdexp[0]&&$fdexp[2]&&$syncArr['data'][3]) getDbUpdate($syncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-'.$R['oneline'],$fdexp[0].'='.$syncArr['data'][1]);
//첨부파일삭제
if ($R['upload'])
{
include_once $g['path_module'].'mediaset/var/var.php';
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['bbsupload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['bbsupload'],'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('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['thumbname']);
}
}
}
}
//한줄의견삭제
if ($R['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$R['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$R['uid']);
}
getDbDelete($table['s_comment'],'uid='.$R['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
if ($R['point']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','댓글삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
}
}
setrawcookie('comment_post_result', rawurlencode('댓글이 삭제 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,106 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid']) echo '[RESULT:로그인을 먼저 해주세요.:RESULT]';
$R = getUidData($table['s_comment'],$uid);
if (!$R['uid']) echo '[RESULT:존재하지 않는 댓글입니다.:RESULT]';
include $g['path_module'].'comment/var/var.php';
if ($d['comment']['singo_del'] && $d['comment']['singo_del_num'] <= $R['singo'])
{
if ($d['comment']['singo_del_act'] == 1)
{
//동기화
$cyncArr = getArrayString($R['cync']);
$fdexp = explode(',',$cyncArr['data'][2]);
if ($fdexp[0]&&$fdexp[1]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[1].'='.$fdexp[1].'-1',$fdexp[0].'='.$cyncArr['data'][1]);
if ($fdexp[0]&&$fdexp[2]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-'.$R['oneline'],$fdexp[0].'='.$cyncArr['data'][1]);
//첨부파일삭제
if ($R['upload'])
{
include_once $g['path_module'].'upload/var/var.php';
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table[$m.'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[$m.'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) echo '[RESULT:FTP서버 연결에 문제가 발생했습니다.:RESULT]';//getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) echo '[RESULT:FTP서버 아이디나 패스워드가 일치하지 않습니다.:RESULT]';//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']);
unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['thumbname']);
}
}
}
}
//한줄의견삭제
if ($R['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$R['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$R['uid']);
}
getDbDelete($table['s_comment'],'uid='.$R['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
if ($R['point']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','댓글삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
}
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').($c?'c='.$c:'m='.$m),array('skin','iframe','sort','orderby','recnum','where','keyword'));
getLink($backUrl ,'parent.' , '신고건수 누적으로 삭제처리 되었습니다.' , $history);
}
else {
getDbUpdate($table['s_comment'],'hidden=1','uid='.$R['uid']);
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').($c?'c='.$c:'m='.$m),array('skin','iframe','sort','orderby','recnum','where','keyword'));
getLink($backUrl ,'parent.' , '신고건수 누적으로 게시제한처리 되었습니다.' , $history);
}
}
else {
if (!strstr($_SESSION['module_comment_singo'],'['.$R['uid'].']'))
{
getDbUpdate($table['s_comment'],'singo=singo+1','uid='.$R['uid']);
$_SESSION['module_comment_singo'] .= '['.$R['uid'].']';
echo '[RESULT:신고처리 되었습니다.:RESULT]';//getLink('','','신고처리 되었습니다.','');
}
else {
echo '[RESULT:이미 신고하신 댓글입니다.:RESULT]'; // getLink('','','이미 신고하신 댓글입니다.','');
}
}
?>

View File

@@ -0,0 +1,30 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid']) echo '[RESULT:로그인을 먼저 해주세요.:RESULT]';
$R = getUidData($table['s_comment'],$uid);
if (!$R['uid']) exit;
$score_limit = 1; //점수한계치(이 점수보다 높은 갚을 임의로 보낼 경우 제한)
$score = $score ? $score : 1;
if ($score > $score_limit) $score = $score_limit;
if (!strstr($_SESSION['module_comment_score'],'['.$R['uid'].']'))
{
if ($value == 'good')
{
getDbUpdate($table['s_comment'],'score1=score1+'.$score,'uid='.$R['uid']);
echo '<script>parent.getId("_score1_'.$uid.'").innerHTML="'.($R['score1']+$score).'";</script>';;
}
else {
getDbUpdate($table['s_comment'],'score2=score2+'.$score,'uid='.$R['uid']);
echo '<script>parent.getId("_score2_'.$uid.'").innerHTML="'.($R['score1']+$score).'";</script>';;
}
$_SESSION['module_comment_score'] .= '['.$R['uid'].']';
echo '[RESULT:ok:RESULT]';
}
else {
echo '[RESULT:이미 평가하신 댓글입니다.:RESULT]';
}
exit;
?>

View File

@@ -0,0 +1,25 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$badword = trim($badword);
$badword = str_replace("\r\n","",$badword);
$badword = str_replace("\n","",$badword);
$fdset = array('skin_main','skin_mobile','skin_total','rss','restr','commentdel','badword','badword_action','badword_escape','report_del','report_del_num','report_del_act','recnum','newtime','give_point','give_opoint');
$gfile= $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$fp = fopen($gfile,'w');
fwrite($fp, "<?php\n");
foreach ($fdset as $val)
{
fwrite($fp, "\$d['comment']['".$val."'] = \"".trim(${$val})."\";\n");
}
fwrite($fp, "?>");
fclose($fp);
@chmod($gfile,0707);
setrawcookie('comment_config_result', rawurlencode('설정이 변경 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,170 @@
<?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['dir_module'].'var/var.'.$B['id'].'.php';
include_once $g['path_module'].'upload/var/var.php';
$backUrl = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').($c?'c='.$c:'m='.$m),array('bid','skin','iframe','cat','p','sort','orderby','recnum','type','where','keyword'));
if ($my['uid'] != $R['mbruid'] && !$my['admin'] && !strstr(','.($d['bbs']['admin']?$d['bbs']['admin']:'.').',',','.$my['id'].','))
{
if (!strstr($_SESSION['module_'.$m.'_pwcheck'],$R['uid']))
{
if ($pw)
{
if (md5($pw) != $R['pw']) getLink('reload','parent.','비밀번호가 일치하지 않습니다.','');
}
else {
getLink($backUrl.'&mod=delete&uid='.$R['uid'],'parent.','','');
}
}
}
if ($d['bbs']['commentdel'])
{
if($R['comment'])
{
getLink('','','댓글이 있는 게시물은 삭제할 수 없습니다.','');
}
}
if ($d['bbs']['replydel'])
{
$_ngid = (int)$R['gid'];
if(getDbRows($table[$m.'data'],'gid > '.$_ngid.' and gid < '.($_ngid+1)) && !$R['depth'])
{
getLink('','','답변글이 있는 게시물은 삭제할 수 없습니다.','');
}
}
//댓글삭제
if ($R['comment'])
{
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
while($_C=db_fetch_array($CCD))
{
if ($_C['upload'])
{
$UPFILES = getArrayString($_C['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['host']==$d['upload']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
ftp_close($FTP_CONNECT);
}
else {
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
}
}
}
}
if ($_C['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
}
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
if ($_C['point']&&$_C['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
}
}
}
//첨부파일삭제
if ($R['upload'])
{
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
getDbUpdate($table['s_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['host']==$d['upload']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['upload']['ftp_host'],$d['upload']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['upload']['ftp_user'],$d['upload']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
if($d['upload']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
ftp_close($FTP_CONNECT);
}
else {
unlink($g['path_file'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink($g['path_file'].$U['folder'].'/'.$U['thumbname']);
}
}
}
}
//태그삭제
if ($R['tag'])
{
$_tagdate = substr($R['d_regis'],0,8);
$_tagarr1 = explode(',',$R['tag']);
foreach($_tagarr1 as $_t)
{
if(!$_t) continue;
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and date='".$_tagdate."' and keyword='".$_t."'",'*');
if($_TAG['uid'])
{
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
}
}
}
getDbUpdate($table[$m.'month'],'num=num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbUpdate($table[$m.'day'],'num=num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and bbs='.$R['bbs']);
getDbDelete($table[$m.'idx'],'gid='.$R['gid']);
getDbDelete($table[$m.'data'],'uid='.$R['uid']);
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']);
}
getLink($backUrl ,'parent.' , $alert , $history);
?>

View File

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

View File

@@ -0,0 +1,85 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['dir_module'].'includes/base.class.php';
require_once $g['dir_module'].'includes/module.class.php';
$comment = new Comment();
$comment->parent = $_REQUEST['parent']; // post 로 넘어온 값
$comment->parent_table = $_REQUEST['parent_table']; // post 로 넘어온 값
$comment->theme_name = $_REQUEST['theme_name']; // post 로 넘어온 값
$comment->sort = $_REQUEST['sort'];
$comment->recnum = $_REQUEST['recnum'];
$comment->orderby = $_REQUEST['orderby'];
// post 로 넘어오는 값
$entry = $_REQUEST['entry']; // 해당 글 uid
$type = $_REQUEST['type'];// comment or oneline
$uid = $_REQUEST['uid']; // comment, oneline...PK
$parent = $_REQUEST['parent'];
// 리턴값 세팅
$result = array();
$result['error'] = false;
if($act=='like'){
// 테이블 세팅
if($type=='comment') $update_table = $comment->commentTable;
else if($type=='oneline') $update_table = $comment->onelineTable;
$opinion_table = $comment->opinionTable;
$mbruid = $my['uid'];
$check_qry = "mbruid='".$mbruid."' and module='".$type."' and entry='".$entry."' and opinion='like'";
// 로그인한 사용자가 좋아요를 했는지 여부 체크
$is_liked = getDbRows($opinion_table,$check_qry);
if($is_liked){ // 좋아요를 했던 경우
getDbDelete($opinion_table,$check_qry);
getDbUpdate($update_table,'likes=likes-1','uid='.$entry);
$result['is_liked'] = 0;
}else{ // 좋아요 안한 경우 추가
$QKEY = "mbruid,module,entry,opinion,d_regis";
$QVAL = "'$mbruid','$type','$entry','like','".$date['totime']."'";
getDbInsert($opinion_table,$QKEY,$QVAL);
getDbUpdate($update_table,'likes=likes+1','uid='.$entry);
$result['is_liked'] = 1;
}
// 현재 해당 글 likes 갯수 얻기
$R = getDbData($update_table,'uid='.$entry,'likes');
$result['total_like'] = $R['likes']?$R['likes']:'';
$result['check_qry'] = $check_qry;
$result['update_table'] = $update_table;
}else if($act=='delete'){
if($type=='comment') $del_msg = $comment->deleteComment($uid);
else if($type=='oneline') $del_msg = $comment->deleteOneline($parent,$uid);
if($del_msg=='OK') $result['msg'] = $del_msg;
else {
$result['error'] = true;
$result['error_msg'] = $del_msg;
}
}else if($act=='notice'){ // 공지글 지정
$update_table = $comment->commentTable;
$check_qry = "notice=1 and uid=".$uid;
$is_notice = getDbRows($update_table,$check_qry);
if ($is_notice) {
getDbUpdate($update_table,'notice=0','uid='.$uid);
$result['is_notice'] = 0;
} else {
getDbUpdate($update_table,'notice=1','uid='.$uid);
$result['is_notice'] = 1;
}
// $result['content'] = $comment->getCommentLog($parent,$sort,$orderby,$recnum,$page);
}else if($act=='getCommentList'){ // 댓글 더보기 & 리로드
$result['content'] = $comment->getCommentLog($parent,$sort,$orderby,$recnum,$page,0);
$result['notice'] = $comment->getCommentLog($parent,$sort,$orderby,$recnum,$page,1);
}
echo json_encode($result);
exit;
?>

View File

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

View File

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

View File

@@ -0,0 +1,56 @@
<?php
/* 채팅박스 초기화 */
if(!defined('__KIMS__')) exit;
require_once $g['dir_module'].'includes/base.class.php';
require_once $g['dir_module'].'includes/module.class.php';
$chatting = new Chatting();
$chatting->id = $_GET['chat_id']; // get 으로 넘어온 값을 id 지정
$is_owner = $chatting->is_owner(); // 채팅방장 여부
$totalPage = $chatting->getTotalPage($chatting->id,$chatting->recnum);
$totalRow = getDbRows($table[$m.'data'],"bbsid='".$chatting->id."'");
$SAT = $chatting->getSettings($chatting->id); // 채팅방 설정값
// 이미지 폴더 패스
$TMPL['img_module_skin'] = $chatting->getThemePath($chatting->id).'/images/';
// chat box html 추출
if($is_owner) $TMPL['chat_owner_menu'] = $chatting->getHtml('chat_owner_menu');
else $TMPL['chat_owner_menu'] = '';
// 차단사용자 모달 값 세팅
$TMPL['room_name'] = $SAT['room_name'];// 채팅방명
$TMPL['block_list'] = $chatting->getBlockUser($chatting->id,1,5); // 차단사용자 리스트
// 열람 권한 체크 및 chat 출력
$UAP = $chatting->getUAP($chatting->id);
if(!$UAP['open']) $TMPL['chat_rows'] = $chatting->getNoAccessMsg('not_open'); // 오픈전 메세지
else if(!$UAP['view']) $TMPL['chat_rows'] = $chatting->getNoAccessMsg('no_viewPerm'); // 열람권한 없음 메세지
else if($UAP['closed']) $TMPL['chat_rows'] = $chatting->getNoAccessMsg('closed'); // closed 메세지
else $TMPL['chat_rows'] = $chatting->getChatLog($chatting->id,1,$chatting->recnum);
// 이모티콘 리스트
$TMPL['emoticon_list'] = $chatting->getEmoticonList($chatting->id);
$chat_box = $chatting->getHtml('chat_box');
$result['chat_box'] = $chat_box;
$result['is_owner'] = $is_owner; // 채팅방장 여부
$result['owner_id'] = $SAT['owner_id'];
$result['totalPage'] = $totalPage;
$result['totalRow'] = $totalRow;
$result['userGroup'] = $my['mygroup']?$my['mygroup']:0;
$result['userLevel'] = $my['level']?$my['level']:0;
$result['room_type'] = $SAT['room_type']; // 운영시작
$result['perm_write'] = $UAP['write']; // 작성 권한
$result['room_open'] = $UAP['open']; // 운영시작
$result['room_closed'] = $UAP['closed']; // 운영마감
$result['t_start'] = $UAP['t_start']; // 운영마감
$result['t_end'] = $UAP['t_end']; // 운영마감
$result['now_time'] = $UAP['now_time']; // 운영마감
echo json_encode($result,true);
exit;
?>

View File

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

View File

@@ -0,0 +1,43 @@
<?php
/* 채팅박스 초기화 */
if(!defined('__KIMS__')) exit;
require_once $g['dir_module'].'includes/base.class.php';
require_once $g['dir_module'].'includes/module.class.php';
$comment = new Comment();
$comment->parent = $_POST['parent']; // post 로 넘어온 값
$comment->parent_table = $_POST['parent_table']; // post 로 넘어온 값
$comment->theme_name = $_POST['theme_name']; // post 로 넘어온 값
$comment->sort = $_POST['sort'];
$comment->recnum = $_POST['recnum'];
$comment->orderby = $_POST['orderby'];
$totalPage = $comment->getTotalData($comment->parent,$comment->recnum,'comment','page',0);
$totalRow = $comment->getTotalData($comment->parent,$comment->recnum,'comment','row',0);
$TMPL['comment_total'] = $totalRow==0?'':$totalRow;
$TMPL['login_user_pic'] = $comment->getUserAvatar($my['uid'],'src');
$TMPL['login_user_nic'] = $my['nic'];
$TMPL['comment_parent'] = $comment->parent;
// comment_box.html 구성요소 세팅
$TMPL['img_module_skin'] = $comment->getThemePath('absolute').'/images/'; // 이미지 폴더 패스
$TMPL['theme_css_path'] = $comment->getThemePath('absolute').'/css/style.css'; // 테마 css
$TMPL['comment_rows_notice'] = $comment->getCommentLog($comment->parent,$sort,$orderby,$recnum,1,1); // 열람 권한 체크 및 고정 comment 출력
$TMPL['comment_rows'] = $comment->getCommentLog($comment->parent,$sort,$orderby,$recnum,1,0); // 열람 권한 체크 및 comment 출력
$TMPL['emoticon_list'] = $comment->getEmoticonList($comment->parent); // 이모티콘 리스트
$TMPL['comment_header'] = $comment->getHtml('comment_header'); // 헤더
$TMPL['comment_write'] = $comment->getHtml('comment_write'); // 쓰기
// 최종 리턴되는 댓글 box html & 세팅값
$result['comment_box'] = $comment->getHtml('comment_box');
$result['totalPage'] = $totalPage;
$result['totalRow'] = $totalRow;
$result['perm_write'] = $my['uid']?true:false; // 작성 권한
$result['userGroup'] = $my['mygroup']?$my['mygroup']:0;
$result['userLevel'] = $my['level']?$my['level']:0;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,21 @@
<?php
/* msg 템플릿 초기화 */
if(!defined('__KIMS__')) exit;
require_once $g['dir_module'].'includes/base.class.php';
require_once $g['dir_module'].'includes/module.class.php';
$chatting = new Chatting();
$chatting->id = $_GET['chat_id']; // get 으로 넘어온 값을 id 지정
$resutl = array();
$result['me'] = $chatting->getHtmlOnly('my_msg');
$result['other'] = $chatting->getHtmlOnly('other_msg');
$result['notice'] = $chatting->getHtmlOnly('notice_msg');
$result['notice'] = $chatting->getHtmlOnly('notice_msg');
$result['photo'] = $chatting->getHtmlOnly('photo_msg');
$result['file'] = $chatting->getHtmlOnly('file_msg');
$result['emoticon'] = $chatting->getHtmlOnly('emoticon_msg');
echo json_encode($result,true);
exit;
?>

View File

@@ -0,0 +1,21 @@
<?php
/* msg 템플릿 초기화 */
if(!defined('__KIMS__')) exit;
require_once $g['dir_module'].'includes/base.class.php';
require_once $g['dir_module'].'includes/module.class.php';
$chatting = new Chatting();
$chatting->id = $_GET['chat_id']; // get 으로 넘어온 값을 id 지정
$resutl = array();
$result['me'] = $chatting->getHtmlOnly('my_msg');
$result['other'] = $chatting->getHtmlOnly('other_msg');
$result['notice'] = $chatting->getHtmlOnly('notice_msg');
$result['notice'] = $chatting->getHtmlOnly('notice_msg');
$result['photo'] = $chatting->getHtmlOnly('photo_msg');
$result['file'] = $chatting->getHtmlOnly('file_msg');
$result['emoticon'] = $chatting->getHtmlOnly('emoticon_msg');
echo json_encode($result,true);
exit;
?>

View File

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

View File

@@ -0,0 +1,54 @@
<?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);
if (!$name) getLink('','','채팅방 이름을 입력해 주세요.','');
if (!$id) getLink('','','채팅방 아이디를 입력해 주세요.','');
if ($bid)
{
$R = getDbData($table[$m.'list'],"id='".$bid."'",'*');
$QVAL = "name='$name',type='$type',owner_id='$owner_id',members='$members',t_start='$t_start',t_end='$t_end',category='$category',imghead='$imghead',imgfoot='$imgfoot',puthead='$puthead',putfoot='$putfoot',addinfo='$addinfo',writecode='$writecode'";
getDbUpdate($table[$m.'list'],$QVAL,"id='".$bid."'");
$backUrl = $g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=makebbs&iframe=Y&uid='.$R['uid'];
$msg = '채팅방 설정내용이 수정되었습니다.';
}
else {
if(getDbRows($table[$m.'list'],"id='".$id."'")) getLink('','','이미 같은 아이디의 채팅방이 존재합니다.','');
$Ugid = getDbCnt($table[$m.'list'],'max(gid)','') + 1;
$QKEY = "gid,id,name,type,owner_id,members,t_start,t_end,category,num_r,d_last,d_regis,imghead,imgfoot,puthead,putfoot,addinfo,writecode";
$QVAL = "'$Ugid','$id','$name','$type','$owner_id','$members','$t_start','$t_end','$category','0','','".$date['totime']."','$imghead','$imgfoot','$puthead','$putfoot','$addinfo','$writecode'";
getDbInsert($table[$m.'list'],$QKEY,$QVAL);
$backUrl = $g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=makebbs&iframe=Y&uid='.getDbCnt($table[$m.'list'],'max(uid)','');
$msg ='새 채팅방이 만들어졌습니다. ';
}
$fdset = array('layout','skin','m_skin','perm_g_view','perm_g_write','perm_l_view','perm_l_write','admin','hitcount','recnum','sbjcut','newtime','display');
$gfile= $g['dir_module'].'var/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);
getLink('reload','parent.',$msg,'');
?>

View File

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

View File

@@ -0,0 +1,233 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
include_once $g['path_module'].'upload/var/var.php';
$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;
$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,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,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']."','0','".$R['score1']."','".$R['score2']."','".$R['singo']."','0','".$R['point2']."','".$R['point3']."','".$R['point4']."',";
$QVAL.= "'".$R['d_regis']."','".$R['d_modify']."','".$R['d_comment']."','".$R['d_trackback']."','".$R['upload']."','".$R['ip']."','".$R['agent']."','".$R['sns']."','".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_cync = '['.$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,score1,score2,singo,d_regis,d_modify,d_oneline,upload,ip,agent,cync,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['score1']."','".$_C['score2']."','".$_C['singo']."','".$_C['d_regis']."','".$_C['d_modify']."','".$_C['d_oneline']."',";
$QVAL.= "'".$_C['upload']."','".$_C['ip']."','".$_C['agent']."','$comment_cync','".$_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,singo,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['singo']."','".$_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']);
$_thumbna = md5($U['thumbname']);
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_get($FTP_CONNECT,$g['path_tmp'].'session/'.$U['tmpname'],$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname'],FTP_BINARY);
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$_tmpname,$g['path_tmp'].'session/'.$U['tmpname'], FTP_BINARY);
@unlink($g['path_tmp'].'session/'.$U['tmpname']);
if($U['type']==2)
{
ftp_get($FTP_CONNECT,$g['path_tmp'].'session/'.$U['thumbname'],$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname'],FTP_BINARY);
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$_thumbna,$g['path_tmp'].'session/'.$U['thumbname'], FTP_BINARY);
@unlink($g['path_tmp'].'session/'.$U['thumbname']);
}
ftp_close($FTP_CONNECT);
}
else {
copy($g['path_file'].$U['folder'].'/'.$U['tmpname'],$g['path_file'].$U['folder'].'/'.$_tmpname);
if($U['type']==2) copy($g['path_file'].$U['folder'].'/'.$U['thumbname'],$g['path_file'].$U['folder'].'/'.$_thumbna);
}
$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,url,folder,name,tmpname,thumbname,size,width,heigth,caption,down,d_regis,d_update,cync";
$QVAL = "'".$upload_gid."','".$U['hidden']."','','".$U['site']."','".$U['mbruid']."','".$U['type']."','".$U['ext']."','".$U['fserver']."','".$U['host']."','".$U['folder']."',";
$QVAL.= "'".addslashes($U['name'])."','".$_tmpname."','".$_thumbna."','".$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']);
$_thumbna = md5($U['thumbname']);
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_get($FTP_CONNECT,$g['path_tmp'].'session/'.$U['tmpname'],$d['upload']['ftp_folder'].$U['folder'].'/'.$U['tmpname'],FTP_BINARY);
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$_tmpname,$g['path_tmp'].'session/'.$U['tmpname'],FTP_BINARY);
@unlink($g['path_tmp'].'session/'.$U['tmpname']);
if($U['type']==2)
{
ftp_get($FTP_CONNECT,$g['path_tmp'].'session/'.$U['thumbname'],$d['upload']['ftp_folder'].$U['folder'].'/'.$U['thumbname'],FTP_BINARY);
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$U['folder'].'/'.$_thumbna,$g['path_tmp'].'session/'.$U['thumbname'],FTP_BINARY);
@unlink($g['path_tmp'].'session/'.$U['thumbname']);
}
ftp_close($FTP_CONNECT);
}
else {
copy($g['path_file'].$U['folder'].'/'.$U['tmpname'],$g['path_file'].$U['folder'].'/'.$_tmpname);
if($U['type']==2) copy($g['path_file'].$U['folder'].'/'.$U['thumbname'],$g['path_file'].$U['folder'].'/'.$_thumbna);
}
$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,url,folder,name,tmpname,thumbname,size,width,height,caption,down,d_regis,d_update,cync";
$QVAL = "'$upload_gid','".$U['hidden']."','','".$U['site']."','".$U['mbruid']."','".$U['type']."','".$U['ext']."','".$U['fserver']."','".$U['host']."',";
$QVAL.= "'".$U['folder']."','".addslashes($U['name'])."','".$_tmpname."','".$_thumbna."','".$U['size']."','".$U['width']."','".$U['height']."',";
$QVAL.= "'".addslashes($U['caption'])."','".$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)','').']';
$_content1 = str_replace($U['tmpname'],$_tmpname,$_content1);
}
}
getDbUpdate($table[$m.'data'],"content='".addslashes($_content1)."',upload='".$tmpupload."'",'uid='.$NOWUID);
}
$_SESSION['BbsPost'.$type] = str_replace('['.$R['uid'].']','',$_SESSION['BbsPost'.$type]);
}
$referer = $g['s'].'/?r='.$r.'&iframe=Y&m=admin&module='.$m.'&front=movecopy&type='.$type;
getLink($referer,'parent.','실행되었습니다.','');
?>

View File

@@ -0,0 +1,146 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
//include_once $g['path_module'].'upload/var/var.php'; ----------> 자체 upload 폴더 사용함으로 필요 없음 2014.12.31 by 케르
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[$m.'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[$m.'upload'],'uid='.$U['uid']);
if ($U['host']==$d['mediaset']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['mediaset']['ftp_host'],$d['mediaset']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['mediaset']['ftp_user'],$d['mediaset']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
if($d['mediaset']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
ftp_delete($FTP_CONNECT,$d['mediaset']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['mediaset']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
ftp_close($FTP_CONNECT);
}
else {
unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['thumbname']);
}
}
}
}
if ($_C['oneline'])
{
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$_C['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($_O['d_regis'],0,8)."' and site=".$_O['site']);
if ($_O['point']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$_O['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_O['point'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$_C['uid']);
}
getDbDelete($table['s_comment'],'uid='.$_C['uid']);
getDbUpdate($table['s_numinfo'],'comment=comment-1',"date='".substr($_C['d_regis'],0,8)."' and site=".$_C['site']);
if ($_C['point']&&$_C['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_C['mbruid']."','0','-".$_C['point']."','댓글삭제(".getStrCut($_C['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$_C['point'],'memberuid='.$_C['mbruid']);
}
}
}
//첨부파일삭제
if ($R['upload'])
{
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table[$m.'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[$m.'upload'],'uid='.$U['uid']);
if ($U['host']==$d['mediaset']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['mediaset']['ftp_host'],$d['mediaset']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['mediaset']['ftp_user'],$d['mediaset']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
if($d['mediaset']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
ftp_delete($FTP_CONNECT,$d['mediaset']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['mediaset']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
ftp_close($FTP_CONNECT);
}
else {
//getLink('','','./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname'],'');
unlink('./modules/bbs/upload/'.$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink('./modules/bbs/upload/'.$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']);
getDbDelete($table['s_trackback'],"parent='".$R['bbsid'].$R['uid']."'");
if ($R['point1']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point1']."','댓글삭제(".getStrCut($R['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point1'],'memberuid='.$R['mbruid']);
}
}
getLink('reload','parent.','','');
?>

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,20 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$fdset = array('noti_title','noti_body','noti_button');
$gfile= $g['dir_module'].'var/noti/'.$type.'.php'; // 알림메시지 양식
$fp = fopen($gfile,'w');
fwrite($fp, "<?php\n");
fwrite($fp, "\$d['comment']['noti_title'] = \"".$noti_title."\";\n");
fwrite($fp, "\$d['comment']['noti_body'] = \"".$noti_body."\";\n");
fwrite($fp, "\$d['comment']['noti_button'] = \"".$noti_button."\";\n");
fwrite($fp, "?>");
fclose($fp);
@chmod($gfile,0707);
setrawcookie('notidoc_result', rawurlencode('수정 되었습니다.|success'));
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,27 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid']) echo '[RESULT:정상적인 접근이 아닙니다.:RESULT]';
$R = getUidData($table['s_oneline'],$uid);
if (!$R['uid']) echo '[RESULT:존재하지 않는 한줄 의견입니다.:RESULT]';
if ($R['id']!=$my['id']&&!$my['admin']) echo '[RESULT:삭제권한이 없습니다.:RESULT]';
$C = getUidData($table['s_comment'],$R['parent']);
getDbDelete($table['s_oneline'],'uid='.$R['uid']);
getDbUpdate($table['s_comment'],'oneline=oneline-1','uid='.$C['uid']);
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
if ($R['point']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($R['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
}
//동기화
$cyncArr = getArrayString($C['cync']);
$fdexp = explode(',',$cyncArr['data'][2]);
if ($fdexp[0]&&$fdexp[2]&&$cyncArr['data'][3]) getDbUpdate($cyncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-1',$fdexp[0].'='.$cyncArr['data'][1]);
echo '[RESULT:ok:RESULT]';
exit;
?>

View File

@@ -0,0 +1,31 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
foreach ($oneline_members as $val)
{
$R = getUidData($table['s_oneline'],$val);
if (!$R['uid']) continue;
$C = getUidData($table['s_comment'],$R['parent']);
getDbDelete($table['s_oneline'],'uid='.$R['uid']);
getDbUpdate($table['s_comment'],'oneline=oneline-1','uid='.$C['uid']);
getDbUpdate($table['s_numinfo'],'oneline=oneline-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site']);
if ($R['point']&&$R['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$R['mbruid']."','0','-".$R['point']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($R['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$R['point'],'memberuid='.$R['mbruid']);
}
//동기화
$syncArr = getArrayString($C['sync']);
$fdexp = explode(',',$syncArr['data'][2]);
if ($fdexp[0]&&$fdexp[2]&&$syncArr['data'][3]) getDbUpdate($syncArr['data'][3],$fdexp[2].'='.$fdexp[2].'-1',$fdexp[0].'='.$syncArr['data'][1]);
}
setrawcookie('comment_oneline_result', rawurlencode('의견이 삭제 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,19 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid']) echo '[RESULT:로그인해 주세요.:RESULT]';
$R = getUidData($table['s_oneline'],$uid);
if (!$R['uid']) echo '[RESULT:존재하지 않는 한줄 의견입니다.:RESULT]';
if (!strstr($_SESSION['module_comment_osingo'],'['.$R['uid'].']'))
{
getDbUpdate($table['s_oneline'],'report=report+1','uid='.$R['uid']);
$_SESSION['module_comment_osingo'] .= '['.$R['uid'].']';
echo '[RESULT:신고처리 되었습니다.:RESULT]';
}
else {
echo '[RESULT:이미 신고하신 한줄의견입니다.:RESULT]';
}
exit;
?>

View File

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

View File

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

View File

@@ -0,0 +1,227 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['dir_module'].'includes/base.class.php';
require_once $g['dir_module'].'includes/module.class.php';
include $g['dir_module'].'var/var.php';
include $g['dir_module'].'var/noti/_'.$a.'.php'; // 알림메시지 양식
function _getPostLink($arr)
{
$sync_arr=explode('|',$arr['sync']);
$B = getUidData($sync_arr[0],$sync_arr[2]);
return RW('m='.$sync_arr[1].'&bid='.$B['bbsid'].'&uid='.$sync_arr[2].($GLOBALS['s']!=$arr['site']?'&s='.$arr['site']:''.'#CMT-'.$arr['uid']));
}
$comment = new Comment();
$comment->theme_name = $_POST['theme_name'];
$comment->recnum = $_POST['recnum'];
$result = array();
$result['error'] = false;
if (!$sess_code){
$result['error'] = true;
$result['error_msg'] = '정상적인 접근이 아닙니다.';
echo json_encode($result);
exit;
}else{
$mbruid = $my['uid'];
$id = $my['id'];
$name = $my['uid'] ? $my['name'] : trim($name);
$nic = $my['uid'] ? $my['nic'] : $name;
$pw = $pw ? md5($pw) : '';
$subject = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
$content = trim($content);
$subject = $subject ? $subject : getStrCut(str_replace('&amp;',' ',strip_tags($content)),35,'..');
$html = $html ? $html : 'TEXT';
$d_regis = $date['totime'];
$d_modify = '';
$d_oneline = '';
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
//$upload = $upfiles; // upfiles 값을 배열로 받아서 풀어서 upload 에 저장한다. 아래 참조
$adddata = trim($adddata);
$hit = 0;
$down = 0;
$oneline = 0;
$likes = 0;
$dislikes = 0;
$report = 0;
$point = $d['comment']['give_point'];
$hidden = ($hidden=='true') ? 1 : 0;
$notice = $notice ? intval($notice) : 0;
$display = $hidepost || $hidden ? 0 : 1;
// 포토, 장소, 링크 존재여부
$is_photo=0;
$is_link=0;
$is_place=0;
if ($d['comment']['badword_action'])
{
$badwordarr = explode(',' , $d['comment']['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['comment']['badword_action'] == 1)
{
$result['error'] = true;
$result['error_msg'] = '등록이 제한된 단어를 사용하셨습니다.';
echo json_encode($result);
exit;
}
else {
$badescape = strCopy($badwordarr[$i],$d['comment']['badword_escape']);
$content = str_replace($badwordarr[$i],$badescape,$content);
$subject = str_replace($badwordarr[$i],$badescape,$subject);
}
}
}
}
// 업로드 파일 세팅
if($upfiles)
{
$upload='';
foreach ($upfiles as $file) {
$upload .=$file;
}
$upload=trim($upload);
$is_photo=1;
}
if ($uid)
{
$R = getUidData($comment->commentTable,$uid);
if (!$R['uid']){
$result['error'] = true;
$result['error_msg'] = '존재하지 않는 댓글입니다.';
echo json_encode($result);
exit;
}
if (!$my['uid'] || ($my['uid'] != $R['mbruid'] && !$my['admin']))
{
if (!$pw)
{
$result['error'] = true;
$result['error_msg'] = '정상적인 접근이 아닙니다.';
echo json_encode($result);
exit;
}
else {
if($pw != $R['pw'])
{
$result['error'] = true;
$result['error_msg'] = '정상적인 접근이 아닙니다.';
echo json_encode($result);
exit;
}
}
}
$QVAL = "display='$display',hidden='$hidden',subject='$subject',content='$content',html='$html',";
$QVAL .="d_modify='$d_regis',upload='$upload',adddata='$adddata'";
getDbUpdate($comment->commentTable,$QVAL,'uid='.$R['uid']);
$result['edit_content'] = $content;
$result['edit_uid'] = $uid;
$result['edit_hidden'] = $hidden;
$result['edit_time'] = getDateFormat($d_regis,'c');
echo json_encode($result);
exit;
}
else
{
// $parent_set 가공
$parent_arr=explode('-',$parent);
$parent_prefix = $parent_arr[0];
$parent_uid = $parent_arr[1];
$parent_set=str_replace('-','', $parent);
$R = getUidData($parent_table,$parent_uid);
getDbUpdate($parent_table,"comment=comment+1,d_comment='".$date['totime']."'",'uid='.$R['uid']);
$parentmbr = $R['mbruid'];
$sync = $parent_table.'|'.$parent_prefix.'|'.$parent_uid;
$minuid = getDbCnt($comment->commentTable,'min(uid)','');
$uid = $minuid ? $minuid-1 : 1000000000;
$QKEY = "uid,site,parent,parentmbr,display,hidden,notice,name,nic,mbruid,id,pw,subject,content,html,";
$QKEY.= "hit,down,oneline,likes,dislikes,report,point,d_regis,d_modify,d_oneline,upload,ip,agent,sync,sns,adddata";
$QVAL = "'$uid','$s','".$parent_set."','$parentmbr','$display','$hidden','$notice','$name','$nic','$mbruid','$id','$pw','$subject','$content','$html',";
$QVAL.= "'$hit','$down','$oneline','$likes','$dislikes','$report','$point','$d_regis','$d_modify','$d_oneline','$upload','$ip','$agent','$sync','','$adddata'";
getDbInsert($comment->commentTable,$QKEY,$QVAL);
getDbUpdate($table['s_numinfo'],'comment=comment+1',"date='".$date['today']."' and site=".$s);
if ($uid == 1000000000) db_query("OPTIMIZE TABLE ".$table['s_comment'],$DB_CONNECT);
if ($point&&$my['uid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point."','댓글(".getStrCut($subject,15,'').")포인트','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point+'.$point,'memberuid='.$my['uid']);
}
$LASTUID = getDbCnt($comment->commentTable,'min(uid)','');
$row = getUidData($comment->commentTable,$LASTUID);
// 연동모듈 댓글통계 반영
if(!getDbRows($table['s_mbrmonth'],"date='".$date['month']."' and site=".$s.' and mbruid='.$row['parentmbr'])) {
getDbInsert($table['s_mbrmonth'],'date,site,mbruid',"'".$date['month']."','".$s."','".$row['parentmbr']."'");
}
if(!getDbRows($table['s_mbrday'],"date='".$date['today']."' and site=".$s.' and mbruid='.$row['parentmbr'])) {
getDbInsert($table['s_mbrday'],'date,site,mbruid',"'".$date['today']."','".$s."','".$row['parentmbr']."'");
}
if(!getDbRows($table[$parent_prefix.'month'],"date='".$date['month']."' and site=".$s.' and data='.$parent_uid)) {
getDbInsert($table[$parent_prefix.'month'],'date,site,data',"'".$date['month']."','".$s."','".$parent_uid."'");
}
if(!getDbRows($table[$parent_prefix.'day'],"date='".$date['today']."' and site=".$s.' and data='.$parent_uid)) {
getDbInsert($table[$parent_prefix.'day'],'date,site,data',"'".$date['today']."','".$s."','".$parent_uid."'");
}
getDbUpdate($table['s_mbrmonth'],'post_comment=post_comment+1',"date='".$date['month']."' and site=".$s.' and mbruid='.$row['parentmbr']); //부모글 등록자 월별 조회수 갱신
getDbUpdate($table['s_mbrday'],'post_comment=post_comment+1',"date='".$date['today']."' and site=".$s.' and mbruid='.$row['parentmbr']); //부모글 등록자 일별조회수 갱신
getDbUpdate($table[$parent_prefix.'month'],'comment=comment+1',"date='".$date['month']."' and site=".$s.' and data='.$parent_uid); //연동모듈 월별 조회수 갱신
getDbUpdate($table[$parent_prefix.'day'],'comment=comment+1',"date='".$date['today']."' and site=".$s.' and data='.$parent_uid); //연동모듈 일별 조회수 갱신
// 댓글의 부모글 등록자에게 알림전송
if ($row['parentmbr'] != $my['uid'] ) {
$B = getDbData($table['bbslist'],'id="'.$R['bbsid'].'"','name');
//알림내용에 양식 적용(/modules/comment/var/noti/regis_comment.php)
$noti_title = $d['comment']['noti_title'];
$noti_body = $d['comment']['noti_body'];
$noti_referer = _getPostLink($row);
$noti_button = $d['comment']['noti_button'];
$noti_tag = '';
// 내용 치환
$noti_title = str_replace('{NAME}',$my['name'],$noti_title); //댓글등록자 이름
$noti_title = str_replace('{NIC}',$my['nic'],$noti_title); //댓글등록자 닉네임
$noti_body = str_replace('{NAME}',$my['name'],$noti_body); //댓글등록자 이름
$noti_body = str_replace('{NIC}',$my['nic'],$noti_body); //댓글등록자 닉네임
$noti_body = str_replace('{BBS}',$B['name'],$noti_body); //게시판명
$noti_body = str_replace('{SUBJECT}',$subject,$noti_body); //댓글내용
putNotice($row['parentmbr'],$m,$my['uid'],$noti_title,$noti_body,$noti_referer,$noti_button,$noti_tag,'','');
}
$result['last_row'] = $comment->getCommentRow($row,$p,0);
$result['lastuid'] = $LASTUID;
$result['parent_table'] = $parent_table;
$result['sess_code'] = $sess_code;
echo json_encode($result);
exit;
}
// 신규등록
}
?>

View File

@@ -0,0 +1,154 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['dir_module'].'includes/base.class.php';
require_once $g['dir_module'].'includes/module.class.php';
include $g['dir_module'].'var/var.php';
include $g['dir_module'].'var/noti/_'.$a.'.php'; // 알림메시지 양식
function _getPostLink($arr)
{
$sync_arr=explode('|',$arr['sync']);
$B = getUidData($sync_arr[0],$sync_arr[2]);
return RW('m='.$sync_arr[1].'&bid='.$B['bbsid'].'&uid='.$sync_arr[2].($GLOBALS['s']!=$arr['site']?'&s='.$arr['site']:''.'#CMT-'.$arr['uid']));
}
$comment = new Comment();
$comment->theme_name = $_POST['theme_name'];
$result = array();
$result['error'] = false;
$R = getUidData($comment->commentTable,$parent);
if (!$my['uid'] || !$R['uid']){
$result['error'] = true;
$result['error_msg'] = '정상적인 접근이 아닙니다.';
echo json_encode($result);
exit;
}else{
$parentmbr = $R['mbruid'];
$mbruid = $my['uid'];
$id = $my['id'];
$name = $my['uid'] ? $my['name'] : trim($name);
$nic = $my['uid'] ? $my['nic'] : $name;
$pw = $pw ? md5($pw) : '';
$content = trim($content);
$html = $html ? $html : 'TEXT';
$report = 0;
$hidden = ($hidden=='true') ? 1 : 0;
$point = $d['comment']['give_opoint'];
$d_regis = $date['totime'];
$d_modify = '';
$d_oneline = '';
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$adddata = trim($adddata);
if ($d['comment']['badword_action'])
{
$badwordarr = explode(',' , $d['comment']['badword']);
$badwordlen = count($badwordarr);
for($i = 0; $i < $badwordlen; $i++)
{
if(!$badwordarr[$i]) continue;
if(strstr($content,$badwordarr[$i]))
{
if ($d['comment']['badword_action'] == 1)
{
$result['error'] = true;
$result['error_msg'] = '등록이 제한된 단어를 사용하셨습니다.';
echo json_encode($result);
exit;
}
else {
$badescape = strCopy($badwordarr[$i],$d['comment']['badword_escape']);
$content = str_replace($badwordarr[$i],$badescape,$content);
}
}
}
}
if ($uid)
{
$R = getUidData($comment->onelineTable,$uid);
if((!$my['admin'] && $my['uid'] != $R['mbruid'])||!$R['uid']){
$result['error'] = true;
$result['error_msg'] = '정상적인 접근이 아닙니다.';
$result['mbruid'] = $R['mbruid'];
$result['uid'] = $R['uid'];
echo json_encode($result);
exit;
}
$QVAL = "hidden='$hidden',content='$content',html='$html',d_modify='$d_regis',adddata='$adddata'";
getDbUpdate($comment->onelineTable,$QVAL,'uid='.$R['uid']);
$result['edit_content'] = $content;
$result['edit_uid'] = $uid;
$result['edit_hidden'] = $hidden;
$result['edit_time'] = getDateFormat($d_regis,'c');
echo json_encode($result);
exit;
}
else
{
$maxuid = getDbCnt($comment->onelineTable,'max(uid)','');
$uid = $maxuid ? $maxuid+1 : 1;
$QKEY = "uid,site,parent,parentmbr,hidden,name,nic,mbruid,id,content,html,report,point,d_regis,d_modify,ip,agent,adddata";
$QVAL = "'$uid','$s','$parent','$parentmbr','$hidden','$name','$nic','$mbruid','$id','$content','$html','$report','$point','$d_regis','$d_modify','$ip','$agent','$adddata'";
getDbInsert($comment->onelineTable,$QKEY,$QVAL);
getDbUpdate($comment->commentTable,"oneline=oneline+1,d_oneline='".$d_regis."'",'uid='.$parent);
getDbUpdate($grant_table,"oneline=oneline+1",'uid='.$grant); // 댓글의 parent = grant
getDbUpdate($table['s_numinfo'],'oneline=oneline+1',"date='".$date['today']."' and site=".$s);
if ($uid == 1) db_query("OPTIMIZE TABLE ".$table['s_oneline'],$DB_CONNECT);
if ($point&&$my['uid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$my['uid']."','0','".$point."','한줄의견(".getStrCut(str_replace('&amp;',' ',strip_tags($content)),15,'').")포인트','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point+'.$point,'memberuid='.$my['uid']);
}
$LASTUID = getDbCnt($comment->onelineTable,'max(uid)','');
$row = getUidData($comment->onelineTable,$LASTUID);
// 한줄의견의 부모댓글 등록자에게 알림전송
if ($row['parentmbr'] != $my['uid'] ) {
$B = getDbData($table['bbslist'],'id="'.$R['bbsid'].'"','name');
//알림내용에 양식 적용(/modules/comment/var/noti/regis_oneline.php)
$noti_title = $d['comment']['noti_title'];
$noti_body = $d['comment']['noti_body'];
$noti_referer = _getPostLink($row);
$noti_button = $d['comment']['noti_button'];
$noti_tag = '';
// 내용 치환
$noti_title = str_replace('{NAME}',$my['name'],$noti_title); //댓글등록자 이름
$noti_title = str_replace('{NIC}',$my['nic'],$noti_title); //댓글등록자 닉네임
$noti_body = str_replace('{NAME}',$my['name'],$noti_body); //댓글등록자 이름
$noti_body = str_replace('{NIC}',$my['nic'],$noti_body); //댓글등록자 닉네임
$noti_body = str_replace('{BBS}',$B['name'],$noti_body); //게시판명
$noti_body = str_replace('{COMMENT}',$R['subject'],$noti_body); //댓글제목
$noti_body = str_replace('{SUBJECT}',$content,$noti_body); //의견내용
putNotice($row['parentmbr'],$m,$my['uid'],$noti_title,$noti_body,$noti_referer,$noti_button,$noti_tag,'','');
}
$result['last_row'] = $comment->getOnelineRow($row,$p);
$result['lastuid'] = $LASTUID;
$result['grant_table'] = $grant_table;
$result['grant'] = $grant;
echo json_encode($result);
exit;
}
}
?>

View File

@@ -0,0 +1,80 @@
<?php
if(!defined('__KIMS__')) exit;
//if (!$_SESSION['wcode']||$_SESSION['wcode']!=$pcode) exit;
$result= array();
$result['error'] = false;
if (!$bid){
$result['error'] = true;
$result['error_msg'] = '게시판 아이디가 지정되지 않았습니다.';
echo json_encode($result,true);
exit;
}
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
include_once $g['dir_module'].'var/var.php';
include_once $g['dir_module'].'var/var.'.$B['id'].'.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 = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
$content = trim($content);
$subject = $subject ? $subject : getStrCut(str_replace('&amp;',' ',strip_tags($content)),35,'..');
$html = $html ? $html : 'TEXT';
$tag = trim($tag);
$d_regis = $date['totime'];
$d_comment = '';
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$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 (!$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'");
}
$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,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,adddata,token";
$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','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$adddata','$token'";
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 ($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);
}
$result = array();
$result['uid'] = $LASTUID;
echo json_encode($result,true);
exit;
?>

View File

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

View File

@@ -0,0 +1,28 @@
<?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('','','존재하지 않는 게시판입니다.','');
$mbruid = $my['uid'];
$category = $_HM['name']?$_HM['name']:$B['name'];
$subject = addslashes($R['subject']);
$url = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').($c?'c='.$c:'m='.$m),array('bid','uid','skin','iframe'));
$d_regis = $date['totime'];
if (getDbRows($table['s_scrap'],"mbruid=".$mbruid." and url='".$url."'"))
{
getLink('','','이미 스크랩된 게시물입니다.','');
}
$_QKEY = 'mbruid,category,subject,url,d_regis';
$_QVAL = "'$mbruid','$category','$subject','$url','$d_regis'";
getDbInsert($table['s_scrap'],$_QKEY,$_QVAL);
getLink('' ,'' , '스크랩 되었습니다.' , '');
?>

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,41 @@
<?php
if(!defined('__KIMS__')) exit;
// post 로 넘어오는 값
$post = $_POST['post']; // 해당 블로그 data uid
// 리턴값 세팅
$result = array();
$result['error'] = false;
$mbruid = $my['uid'];
// 로그인한 사용자가 좋아요를 했는지 여부 체크
$is_liked = getDbRows($table[$m.'likes'],'mbruid='.$mbruid.' and post='.$post);
if($is_liked){ // 좋아요를 했던 경우
// rb_blog_likes 테이블 row 삭제
getDbDelete($table[$m.'likes'],'mbruid='.$mbruid.' and post='.$post);
// rb_blog_data 테이블 해당 글의 likes 갯수 업데이트
getDbUpdate($table[$m.'data'],'likes=likes-1','uid='.$post);
}else{ // 좋아요 안한 경우 추가
// rb_blog_likes 테이블 row 추가
$QKEY = "mbruid,post,d_regis";
$QVAL = "'$mbruid','$post','".$date['totime']."'";
getDbInsert($table[$m.'likes'],$QKEY,$QVAL);
// rb_blog_data 테이블 해당 글의 likes 갯수 업데이트
getDbUpdate($table[$m.'data'],'likes=likes+1','uid='.$post);
}
// 현재 해당 글 likes 갯수 얻기
$R = getDbData($table[$m.'data'],'uid='.$post,'likes');
$result['total_like'] = $R['likes'];
echo json_encode($result);
exit;
?>

View File

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

View File

@@ -0,0 +1,436 @@
<?php
if(!defined('__KIMS__')) exit;
//if (!$_SESSION['wcode']||$_SESSION['wcode']!=$pcode) exit;
if (!$bid) getLink('','','게시판 아이디가 지정되지 않았습니다.','');
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
if (!$subject) getLink('','','제목이 입력되지 않았습니다.','');
include_once $g['dir_module'].'var/var.php';
include_once $g['dir_module'].'var/var.'.$B['id'].'.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 = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
$content = trim($content);
$html = $html ? $html : 'TEXT';
$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 ($num_upfile || $num_photo)
{
include_once $g['path_core'].'function/thumb.func.php';
//include_once $g['path_module'].'upload/var/var.php';
$fserver = $d['mediaset']['use_fileserver'];
$fserverurl = $fserver ? $d['mediaset']['ftp_urlpath'] : $g['url_root'].'/files/bbs/';
$incPhoto = '';
$upload = $uid ? $upload : '';
$saveDir = $g['path_file'].$m.'/';
$savePath1 = $saveDir.substr($date['today'],0,4);
$savePath2 = $savePath1.'/'.substr($date['today'],4,2);
$savePath3 = $savePath2.'/'.substr($date['today'],6,2);
$up_folder = substr($date['today'],0,4).'/'.substr($date['today'],4,2).'/'.substr($date['today'],6,2);
$up_caption = $subject;
$up_cync = '';
if ($fserver)
{
$FTP_CONNECT = ftp_connect($d['mediaset']['ftp_host'],$d['mediaset']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['mediaset']['ftp_user'],$d['mediaset']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
if ($d['mediaset']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
ftp_chdir($FTP_CONNECT,$d['mediaset']['ftp_folder']);
for ($i = 1; $i < 4; $i++)
{
ftp_mkdir($FTP_CONNECT,$d['mediaset']['ftp_folder'].str_replace('./files/','',${'savePath'.$i}));
}
}
else {
for ($i = 1; $i < 4; $i++)
{
if (!is_dir(${'savePath'.$i}))
{
mkdir(${'savePath'.$i},0707);
@chmod(${'savePath'.$i},0707);
}
}
}
for ($i = 0; $i < $num_upfile + $num_photo; $i++)
{
if (!$_FILES['upfile']['tmp_name'][$i]) continue;
$width = 0;
$height = 0;
$up_name = strtolower($_FILES['upfile']['name'][$i]);
$up_size = $_FILES['upfile']['size'][$i];
$up_fileExt = getExt($up_name);
$up_fileExt = $up_fileExt == 'jpeg' ? 'jpg' : $up_fileExt;
$up_type = getFileType($up_fileExt);
$up_tmpname = md5($up_name).substr($date['totime'],8,14);
$up_tmpname = $up_type == 2 ? $up_tmpname.'.'.$up_fileExt : $up_tmpname;
$up_mingid = getDbCnt($table['s_upload'],'min(gid)','');
$up_gid = $up_mingid ? $up_mingid - 1 : 100000000;
$up_saveFile= $savePath3.'/'.$up_tmpname;
$up_hidden = $up_type == 2 ? 1 : 0;
if ($fserver)
{
if ($up_type == 2)
{
$up_thumbname = md5($up_tmpname);
$up_thumbFile = $g['path_tmp'].'backup/'.$up_thumbname;
ResizeWidth($_FILES['upfile']['tmp_name'][$i],$up_thumbFile,150);
$IM = getimagesize($_FILES['upfile']['tmp_name'][$i]);
$width = $IM[0];
$height= $IM[1];
ftp_put($FTP_CONNECT,$d['mediaset']['ftp_folder'].$up_folder.'/'.$up_thumbname,$up_thumbFile,FTP_BINARY);
unlink($up_thumbFile);
}
ftp_put($FTP_CONNECT,$d['mediaset']['ftp_folder'].$up_folder.'/'.$up_tmpname,$_FILES['upfile']['tmp_name'][$i],FTP_BINARY);
}
else {
if (!is_file($up_saveFile))
{
move_uploaded_file($_FILES['upfile']['tmp_name'][$i], $up_saveFile);
if ($up_type == 2)
{
$up_thumbname = md5($up_tmpname);
$up_thumbFile = $savePath3.'/'.$up_thumbname;
ResizeWidth($up_saveFile,$up_thumbFile,150);
@chmod($up_thumbFile,0707);
$IM = getimagesize($up_saveFile);
$width = $IM[0];
$height= $IM[1];
}
@chmod($up_saveFile,0707);
}
}
$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 = "'$up_gid','$up_hidden','','$s','$mbruid','$up_type','$up_fileExt','$fserver','$fserverurl','$up_folder','$up_name','$up_tmpname','$up_thumbname','$up_size','$width','$height','$up_caption','0','$d_regis','','$up_cync'";
getDbInsert($table['s_upload'],$QKEY,$QVAL);
$up_lastuid = getDbCnt($table['s_upload'],'max(uid)','');
$upload .= '['.$up_lastuid.']';
if ($up_type == 2)
{
if ($fserver)
{
$incPhoto .= '<img src="'.$d['mediaset']['ftp_urlpath'].$up_folder.'/'.$up_tmpname.'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
}
else {
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$up_folder.'/'.$up_tmpname.'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
}
}
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".$date['today']."' and site=".$s);
if ($up_gid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_upload'],$DB_CONNECT);
}
if ($uid && $upfiles)
{
$_uploadtmp = getArrayString($upfiles);
foreach($_uploadtmp['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['type'] == 2)
{
if ($fserver)
{
$incPhoto .= '<img src="'.$d['mediaset']['ftp_urlpath'].$U['folder'].'/'.$U['tmpname'].'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
}
else {
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$U['folder'].'/'.$U['tmpname'].'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
}
}
}
}
if ($incPhoto)
{
if ($insert_photo == 'top')
{
$content = $incPhoto.nl2br($content);
}
if ($insert_photo == 'bottom')
{
$content = nl2br($content).'<br /><br />'.$incPhoto;
}
$html = 'HTML';
}
if ($fserver)
{
ftp_close($FTP_CONNECT);
}
}
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['sosok'].']'))
{
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,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,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','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$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',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['sosok'].']'))
{
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,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,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','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$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 ($trackback)
{
$trackback = trim($trackback);
$compaurl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'/'.$m.'/'.$NOWUID;
if ($trackback != $compaurl)
{
include_once $g['path_core'].'function/trackback.func.php';
$orignurl = 'http://'.$_SERVER['HTTP_HOST'].str_replace('index.php','?m=',$_SERVER['SCRIPT_NAME']).$m.'&bid='.$bbsid.'&uid='.$NOWUID;
$result = putTrackback($trackback,$orignurl,getUTFtoKR(strip_tags($subject)),getUTFtoKR(${$_HS['nametype']}),getUTFtoKR(strip_tags($content)),0);
if ($result)
{
$minuid = getDbCnt($table['s_trackback'],'min(uid)','');
$trackuid = $minuid ? $minuid-1 : 100000000;
$cync = '['.$m.']['.$NOWUID.'][m:'.$m.',bid:'.$bbsid.',uid:'.$NOWUID.']';
$QKEY = "uid,site,type,parent,parentmbr,url,name,subject,content,d_regis,d_modify,cync";
$QVAL = "'$trackuid','$s','2','".$m.$NOWUID."','$mbruid','$trackback','','','','$d_regis','','$cync'";
getDbInsert($table['s_trackback'],$QKEY,$QVAL);
getDbUpdate($table['s_numinfo'],'sndtrack=sndtrack+1',"date='".$date['today']."' and site=".$s);
if ($trackuid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_trackback'],$DB_CONNECT);
}
}
}
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'");
}
}
if ($snsCallBack && ($sns_t||$sns_f||$sns_m||$sns_y))
{
$xcync = "[][][][][][m:".$m.",bid:".$bbsid.",uid:".$NOWUID."]";
$orignSubject = strip_tags($subject);
$orignContent = getStrCut($orignSubject,60,'..');
$orignUrl = 'http://'.$_SERVER['SERVER_NAME'].str_replace('./','/',getCyncUrl($xcync)).'#CMT';
include_once $g['path_module'].$snsCallBack;
if ($snsSendResult)
{
getDbUpdate($table[$m.'data'],"sns='".$snsSendResult."'",'uid='.$LASTUID);
}
}
$_SESSION['bbsback'] = $backtype;
if ($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.','','');
}
?>

View File

@@ -0,0 +1,501 @@
<?php
if(!defined('__KIMS__')) exit;
//if (!$_SESSION['wcode']||$_SESSION['wcode']!=$pcode) exit;
if (!$bid) getLink('','','게시판 아이디가 지정되지 않았습니다.','');
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
if (!$subject) getLink('','','제목이 입력되지 않았습니다.','');
include_once $g['dir_module'].'var/var.php';
include_once $g['dir_module'].'var/var.'.$B['id'].'.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 = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
$content = trim($content);
$html = $html ? $html : 'TEXT';
$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 ($num_upfile || $num_photo)
{
include_once $g['path_core'].'function/thumb.func.php';
//include_once $g['path_module'].'upload/var/var.php';
$fserver = $d['mediaset']['use_fileserver'];
$fserverurl = $fserver ? $d['mediaset']['ftp_urlpath'] : $g['url_root'].'/files/bbs/';
$incPhoto = '';
$upload = $uid ? $upload : '';
$saveDir = $g['path_file'].$m.'/';
$savePath1 = $saveDir.substr($date['today'],0,4);
$savePath2 = $savePath1.'/'.substr($date['today'],4,2);
$savePath3 = $savePath2.'/'.substr($date['today'],6,2);
$up_folder = substr($date['today'],0,4).'/'.substr($date['today'],4,2).'/'.substr($date['today'],6,2);
$up_caption = $subject;
$up_cync = '';
if ($fserver)
{
$FTP_CONNECT = ftp_connect($d['mediaset']['ftp_host'],$d['mediaset']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['mediaset']['ftp_user'],$d['mediaset']['ftp_pass']);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
if ($d['mediaset']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
ftp_chdir($FTP_CONNECT,$d['mediaset']['ftp_folder']);
for ($i = 1; $i < 4; $i++)
{
ftp_mkdir($FTP_CONNECT,$d['mediaset']['ftp_folder'].str_replace('./files/','',${'savePath'.$i}));
}
}
else {
for ($i = 1; $i < 4; $i++)
{
if (!is_dir(${'savePath'.$i}))
{
mkdir(${'savePath'.$i},0707);
@chmod(${'savePath'.$i},0707);
}
}
}
for ($i = 0; $i < $num_upfile + $num_photo; $i++)
{
if (!$_FILES['upfile']['tmp_name'][$i]) continue;
$width = 0;
$height = 0;
$up_name = strtolower($_FILES['upfile']['name'][$i]);
$up_size = $_FILES['upfile']['size'][$i];
$up_fileExt = getExt($up_name);
$up_fileExt = $up_fileExt == 'jpeg' ? 'jpg' : $up_fileExt;
$up_type = getFileType($up_fileExt);
$up_tmpname = md5($up_name).substr($date['totime'],8,14);
$up_tmpname = $up_type == 2 ? $up_tmpname.'.'.$up_fileExt : $up_tmpname;
$up_mingid = getDbCnt($table[$m.'upload'],'min(gid)','');
$up_gid = $up_mingid ? $up_mingid - 1 : 100000000;
$up_saveFile= $savePath3.'/'.$up_tmpname;
$up_hidden = $up_type == 2 ? 1 : 0;
if ($fserver)
{
if ($up_type == 2)
{
$up_thumbname = md5($up_tmpname);
$up_thumbFile = $g['path_tmp'].'backup/'.$up_thumbname;
ResizeWidth($_FILES['upfile']['tmp_name'][$i],$up_thumbFile,150);
$IM = getimagesize($_FILES['upfile']['tmp_name'][$i]);
$width = $IM[0];
$height= $IM[1];
ftp_put($FTP_CONNECT,$d['mediaset']['ftp_folder'].$up_folder.'/'.$up_thumbname,$up_thumbFile,FTP_BINARY);
unlink($up_thumbFile);
}
ftp_put($FTP_CONNECT,$d['mediaset']['ftp_folder'].$up_folder.'/'.$up_tmpname,$_FILES['upfile']['tmp_name'][$i],FTP_BINARY);
}
else {
if (!is_file($up_saveFile))
{
move_uploaded_file($_FILES['upfile']['tmp_name'][$i], $up_saveFile);
if ($up_type == 2)
{
$up_thumbname = md5($up_tmpname);
$up_thumbFile = $savePath3.'/'.$up_thumbname;
ResizeWidth($up_saveFile,$up_thumbFile,150);
@chmod($up_thumbFile,0707);
$IM = getimagesize($up_saveFile);
$width = $IM[0];
$height= $IM[1];
}
@chmod($up_saveFile,0707);
}
}
$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 = "'$up_gid','$up_hidden','','$s','$mbruid','$up_type','$up_fileExt','$fserver','$fserverurl','$up_folder','$up_name','$up_tmpname','$up_thumbname','$up_size','$width','$height','$up_caption','0','$d_regis','','$up_cync'";
getDbInsert($table[$m.'upload'],$QKEY,$QVAL);
$up_lastuid = getDbCnt($table[$m.'upload'],'max(uid)','');
$upload .= '['.$up_lastuid.']';
if ($up_type == 2)
{
if ($fserver)
{
$incPhoto .= '<img src="'.$d['mediaset']['ftp_urlpath'].$up_folder.'/'.$up_tmpname.'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
}
else {
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$up_folder.'/'.$up_tmpname.'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
}
}
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".$date['today']."' and site=".$s);
if ($up_gid == 100000000) db_query("OPTIMIZE TABLE ".$table[$m.'upload'],$DB_CONNECT);
}
if ($uid && $upfiles)
{
$_uploadtmp = getArrayString($upfiles);
foreach($_uploadtmp['data'] as $_val)
{
$U = getUidData($table[$m.'upload'],$_val);
if ($U['type'] == 2)
{
if ($fserver)
{
$incPhoto .= '<img src="'.$d['mediaset']['ftp_urlpath'].$U['folder'].'/'.$U['tmpname'].'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
}
else {
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$U['folder'].'/'.$U['tmpname'].'" width="'.$d['mediaset']['width_img'].'" class="photo" alt="" /><br /><br />';
}
}
}
}
if ($incPhoto)
{
if ($insert_photo == 'top')
{
$content = $incPhoto.nl2br($content);
}
if ($insert_photo == 'bottom')
{
$content = nl2br($content).'<br /><br />'.$incPhoto;
}
$html = 'HTML';
}
if ($fserver)
{
ftp_close($FTP_CONNECT);
}
}
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['sosok'].']'))
{
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,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,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','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$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',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['sosok'].']'))
{
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,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,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','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$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 ($trackback)
{
$trackback = trim($trackback);
$compaurl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'/'.$m.'/'.$NOWUID;
if ($trackback != $compaurl)
{
include_once $g['path_core'].'function/trackback.func.php';
$orignurl = 'http://'.$_SERVER['HTTP_HOST'].str_replace('index.php','?m=',$_SERVER['SCRIPT_NAME']).$m.'&bid='.$bbsid.'&uid='.$NOWUID;
$result = putTrackback($trackback,$orignurl,getUTFtoKR(strip_tags($subject)),getUTFtoKR(${$_HS['nametype']}),getUTFtoKR(strip_tags($content)),0);
if ($result)
{
$minuid = getDbCnt($table['s_trackback'],'min(uid)','');
$trackuid = $minuid ? $minuid-1 : 100000000;
$cync = '['.$m.']['.$NOWUID.'][m:'.$m.',bid:'.$bbsid.',uid:'.$NOWUID.']';
$QKEY = "uid,site,type,parent,parentmbr,url,name,subject,content,d_regis,d_modify,cync";
$QVAL = "'$trackuid','$s','2','".$m.$NOWUID."','$mbruid','$trackback','','','','$d_regis','','$cync'";
getDbInsert($table['s_trackback'],$QKEY,$QVAL);
getDbUpdate($table['s_numinfo'],'sndtrack=sndtrack+1',"date='".$date['today']."' and site=".$s);
if ($trackuid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_trackback'],$DB_CONNECT);
}
}
}
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'");
}
}
if ($snsCallBack && ($sns_t||$sns_f||$sns_m||$sns_y))
{
$xcync = "[][][][][][m:".$m.",bid:".$bbsid.",uid:".$NOWUID."]";
$orignSubject = strip_tags($subject);
$orignContent = getStrCut($orignSubject,60,'..');
$orignUrl = 'http://'.$_SERVER['SERVER_NAME'].str_replace('./','/',getCyncUrl($xcync)).'#CMT';
include_once $g['path_module'].$snsCallBack;
if ($snsSendResult)
{
getDbUpdate($table[$m.'data'],"sns='".$snsSendResult."'",'uid='.$LASTUID);
}
}
### 이메일 발송 #########################################################################
function SendSMTP($to_email,$to_name,$from_name,$from_email,$title,$content)
{
global $g;
$smtp_mail_id = "notifications@kimsq.com"; //예)test@naver.com 혹은 test@gmail.com 등의 형식
$smtp_mail_pw = "redred@#$";
//$smtp_use = 'smtp.naver.com'; //네이버 메일 사용시
$smtp_use = 'smtp.gmail.com'; //구글 메일 사용시 주석제거
if ($smtp_use == 'smtp.naver.com') {
$from_email = $smtp_mail_id; //네이버메일은 보내는 id로만 전송이가능함
}else {
$from_email = $from_email;
}
//메일러 로딩
require_once $g['dir_module']."lib/class.smtp.php";
require_once $g['dir_module']."lib/class.phpmailer.php";
$mail = new PHPMailer(true);
$mail->IsSMTP();
try {
$mail->Host = $smtp_use; // email 보낼때 사용할 서버를 지정
$mail->SMTPAuth = true; // SMTP 인증을 사용함
$mail->Port = 465; // email 보낼때 사용할 포트를 지정
$mail->SMTPSecure = "ssl"; // SSL을 사용함
$mail->Username = $smtp_mail_id; // 계정
$mail->Password = $smtp_mail_pw; // 패스워드
$mail->SetFrom($from_email, $from_name); // 보내는 사람 email 주소와 표시될 이름 (표시될 이름은 생략가능)
$mail->AddAddress($to_email, $to_name); // 받을 사람 email 주소와 표시될 이름 (표시될 이름은 생략가능)
$mail->Subject = $title; // 메일 제목
$mail->MsgHTML($content); // 메일 내용 (HTML 형식도 되고 그냥 일반 텍스트도 사용 가능함)
$mail->Send(); // 실제로 메일을 보냄
} catch (phpmailerException $e) {
$e->errorMessage();
} catch (Exception $e) {
$e->getMessage();
}
return $e;
}
include_once $g['path_module'].'contactUs/var/var.php';
$from_email='kkk@naver.com';
$from_name='경기방송';
$to_name='관리자';
$to_email_arr =explode(',',$d['cs']['rsv_email']);
$_title='[경기방송] 사용자의 참여/제보 및 문의메일이 접수되었습니다.';
$title = $subject?$subject:$_title;
foreach ($to_email_arr as $to_email) {
SendSMTP($to_email,$to_name,$from_name,$from_email,$title,$content);
}
### 이메일 발송 #########################################################################
// ajax 전송과 일반전송에 따른 결과값 리턴방식 구분
if($backtype=='ajax'){
$return=array();
$return['error'] = false;
$return['result'] ='OK';
$return['email'] = $d['cs']['rsv_email'];
echo json_encode($return,true);
exit;
}else{
$_SESSION['bbsback'] = $backtype;
if ($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.','','');
}
}
?>

View File

@@ -0,0 +1,457 @@
<!--
비회원 전용 / 비밀기능 게시판 변경 내역
1. 아이디와 닉네임을 'guest' 처리
2. 비회원인 경우 접근거부 루틴 제거 ( 아래 308 라인)
-->
<?php
if(!defined('__KIMS__')) exit;
//if (!$_SESSION['wcode']||$_SESSION['wcode']!=$pcode) exit;
if (!$bid) getLink('','','게시판 아이디가 지정되지 않았습니다.','');
$B = getDbData($table[$m.'list'],"id='".$bid."'",'*');
if (!$B['uid']) getLink('','','존재하지 않는 게시판입니다.','');
if (!$subject) getLink('','','제목이 입력되지 않았습니다.','');
include_once $g['dir_module'].'var/var.php';
include_once $g['dir_module'].'var/var.'.$B['id'].'.php';
$bbsuid = $B['uid'];
$bbsid = $B['id'];
$mbruid = $my['uid']? $my['uid'] :'0';
$id = $my['uid']? $my['id'] : 'guest';
$name = $my['uid'] ? $my['nic'] : trim($name);
$nic = $my['uid'] ? $my['nic'] : 'guest';
$category = trim($category);
$subject = $my['admin'] ? trim($subject) : htmlspecialchars(trim($subject));
$content = trim($content);
$html = $html ? $html : 'TEXT';
$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 ($num_upfile || $num_photo)
{
include_once $g['path_core'].'function/thumb.func.php';
include_once $g['path_module'].'upload/var/var.php';
$fserver = $d['upload']['use_fileserver'];
$fserverurl = $fserver ? $d['upload']['ftp_urlpath'] : '/files/';
$incPhoto = '';
$upload = $uid ? $upload : '';
$saveDir = $g['path_file'];
$savePath1 = $saveDir.substr($date['today'],0,4);
$savePath2 = $savePath1.'/'.substr($date['today'],4,2);
$savePath3 = $savePath2.'/'.substr($date['today'],6,2);
$up_folder = substr($date['today'],0,4).'/'.substr($date['today'],4,2).'/'.substr($date['today'],6,2);
$up_caption = $subject;
$up_cync = '';
if ($fserver)
{
$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_chdir($FTP_CONNECT,$d['upload']['ftp_folder']);
for ($i = 1; $i < 4; $i++)
{
ftp_mkdir($FTP_CONNECT,$d['upload']['ftp_folder'].str_replace('./files/','',${'savePath'.$i}));
}
}
else {
for ($i = 1; $i < 4; $i++)
{
if (!is_dir(${'savePath'.$i}))
{
mkdir(${'savePath'.$i},0707);
@chmod(${'savePath'.$i},0707);
}
}
}
for ($i = 0; $i < $num_upfile + $num_photo; $i++)
{
if (!$_FILES['upfile']['tmp_name'][$i]) continue;
$width = 0;
$height = 0;
$up_name = strtolower($_FILES['upfile']['name'][$i]);
$up_size = $_FILES['upfile']['size'][$i];
$up_fileExt = getExt($up_name);
$up_fileExt = $up_fileExt == 'jpeg' ? 'jpg' : $up_fileExt;
$up_type = getFileType($up_fileExt);
$up_tmpname = md5($up_name).substr($date['totime'],8,14);
$up_tmpname = $up_type == 2 ? $up_tmpname.'.'.$up_fileExt : $up_tmpname;
$up_mingid = getDbCnt($table['s_upload'],'min(gid)','');
$up_gid = $up_mingid ? $up_mingid - 1 : 100000000;
$up_saveFile= $savePath3.'/'.$up_tmpname;
$up_hidden = $up_type == 2 ? 1 : 0;
if ($fserver)
{
if ($up_type == 2)
{
$up_thumbname = md5($up_tmpname);
$up_thumbFile = $g['path_tmp'].'backup/'.$up_thumbname;
ResizeWidth($_FILES['upfile']['tmp_name'][$i],$up_thumbFile,150);
$IM = getimagesize($_FILES['upfile']['tmp_name'][$i]);
$width = $IM[0];
$height= $IM[1];
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$up_folder.'/'.$up_thumbname,$up_thumbFile,FTP_BINARY);
unlink($up_thumbFile);
}
ftp_put($FTP_CONNECT,$d['upload']['ftp_folder'].$up_folder.'/'.$up_tmpname,$_FILES['upfile']['tmp_name'][$i],FTP_BINARY);
}
else {
if (!is_file($up_saveFile))
{
move_uploaded_file($_FILES['upfile']['tmp_name'][$i], $up_saveFile);
if ($up_type == 2)
{
$up_thumbname = md5($up_tmpname);
$up_thumbFile = $savePath3.'/'.$up_thumbname;
ResizeWidth($up_saveFile,$up_thumbFile,150);
@chmod($up_thumbFile,0707);
$IM = getimagesize($up_saveFile);
$width = $IM[0];
$height= $IM[1];
}
@chmod($up_saveFile,0707);
}
}
$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 = "'$up_gid','$up_hidden','','$s','$mbruid','$up_type','$up_fileExt','$fserver','$fserverurl','$up_folder','$up_name','$up_tmpname','$up_thumbname','$up_size','$width','$height','$up_caption','0','$d_regis','','$up_cync'";
getDbInsert($table['s_upload'],$QKEY,$QVAL);
$up_lastuid = getDbCnt($table['s_upload'],'max(uid)','');
$upload .= '['.$up_lastuid.']';
if ($up_type == 2)
{
if ($fserver)
{
$incPhoto .= '<img src="'.$d['upload']['ftp_urlpath'].$up_folder.'/'.$up_tmpname.'" width="'.$d['upload']['width_img'].'" class="photo" alt="" /><br /><br />';
}
else {
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$up_folder.'/'.$up_tmpname.'" width="'.$d['upload']['width_img'].'" class="photo" alt="" /><br /><br />';
}
}
getDbUpdate($table['s_numinfo'],'upload=upload+1',"date='".$date['today']."' and site=".$s);
if ($up_gid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_upload'],$DB_CONNECT);
}
if ($uid && $upfiles)
{
$_uploadtmp = getArrayString($upfiles);
foreach($_uploadtmp['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['type'] == 2)
{
if ($fserver)
{
$incPhoto .= '<img src="'.$d['upload']['ftp_urlpath'].$U['folder'].'/'.$U['tmpname'].'" width="'.$d['upload']['width_img'].'" class="photo" alt="" /><br /><br />';
}
else {
$incPhoto .= '<img src="'.$g['url_root'].'/files/'.$U['folder'].'/'.$U['tmpname'].'" width="'.$d['upload']['width_img'].'" class="photo" alt="" /><br /><br />';
}
}
}
}
if ($incPhoto)
{
if ($insert_photo == 'top')
{
$content = $incPhoto.nl2br($content);
}
if ($insert_photo == 'bottom')
{
$content = nl2br($content).'<br /><br />'.$incPhoto;
}
$html = 'HTML';
}
if ($fserver)
{
ftp_close($FTP_CONNECT);
}
}
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['sosok'].']'))
{
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,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,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','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$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',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
{
##################################################################################
// 비회원인 경우 접근거부 루틴 제거 (2012.1.23 by 케르)
/* 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['sosok'].']'))
{
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,trackback,score1,score2,singo,point1,point2,point3,point4,d_regis,d_modify,d_comment,d_trackback,upload,ip,agent,sns,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','0','$point1','$point2','$point3','$point4','$d_regis','','','','$upload','$ip','$agent','','$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 ($trackback)
{
$trackback = trim($trackback);
$compaurl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'/'.$m.'/'.$NOWUID;
if ($trackback != $compaurl)
{
include_once $g['path_core'].'function/trackback.func.php';
$orignurl = 'http://'.$_SERVER['HTTP_HOST'].str_replace('index.php','?m=',$_SERVER['SCRIPT_NAME']).$m.'&bid='.$bbsid.'&uid='.$NOWUID;
$result = putTrackback($trackback,$orignurl,getUTFtoKR(strip_tags($subject)),getUTFtoKR(${$_HS['nametype']}),getUTFtoKR(strip_tags($content)),0);
if ($result)
{
$minuid = getDbCnt($table['s_trackback'],'min(uid)','');
$trackuid = $minuid ? $minuid-1 : 100000000;
$cync = '['.$m.']['.$NOWUID.'][m:'.$m.',bid:'.$bbsid.',uid:'.$NOWUID.']';
$QKEY = "uid,site,type,parent,parentmbr,url,name,subject,content,d_regis,d_modify,cync";
$QVAL = "'$trackuid','$s','2','".$m.$NOWUID."','$mbruid','$trackback','','','','$d_regis','','$cync'";
getDbInsert($table['s_trackback'],$QKEY,$QVAL);
getDbUpdate($table['s_numinfo'],'sndtrack=sndtrack+1',"date='".$date['today']."' and site=".$s);
if ($trackuid == 100000000) db_query("OPTIMIZE TABLE ".$table['s_trackback'],$DB_CONNECT);
}
}
}
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'");
}
}
if ((!$uid||$reply=='Y') && $snsCallBack && is_file($g['path_module'].$snsCallBack))
{
$xcync = "[][][][][][m:".$m.",bid:".$bbsid.",uid:".$NOWUID."]";
$orignSubject = strip_tags($subject);
$orignContent = getStrCut($orignSubject,60,'..');
$orignUrl = 'http://'.$_SERVER['SERVER_NAME'].str_replace('./','/',getCyncUrl($xcync)).'#CMT';
include_once $g['path_module'].$snsCallBack;
if ($snsSendResult)
{
getDbUpdate($table[$m.'data'],"sns='".$snsSendResult."'",'uid='.$LASTUID);
}
}
include_once $g['dir_module'].'theme/_pc/'.$bid.'/_var.php';
// 메일 발송
if($d['theme']['email_send'] && !$my['admin'])
{
$AD = getDbData($table['s_mbrdata'],"nic='관리자'",'*');
$email=$AD['email'];
$to=$AD['name'];
include_once $g['path_core'].'function/email.func.php';
include_once $g['path_module'].'member/var/var.join.php';
getSendMail($email.'|'. $to, $d['member']['join_email'].'|'.$_HS['name'], '['.$_HS['name'].']의 ['.$B['name'].']게시판에 ['.$name.']님께서 아래와 같은 내용의 글을 등록하셨습니다. ', $content, 'HTML');
}
$_SESSION['bbsback'] = $backtype;
if ($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.','','');
}
?>