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,13 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$R = getUidData($table[$m.'category'],$cat);
if ($R['img'.$dtype]){
getDbUpdate($table[$m.'category'],"img".$dtype."=''",'uid='.$R['uid']);
unlink($g['path_file'].$m.'/category/'.$R['img'.$dtype]);
}
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,67 @@
<?php
if(!defined('__KIMS__')) exit;
$result=array();
$result['error'] = false;
if (!$uid || !$display ) getLink('','','잘못된 접근입니다.','');
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) getLink('','','존재하지 않는 포스트입니다.','');
if (!checkPostOwner($R)) getLink('','','권한이 없습니다.','');
$hidden = $display==1 || $display==2?1:0;
$d_modify =$date['totime']; // 수정 등록일
//데이터 업데이트
$QVAL1 = "display='$display',hidden='$hidden',d_modify='$d_modify'";
getDbUpdate($table[$m.'data'],$QVAL1,'uid='.$R['uid']);
// 피드 인덱스 추가
if ($display>3) {
$_FCD = getDbArray($table['s_friend'],'by_mbruid='.$my['uid'],'my_mbruid','uid','asc',0,1);
while ($_F=db_fetch_array($_FCD)) {
$mbruid = $_F['my_mbruid'];
$module = $m;
$category = '';
$entry = $R['uid'];
$d_regis = $date['totime'];
$check_feed_qry = "mbruid='".$mbruid."' and module='".$module."' and entry='".$entry."'";
$is_feed = getDbRows($table['s_feed'],$check_feed_qry);
if (!$is_feed){
$_QKEY = 'site,mbruid,module,category,entry,d_regis';
$_QVAL = "'$s','$mbruid','$module','$category','$entry','$d_regis'";
getDbInsert($table['s_feed'],$_QKEY,$_QVAL);
}
}
//피드 구데이터 삭제 (인덱스 용량 5000건 제한 )
$_REFCNT = getDbRows($table['s_feed'],'');
if ($_REFCNT > 5000) {
$_REFOVER = getDbArray($table['s_feed'],'','*','uid','asc',($_REFCNT - 4001),1);
while($_REFK=db_fetch_array($_REFOVER)) {
getDbDelete($table['s_feed'],'uid='.$_REFK['uid']); // 구 데이터삭제
}
}
if ($_REFCNT == 1000) {
db_query("OPTIMIZE TABLE ".$table['s_feed'],$DB_CONNECT);
}
}
getDbUpdate($table[$m.'index'],'display='.$display,'gid='.$R['gid']); //데이터 인덱스 업데이트
getDbUpdate($table[$m.'member'],'display='.$display,'data='.$R['uid']); //멤버 인덱스 업데이트
getDbUpdate($table[$m.'category_index'],'display='.$display,'data='.$R['uid']); //카테고리 인덱스 업데이트
getDbUpdate($table[$m.'list_index'],'display='.$display,'data='.$R['uid']); //리스트 인덱스 업데이트
getDbUpdate($table['s_feed'],'display='.$display,'module="'.$m.'" and entry='.$R['uid']); //피드 인덱스 업데이트
getDbUpdate($table[$m.'day'],'display='.$display,'data='.$R['uid']); // 일별현황 업데이트 (인기 포스트 추출목적)
echo json_encode($result);
exit;
?>

View File

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

View File

@@ -0,0 +1,229 @@
<?php
if(!defined('__KIMS__')) exit;
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/post.var.php';
$_tmpvfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $_tmpvfile;
if (!$my['admin']) {
if ($d['post']['perm_l_write'] > $my['level'] || strpos('_'.$d['post']['perm_g_write'],'['.$my['mygroup'].']') || !$my['uid']) {
$error_msg = '정상적인 접근이 아닙니다.';
if ($send_mod=='ajax') {
$result=array();
$result['error'] = $error_msg;
echo json_encode($result);
exit;
} else {
getLink('reload','parent.',$error_msg,'');
}
}
}
if ($_POST['uid']) {
$uid = $_POST['uid'];
$R = getUidData($table[$m.'data'],$uid);
} else {
$R=getDbData($table[$m.'data'],"cid='".$cid."'",'*');
}
if (!$R['uid']) getLink('','','삭제되었거나 존재하지 않는 포스트 입니다.','');
if ($my['uid'] != $R['mbruid'] && !$my['admin']) {
getLink('','','잘못된 접속입니다.','');
}
include_once $g['dir_module'].'var/var.php';
include_once $g['path_module'].'mediaset/var/var.php';
if ($d['post']['commentdel'])
{
if($R['comment'])
{
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'] && $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'].$m.'/'.$U['folder'].'/'.$U['tmpname']);
}
}
}
}
//태그삭제
if ($R['tag'])
{
$_tagarr1 = explode(',',$R['tag']);
foreach($_tagarr1 as $_t)
{
if(!$_t) continue;
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and keyword='".$_t."'",'*');
if($_TAG['uid'])
{
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
}
}
}
//카테고리 등록 포스트 수 조정
$IDX = getDbSelect($table[$m.'category_index'],'data='.$R['uid'],'*');
while($I=db_fetch_array($IDX)) {
getDbUpdate($table[$m.'category'],'num=num-1','uid='.$I['category']);
}
//리스트 등록 포스트 수 조정
$IDX2 = getDbSelect($table[$m.'list_index'],'data='.$R['uid'],'*');
while($I2=db_fetch_array($IDX2)) {
getDbUpdate($table[$m.'list'],'num=num-1','uid='.$I2['list']);
}
getDbDelete($table[$m.'data'],'uid='.$R['uid']); //데이터삭제
getDbDelete($table[$m.'index'],'gid='.$R['gid']); // 데이터 인덱스삭제
getDbDelete($table[$m.'category_index'],'data='.$R['uid']);//카테고리 인덱스삭제
getDbDelete($table[$m.'member'],'data='.$R['uid']);//멤버삭제
getDbDelete($table[$m.'list_index'],'data='.$R['uid']);//리스트 인덱스삭제
//회원의 등록수량 조절
getDbUpdate($table['s_mbrdata'],'num_post=num_post-1,hit_post=hit_post-'.$R['hit'].',likes_post=likes_post-'.$R['likes'].',dislikes_post=dislikes_post-'.$R['dislikes'],'memberuid='.$R['mbruid']);
getDbUpdate($table['s_mbrmonth'],'post_num=post_num-1',"date='".substr($R['d_regis'],0,6)."' and site=".$R['site'].' and mbruid='.$R['mbruid']); // 회원의 월별통계 수량갱신
getDbUpdate($table['s_mbrday'],'post_num=post_num-1',"date='".substr($R['d_regis'],0,8)."' and site=".$R['site'].' and mbruid='.$R['mbruid']); //회원의 일별 수량갱신
//회원의 월총수량 조절 (조회수,좋아요,싫어요,댓글수)
$_MONTH = getDbSelect($table[$m.'month'],'data='.$R['uid'],'*');
while ($_M=db_fetch_array($_MONTH)) {
getDbUpdate($table['s_mbrmonth'],'post_hit=post_hit-'.$_M['hit'].',post_likes=post_likes-'.$_M['likes'].',post_dislikes=post_dislikes-'.$_M['dislikes'].',post_comment=post_comment-'.$_M['comment'],"date='".$_M['date']."' and site=".$R['site'].' and mbruid='.$R['mbruid']);
}
//회원의 일총수량 조절 (조회수,좋아요,싫어요,댓글수)
$_DAY = getDbSelect($table[$m.'day'],'data='.$R['uid'],'*');
while ($_D=db_fetch_array($_DAY)) {
getDbUpdate($table['s_mbrday'],'post_hit=post_hit-'.$_D['hit'].',post_likes=post_likes-'.$_D['likes'].',post_dislikes=post_dislikes-'.$_D['dislikes'].',post_comment=post_comment-'.$_D['comment'],"date='".$_D['date']."' and site=".$R['site'].' and mbruid='.$R['mbruid']);
}
//포스트의 수량 삭제 (조회수,추천수)
getDbDelete($table[$m.'month'],'data='.$R['uid']); //월 데이터삭제
getDbDelete($table[$m.'day'],'data='.$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']);
}
// 피드 인덱스 삭제
$_FCD = getDbArray($table['s_friend'],'by_mbruid='.$my['uid'],'my_mbruid','uid','asc',0,1);
while ($_F=db_fetch_array($_FCD)) {
$mbruid = $_F['my_mbruid'];
$module = $m;
$entry = $R['uid'];
$check_feed_qry = "mbruid='".$mbruid."' and module='".$module."' and entry='".$entry."'";
$is_feed = getDbRows($table['s_feed'],$check_feed_qry);
if ($is_feed) getDbDelete($table['s_feed'],$check_feed_qry);
}
if ($send_mod=='ajax') {
$result=array();
$result['error'] = false;
echo json_encode($result);
exit;
} else {
setrawcookie('post_action_result', rawurlencode('포스트가 삭제 되었습니다.|success')); // 처리여부 cookie 저장
if ($usertype=='admin') getLink('reload','parent.' , $alert , $history);
else getLink(RW('mod=dashboard&page=post') ,'parent.' , $alert , $history);
}
?>

View File

@@ -0,0 +1,34 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
include_once $g['path_module'].$m.'/_main.php';
if (!$cat) getLink('./?m=admin&module='.$m.'&front=category','parent.','','');
$CINFO = getUidData($table[$m.'category'],$cat);
$subQue = getPostCategoryCodeToSql($table[$m.'category'],$CINFO['id']);
$subQue = str_replace('category=','uid=',$subQue);
if ($subQue)
{
$DAT = getDbSelect($table[$m.'category'],$subQue,'*');
while($R=db_fetch_array($DAT))
{
getDbDelete($table[$m.'category'],'uid='.$R['uid']); // 카테고리 삭제
getDbDelete($table[$m.'category_index'],'category='.$R['uid']); //인덱스삭제
$_xfile = $g['path_file'].$m.'/code/'.sprintf('%05d',$R['uid']);
@unlink($_xfile.'.header.php');
@unlink($_xfile.'.footer.php');
@unlink($g['path_file'].$m.'/category/'.$R['imghead']);
@unlink($g['path_file'].$m.'/category/'.$R['imgfoot']);
}
if ($parent)
{
if (!getDbRows($table[$m.'category'],'parent='.$parent))
{
getDbUpdate($table[$m.'category'],'is_child=0','uid='.$parent);
}
}

View File

@@ -0,0 +1,36 @@
<?php
if(!defined('__KIMS__')) exit;
$R = getUidData($table[$m.'list'],$uid);
if (!$R['uid']) getLink('','','삭제되었거나 존재하지 않는 리스트 입니다.','');
if ($my['uid'] != $R['mbruid'] && !$my['admin']) {
getLink('','','잘못된 접속입니다.','');
}
//태그삭제
if ($R['tag']) {
$_tagarr1 = explode(',',$R['tag']);
foreach($_tagarr1 as $_t)
{
if(!$_t) continue;
$_TAG = getDbData($table['s_tag'],"site=".$R['site']." and keyword='".$_t."'",'*');
if($_TAG['uid'])
{
if($_TAG['hit']>1) getDbUpdate($table['s_tag'],'hit=hit-1','uid='.$_TAG['uid']);
else getDbDelete($table['s_tag'],'uid='.$_TAG['uid']);
}
}
}
getDbUpdate($table['s_mbrdata'],'num_list=num_list-1','memberuid='.$R['mbruid']); //회원 리스트수 조정
getDbDelete($table[$m.'list'],'uid='.$R['uid']); // 리스트 삭제
getDbDelete($table[$m.'list_index'],'list='.$R['uid']);//인덱스삭제
getDbDelete($table[$m.'list_member'],'list='.$R['uid']);//멤버삭제
setrawcookie('list_action_result', rawurlencode('리스트가 삭제 되었습니다.|success')); // 처리여부 cookie 저장
if ($usertype=='admin') getLink('reload','parent.' , $alert , $history);
else getLink(RW('mod=dashboard&page=list') ,'parent.' , $alert , $history);
?>

View File

@@ -0,0 +1,18 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid']) getLink('','','정상적인 접근이 아닙니다.','');
$LIST = getDbData($table[$m.'list'],"id='".$listid."'",'*');
if (!$LIST['uid']) getLink('','','삭제되었거나 존재하지 않는 리스트 입니다.','');
if ($my['uid']!=$LIST['mbruid']) getLink('','','정상적인 접근이 아닙니다.','');
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) getLink('','','삭제되었거나 존재하지 않는 포스트 입니다.','');
getDbDelete($table[$m.'list_index'],'list='.$LIST['uid'].' and data='.$R['uid']);//인덱스삭제
getDbUpdate($table[$m.'list'],'num=num-1','uid='.$LIST['uid']); // 리스트 포스트수 조정
getLink('reload'.$parent,'parent.','','');
?>

View File

@@ -0,0 +1,28 @@
<?php
if(!defined('__KIMS__')) exit;
$_IS_POSTOWN=getDbRows($table[$m.'member'],'mbruid='.$my['uid'].' and data='.$data.' and level=1');
if (!$_IS_POSTOWN) getLink('reload','parent.','정상적인 접근이 아닙니다.','');
if(!getDbRows($table[$m.'member'],'data='.$data.' and mbruid='.$mbruid)) getLink('reload','parent.','목록에 존재하지 않는 회원입니다.','');
$d_regis = $date['totime']; // 최초 등록일
getDbUpdate($table['s_mbrdata'],'num_post=num_post-1','memberuid='.$mbruid); //회원 리스트수 조정
getDbDelete($table[$m.'member'],'data='.$data.' and mbruid='.$mbruid);//멤버삭제
// 리스트에서 제거
$_orign_list_members = getDbArray($table[$m.'list_index'],'data='.$data.' and mbruid='.$mbruid,'*','data','asc',0,1);
while($_olm=db_fetch_array($_orign_list_members)) {
getDbDelete($table[$m.'list_index'],'list='.$_olm['list'].' and data='.$data.' and mbruid='.$mbruid);
getDbUpdate($table[$m.'list'],'num=num-1,d_last='.$d_regis,'uid='.$_olm['list']);
}
getDbUpdate($table['s_feed'],'hidden=1','module="'.$m.'" and entry='.$data.' and mbruid='.$mbruid); //피드 인덱스 업데이트
$result=array();
$result['error'] = false;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,32 @@
<?php
if(!defined('__KIMS__')) exit;
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/post.var.php';
$_tmpvfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $_tmpvfile;
$result=array();
$result['error'] = false;
if (!$my['admin']) {
if ($d['post']['perm_l_category'] > $my['level'] || strpos('_'.$d['post']['perm_g_category'],'['.$my['mygroup'].']') || !$my['uid']) {
$error_msg = '카테고리 권한이 없습니다.';
$result['error'] = $error_msg;
echo json_encode($result);
exit;
}
}
$tree='';
if (getDbRows($table[$m.'category'],'site='.$s.' and reject=0 and hidden=0')) {
include_once $g['dir_module'].'_main.php';
$_treeOptions=array('site'=>$s,'table'=>$table[$m.'category'],'dispNum'=>true,'dispHidden'=>false,'dispCheckbox'=>true,'allOpen'=>false);
$tree = getTreePostCategoryCheck($_treeOptions,$uid,0,0,'');
}
$result['category_tree'] = $tree;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,40 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'mod/_list.php';
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
$result=array();
$result['error'] = false;
$list='';
foreach ($RCD as $R) {
$TMPL['name']=stripslashes($R['name']);
$TMPL['uid']=$R['uid'];
$TMPL['id']=$R['id'];
$TMPL['num']=$R['num'];
$TMPL['featured_img'] = getPreviewResize(getListImageSrc($R['uid']),'480x270');
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$skin=new skin($markup_file);
$list.=$skin->make();
}
$result['list'] = $list;
$result['num'] = $NUM;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,59 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
$listque = 'mbruid='.$my['uid'];
$RCD = getDbArray($table[$m.'list'],$listque,'*','gid','asc',30,1);
$NUM = getDbRows($table[$m.'list'],$listque);
// 포스트 공개관련
$d['displaySet'] = "||비공개,lock||일부공개,how_to_reg||미등록,insert_link||회원공개,people_alt||전체공개,public";
$g['displaySet']['label'] = [];
$g['displaySet']['icon'] = [];
$displaySet=explode('||',$d['displaySet']);
foreach ($displaySet as $displayLine) {
$dis=explode(',',$displayLine);
array_push($g['displaySet']['label'], $dis[0]);
array_push($g['displaySet']['icon'], $dis[1]);
}
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
$result=array();
$result['error'] = false;
// 로그인한 사용자가 게시물을 저장했는지 여부 체크
$check_saved_qry = "mbruid='".$my['uid']."' and module='".$m."' and entry='".$uid."'";
$is_saved = getDbRows($table['s_saved'],$check_saved_qry);
$result['is_saved']=$is_saved;
$list='';
foreach ($RCD as $R) {
$is_list = getDbRows($table[$m.'list_index'],'data='.$uid.' and list='.$R['uid']);
$TMPL['name']=stripslashes($R['name']);
$TMPL['uid']=$R['uid'];
$TMPL['is_list']=$is_list?' checked':'';
$TMPL['display_label']=$g['displaySet']['label'][$R['display']];
$TMPL['display_icon']=$g['displaySet']['icon'][$R['display']];
$skin=new skin($markup_file);
$list.=$skin->make();
}
$result['list'] = $list;
$result['num'] = $NUM;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,65 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
$LIST=getDbData($table[$m.'list'],"id='".$listid."'",'*');
include_once $g['dir_module'].'mod/_list.php';
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$result=array();
$result['error'] = false;
$box='';
$list='';
$TMPL['avatar'] = getAvatarSrc($LIST['mbruid'],'64');
$TMPL['mbruid'] = $LIST['mbruid'];
$TMPL['nic'] = getProfileInfo($LIST['mbruid'],'nic');
$TMPL['name'] = $LIST['name'];
$TMPL['num']=$LIST['num'];
$TMPL['list']=$LIST['id'];
$TMPL['cover']=getListImageSrc($LIST['uid']);
$TMPL['review']=$LIST['review'];
foreach ($RCD as $R) {
$TMPL['subject']=checkPostPerm($R)?stripslashes($R['subject']):'[비공개 포스트]';
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['format'] = $formats[$R['format']];
$TMPL['time']=checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9_sm'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'480x270'):getPreviewResize('/files/noimage.png','480x270');
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$skin_list=new skin('listview-row');
$list.=$skin_list->make();
}
$TMPL['row'] = $list;
$skin=new skin($markup_file);
$box.=$skin->make();
$result['box'] = $box;
$result['num'] = $NUM;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,89 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
// 포스트 공개관련
$d['displaySet'] = "||비공개,lock||일부공개,how_to_reg||미등록,insert_link||회원공개,people_alt||전체공개,public";
$g['displaySet']['label'] = [];
$g['displaySet']['icon'] = [];
$displaySet=explode('||',$d['displaySet']);
foreach ($displaySet as $displayLine) {
$dis=explode(',',$displayLine);
array_push($g['displaySet']['label'], $dis[0]);
array_push($g['displaySet']['icon'], $dis[1]);
}
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$sort = $sort ? $sort : 'uid';
$orderby= $orderby ? $orderby : 'desc';
$recnum = $recnum && $recnum < 200 ? $recnum : 15;
$where = 'subject|review|tag';
$postque = 'site='.$s;
if ($sort == 'uid' && !$keyword) {
$postque .= ' and mbruid='.$my['uid'].' and module="'.$m.'"';
$NUM = getDbRows($table['s_history'],$postque);
$TCD = getDbArray($table['s_history'],$postque,'entry',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table['postdata'],'uid='.$_R['entry'],'*');
} else {
}
$TPG = getTotalPage($NUM,$recnum);
$result=array();
$result['error'] = false;
$list='';
$TMPL['start']=$start;
if (!empty($RCD)) {
foreach ($RCD as $R) {
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=$R['uid']?stripslashes($R['subject']):'삭제된 포스트';
$TMPL['format'] = $R['format'];
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_16by9_sm'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'320x180'):getPreviewResize('/files/noimage.png','320x180');
$TMPL['has_featured'] = !$R['featured_img']?'d-none':'';
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$TMPL['display']=$R['display']!=5?$g['displaySet']['icon'][$R['display']]:'';
$skin=new skin($markup_file);
$list.=$skin->make();
}
}
$result['list'] = $list;
$result['num'] = $NUM;
$result['tpg']= $TPG;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,78 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
// 포스트 공개관련
$d['displaySet'] = "||비공개,lock||일부공개,how_to_reg||미등록,insert_link||회원공개,people_alt||전체공개,public";
$g['displaySet']['label'] = [];
$g['displaySet']['icon'] = [];
$displaySet=explode('||',$d['displaySet']);
foreach ($displaySet as $displayLine) {
$dis=explode(',',$displayLine);
array_push($g['displaySet']['label'], $dis[0]);
array_push($g['displaySet']['icon'], $dis[1]);
}
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$sort = $sort ? $sort : 'gid';
$orderby= $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 201 ? $recnum : 15;
$where = 'name|tag';
$listque = 'mbruid='.$my['uid'].' and site='.$s;
if ($display) $listque .= ' and display='.$display;
if ($where && $keyword) {
if (strstr('[id]',$where)) $listque .= " and ".$where."='".$keyw."'";
else $listque .= getSearchSql($where,$keyword,$ikeyword,'or');
}
$RCD = getDbArray($table['postlist'],$listque,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table['postlist'],$listque);
$TPG = getTotalPage($NUM,$recnum);
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$result=array();
$result['error'] = false;
$list='';
$TMPL['start']=$start;
foreach ($RCD as $R) {
$TMPL['name']=stripslashes($R['name']);
$TMPL['format'] = $formats[$R['format']];
$TMPL['uid']=$R['uid'];
$TMPL['id']=$R['id'];
$TMPL['num']=$R['num'];
$TMPL['featured_16by9'] = getPreviewResize(getListImageSrc($R['uid']),'480x270');
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$TMPL['display']=$R['display']!=5?$g['displaySet']['icon'][$R['display']]:'';
$skin=new skin($markup_file);
$list.=$skin->make();
}
$result['list'] = $list;
$result['num'] = $NUM;
$result['tpg']= $TPG;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,105 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
// 포스트 공개관련
$d['displaySet'] = "||비공개,lock||일부공개,how_to_reg||미등록,insert_link||회원공개,people_alt||전체공개,public";
$g['displaySet']['label'] = [];
$g['displaySet']['icon'] = [];
$displaySet=explode('||',$d['displaySet']);
foreach ($displaySet as $displayLine) {
$dis=explode(',',$displayLine);
array_push($g['displaySet']['label'], $dis[0]);
array_push($g['displaySet']['icon'], $dis[1]);
}
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$sort = $sort ? $sort : 'gid';
$orderby= $orderby ? $orderby : 'asc';
$recnum = $recnum && $recnum < 200 ? $recnum : 15;
$where = 'subject|review|tag';
$postque = 'site='.$s;
if ($display) $postque .= ' and display='.$display;
if ($sort != 'gid') $orderby= 'desc';
if ($sort == 'gid' && !$keyword) {
$postque .= ' and mbruid='.$my['uid'];
$NUM = getDbRows($table['postmember'],$postque);
$TCD = getDbArray($table['postmember'],$postque,'gid',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table['postdata'],'gid='.$_R['gid'],'*');
} else {
$postque .= getSearchSql('members','['.$my['uid'].']',$ikeyword,'or');
if ($where && $keyword) {
if (strstr('[name][nic][id][ip]',$where)) $postque .= " and ".$where."='".$keyword."'";
else if ($where == 'term') $postque .= " and d_regis like '".$keyword."%'";
else $postque .= getSearchSql($where,$keyword,$ikeyword,'or');
}
$NUM = getDbRows($table['postdata'],$postque);
$TCD = getDbArray($table['postdata'],$postque,'*',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = $_R;
}
$TPG = getTotalPage($NUM,$recnum);
$result=array();
$result['error'] = false;
$list='';
$TMPL['start']=$start;
if (!empty($RCD)) {
foreach ($RCD as $R) {
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=stripslashes($R['subject']);
$TMPL['format'] = $R['format'];
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_16by9_sm'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'320x180'):getPreviewResize('/files/noimage.png','320x180');
$TMPL['has_featured'] = !$R['featured_img']?'d-none':'';
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$TMPL['display']=$R['display']!=5?$g['displaySet']['icon'][$R['display']]:'';
$skin=new skin($markup_file);
$list.=$skin->make();
}
}
$result['list'] = $list;
$result['num'] = $NUM;
$result['tpg']= $TPG;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,59 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
include_once $g['dir_module'].'var/var.php';
$result=array();
$result['error']=false;
$R = getUidData($table[$m.'data'],$uid);
include_once $g['path_module'].'post/var/var.php';
$result['uid'] = $R['uid'];
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['m_skin']?$d['post']['m_skin']:$d['post']['skin_mobile'];
$device = 'mobile';
} else {
$theme = $d['post']['skin']?$d['post']['skin']:$d['post']['skin_main'];
$device = 'desktop';
}
$sort = 'uid';
$orderby = 'desc';
$recnum = 20;
$where = 'module="'.$m.'" and opinion="'.$opinion.'" and entry='.$uid; // 출력 조건
$where1 = 'module="'.$m.'" and opinion="like" and entry='.$uid; // 좋아요 출력 조건
$where2 = 'module="'.$m.'" and opinion="dislike" and entry='.$uid; // 싫어요 출력 조건
$RCD = getDbArray($table['s_opinion'],$where,'*',$sort,$orderby,$recnum,1);
$NUM = getDbRows($table['s_opinion'],$where);
$NUM1 = getDbRows($table['s_opinion'],$where1); //좋아요 수량
$NUM2 = getDbRows($table['s_opinion'],$where2); //싫어요 수량
$html='';
foreach ($RCD as $R) {
$M = getUidData($table['s_mbrid'],$R['mbruid']);
$M1 = getDbData($table['s_mbrdata'],'memberuid='.$R['mbruid'],'*');
$myself = $R['mbruid']==$my['uid']?' (나)':'';
$TMPL['nic']=$M1['nic'].$myself;
$TMPL['id']=$M['id'];
$TMPL['mbruid']=$R['mbruid'];
$TMPL['avatar']=getAvatarSrc($R['mbruid'],'84');
$TMPL['num_follower']=$M1['num_follower'];
$TMPL['num_post']=$M1['num_post'];
$TMPL['profile_link']=getProfileLink($R['mbruid']);
$TMPL['d_regis']=getDateFormat($R['d_regis'],'Y-m-d H:i');
$skin_item=new skin($markup_file);
$html.=$skin_item->make();
}
$result['num']=$NUM;
$result['num_like']=$NUM1;
$result['num_dislike']=$NUM2;
$result['list']=$html;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,78 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'mod/_post.php';
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$mbruid = $my['uid'];
$result=array();
$result['error'] = false;
$list='';
foreach ($RCD as $R) {
$_markup_file = $markup_file.'-'.$formats[$R['format']];
$comment = $R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$_comment = $comment==0?'':$comment;
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=getContents($R['subject'],$R['html']);
$TMPL['has_content']=$R['content']?'d-block':'d-none';
$TMPL['review']=stripslashes($R['review']);
$TMPL['format'] = $R['format'];
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['mbruid']=$R['mbruid'];
$TMPL['post_url']=getPostLink($R,0);
$TMPL['profile_url']=getProfileLink($R['mbruid']);
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$_comment;
$TMPL['likes']=$R['likes'];
$TMPL['dislikes']=$R['dislikes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_1by1'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x640'):getPreviewResize('/files/noimage.png','640x640');
$TMPL['has_featured'] = !$R['featured_img']?'d-none':'';
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$TMPL['has_goodslink']=$R['goods']?'':'d-none';
$check_like_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."' and opinion='like'";
$check_dislike_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."' and opinion='dislike'";
$check_saved_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."'";
$is_post_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_post_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
$is_post_saved = getDbRows($table['s_saved'],$check_saved_qry);
$TMPL['is_post_liked'] = $is_post_liked?'active':'';
$TMPL['is_post_disliked'] = $is_post_disliked?'active':'';
$TMPL['is_post_saved'] = $is_post_saved?'true':'false';
$skin=new skin($_markup_file);
$list.=$skin->make();
}
$result['list'] = $list;
$result['num'] = $NUM;
$result['tpg'] = $TPG;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,99 @@
<?php
if(!defined('__KIMS__')) exit;
$p = $p ? $p : 1;
$recnum = $recnum && $recnum < 200 ? $recnum : 20;
$sort = $sort ? $sort : 'hit';
$orderby= $orderby ? $orderby : 'desc';
$query = 'site='.$s.' and ';
$_WHERE1= $query.'date >= '.$d_start.' and '.$sort.'>0';
if ($sort=='hit') $_WHERE2= 'data,sum(hit) as hit';
if ($sort=='likes') $_WHERE2= 'data,sum(likes) as likes';
if ($sort=='dislikes') $_WHERE2= 'data,sum(dislikes) as dislikes';
if ($sort=='comment') $_WHERE2= 'data,sum(comment) as comment';
$RCD = getDbSelect($table[$m.'day'],$_WHERE1.' group by data order by '.$sort.' '.$orderby.' limit 0,'.$recnum,$_WHERE2);
while($_R = db_fetch_array($RCD)) $_RCD[] = getDbData($table[$m.'data'],'uid='.$_R['data'],'*');
$NUM = getDbRows($table[$m.'day'],$_WHERE1.' group by data');
$TPG = getTotalPage($NUM,$recnum);
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
include_once $g['dir_module'].'var/var.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$mbruid = $my['uid'];
$result=array();
$result['error'] = false;
$list='';
if (!empty($_RCD)) {
$i=1;foreach ($_RCD as $R) {
if ($dashboard=='Y' && !strpos('_'.$R['members'],'['.$my['uid'].']')) continue;
$_markup_file = $markup_file.'-'.$formats[$R['format']];
$TMPL['link']=getPostLink($R,1);
$TMPL['edit_link']=RW('m=post&mod=write&cid='.$R['cid']);
$TMPL['subject']=getContents($R['subject'],$R['html']);
$TMPL['has_content']=$R['content']?'d-block':'d-none';
$TMPL['format'] = $R['format'];
$TMPL['uid']=$R['uid'];
$TMPL['mbruid']=$R['mbruid'];
$TMPL['post_url']=getPostLink($R,0);
$TMPL['profile_url']=getProfileLink($R['mbruid']);
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['dislikes']=$R['dislikes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_16by9_sm'] = checkPostPerm($R) ?getPreviewResize(getUpImageSrc($R),'300x168'):getPreviewResize('/files/noimage.png','300x168');
$TMPL['has_featured'] = !$R['featured_img']?'d-none':'';
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$check_like_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."' and opinion='like'";
$check_dislike_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."' and opinion='dislike'";
$check_saved_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."'";
$is_post_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_post_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
$is_post_saved = getDbRows($table['s_saved'],$check_saved_qry);
$TMPL['is_post_liked'] = $is_post_liked?'active':'';
$TMPL['is_post_disliked'] = $is_post_disliked?'active':'';
$TMPL['is_post_saved'] = $is_post_saved?'true':'false';
if ($sort=='hit') $TMPL['num']=$R['hit']?'조회 '.$R['hit']:'';
if ($sort=='likes') $TMPL['num']=$R['likes']?'좋아요 '.$R['likes']:'';
if ($sort=='dislikes') $TMPL['num']=$R['dislikes']?'싫어요 '.$R['dislikes']:'';
if ($sort=='comment') $TMPL['num']=$R['comment']?'댓글 '.$R['comment']:'';
$skin=new skin($_markup_file);
$list.=$skin->make();
if ($i==$limit) break;
$i++;
}
}
$result['list'] = $list;
$result['num'] = $NUM;
$result['tpg'] = $TPG;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,57 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'_main.php';
include_once $g['dir_module'].'mod/_category.php';
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$result=array();
$result['error'] = false;
$list='';
$TMPL['start']=$start;
foreach ($RCD as $R) {
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=checkPostPerm($R)?stripslashes($R['subject']):'[비공개 포스트]';
$TMPL['format'] = $formats[$R['format']];
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_16by9_sm'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'320x180'):getPreviewResize('/files/noimage.png','320x180');
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$skin=new skin($markup_file);
$list.=$skin->make();
}
$result['list'] = $list;
$result['num'] = $NUM;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,40 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
include_once $g['dir_module'].'var/var.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
$result=array();
$result['error'] = false;
$uid = $_POST['uid']; // 포스트 고유번호
$R = getUidData($table[$m.'data'],$uid);
$linkedshopArr = getArrayString($R['linkedshop']);
$result['featured'] = getPreviewResize(getUpImageSrc($R),'320x180');
$result['subject'] = stripslashes($R['subject']);
$result['goods'] = $linkedshopArr['data'][0];
$result['article'] = getContents($R['content'],'HTML');
$result['nic'] = getProfileInfo($R['mbruid'],'nic');
$result['hit'] = $R['hit'];
$result['likes'] = $R['likes']?$R['likes']:'';
$result['dislikes'] = $R['dislikes']?$R['dislikes']:'';
$result['comment'] = $R['comment']?($R['comment'].($R['oneline']?'+'.$R['oneline']:'')):'';
$result['time'] = getUpImageTime($R)?getUpImageTime($R):'';
$markup_file = $markup_file?$markup_file:'view';
// 최종 결과값 추출 (sys.class.php)
//$skin=new skin($markup_file);
//$result['article']=$skin->make();
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,93 @@
<?php
if(!defined('__KIMS__')) exit;
$sort = $sort ? $sort : 'uid';
$orderby= $orderby ? $orderby : 'desc';
$recnum = $recnum && $recnum < 200 ? $recnum : 16;
$postque = 'site='.$s;
$postque .= ' and (display=2 and hidden=0) or display>3';
$postque .= ' and mbruid='.$my['uid'];
$NUM = getDbRows($table['s_feed'],$postque);
$TPG = getTotalPage($NUM,$recnum);
$TCD = getDbArray($table['s_feed'],$postque,'entry',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table['postdata'],'uid='.$_R['entry'],'*');
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
include_once $g['dir_module'].'var/var.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$mbruid = $my['uid'];
$result=array();
$result['error'] = false;
$list='';
if (!empty($RCD)) {
$i=1;foreach ($RCD as $R) {
$_markup_file = $markup_file.'-'.$formats[$R['format']];
$comment = $R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$_comment = $comment==0?'':$comment;
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=getContents($R['subject'],$R['html']);
$TMPL['has_content']=$R['content']?'d-block':'d-none';
$TMPL['format'] = $R['format'];
$TMPL['uid']=$R['uid'];
$TMPL['hit']=$R['hit'];
$TMPL['mbruid']=$R['mbruid'];
$TMPL['post_url']=getPostLink($R,0);
$TMPL['profile_url']=getProfileLink($R['mbruid']);
$TMPL['comment']=$_comment;
$TMPL['likes']=$R['likes'];
$TMPL['dislikes']=$R['dislikes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_1by1'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x640'):getPreviewResize('/files/noimage.png','640x640');
$TMPL['featured_16by9_sm'] = checkPostPerm($R) ?getPreviewResize(getUpImageSrc($R),'300x168'):getPreviewResize('/files/noimage.png','300x168');
$TMPL['has_featured'] = !$R['featured_img']?'d-none':'';
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$TMPL['has_goodslink']=$R['goods']?'':'d-none';
$check_like_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."' and opinion='like'";
$check_dislike_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."' and opinion='dislike'";
$check_saved_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."'";
$is_post_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_post_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
$is_post_saved = getDbRows($table['s_saved'],$check_saved_qry);
$TMPL['is_post_liked'] = $is_post_liked?'active':'';
$TMPL['is_post_disliked'] = $is_post_disliked?'active':'';
$TMPL['is_post_saved'] = $is_post_saved?'true':'false';
if ($sort=='hit') $TMPL['num']=$R['hit']?'조회 '.$R['hit']:'';
if ($sort=='likes') $TMPL['num']=$R['likes']?'좋아요 '.$R['likes']:'';
if ($sort=='dislikes') $TMPL['num']=$R['dislikes']?'싫어요 '.$R['dislikes']:'';
if ($sort=='comment') $TMPL['num']=$R['comment']?'댓글 '.$R['comment']:'';
$skin=new skin($_markup_file);
$list.=$skin->make();
if ($i==$limit) break;
$i++;
}
}
$result['list'] = $list;
$result['tpg'] = $TPG;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,56 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'mod/_category.php';
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$result=array();
$result['error'] = false;
$list='';
$TMPL['start']=$start;
foreach ($RCD as $R) {
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=checkPostPerm($R)?stripslashes($R['subject']):'[비공개 포스트]';
$TMPL['format'] = $formats[$R['format']];
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_16by9_sm'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'320x180'):getPreviewResize('/files/noimage.png','320x180');
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$skin=new skin($markup_file);
$list.=$skin->make();
}
$result['list'] = $list;
$result['num'] = $NUM;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,85 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
// 포스트 공개관련
$d['displaySet'] = "||비공개,lock||일부공개,how_to_reg||미등록,insert_link||회원공개,people_alt||전체공개,public";
$g['displaySet']['label'] = [];
$g['displaySet']['icon'] = [];
$displaySet=explode('||',$d['displaySet']);
foreach ($displaySet as $displayLine) {
$dis=explode(',',$displayLine);
array_push($g['displaySet']['label'], $dis[0]);
array_push($g['displaySet']['icon'], $dis[1]);
}
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$sort = 'uid';
$orderby= $orderby ? $orderby : 'desc';
$recnum = $recnum && $recnum < 200 ? $recnum : 15;
$sqlque = 'mbruid='.$my['uid'].' and opinion="like" and module="post"';
$TCD = getDbArray($table['s_opinion'],$sqlque,'entry',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table[$m.'data'],'uid='.$_R['entry'],'*');
$NUM = getDbRows($table['s_opinion'],$sqlque);
$TPG = getTotalPage($NUM,$recnum);
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$result=array();
$result['error'] = false;
$list='';
$TMPL['start']=$start;
if (!empty($RCD)) {
foreach ($RCD as $R) {
if (!$R['uid']) continue;
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=stripslashes($R['subject']);
$TMPL['format'] = $formats[$R['format']];
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_16by9_sm'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'320x180'):getPreviewResize('/files/noimage.png','320x180');
$TMPL['has_featured'] = !$R['featured_img']?'d-none':'';
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$TMPL['display']=$R['display']!=5?$g['displaySet']['icon'][$R['display']]:'';
$skin=new skin($markup_file);
$list.=$skin->make();
}
}
$result['list'] = $list;
$result['num'] = $NUM;
$result['tpg']= $TPG;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,47 @@
<?php
if(!defined('__KIMS__')) exit;
$NUM = getDbRows($table['postday'],$que);
$RCD=getDbArray($table['postday'],$que,'*',$sort,'desc',$_NUM,1);
while($_R = db_fetch_array($RCD)) $_RCD[] = getDbData($table['postdata'],'uid='.$_R['data'],'*');
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
include_once $g['dir_module'].'var/var.php';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
$result=array();
$result['error'] = false;
$list='';
$i=1;foreach ($_RCD as $R) {
if (!strpos('_'.$R['members'],'['.$my['uid'].']')) continue;
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=stripslashes($R['subject']);
$TMPL['uid']=$R['uid'];
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['featured_img'] = checkPostPerm($R) ?getPreviewResize(getUpImageSrc($R),'100x56'):getPreviewResize('/files/noimage.png','100x56');
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$skin=new skin($markup_file);
$list.=$skin->make();
if ($i==$limit) break;
$i++;
}
$result['list'] = $list;
$result['num'] = $i;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,59 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
require_once $g['dir_module'].'lib/base.class.php';
require_once $g['dir_module'].'lib/module.class.php';
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
$d['post']['writeperm'] = true;
if (!$my['admin']) {
if ($d['post']['perm_l_write'] > $my['level'] || strpos('_'.$d['post']['perm_g_write'],'['.$my['mygroup'].']') || !$my['uid']) {
$d['post']['writeperm'] = false;
}
}
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
$_IS_POSTOWN=getDbRows($table[$m.'member'],'mbruid='.$my['uid'].' and data='.$uid.' and level=1');
$_perm['post_owner'] = $my['admin'] || $_IS_POSTOWN ? true : false;
$post = new Post();
$post->theme_name = $theme;
$result=array();
$result['error'] = false;
$R = getUidData($table[$m.'data'],$uid);
$TMPL['uid'] = $R['uid'];
$TMPL['cid'] = $R['cid'];
$list='';
$list = $post->getHtml('post-menu');
if ($d['post']['writeperm']) {
$list .= $_perm['post_owner']?$post->getHtml('post-menu-owner'):'';
}
$result['subject'] = stripslashes($R['subject']);
$result['featured'] = $g['url_host'].getPreviewResize(getUpImageSrc($R),'640x360');
$result['review'] = $R['review'];
$result['link'] = $g['url_host'].getPostLink($R,0);
$result['likes'] = $R['likes']?$R['likes']:'';
$result['owner'] = $_perm['post_owner']?1:0;
$result['list'] = $list;
$result['num'] = $i;
$result['cid'] = $R['cid'];
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,79 @@
<?php
if(!defined('__KIMS__')) exit;
$RCD = explode(',',$posts);
require_once $g['path_core'].'function/sys.class.php';
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
$mbruid = $my['uid'];
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$formats = explode(',', $d['theme']['format']);
array_unshift($formats,'');
$result=array();
$result['error'] = false;
$list='';
if (!empty($RCD)) {
foreach ($RCD as $_R) {
$R = getDbData($table[$m.'data'],"cid='".$_R."'",'*');
if (!$R['uid']) continue;
$_markup_file = $markup_file.'-'.$formats[$R['format']];
$comment = $R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$_comment = $comment==0?'':$comment;
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=stripslashes($R['subject']);
$TMPL['review']=stripslashes($R['review']);
$TMPL['format'] = $R['format'];
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['mbruid']=$R['mbruid'];
$TMPL['post_url']=getPostLink($R,0);
$TMPL['profile_url']=getProfileLink($R['mbruid']);
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$_comment;
$TMPL['likes']=$R['likes'];
$TMPL['dislikes']=$R['dislikes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_1by1'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x640'):getPreviewResize('/files/noimage.png','640x640');
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$TMPL['has_goodslink']=$R['goods']?'':'d-none';
$check_like_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."' and opinion='like'";
$check_dislike_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."' and opinion='dislike'";
$check_saved_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$R['uid']."'";
$is_post_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_post_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
$is_post_saved = getDbRows($table['s_saved'],$check_saved_qry);
$TMPL['is_post_liked'] = $is_post_liked?'active':'';
$TMPL['is_post_disliked'] = $is_post_disliked?'active':'';
$TMPL['is_post_saved'] = $is_post_saved?'true':'false';
$skin=new skin($_markup_file);
$list.=$skin->make();
}
}
$result['list'] = $list;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,86 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
// 포스트 공개관련
$d['displaySet'] = "||비공개,lock||일부공개,how_to_reg||미등록,insert_link||회원공개,people_alt||전체공개,public";
$g['displaySet']['label'] = [];
$g['displaySet']['icon'] = [];
$displaySet=explode('||',$d['displaySet']);
foreach ($displaySet as $displayLine) {
$dis=explode(',',$displayLine);
array_push($g['displaySet']['label'], $dis[0]);
array_push($g['displaySet']['icon'], $dis[1]);
}
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$sort = 'uid';
$orderby= $orderby ? $orderby : 'desc';
$recnum = $recnum && $recnum < 200 ? $recnum : 15;
$sqlque = 'mbruid='.$my['uid'].' and module="post"';
$TCD = getDbArray($table['s_saved'],$sqlque,'entry',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table[$m.'data'],'uid='.$_R['entry'],'*');
$NUM = getDbRows($table['s_saved'],$sqlque);
$TPG = getTotalPage($NUM,$recnum);
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$result=array();
$result['error'] = false;
$list='';
$TMPL['start']=$start;
if (!empty($RCD)) {
foreach ($RCD as $R) {
if (!$R['uid']) continue;
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=stripslashes($R['subject']);
$TMPL['format'] = $formats[$R['format']];
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['hit']=$R['hit'];
$TMPL['post_url']=getPostLink($R,0);
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_16by9_sm'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'320x180'):getPreviewResize('/files/noimage.png','320x180');
$TMPL['has_featured'] = !$R['featured_img']?'d-none':'';
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$TMPL['display']=$R['display']!=5?$g['displaySet']['icon'][$R['display']]:'';
$skin=new skin($markup_file);
$list.=$skin->make();
}
}
$result['list'] = $list;
$result['num'] = $NUM;
$result['tpg']= $TPG;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,58 @@
<?php
if(!defined('__KIMS__')) exit;
$recnum = $_POST['recnum'];
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'mod/_post.php';
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
$TMPL['start']=$start;
} else {
$theme = $d['post']['skin_main'];
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$mbruid = $my['uid'];
$result=array();
$result['error'] = false;
$list='';
$TMPL['start']=$start;
foreach ($RCD as $R) {
$TMPL['link']=getPostLink($R,1);
$TMPL['subject']=checkPostPerm($R)?stripslashes($R['subject']):'[비공개 포스트]';
$TMPL['format'] = $R['format'];
$TMPL['uid']=$R['uid'];
$TMPL['cid']=$R['cid'];
$TMPL['hit']=$R['hit'];
$TMPL['comment']=$R['comment'].($R['oneline']?'+'.$R['oneline']:'');
$TMPL['likes']=$R['likes'];
$TMPL['provider']=getFeaturedimgMeta($R,'provider');
$TMPL['videoId']=getFeaturedimgMeta($R,'provider')=='YouTube'?getFeaturedimgMeta($R,'name'):'';
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['featured_16by9_sm'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'320x180'):getPreviewResize('/files/noimage.png','320x180');
$TMPL['time'] = checkPostPerm($R)?getUpImageTime($R):'';
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'68');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
$skin=new skin($markup_file);
$list.=$skin->make();
}
$result['list'] = $list;
$result['num'] = $NUM;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,322 @@
<?php
if(!defined('__KIMS__')) exit;
$R = getUidData($table[$m.'data'],$uid);
if (!$my['uid'] || !$R['uid']) {
getLink('','','정상적인 접근이 아닙니다.','');
}
$result=array();
$result['error'] = false;
$data = array();
$new_date = date("Ymd", strtotime($d_start.' -1 '.$unit));
// 디바이스별 접속구분
if ($mod=='device') {
$type = 'pie';
$mobile=0;
$desktop=0;
while(true) {
if ($unit=='month') {
$_new_date = date("Y/m", strtotime($new_date. '+1 month'));
$new_date = date("Ymd", strtotime($new_date. '+1 month'));
} else {
$_new_date = date("m/d", strtotime($new_date. '+1 day'));
$new_date = date("Ymd", strtotime($new_date. '+1 day'));
}
$_R = getDbData($table[$m.$unit],'date ='.$new_date.' and data='.$R['uid'],'*');
$mobile+=$_R['mobile'];
$desktop+=$_R['desktop'];
if ($unit=='month') {
if(substr($new_date,0,6) == date('Ym', strtotime("now"))) break;
} else {
if($new_date == date('Ymd', strtotime("now"))) break;
}
}
$data['labels'] = array ('모바일','데스크탑');
$data['datasets']= array (
array (
'label' => '디바이스별 접속 현황',
'backgroundColor' => array('#007bff', '#563d7c'),
'data' => array($mobile, $desktop)
)
);
}
// 내외부 접속구분
if ($mod=='side') {
$type='pie';
$outside=0;
$inside=0;
while(true) {
if ($unit=='month') {
$_new_date = date("Y/m", strtotime($new_date. '+1 month'));
$new_date = date("Ymd", strtotime($new_date. '+1 month'));
} else {
$_new_date = date("m/d", strtotime($new_date. '+1 day'));
$new_date = date("Ymd", strtotime($new_date. '+1 day'));
}
$_R = getDbData($table[$m.$unit],'date ='.$new_date.' and data='.$R['uid'],'*');
$outside+=$_R['outside'];
$inside+=$_R['inside'];
if ($unit=='month') {
if(substr($new_date,0,6) == date('Ym', strtotime("now"))) break;
} else {
if($new_date == date('Ymd', strtotime("now"))) break;
}
}
$data['labels'] = array ('외부 및 직접접속','내부');
$data['datasets']= array (
array (
'label' => '접속구분',
'backgroundColor' => array('#007bff', '#555'),
'data' => array($outside, $inside)
)
);
}
// 외부 유입추이
if ($mod=='referer') {
$type='bar';
$inside=0;$yt=0;$kt=0;$ks=0;$bd=0;$ig=0;$fb=0;$tt=0;$nb=0;$etc=0;
while(true) {
if ($unit=='month') {
$_new_date = date("Y/m", strtotime($new_date. '+1 month'));
$new_date = date("Ymd", strtotime($new_date. '+1 month'));
} else {
$_new_date = date("m/d", strtotime($new_date. '+1 day'));
$new_date = date("Ymd", strtotime($new_date. '+1 day'));
}
$_R = getDbData($table[$m.$unit],'date ='.$new_date.' and data='.$R['uid'],'*');
$inside+=$_R['inside'];
$yt+=$_R['yt'];
$kt+=$_R['kt'];
$ks+=$_R['ks'];
$bd+=$_R['bd'];
$ig+=$_R['ig'];
$fb+=$_R['fb'];
$tt+=$_R['tt'];
$nb+=$_R['nb'];
if ($unit=='month') {
if(substr($new_date,0,6) == date('Ym', strtotime("now"))) break;
} else {
if($new_date == date('Ymd', strtotime("now"))) break;
}
}
$etc = $R['hit']-($yt+$kt+$ks+$bd+$ig+$fb+$tt+$nb)-$inside;
$data['labels'] = array ('내부','유튜브','카카오톡','카카오스토리','밴드','인스타그램','페이스북','트위터','네이버 블로그','기타');
$data['datasets']= array (
array (
'label' => '내부유입',
'backgroundColor' => array('#888888','#ff0000', '#e4d533','#ff9400', '#1bcc21','#b50189', '#3a5896','#007bff','#40cd19','#444444'),
'data' => array($inside,$yt,$kt,$ks,$bd,$ig,$fb,$tt,$nb,$etc)
)
);
$options['scales']['yAxes'] = array (array('display'=>true,'scaleLabel' => array ('display'=>true,'labelString'=>'유입수')));
}
if ($mod=='hit' || $mod=='likes' || $mod=='dislikes' || $mod=='comment') {
$labelsArray = array ();
$dataArray = array ();
$dataytArray = array ();
$dataktArray = array ();
$dataksArray = array ();
$databdArray = array ();
$dataigArray = array ();
$datafbArray = array ();
$datattArray = array ();
$datanbArray = array ();
$yt=0;$kt=0;$ks=0;$bd=0;$ig=0;$fb=0;$tt=0;$nb=0;
while(true) {
if ($unit=='month') {
$_new_date = date("Y/m", strtotime($new_date. '+1 month'));
$new_date = date("Ymd", strtotime($new_date. '+1 month'));
} else {
$_new_date = date("m/d", strtotime($new_date. '+1 day'));
$new_date = date("Ymd", strtotime($new_date. '+1 day'));
}
$_R = getDbData($table[$m.$unit],'date ='.$new_date.' and data='.$R['uid'],'*');
array_push($labelsArray, $_new_date);
array_push($dataArray, $_R[$mod]?$_R[$mod]:0);
array_push($dataytArray, $_R['yt']?$_R['yt']:0);$yt+=$_R['yt'];
array_push($dataktArray, $_R['kt']?$_R['kt']:0);$kt+=$_R['kt'];
array_push($dataksArray, $_R['ks']?$_R['ks']:0);$ks+=$_R['ks'];
array_push($databdArray, $_R['bd']?$_R['bd']:0);$bd+=$_R['bd'];
array_push($dataigArray, $_R['ig']?$_R['ig']:0);$ig+=$_R['ig'];
array_push($datafbArray, $_R['fb']?$_R['fb']:0);$fb+=$_R['fb'];
array_push($datattArray, $_R['tt']?$_R['tt']:0);$tt+=$_R['tt'];
array_push($datanbArray, $_R['nb']?$_R['nb']:0);$nb+=$_R['nb'];
if ($unit=='month') {
if(substr($new_date,0,6) == date('Ym', strtotime("now"))) break;
} else {
if($new_date == date('Ymd', strtotime("now"))) break;
}
}
$type='line';
$data['labels'] = $labelsArray;
if ($mod=='hit') {
$data['datasets']= array (
array (
'label' => '조회수',
'borderColor' => array('#999999'),
'backgroundColor' => array('#999999'),
'data' => $dataArray,
'fill' => false,
)
);
if ($yt) {
array_push($data['datasets'], array (
'label' => '유튜브',
'borderColor' => array('#ff0000'),
'backgroundColor' => array('#ff0000'),
'data' => $dataytArray,
'fill' => false,
));
}
if ($kt) {
array_push($data['datasets'], array (
'label' => '카카오톡',
'borderColor' => array('#e4d533'),
'backgroundColor' => array('#e4d533'),
'data' => $dataktArray,
'fill' => false,
));
}
if ($ks) {
array_push($data['datasets'], array (
'label' => '카카오스토리',
'borderColor' => array('#ff9400'),
'backgroundColor' => array('#ff9400'),
'data' => $dataksArray,
'fill' => false,
));
}
if ($bd) {
array_push($data['datasets'], array (
'label' => '밴드',
'borderColor' => array('#1bcc21'),
'backgroundColor' => array('#1bcc21'),
'data' => $databdArray,
'fill' => false,
));
}
if ($ig) {
array_push($data['datasets'], array (
'label' => '인스타그램',
'borderColor' => array('#b50189'),
'backgroundColor' => array('#b50189'),
'data' => $dataigArray,
'fill' => false,
));
}
if ($fb) {
array_push($data['datasets'], array (
'label' => '페이스북',
'borderColor' => array('#3a5896'),
'backgroundColor' => array('#3a5896'),
'data' => $datafbArray,
'fill' => false,
));
}
if ($tt) {
array_push($data['datasets'], array (
'label' => '트위터',
'borderColor' => array('#007bff'),
'backgroundColor' => array('#007bff'),
'data' => $datattArray,
'fill' => false,
));
}
if ($nb) {
array_push($data['datasets'], array (
'label' => '네이버 블로그',
'borderColor' => array('#40cd19'),
'backgroundColor' => array('#40cd19'),
'data' => $datanbArray,
'fill' => false,
));
}
$options['scales']['xAxes'] = array (array('display'=>true,'scaleLabel' => array ('display'=>true,'labelString'=>'기간')));
$options['scales']['yAxes'] = array (array('display'=>true,'scaleLabel' => array ('display'=>true,'labelString'=>'외부 유입수')));
// $options['tooltips'] = array ('mode'=>'index');
}
if ($mod=='likes') {
$data['datasets']= array (
array (
'label' => '좋아요 추이',
'backgroundColor' => array('#d4edda'),
'borderColor' => array('#155724'),
'data' => $dataArray
)
);
}
if ($mod=='dislikes') {
$data['datasets']= array (
array (
'label' => '싫어요 추이',
'backgroundColor' => array('#f8d7da'),
'borderColor' => array('#721c24'),
'data' => $dataArray
)
);
}
if ($mod=='comment') {
$data['datasets']= array (
array (
'label' => '댓글 추이',
'backgroundColor' => array('#fff3cd'),
'borderColor' => array('#856404'),
'data' => $dataArray
)
);
}
}
$result['type'] = $type;
$result['data'] = $data;
$result['options'] = $options;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,195 @@
<?php
if(!defined('__KIMS__')) exit;
require_once $g['path_core'].'function/sys.class.php';
include_once $g['dir_module'].'lib/action.func.php';
require_once $g['dir_module'].'lib/base.class.php';
require_once $g['dir_module'].'lib/module.class.php';
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
$post = new Post();
$post->theme_name = $theme;
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$mbruid = $my['uid'];
$_IS_POSTMBR=getDbRows($table[$m.'member'],'mbruid='.$my['uid'].' and data='.$uid);
$_IS_POSTOWN=getDbRows($table[$m.'member'],'mbruid='.$my['uid'].' and data='.$uid.' and level=1');
$_perm['post_member'] = $my['admin'] || $_IS_POSTMBR ? true : false;
$_perm['post_owner'] = $my['admin'] || $_IS_POSTOWN ? true : false;
$check_like_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."' and opinion='like'";
$check_dislike_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."' and opinion='dislike'";
$check_saved_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."'";
$is_post_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_post_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
$is_post_saved = getDbRows($table['s_saved'],$check_saved_qry);
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$result=array();
$uid = $_POST['uid']; // 포스트 고유번호
$R = getUidData($table[$m.'data'],$uid);
$mod = 'view';
$d['post']['isperm'] = true;
include_once $g['dir_module'].'mod/_view.php';
if ($list) {
$LIST=getDbData($table[$m.'list'],"id='".$list."'",'*');
$_WHERE = 'site='.$s;
$_WHERE .= ' and list="'.$LIST['uid'].'"';
$TCD = getDbArray($table[$m.'list_index'],$_WHERE,'*','gid','asc',11,1);
$NUM = getDbRows($table[$m.'list_index'],$_WHERE);
while($_R = db_fetch_array($TCD)) $LCD[] = getDbData($table[$m.'data'],'uid='.$_R['data'],'*');
$TMPL['list_name'] = $LIST['name'];
$TMPL['list_num'] = $LIST['num'];
$TMPL['list_id'] = $LIST['id'];
$TMPL['list_mbrnic'] = getProfileInfo($LIST['mbruid'],'nic');
$listPost = '';
foreach ($LCD as $_L) {
$TMPL['L_active']=$_L['uid']==$uid?'table-view-active':'';
$TMPL['L_uid']=$_L['uid'];
$TMPL['L_cid']=$_L['cid'];
$TMPL['L_subject']=checkPostPerm($_L)?stripslashes($_L['subject']):'[비공개 포스트]';
$TMPL['L_featured_16by9_sm'] = checkPostPerm($_L)?getPreviewResize(getUpImageSrc($_L),'240x134'):getPreviewResize('/files/noimage.png','240x134');
$TMPL['L_featured_16by9'] = checkPostPerm($_L)?getPreviewResize(getUpImageSrc($_L),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['L_time'] = checkPostPerm($_L)?getUpImageTime($_L):'';
$TMPL['L_provider']=getFeaturedimgMeta($_L,'provider');
$TMPL['L_videoId']=getFeaturedimgMeta($_L,'provider')=='YouTube'?getFeaturedimgMeta($_L,'name'):'';
$TMPL['L_format']=$formats[$_L['format']];
$skin_listPost=new skin('view_listPost');
$listPost.=$skin_listPost->make();
}
$TMPL['listPost'] = $listPost;
$skin_listCollapse=new skin('view_list-collapse');
$result['listCollapse']=$skin_listCollapse->make();
}
$TMPL['list_name'] = $LIST['name'];
$TMPL['list_num'] = $LIST['num'];
$TMPL['uid'] = $R['uid'];
$TMPL['cid'] = $R['cid'];
$TMPL['mbruid'] = $R['mbruid'];
$TMPL['profile_url']=getProfileLink($R['mbruid']);
$TMPL['post_url']=getPostLink($R,0);
$TMPL['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$TMPL['num_follower'] = number_format(getProfileInfo($R['mbruid'],'num_follower'));
$TMPL['avatar'] = getAvatarSrc($R['mbruid'],'150');
$TMPL['nic'] = getProfileInfo($R['mbruid'],'nic');
if ($R['format']==2) $TMPL['subject'] = stripslashes($R['subject']);
else $TMPL['subject']=getContents($R['subject'],$R['html']);
$TMPL['review'] = stripslashes($R['review']);
$TMPL['content'] = getContents($R['content'],'HTML');
$TMPL['hit'] = $R['hit'];
$TMPL['likes'] = $R['likes'];
$TMPL['dislikes'] = $R['dislikes'];
$TMPL['comment'] = $R['comment']?number_format($R['comment']):'';
$TMPL['oneline'] = $R['oneline']?'+'.$R['oneline']:'';
$TMPL['tag'] = $R['tag']?getPostTag($R['tag']):'';
$TMPL['d_regis'] = getDateFormat($R['d_regis'],'Y.m.d H:i');
$TMPL['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$TMPL['isFollowing'] = $_isFollowing ?'active':'';
$TMPL['view_follow'] = $my['uid']!=$R['mbruid']?$post->getHtml('view_follow'):'';
$TMPL['view_opinion'] = $my['uid']&&$R['likes']&&!$R['dis_like'] ?$post->getHtml('view_opinion'):'';
$result['subject'] = stripslashes($R['subject']);
$result['featured_16by9'] = checkPostPerm($R)?getPreviewResize(getUpImageSrc($R),'640x360'):getPreviewResize('/files/noimage.png','640x360');
$result['nic'] = getProfileInfo($R['mbruid'],'nic');
$result['dis_like'] = $R['dis_like']?$R['dis_like']:'';
$result['dis_rating'] = $R['dis_rating']?$R['dis_rating']:'';
$result['dis_comment'] = $R['dis_comment']?$R['dis_comment']:'';
$result['dis_listadd'] = $R['dis_listadd']?$R['dis_listadd']:'';
$result['goods'] = $R['goods'];
//최근 포스트
$postque = 'mbruid='.$R['mbruid'].' and site='.$s.' and data <>'.$R['uid'];
if ($my['uid']) $postque .= ' and display > 3'; // 회원공개와 전체공개 포스트 출력
else $postque .= ' and display = 5'; // 전체공개 포스트만 출력
$_RCD=getDbArray($table['postmember'],$postque,'*','gid','asc',6,1);
while($_R = db_fetch_array($_RCD)) $RCD[] = getDbData($table['postdata'],'gid='.$_R['gid'],'*');
$_NUM = getDbRows($table['postmember'],$postque);
$newPost = '';
if ($_NUM) {
foreach ($RCD as $POST) {
$TMPL['newpost_uid']=$POST['uid'];
$TMPL['newpost_cid']=$POST['cid'];
$TMPL['newpost_format']=$formats[$POST['format']];
$TMPL['newpost_subject']=stripslashes($POST['subject']);
$TMPL['newpost_featured_16by9'] = getPreviewResize(getUpImageSrc($POST),'640x360');
$TMPL['newpost_featured_16by9_sm'] = getPreviewResize(getUpImageSrc($POST),'320x180');
$TMPL['newpost_has_featured'] = $POST['featured_img']?'':'d-none';
$TMPL['newpost_provider']=getFeaturedimgMeta($POST,'provider');
$TMPL['newpost_videoId']=getFeaturedimgMeta($POST,'provider')=='YouTube'?getFeaturedimgMeta($POST,'name'):'';
$TMPL['newpost_hit']=$POST['hit'];
$TMPL['newpost_d_modify'] = getDateFormat($POST['d_modify']?$POST['d_modify']:$POST['d_regis'],'c');
$TMPL['newpost_nic'] = getProfileInfo($POST['mbruid'],'nic');
$TMPL['newpost_time'] = getUpImageTime($POST);
$skin_newPost=new skin('view_newPost');
$newPost.=$skin_newPost->make();
}
}
$TMPL['newPost'] = $newPost;
if (!checkPostPerm($R)){
$markup_file = '_404';
$result['isperm'] = false;
} else {
$result['isperm'] = true;
$result['linkurl']=getFeaturedimgMeta($R,'linkurl');
}
if ($is_post_liked) $result['is_post_liked'] = 1;
if ($is_post_disliked) $result['is_post_disliked'] = 1;
if ($is_post_saved) $result['is_post_saved'] = 1;
$markup_file = $markup_file?$markup_file:'view_doc_content';
$skin=new skin($markup_file);
$result['error'] = false;
$result['review']= stripslashes($R['review']);
$result['article']=$skin->make();
$result['theme'] = $theme;
//첨부링크 및 파일
$theme_attach= '_mobile/rc-post-file';
$theme_link= '_mobile/rc-post-link';
include_once $g['path_module'].'mediaset/themes/'.$theme_attach.'/main.func.php';
include_once $g['path_module'].'mediaset/themes/'.$theme_link.'/main.func.php';
if($R['upload']) {
if ($AttachListType == 'object') {
$result['photo'] = getAttachObjectArray($R,'photo');
} else {
$result['attachNum'] = getAttachNum($R['upload'],'view');
$result['file'] = getAttachFileList($R,'view','file',$theme_attach);
$result['photo'] = getAttachFileList($R,'view','photo',$theme_attach);
$result['video'] = getAttachFileList($R,'view','video',$theme_attach);
$result['link'] = getAttachPlatformList($R,'view','link');
}
$result['theme_attachFile'] = $theme_attach;
}
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,116 @@
<?php
if(!defined('__KIMS__')) exit;
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/'.$m.'.var.php';
$svfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $svfile;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$theme = $d['post']['skin_mobile'];
} else {
$theme = $d['post']['skin_main'];
}
// 포스트 공개관련
$d['displaySet'] = "||비공개,lock||일부공개,how_to_reg||미등록,insert_link||회원공개,people_alt||전체공개,public";
$g['displaySet']['label'] = [];
$g['displaySet']['icon'] = [];
$displaySet=explode('||',$d['displaySet']);
foreach ($displaySet as $displayLine) {
$dis=explode(',',$displayLine);
array_push($g['displaySet']['label'], $dis[0]);
array_push($g['displaySet']['icon'], $dis[1]);
}
include_once $g['dir_module'].'themes/'.$theme.'/_var.php';
$mbruid = $my['uid'];
$_IS_POSTMBR=getDbRows($table[$m.'member'],'mbruid='.$my['uid'].' and data='.$uid);
$_IS_POSTOWN=getDbRows($table[$m.'member'],'mbruid='.$my['uid'].' and data='.$uid.' and level=1');
$_perm['post_member'] = $my['admin'] || $_IS_POSTMBR ? true : false;
$_perm['post_owner'] = $my['admin'] || $_IS_POSTOWN ? true : false;
$check_like_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."' and opinion='like'";
$check_dislike_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."' and opinion='dislike'";
$check_saved_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."'";
$is_post_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_post_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
$is_post_saved = getDbRows($table['s_saved'],$check_saved_qry);
$formats = explode(',', $d['theme']['format']);array_unshift($formats,'');
$result=array();
$uid = $_POST['uid']; // 포스트 고유번호
$R = getUidData($table[$m.'data'],$uid);
$mod = 'write';
$d['post']['isperm'] = true;
$goodsArry = getArrayString($R['goods']);
include_once $g['dir_module'].'mod/_view.php';
$result['uid'] = $R['uid'];
$result['avatar'] = getAvatarSrc($R['mbruid'],'48');
$result['featured'] = getPreviewResize(getUpImageSrc($R),'240x134');
$result['featured_img'] = $R['featured_img']?$R['featured_img']:'';
if ( ($date['totime']-$R['d_regis']) < 5 ) {
$result['display'] = 5;
$result['display_label']=$g['displaySet']['label'][5];
} else {
$result['display'] = $R['display'];
$result['display_label']=$g['displaySet']['label'][$R['display']];
}
$result['format'] = $R['format'];
$result['upload'] = $R['upload'];
$result['time'] = getUpImageTime($R)?getUpImageTime($R):'';
$result['nic'] = getProfileInfo($R['mbruid'],'nic');
$result['subject'] = stripslashes($R['subject']);
$result['review'] = stripslashes($R['review']);
$result['content'] = getContents($R['content'],'HTML');
$result['tag'] = $R['tag']?$R['tag']:'';
$result['d_regis'] = getDateFormat($R['d_regis'],'Y.m.d H:i');
$result['d_modify'] = getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c');
$result['nic'] = getProfileInfo($R['mbruid'],'nic');
$result['dis_like'] = $R['dis_like']?$R['dis_like']:'';
$result['dis_rating'] = $R['dis_rating']?$R['dis_rating']:'';
$result['dis_comment'] = $R['dis_comment']?$R['dis_comment']:'';
$result['dis_listadd'] = $R['dis_listadd']?$R['dis_listadd']:'';
if($R['upload']) {
//첨부링크 및 파일
$theme_attach= '_mobile/rc-post-file';
$theme_link= '_mobile/rc-post-link';
include_once $g['path_module'].'mediaset/themes/'.$theme_attach.'/main.func.php';
include_once $g['path_module'].'mediaset/themes/'.$theme_link.'/main.func.php';
$result['attachNum'] = getAttachNum($R['upload'],'modify');
$result['theme_attachFile'] = $theme_attach;
}
if ($R['goods']) {
$result['goods'] = $R['goods'];
$result['goodsNum'] = count($goodsArry['data']);
}
if (!checkPostPerm($R)){
$markup_file = '_404';
$result['isperm'] = false;
} else {
$result['isperm'] = true;
$result['linkurl']=getFeaturedimgMeta($R,'linkurl');
}
if ($is_post_liked) $result['is_post_liked'] = 1;
if ($is_post_disliked) $result['is_post_disliked'] = 1;
if ($is_post_saved) $result['is_post_saved'] = 1;
$result['error'] = false;
echo json_encode($result);
exit;
?>

View File

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

View File

@@ -0,0 +1,19 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid'] || !$type) getLink('','','정상적인 접근이 아닙니다.','');
$i = 1;
if ($type=='list') {
foreach($listmembers as $val) getDbUpdate($table[$m.'list'],'gid='.($i++),'uid='.$val);
setrawcookie('list_action_result', rawurlencode('순서가 변경되었습니다.|success')); // 처리여부 cookie 저장
}
if ($type=='post') {
foreach($listmembers as $val) getDbUpdate($table[$m.'list_index'],'gid='.($i++),'data='.$val);
setrawcookie('listview_action_result', rawurlencode('순서가 변경되었습니다.|success')); // 처리여부 cookie 저장
}
getLink('reload','parent.','','');
?>

View File

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

View File

@@ -0,0 +1,53 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
include_once $g['dir_module'].'var/var.php';
foreach ($post_members as $val)
{
$R=getUidData($table[$m.'data'],$val);
if (!$R['uid']) continue;
$IDX = getDbSelect($table[$m.'index'],'data='.$R['uid'],'*');
while($I=db_fetch_array($IDX)) {
getDbUpdate($table[$m.'category'],'num=num-1','uid='.$I['category']); //카테고리 등록 포스트 수 조정
}
getDbDelete($table[$m.'data'],'uid='.$R['uid']); //데이터삭제
getDbDelete($table[$m.'index'],'data='.$R['uid']);//인덱스삭제
getDbDelete($table[$m.'member'],'data='.$R['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_numinfo'],'upload=upload-1',"date='".substr($U['d_regis'],0,8)."' and site=".$U['site']);
getDbDelete($table['s_upload'],'uid='.$U['uid']);
if ($U['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);
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'].$m.'/'.$U['folder'].'/'.$U['tmpname']);
}
}
}
}
}

View File

@@ -0,0 +1,140 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid']) getLink('reload','parent.','정상적인 접근이 아닙니다.','');
$mbruid = $my['uid'];
$last_log = $date['totime'];
$id = $id ? trim($id) : substr($g['time_srnad'],9,7);;
$name = str_replace('"','“',$name);
$name = addslashes(htmlspecialchars(trim($name)));
if ($uid) {
$R = getUidData($table[$m.'list'],$uid);
if ($R['mbruid']!=$mbruid) getLink('reload','parent.','정상적인 접근이 아닙니다.','');
if ($type=='name') {
if (!$name) getLink('reload','parent.','리스트 이름을 입력해 주세요.','');
if(getDbRows($table[$m.'list'],"name='".$name."' and mbruid=".$mbruid." and uid<>".$R['uid'])) getLink('reload','parent.','이미 같은 이름의 리스트가 존재합니다.','');
getDbUpdate($table[$m.'list'],'name="'.$name.'",d_last='.$last_log,'uid='.$R['uid']); //리스트명 조정
setrawcookie('listview_action_result', rawurlencode('리스트명이 수정 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
}
if ($type=='review') {
$result=array();
$result['error'] = false;
$review = str_replace(array("\r", "\n"), '', $content);
$QVAL = "review='$review',d_last='$last_log'";
getDbUpdate($table[$m.'list'],$QVAL,'uid='.$R['uid']);
$_list = getUidData($table[$m.'list'],$R['uid']);
$result['content'] = getContents($_list['review'],'TEXT');
echo json_encode($result);
exit;
}
if ($type=='display') {
$result=array();
$result['error'] = false;
echo json_encode($result);
getDbUpdate($table[$m.'list'],'display='.$display,'uid='.$R['uid']);
getDbUpdate($table[$m.'list_member'],'display='.$display,'list='.$R['uid']);
exit;
}
if ($type=='tag') {
$result=array();
$result['error'] = false;
echo json_encode($result);
getDbUpdate($table[$m.'list'],'tag="'.$tag.'"','uid='.$R['uid']);
// 태그등록
if ($tag || $R['tag'])
{
$_tagarr1 = array();
$_tagarr2 = explode(',',$tag);
$_tagdate = $date['today'];
if ($R['uid'])
{
$_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'");
}
}
setrawcookie('listview_action_result', rawurlencode($name.' 태그가 저장 되었습니다.|success')); // 처리여부 cookie 저장
exit;
}
} else {
if (!$name) getLink('reload','parent.','리스트 이름을 입력해 주세요.','');
if (!$id) getLink('reload','parent.','아이디를 입력해 주세요.','');
if(getDbRows($table[$m.'list'],"id='".$id."'")) getLink('reload','parent.','이미 같은 아이디의 리스트가 존재합니다.','');
if(getDbRows($table[$m.'list'],"name='".$name."' and mbruid=".$mbruid)) {
if ($send_mod == 'ajax') {
$result['error'] = 'name_exists';
echo json_encode($result);
exit;
} else {
getLink('reload','parent.','이미 같은 이름의 리스트가 존재합니다.','');
}
}
$display = $display?$display:1;
$maxgid = getDbCnt($table[$m.'list'],'max(gid)','');
$gid = $maxgid ? $maxgid+1 : 1;
$QKEY = "gid,site,id,name,mbruid,display,num,d_last,d_regis,imghead,imgfoot,puthead,putfoot,addinfo,writecode";
$QVAL = "'$gid','$s','$id','$name','$mbruid','$display','0','$last_log','$last_log','$imghead','$imgfoot','$puthead','$putfoot','$addinfo','$writecode'";
getDbInsert($table[$m.'list'],$QKEY,$QVAL);
getDbUpdate($table['s_mbrdata'],'num_list=num_list+1','memberuid='.$my['uid']); //회원 리스트수 조정
$LASTUID = getDbCnt($table[$m.'list'],'max(uid)','');
$QKEY2 = "mbruid,site,gid,list,display,auth,level,d_regis";
$QVAL2 = "'$mbruid','$s','$gid','$LASTUID','$display','1','1','$last_log'";
getDbInsert($table[$m.'list_member'],$QKEY2,$QVAL2);
if ($send_mod == 'ajax') {
$_R = getUidData($table[$m.'list'],$LASTUID);
$result=array();
$result['error'] = false;
$result['uid'] = $LASTUID;
$result['id'] = $_R['id'];
$result['icon'] = $g['displaySet']['icon'][$_R['display']];
$result['label'] = $g['displaySet']['label'][$_R['display']];
echo json_encode($result);
exit;
} else {
setrawcookie('list_action_result', rawurlencode($name.' 리스트가 추가 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
}
}
?>

View File

@@ -0,0 +1,57 @@
<?php
if(!defined('__KIMS__')) exit;
$_IS_POSTOWN=getDbRows($table[$m.'member'],'mbruid='.$my['uid'].' and data='.$data.' and level=1');
if (!$_IS_POSTOWN) getLink('reload','parent.','정상적인 접근이 아닙니다.','');
if(!getDbRows($table['s_mbrdata'],'nic="'.$nic.'"')) getLink('reload','parent.','존재하지 않는 회원입니다.','');
$R = getUidData($table[$m.'data'],$data);
$M = getDbData($table['s_mbrdata'],'nic="'.$nic.'"','*');
$mbruid = $M['memberuid'];
$d_regis = $date['totime'];
$gid = $R['gid'];
$display = $R['display'];
if(getDbRows($table[$m.'member'],'data='.$data.' and mbruid='.$mbruid)) getLink('reload','parent.','포스트에 이미 존재합니다.','');
$QKEY = "mbruid,site,gid,data,display,auth,level,d_regis";
$QVAL = "'$mbruid','$s','$gid','$data','$display','1','$level','$d_regis'";
getDbInsert($table[$m.'member'],$QKEY,$QVAL);
getDbUpdate($table['s_mbrdata'],'num_post=num_post+1','memberuid='.$mbruid); //추가회원 포스트수 조정
// 피드 인덱스 추가
if ($display>1) {
$_FCD = getDbArray($table['s_friend'],'by_mbruid='.$my['uid'],'my_mbruid','uid','asc',0,1);
while ($_F=db_fetch_array($_FCD)) {
$mbruid = $_F['my_mbruid'];
$module = $m;
$category = '';
$entry = $R['uid'];
$d_regis = $date['totime'];
$check_feed_qry = "mbruid='".$mbruid."' and module='".$module."' and entry='".$entry."'";
$is_feed = getDbRows($table['s_feed'],$check_feed_qry);
if (!$is_feed){
$_QKEY = 'site,mbruid,module,category,entry,d_regis';
$_QVAL = "'$s','$mbruid','$module','$category','$entry','$d_regis'";
getDbInsert($table['s_feed'],$_QKEY,$_QVAL);
} else {
getDbUpdate($table['s_feed'],'hidden=0',$check_feed_qry); //피드 인덱스 업데이트
}
}
}
$result=array();
$result['error'] = false;
$result['mbruid'] = $mbruid;
setrawcookie('post_action_result', rawurlencode('공유목록에 추가되었습니다.|success')); // 처리여부 cookie 저장
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,140 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$id = trim($id);
$codhead = trim($codhead);
$codfoot = trim($codfoot);
$recnum = trim($recnum);
// 임시-featured_img 필드 없는 경우, 생성
$_tmp = db_query("SHOW COLUMNS FROM ".$table[$m.'category']." WHERE `Field` = 'featured_img'",$DB_CONNECT);
if(!db_num_rows($_tmp)) {
$_tmp = ("alter table ".$table[$m.'category']." ADD featured_img varchar(50) NOT NULL");
db_query($_tmp, $DB_CONNECT);
}
if ($cat && !$vtype) {
$R = getUidData($table[$m.'category'],$cat);
$imghead = $R['imghead'];
$imgfoot = $R['imgfoot'];
$imgset = array('head','foot');
for ($i = 0; $i < 2; $i++)
{
$tmpname = $_FILES['img'.$imgset[$i]]['tmp_name'];
$realname = $_FILES['img'.$imgset[$i]]['name'];
$fileExt = strtolower(getExt($realname));
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
$userimg = sprintf('%05d',$R['uid']).'_'.$imgset[$i].'.'.$fileExt;
$saveFile = $g['path_file'].$m.'/category/'.$userimg;
if (is_uploaded_file($tmpname)) {
if (!strstr('[gif][jpg][png][swf]',$fileExt))
{
getLink('','','헤더/풋터파일은 gif/jpg/png/swf 파일만 등록할 수 있습니다.','');
}
if (!is_dir($g['path_file'].$m.'/category/')) {
mkdir($g['path_file'].$m.'/category/',0707);
}
move_uploaded_file($tmpname,$saveFile);
@chmod($saveFile,0707);
${'img'.$imgset[$i]} = $userimg;
}
}
$QVAL = "id='$id',hidden='$hidden',reject='$reject',name='$name',";
$QVAL.= "layout='$layout',layout_mobile='$layout_mobile',skin='$skin',skin_mobile='$skin_mobile',imghead='$imghead',imgfoot='$imgfoot',puthead='$puthead',putfoot='$putfoot',recnum='$recnum',sosokmenu='$sosokmenu',featured_img='$featured_img'";
getDbUpdate($table[$m.'category'],$QVAL,'uid='.$cat);
$vfile = $g['path_file'].$m.'/code/'.sprintf('%05d',$cat);
if (!is_dir($g['path_file'].$m.'/code/')) {
mkdir($g['path_file'].$m.'/code/',0707);
}
if (trim($codhead))
{
$fp = fopen($vfile.'.header.php','w');
fwrite($fp, trim(stripslashes($codhead)));
fclose($fp);
@chmod($vfile.'.header.php',0707);
}
else {
if(is_file($vfile.'.header.php'))
{
unlink($vfile.'.header.php');
}
}
if (trim($codfoot))
{
$fp = fopen($vfile.'.footer.php','w');
fwrite($fp, trim(stripslashes($codfoot)));
fclose($fp);
@chmod($vfile.'.footer.php',0707);
}
else {
if(is_file($vfile.'.footer.php'))
{
unlink($vfile.'.footer.php');
}
}
if ($subcopy == 1)
{
include_once $g['dir_module'].'_main.php';
$subQue = getPostCategoryCodeToSql($table[$m.'category'],$cat,'uid');
if ($subQue)
{
getDbUpdate($table[$m.'category'],"hidden='".$hidden."',reject='".$reject."',layout='".$layout."',layout_mobile='".$layout_mobile."',skin='".$skin."',skin_mobile='".$skin_mobile."'","uid <> ".$cat." and (".$subQue.")");
}
}
setrawcookie('result_post_category', rawurlencode('카테고리 등록정보가 변경 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
}
else {
$MAXC = getDbCnt($table[$m.'category'],'max(gid)','depth='.($depth+1).' and parent='.$parent);
$sarr = explode(',' , trim($name));
$slen = count($sarr);
if ($depth > 4) getLink('','','카테고리는 최대 5단계까지 등록할 수 있습니다.','');
for ($i = 0 ; $i < $slen; $i++)
{
if (!$sarr[$i]) continue;
$gid = $MAXC+1+$i;
$xdepth = $depth+1;
$xname = trim($sarr[$i]);
$xnarr = explode('=',$xname);
$QKEY = "gid,site,id,is_child,parent,depth,hidden,reject,name,layout,layout_mobile,skin,skin_mobile,imghead,imgfoot,puthead,putfoot,recnum,num,sosokmenu,featured_img";
$QVAL = "'$gid','".$_HS['uid']."','".$xnarr[1]."','0','$parent','$xdepth','$hidden','$reject','$xnarr[0]','$layout','$layout_mobile','$skin','$skin_mobile','','','','','$recnum','0','$sosokmenu','$featured_img'";
getDbInsert($table[$m.'category'],$QKEY,$QVAL);
$lastcat = getDbCnt($table[$m.'category'],'max(uid)','');
if (!$xnarr[1]) {
getDbUpdate($table[$m.'category'],"id='".$lastcat."'",'uid='.$lastcat);
} else {
$ISCODE = getDbData($table[$m.'category'],"uid<> ".$lastcat." and id='".$xnarr[1]."' and site=".$s,'*');
if ($ISCODE['uid']) {
getDbUpdate($table[$m.'category'],"id='".$lastcat."'",'uid='.$lastcat);
}
}
}
if ($parent)
{
getDbUpdate($table[$m.'category'],'is_child=1','uid='.$parent);
}
db_query("OPTIMIZE TABLE ".$table[$m.'category'],$DB_CONNECT);
setrawcookie('result_post_category', rawurlencode('카테고리가 등록 되었습니다.'));
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=category&cat='.$lastcat.'&code='.($code?$code.'/'.$lastcat:$lastcat).'#site-cate-info','parent.','','');
}
?>

View File

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

View File

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

View File

@@ -0,0 +1,16 @@
<?php
if(!defined('__KIMS__')) exit;
$data = array();
$posts=getDbArray($table[$m.'data'],"mbruid=".$my['uid']." and subject like '%".$q."%'",'subject,cid','hit','desc','',1);
$postData = '';
while($R=db_fetch_array($posts)){
$link = '/post/write/'.$R['cid'];
$subject = str_replace(',', '', $R['subject']);
$postData .= $subject.'|'.$link.',';
}
$data['postlist'] = $postData;
echo json_encode($data);
exit;
?>

View File

@@ -0,0 +1,32 @@
<?php
if(!defined('__KIMS__')) exit;
$sort = 'gid'; // 정렬 기준
$orderby = 'asc'; // 정렬순서
$recnum = 100; // 출력갯수
$where = 'parent='.$parent.' and hidden=0';
$RCD = getDbArray($table[$m.'category'],$where,'*',$sort,$orderby,$recnum,1);
$NUM = getDbRows($table[$m.'category'],$where);
$result=array();
$result['error']=false;
$nav_links='';
$swiper_slides='';
$nav_links.='<div class="nav-link swiper-slide" data-category="'.$parent.'">전체보기</div>';
$swiper_slides='<div class="swiper-slide" data-category="'.$parent.'"></div>';
while($R = db_fetch_array($RCD)){
$nav_links.='<div class="nav-link swiper-slide" data-category="'.$R['uid'].'">'.$R['name'].'</div>';
$swiper_slides.='<div class="swiper-slide" data-category="'.$R['uid'].'"></div>';
}
$result['nav_links'] = $nav_links;
$result['swiper_slides'] = $swiper_slides;
$result['num'] = $NUM;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,55 @@
<?php
if(!defined('__KIMS__')) exit;
if (!$my['uid']) getLink('reload','parent.','정상적인 접근이 아닙니다.','');
$R = getUidData($table[$m.'data'],$uid);
$mbruid = $my['uid'];
$last_log = $date['totime'];
$display = $R['display'];
$subject = $R['subject'];
$category = '포스트';
// 저장함 업데이트
$check_saved_qry = "mbruid='".$mbruid."' and module='".$m."' and entry='".$uid."'";
$is_saved = getDbRows($table['s_saved'],$check_saved_qry);
if ($is_saved){ // 이미 저장했던 경우
getDbDelete($table['s_saved'],$check_saved_qry);
}else{ // 저장을 안한 경우 추가
$_QKEY = 'mbruid,module,category,entry,subject,url,d_regis';
$_QVAL = "'$mbruid','$m','$category','$uid','$subject','$url','$last_log'";
getDbInsert($table['s_saved'],$_QKEY,$_QVAL);
}
//리스트 업데이트
$_orign_list_members = getDbArray($table[$m.'list_index'],'data='.$R['uid'].' and mbruid='.$mbruid,'*','data','asc',0,1);
while($_olm=db_fetch_array($_orign_list_members)) {
if(!strstr($list_members,'['.$_olm['list'].']')) {
getDbDelete($table[$m.'list_index'],'list='.$_olm['list'].' and data='.$R['uid'].' and mbruid='.$mbruid);
getDbUpdate($table[$m.'list'],'num=num-1','uid='.$_olm['list']);
}
}
$_list_members = array();
$_list_members = getArrayString($list_members);
foreach($_list_members['data'] as $_lt1) {
if (getDbRows($table[$m.'list_index'],'data='.$uid.' and list='.$_lt1)) {
getDbUpdate($table[$m.'list_index'],'display='.$display,'data='.$uid.' and list='.$_lt1);
} else {
$maxgid = getDbCnt($table[$m.'list_index'],'max(gid)','');
$gid = $maxgid ? $maxgid+1 : 1;
getDbInsert($table[$m.'list_index'],'site,list,display,data,gid,mbruid',"'".$s."','".$_lt1."','".$display."','".$R['uid']."','".$gid."','".$mbruid."'");
getDbUpdate($table[$m.'list'],'num=num+1,d_last='.$last_log,'uid='.$_lt1);
}
}
$result=array();
$result['error'] = false;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,31 @@
<?php
if(!defined('__KIMS__')) exit;
$R = getUidData($table[$m.'data'],$uid);
$result=array();
$result['error']=false;
if (!$R['uid']) {
$result['error']=true;
}
$mbruid = $my['uid'];
$module = $m;
$category ='포스트';
$entry = $R['uid'];
$subject = addslashes($R['subject']);
$d_regis = $date['totime'];
$check_saved_qry = "mbruid='".$mbruid."' and module='".$module."' and entry='".$entry."'";
$is_saved = getDbRows($table['s_saved'],$check_saved_qry);
if (!$is_saved){ // 이미 저장했던 경우
$_QKEY = 'mbruid,module,category,entry,subject,url,d_regis';
$_QVAL = "'$mbruid','$module','$category','$entry','$subject','$url','$d_regis'";
getDbInsert($table['s_saved'],$_QKEY,$_QVAL);
}
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,349 @@
<?php
if(!defined('__KIMS__')) exit;
$g['postVarForSite'] = $g['path_var'].'site/'.$r.'/post.var.php';
$_tmpvfile = file_exists($g['postVarForSite']) ? $g['postVarForSite'] : $g['dir_module'].'var/var.php';
include_once $_tmpvfile;
if (!$my['admin']) {
if ($d['post']['perm_l_write'] > $my['level'] || strpos('_'.$d['post']['perm_g_write'],'['.$my['mygroup'].']') || !$my['uid']) {
$error_msg = '정상적인 접근이 아닙니다.';
if ($send_mod=='ajax') {
$result=array();
$result['error'] = $error_msg;
echo json_encode($result);
exit;
} else {
getLink('reload','parent.',$error_msg,'');
}
}
}
// member -> members 필드명 변경
$_tmp1 = db_query("SHOW COLUMNS FROM ".$table[$m.'data']." WHERE `Field` = 'members'",$DB_CONNECT);
if(!db_num_rows($_tmp1)) {
$_tmp1 = ("alter table ".$table[$m.'data']." CHANGE member members TEXT not null");
db_query($_tmp1, $DB_CONNECT);
}
include_once $g['dir_module'].'lib/action.func.php';
$mbruid = $author ? $author : $my['uid'];
$tag = trim($tag);
$subject = str_replace('"','“',$subject);
$subject = $subject?htmlspecialchars(trim($subject)):'(제목 없음)';
$review = trim($review);
$content = trim($content);
$d_regis = $date['totime']; // 최초 등록일
if($uid) $d_modify =$date['totime']; // 수정 등록일
else $d_modify=''; // 최초에는 수정일 없음
$ip = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$format= $format?$format:1;
$display= $display?$display:1;
$hidden = $display==1 || $display==2?1:0;
if ($d['post']['badword_action'])
{
$badwordarr = explode(',' , $d['post']['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['post']['badword_action'] == 1)
{
getLink('','','등록이 제한된 단어를 사용하셨습니다.','');
}
else {
$badescape = strCopy($badwordarr[$i],$d['post']['badword_escape']);
$content = str_replace($badwordarr[$i],$badescape,$content);
$subject = str_replace($badwordarr[$i],$badescape,$subject);
}
}
}
}
if (!$featured_img) $format = 1; //대표이미자가 없을 경우 무조건 doc 포맷지정
if ($uid) {
$result=array();
$result['error'] = false;
$R = getUidData($table[$m.'data'],$uid);
if (!$R['uid']) getLink('','','존재하지 않는 포스트입니다.','');
if (!checkPostOwner($R)) getLink('','','잘못된 접근입니다.','');
$log = $my[$_HS['nametype']].'|'.getDateFormat($date['totime'],'Y.m.d H:i').'<s>'.$R['log'];
$QVAL1 = "subject='$subject',review='$review',content='$content',tag='$tag',display='$display',hidden='$hidden',format='$format',";
$QVAL1 .="d_modify='$d_modify',category='$category_members',members='$members',upload='$upload',log='$log',featured_img='$featured_img',linkedmenu='$linkedmenu',dis_comment='$dis_comment',dis_like='$dis_like',dis_rating='$dis_rating',dis_listadd='$dis_listadd',goods='$goods'";
getDbUpdate($table[$m.'data'],$QVAL1,'uid='.$R['uid']);
//포스트 공유설정 업데이트
getDbUpdate($table[$m.'index'],'display='.$display.',format='.$format,'gid='.$R['gid']);
getDbUpdate($table[$m.'member'],'display='.$display.',format='.$format,'data='.$R['uid']);
getDbUpdate($table[$m.'day'],'display='.$display,'data='.$R['uid']); // 일별현황 업데이트 (인기 포스트 추출목적)
//카테고리 업데이트
$_orign_category_members = getDbArray($table[$m.'category_index'],'data='.$R['uid'],'*','data','asc',0,1);
while($_ocm=db_fetch_array($_orign_category_members)) {
if(!strstr($category_members,'['.$_ocm['category'].']')) {
getDbDelete($table[$m.'category_index'],'category='.$_ocm['category'].' and data='.$uid);
getDbUpdate($table[$m.'category'],'num=num-1','uid='.$_ocm['category']);
}
}
$_category_members = array();
$_category_members = getArrayString($category_members);
foreach($_category_members['data'] as $_ct1) {
if (getDbRows($table[$m.'category_index'],'data='.$uid.' and category='.$_ct1)) {
getDbUpdate($table[$m.'category_index'],'display='.$display.',format='.$format,'data='.$uid.' and category='.$_ct1);
} else {
$mingid = getDbCnt($table[$m.'data'],'min(gid)','');
$gid = $mingid ? $mingid-1 : 100000000;
$_ct1_info=getUidData($table[$m.'category'],$_ct1);
$_ct1_depth=$_ct1_info['depth'];
getDbInsert($table[$m.'category_index'],'site,data,category,display,format,depth,gid',"'".$s."','".$R['uid']."','".$_ct1."','".$display."','".$format."','".$_ct1_depth."','".$gid."'");
getDbUpdate($table[$m.'category'],'num=num+1','uid='.$_ct1);
}
}
//리스트 업데이트
$_orign_list_members = getDbArray($table[$m.'list_index'],'data='.$R['uid'].' and mbruid='.$mbruid,'*','data','asc',0,1);
while($_olm=db_fetch_array($_orign_list_members)) {
if(!strstr($list_members,'['.$_olm['list'].']')) {
getDbDelete($table[$m.'list_index'],'list='.$_olm['list'].' and data='.$R['uid'].' and mbruid='.$mbruid);
getDbUpdate($table[$m.'list'],'num=num-1','uid='.$_olm['list']);
}
}
$_list_members = array();
$_list_members = getArrayString($list_members);
foreach($_list_members['data'] as $_lt1) {
if (getDbRows($table[$m.'list_index'],'data='.$uid.' and list='.$_lt1)) {
getDbUpdate($table[$m.'list_index'],'display='.$display,'data='.$uid.' and list='.$_lt1);
} else {
$maxgid = getDbCnt($table[$m.'list_index'],'max(gid)','');
$gid = $maxgid ? $maxgid+1 : 1;
getDbInsert($table[$m.'list_index'],'site,list,display,data,gid,mbruid',"'".$s."','".$_lt1."','".$display."','".$R['uid']."','".$gid."','".$mbruid."'");
getDbUpdate($table[$m.'list'],'num=num+1,d_last='.$d_regis,'uid='.$_lt1);
}
}
//상품리뷰 인덱스 업데이트
if ($goods) {
$_orign_goods_members = getDbArray($table['shopreview'],'post='.$R['uid'],'*','post','asc',0,1);
while($_ogm=db_fetch_array($_orign_goods_members)) {
if(!strstr($goods,'['.$_ogm['goods'].']')) {
getDbDelete($table['shopreview'],'goods='.$_ogm['goods'].' and post='.$R['uid']);
getDbUpdate($table['shopdata'],'post=post-1','uid='.$_ogm['goods']);
}
}
$_goods_members = array();
$_goods_members = getArrayString($goods);
foreach($_goods_members['data'] as $_gd1) {
if (getDbRows($table['shopreview'],'post='.$uid.' and goods='.$_gd1)) {
getDbUpdate($table['shopreview'],'display='.$display,'post='.$uid.' and goods='.$_gd1);
} else {
$maxgid = getDbCnt($table['shopreview'],'max(gid)','');
$gid = $maxgid ? $maxgid+1 : 1;
getDbInsert($table['shopreview'],'site,goods,display,post,gid,auth',"'".$s."','".$_gd1."','".$display."','".$R['uid']."','".$gid."','1'");
getDbUpdate($table['shopdata'],'post=post+1,d_last='.$d_regis,'uid='.$_gd1);
}
}
}
// 피드 인덱스 추가
if ($display>3) {
$_FCD = getDbArray($table['s_friend'],'by_mbruid='.$my['uid'],'my_mbruid','uid','asc',0,1);
while ($_F=db_fetch_array($_FCD)) {
$mbruid = $_F['my_mbruid'];
$module = $m;
$category = '';
$entry = $R['uid'];
$d_regis = $date['totime'];
$check_feed_qry = "mbruid='".$mbruid."' and module='".$module."' and entry='".$entry."'";
$is_feed = getDbRows($table['s_feed'],$check_feed_qry);
if (!$is_feed){
$_QKEY = 'site,mbruid,module,category,entry,d_regis';
$_QVAL = "'$s','$mbruid','$module','$category','$entry','$d_regis'";
getDbInsert($table['s_feed'],$_QKEY,$_QVAL);
}
}
//피드 구데이터 삭제 (인덱스 용량 5000건 제한 )
$_REFCNT = getDbRows($table['s_feed'],'');
if ($_REFCNT > 5000) {
$_REFOVER = getDbArray($table['s_feed'],'','*','uid','asc',($_REFCNT - 4001),1);
while($_REFK=db_fetch_array($_REFOVER)) {
getDbDelete($table['s_feed'],'uid='.$_REFK['uid']); // 구 데이터삭제
}
}
if ($_REFCNT == 1000) {
db_query("OPTIMIZE TABLE ".$table['s_feed'],$DB_CONNECT);
}
}
getDbUpdate($table['s_feed'],'display='.$display,'module="'.$m.'" and entry='.$R['uid']); //피드 인덱스 업데이트
} else {
$members= $members?$members:'['.$mbruid.']';
$cid = substr($g['time_srnad'],9,7);
$mingid = getDbCnt($table[$m.'data'],'min(gid)','');
$maxgid = getDbCnt($table[$m.'data'],'max(gid)','');
$gid = $mingid ? $mingid-1 : 100000000.00;
$_gid = $maxgid ? $maxgid+1 : 1;
$log = $my[$_HS['nametype']].'|'.getDateFormat($date['totime'],'Y.m.d H:i').'<s>';
$QKEY1 = "site,gid,mbruid,cid,subject,review,content,tag,html,";
$QKEY1.= "hit,comment,oneline,d_regis,d_modify,d_comment,members,upload,log,display,hidden,featured_img,format,dis_comment,dis_like,dis_rating,dis_listadd,ip,agent";
$QVAL1 = "'$s','$gid','$mbruid','$cid','$subject','$review','$content','$tag','$html',";
$QVAL1.= "'0','0','0','$d_regis','','','$members','$upload','$log','$display','$hidden','$featured_img','$format','$dis_comment','$dis_like','$dis_rating','$dis_listadd','$ip','$agent'";
getDbInsert($table[$m.'data'],$QKEY1,$QVAL1);
getDbInsert($table[$m.'index'],'site,display,format,gid',"'$s','$display','$format','$gid'");
$LASTUID = getDbCnt($table[$m.'data'],'max(uid)','');
$QKEY2 = "mbruid,site,gid,data,display,format,auth,level,d_regis";
$QVAL2 = "'$mbruid','$s','$gid','$LASTUID','$display','$format','1','1','$d_regis'";
getDbInsert($table[$m.'member'],$QKEY2,$QVAL2);
if(!getDbRows($table['s_mbrmonth'],"date='".$date['month']."' and site=".$s.' and mbruid='.$mbruid)) {
getDbInsert($table['s_mbrmonth'],'date,site,mbruid,post_num',"'".$date['month']."','".$s."','".$mbruid."','0'");
}
if(!getDbRows($table['s_mbrday'],"date='".$date['today']."' and site=".$s.' and mbruid='.$mbruid)) {
getDbInsert($table['s_mbrday'],'date,site,mbruid,post_num',"'".$date['today']."','".$s."','".$mbruid."','0'");
}
getDbUpdate($table['s_mbrdata'],'num_post=num_post+1','memberuid='.$my['uid']); // 회원포스트 수량 +1
getDbUpdate($table['s_mbrmonth'],'post_num=post_num+1',"date='".$date['month']."' and site=".$s.' and mbruid='.$mbruid); //회원별 월별 수량등록
getDbUpdate($table['s_mbrday'],'post_num=post_num+1',"date='".$date['today']."' and site=".$s.' and mbruid='.$mbruid); //회원별 일별 수량등록
$_category_members = array();
$_category_members = getArrayString($category_members);
foreach($_category_members['data'] as $_ct1)
{
$_ct1_info=getUidData($table[$m.'category'],$_ct1);
$_ct1_depth=$_ct1_info['depth'];
if (!getDbRows($table[$m.'category_index'],'data='.$LASTUID.' and category='.$_ct1))
{
getDbInsert($table[$m.'category_index'],'site,data,category,depth,gid',"'".$s."','".$LASTUID."','".$_ct1."','".$_ct1_depth."','".$gid."'");
getDbUpdate($table[$m.'category'],'num=num+1','uid='.$_ct1);
}
}
$_list_members = array();
$_list_members = getArrayString($list_members);
foreach($_list_members['data'] as $_lt1) {
if (!getDbRows($table[$m.'list_index'],'data='.$LASTUID.' and list='.$_lt1)) {
getDbInsert($table[$m.'list_index'],'site,data,list,gid',"'".$s."','".$LASTUID."','".$_lt1."','".$_gid."'");
getDbUpdate($table[$m.'list'],'num=num+1,d_last='.$d_regis,'uid='.$_lt1);
}
}
if ($gid == 100000000)
{
db_query("OPTIMIZE TABLE ".$table[$m.'data'],$DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$m.'index'],$DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$m.'category_index'],$DB_CONNECT);
}
}
$NOWUID = $LASTUID ? $LASTUID : $R['uid'];
// 업로드 파일에 대한 parent 값 업데이트
if ($upload) {
$_updata = getArrayString($upload);
foreach ($_updata['data'] as $_ups)
{
getDbUpdate($table['s_upload'],"parent='".$m.$NOWUID."'",'uid='.$_ups);
}
}
// 링크 첨부에 대한 parent 값 업데이트
if($attachLink) {
foreach ($attachLink as $val) {
getDbUpdate($table['s_link'],"module='".$m."',entry='".$NOWUID."' ",'uid='.$val);
}
}
// 태그등록
if ($tag || $R['tag'])
{
$_tagarr1 = array();
$_tagarr2 = explode(',',$tag);
$_tagdate = $date['today'];
if ($R['uid'])
{
$_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) {
$result['d_modify'] = getDateFormat($d_modify,'Y.m.d H:i');
echo json_encode($result);
exit;
} else {
if ($send_mod=='ajax') {
$result['last_uid'] = $LASTUID;
$result['last_cid'] = $cid;
echo json_encode($result);
exit;
} else {
$_R = getUidData($table[$m.'data'],$LASTUID);
getLink(RW('m=post&mod=write&cid='.$_R['cid']),'parent.','','');
}
}
?>