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

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

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

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

8
modules/post/_main.js Normal file
View File

@@ -0,0 +1,8 @@
function OpenWindowX(url)
{
window.open(url,'','top=0,left=0,width=100px,height=100px,status=yes,resizable=no,scrollbars=yes');
}
function OpenWindowT(url)
{
window.open(url,'','top=0,left=0,width=800px,height=700px,status=yes,resizable=no,scrollbars=yes');
}

240
modules/post/_main.php Normal file
View File

@@ -0,0 +1,240 @@
<?php
//카테고리 출력
function getPostCategoryShow($table,$j,$parent,$depth,$uid,$CXA,$hidden)
{
global $path,$cat,$g;
global $MenuOpen,$numhidden,$checkbox,$headfoot;
static $j;
$CD=getDbSelect($table,'depth='.($depth+1).' and parent='.$parent.($hidden ? ' and hidden=0':'').' order by gid asc','*');
while($C=db_fetch_array($CD))
{
$j++;
if(@in_array($C['uid'],$CXA)) $MenuOpen .= 'trees[0].tmB('.$j.');';
$numprintx = !$numhidden && $C['num'] ? '&lt;span class="num"&gt;('.$C['num'].')&lt;/span&gt;' : '';
$C['name'] = $headfoot && ($C['imghead']||$C['imgfoot']||$C['codhead']||$C['codfoot']) ? '&lt;b&gt;'.$C['name'].'&lt;b&gt;' : $C['name'];
$name = $C['uid'] != $cat ? addslashes($C['name']): '&lt;span class="on"&gt;'.addslashes($C['name']).'&lt;/span&gt;';
$name = '&lt;span class="ticon tdepth'.$C['depth'].'"&gt;&lt;/span&gt;&lt;span class="name ndepth'.$C['depth'].'"&gt;'.$name.'&lt;/span&gt;';
if($checkbox) $icon1 = '&lt;input type="checkbox" name="members[]" value="'.$C['uid'].'" /&gt;';
$icon2 = $C['hidden'] ? ' &lt;img src="'.$g['img_core'].'/_public/ico_hidden.gif" class="hidden" alt="숨김상태" /&gt;' : '';
if ($C['is_child'])
{
echo "['".$icon1.$name.$icon2.$numprintx."','".$C['uid']."',";
getPostCategoryShow($table,$j,$C['uid'],$C['depth'],$uid,$CXA,$hidden);
echo "],\n";
}
else {
echo "['".$icon1.$name.$icon2.$numprintx."','".$C['uid']."',''],\n";
}
}
}
//카테고리 코드->경로
function getPostCategoryCodeToPath($table,$cat,$j)
{
global $DB_CONNECT;
static $arr;
$R=getUidData($table,$cat);
if($R['parent'])
{
$arr[$j]['uid'] = $R['uid'];
$arr[$j]['id'] = $R['id'];
$arr[$j]['name']= $R['name'];
getPostCategoryCodeToPath($table,$R['parent'],$j+1);
}
else {
$C=getUidData($table,$cat);
$arr[$j]['uid'] = $C['uid'];
$arr[$j]['id'] = $C['id'];
$arr[$j]['name']= $C['name'];
}
sort($arr);
reset($arr);
return $arr;
}
//카테고리코드->SQL
function getPostCategoryCodeToSql($table,$cat)
{
$R=getDbData($table,'id="'.$cat.'"','*');
if ($R['uid']) $sql .= 'category='.$R['uid'].' or ';
if ($R['is_child'])
{
$RDATA=getDbSelect($table,'parent='.$R['uid'],'uid,is_child');
while($C=db_fetch_array($RDATA)) $sql .= getPostCategoryCodeToSqlX($table,$C['uid'],$C['is_child']);
}
return substr($sql,0,strlen($sql)-4);
}
function getPostCategoryCodeToSql2($table,$cat)
{
$R=getDbData($table,'id="'.$cat.'"','*');
if ($R['uid']) $sql .= 'category like "%['.$R['uid'].']%" or ';
if ($R['is_child'])
{
$RDATA=getDbSelect($table,'parent='.$R['uid'],'uid,is_child');
while($C=db_fetch_array($RDATA)) $sql .= getPostCategoryCodeToSqlY($table,$C['uid'],$C['is_child']);
}
return substr($sql,0,strlen($sql)-4);
}
//카테고리코드->SQL
function getPostCategoryCodeToSqlX($table,$cat,$is_child)
{
$sql = 'category='.$cat.' or ';
if ($is_child)
{
$RDATA=getDbSelect($table,'parent='.$cat,'uid,is_child');
while($C=db_fetch_array($RDATA)) $sql .= getPostCategoryCodeToSqlX($table,$C['uid'],$C['is_child']);
}
return $sql;
}
function getPostCategoryCodeToSqlY($table,$cat,$is_child)
{
$sql = 'category like "%['.$cat.']%" or ';
if ($is_child)
{
$RDATA=getDbSelect($table,'parent='.$cat,'uid,is_child');
while($C=db_fetch_array($RDATA)) $sql .= getPostCategoryCodeToSqlY($table,$C['uid'],$C['is_child']);
}
return $sql;
}
//카테고리출력
function getCategoryShowSelect($table,$j,$parent,$depth,$uid,$hidden)
{
global $cat;
static $j;
$CD=getDbSelect($table,'depth='.($depth+1).' and parent='.$parent.($hidden ? ' and hidden=0':'').' order by gid asc','*');
while($C=db_fetch_array($CD))
{
$j++;
echo '<option class="selectcat'.$C['depth'].'" value="'.$C['uid'].'"'.($C['uid']==$cat?' selected="selected"':'').'>';
if(!$depth) echo 'ㆍ';
for($i=1;$i<$C['depth'];$i++) echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
if ($C['depth'] > 1) echo 'ㄴ';
echo $C['name'].'</option>';
if ($C['is_child']) getCategoryShowSelect($table,$j,$C['uid'],$C['depth'],$uid,$hidden);
}
}
function getTreePostCategoryCheck($conf,$uid,$depth,$parent,$tmpcode) {
global $table,$g;
$ctype = $conf['ctype']?$conf['ctype']:'uid';
$id = 'tree_'.filterstr(microtime());
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
if (!$parent) $tree = '<ul class="table-view table-view-full bg-white rc-checkboxtree" id="'.$id.'">';
$CD=getDbSelect($conf['table'],($conf['site']?'site='.$conf['site'].' and ':'').'depth='.($depth+1).' and parent='.$parent.($conf['dispHidden']?' and hidden=0':'').($conf['mobile']?' and mobile=1':'').' order by gid asc','*');
$_i = 0;
while($C=db_fetch_array($CD)) {
$tcheck= getDbRows($table['postcategory_index'],'data='.$uid.' and category='.$C['uid']);
$tree.= '<li class="table-view-cell">';
if ($C['is_child'])
{
$tree.= '<div class="position-relative">';
if ($conf['userMenu']=='link') $tree.= '<span'.($code==$rcode?' class="rb-active"':'').'>';
else $tree.= '<label class="custom-control custom-checkbox">';
if($conf['dispCheckbox']) $tree.= '<input type="checkbox" class="custom-control-input" name="tree_members[]" id="check'.$C['uid'].'" value="'.$C['uid'].'" '.($tcheck?' checked':'').'>';
if($C['hidden']) $tree.='<u title="숨김" data-tooltip="tooltip">';
$tree.= '<span class="custom-control-indicator"></span><span class="custom-control-description" for="check'.$C['uid'].'">'.$C['name'];
if($conf['dispNum']&&$C['num']) $tree.= ' <small class="text-muted ml-1">('.$C['num'].')</small>';
$tree.='</span></label>';
if($C['hidden']) $tree.='</u>';
$tree.= '<button data-toggle="collapse" data-target="#'.$id.'-'.$_i.'-'.$C['uid'].'" data-parent="#'.$id.'" class="btn btn-link text-reset'.($conf['allOpen']?'':' collapsed').'"><i class="fa fa-minus" aria-hidden="true"></i></button>';
$tree.= '</div>';
if(!$conf['hideIcon'])
{
if($C['target']) $tree.= ' <i class="fa fa-window-restore fa-fw" title="새창" data-tooltip="tooltip"></i>';
if($C['reject']) $tree.= ' <i class="fa fa-lock fa-lg fa-fw" title="차단" data-tooltip="tooltip"></i>';
}
$tree.= '<ul class="table-view table-view-full collapse" id="'.$id.'-'.$_i.'-'.$C['uid'].'" class="collapse'.($conf['allOpen']?' in':'').'">';
$tree.= getTreePostCategoryCheck($conf,$uid,$C['depth'],$C['uid'],$rcode);
$tree.= '</ul>';
}
else {
$tree.= '<div class="position-relative">';
if ($conf['userMenu']=='link') $tree.= '<span'.($code==$rcode?' class="rb-active"':'').'>';
else $tree.= '<label class="custom-control custom-checkbox">';
if($conf['dispCheckbox']) $tree.= '<input type="checkbox" class="custom-control-input" name="tree_members[]" id="check'.$C['uid'].'" value="'.$C['uid'].'" '.($tcheck?' checked':'').'>';
if($C['hidden']) $tree.='<u title="숨김" data-tooltip="tooltip">';
$tree.= '<span class="custom-control-indicator"></span><span class="custom-control-description" for="check'.$C['uid'].'">'.$C['name'];
if($conf['dispNum']&&$C['num']) $tree.= ' <small class="text-muted ml-1">('.$C['num'].')</small>';
if($C['hidden']) $tree.='</u>';
$tree.='</span></label>';
$tree.= '<a href="#. " class="rb-leaf"></a>';
$tree.= '</div>';
if(!$conf['hideIcon'])
{
if($C['mobile']) $tree.= '<i class="fa fa-mobile fa-lg fa-fw" title="모바일" data-tooltip="tooltip"></i>&nbsp;';
if($C['target']) $tree.= ' <i class="fa fa-window-restore fa-fw" title="새창" data-tooltip="tooltip"></i>';
if($C['reject']) $tree.= ' <i class="fa fa-lock fa-lg fa-fw" title="차단" data-tooltip="tooltip"></i>';
}
}
$tree.= '</li>';
$_i++;
}
if (!$parent) $tree.= '</ul>';
} else {
$tree = '<div class="rb-tree"><ul id="'.$id.'">';
$CD=getDbSelect($conf['table'],($conf['site']?'site='.$conf['site'].' and ':'').'depth='.($depth+1).' and parent='.$parent.($conf['dispHidden']?' and hidden=0':'').($conf['mobile']?' and mobile=1':'').' order by gid asc','*');
$_i = 0;
while($C=db_fetch_array($CD)) {
$tcheck= getDbRows($table['postcategory_index'],'data='.$uid.' and category='.$C['uid']);
$tree.= '<li>';
if ($C['is_child'])
{
$tree.= '<a data-toggle="collapse" href="#'.$id.'-'.$_i.'-'.$C['uid'].'" class="rb-branch'.($conf['allOpen']?'':' collapsed').'"></a>';
if ($conf['userMenu']=='link') $tree.= '<span'.($code==$rcode?' class="rb-active"':'').'>';
else $tree.= '<span class="form-group form-check mb-0">';
if($conf['dispCheckbox']) $tree.= '<input type="checkbox" form-check-input name="tree_members[]" id="check'.$C['uid'].'" value="'.$C['uid'].'" '.($tcheck?' checked':'').'>';
if($C['hidden']) $tree.='<u title="숨김" data-tooltip="tooltip">';
$tree.= '<label class="form-check-label" for="check'.$C['uid'].'">'.$C['name'].'</label>';
if($conf['dispNum']&&$C['num']) $tree.= ' <small>('.$C['num'].')</small>';
if($C['hidden']) $tree.='</span>';
$tree.='</u>';
if(!$conf['hideIcon'])
{
if($C['target']) $tree.= ' <i class="fa fa-window-restore fa-fw" title="새창" data-tooltip="tooltip"></i>';
if($C['reject']) $tree.= ' <i class="fa fa-lock fa-lg fa-fw" title="차단" data-tooltip="tooltip"></i>';
}
$tree.= '<ul id="'.$id.'-'.$_i.'-'.$C['uid'].'" class="collapse'.($conf['allOpen']?' show':'').'">';
$tree.= getTreePostCategoryCheck($conf,$uid,$C['depth'],$C['uid'],$rcode);
$tree.= '</ul>';
}
else {
$tree.= '<a href="#." class="rb-leaf"></a>';
if ($conf['userMenu']=='link') $tree.= '<span'.($code==$rcode?' class="rb-active"':'').'>';
else $tree.= '<a class="form-group form-check mb-0">';
if($conf['dispCheckbox']) $tree.= '<input type="checkbox" class="form-check-input" name="tree_members[]" id="check'.$C['uid'].'" value="'.$C['uid'].'" '.($tcheck?' checked':'').'>';
if($C['hidden']) $tree.='<u title="숨김" data-tooltip="tooltip">';
$tree.= '<label class="form-check-label" for="check'.$C['uid'].'">'.$C['name'].'</label>';
if($conf['dispNum']&&$C['num']) $tree.= ' <small>('.$C['num'].')</small>';
if($C['hidden']) $tree.='</u>';
$tree.='</a>';
if(!$conf['hideIcon'])
{
if($C['mobile']) $tree.= '<i class="fa fa-mobile fa-lg fa-fw" title="모바일" data-tooltip="tooltip"></i>&nbsp;';
if($C['target']) $tree.= ' <i class="fa fa-window-restore fa-fw" title="새창" data-tooltip="tooltip"></i>';
if($C['reject']) $tree.= ' <i class="fa fa-lock fa-lg fa-fw" title="차단" data-tooltip="tooltip"></i>';
}
}
$tree.= '</li>';
$_i++;
}
$tree.= '</ul></div>';
}
return $tree;
}
?>

View File

@@ -0,0 +1,317 @@
<?php
if(!defined('__KIMS__')) exit;
//데이터
$_tmp = db_query( "select count(*) from ".$table[$module.'data'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'data']." (
uid INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
site INT DEFAULT '0' NOT NULL,
gid INT DEFAULT '0' NOT NULL,
mbruid INT DEFAULT '0' NOT NULL,
cid INT DEFAULT '0' NOT NULL,
subject VARCHAR(200) DEFAULT '' NOT NULL,
review VARCHAR(200) DEFAULT '' NOT NULL,
content MEDIUMTEXT DEFAULT '' NOT NULL,
tag VARCHAR(200) DEFAULT '' NOT NULL,
display TINYINT DEFAULT '0' NOT NULL,
hidden TINYINT DEFAULT '0' NOT NULL,
html VARCHAR(4) DEFAULT '' NOT NULL,
category TEXT NOT NULL,
members TEXT NOT NULL,
upload TEXT NOT NULL,
videos TEXT NOT NULL,
featured_img INT DEFAULT '0' NOT NULL,
comment INT DEFAULT '0' NOT NULL,
oneline INT DEFAULT '0' NOT NULL,
hit INT DEFAULT '0' NOT NULL,
likes INT DEFAULT '0' NOT NULL,
dislikes INT DEFAULT '0' NOT NULL,
rating INT DEFAULT '0' NOT NULL,
num_rating INT DEFAULT '0' NOT NULL,
location VARCHAR(200) DEFAULT '' NOT NULL,
pin VARCHAR(50) DEFAULT '' NOT NULL,
dis_like TINYINT DEFAULT '0' NOT NULL,
dis_rating TINYINT DEFAULT '0' NOT NULL,
dis_comment TINYINT DEFAULT '0' NOT NULL,
dis_listadd TINYINT DEFAULT '0' NOT NULL,
perm_g VARCHAR(200) DEFAULT '' NOT NULL,
perm_l TINYINT DEFAULT '0' NOT NULL,
format TINYINT DEFAULT '0' NOT NULL,
d_regis VARCHAR(14) DEFAULT '' NOT NULL,
d_modify VARCHAR(14) DEFAULT '' NOT NULL,
d_comment VARCHAR(14) DEFAULT '' NOT NULL,
d_select VARCHAR(14) DEFAULT '' NOT NULL,
ip VARCHAR(25) DEFAULT '' NOT NULL,
agent VARCHAR(150) DEFAULT '' NOT NULL,
joint TEXT NOT NULL,
linkedmenu VARCHAR(100) DEFAULT '' NOT NULL,
goods VARCHAR(200) DEFAULT '' NOT NULL,
log TEXT NOT NULL,
adddata TEXT NOT NULL,
KEY gid(gid),
KEY display(display),
KEY subject(subject),
KEY tag(tag),
KEY hit(hit),
KEY likes(likes),
KEY dislikes(dislikes),
KEY d_modify(d_modify),
KEY d_regis(d_regis)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'data'],$DB_CONNECT);
}
//리스트 인덱스
$_tmp = db_query( "select count(*) from ".$table[$module.'list_index'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'list_index']." (
site INT DEFAULT '0' NOT NULL,
list INT DEFAULT '0' NOT NULL,
display TINYINT DEFAULT '0' NOT NULL,
data INT DEFAULT '0' NOT NULL,
gid INT DEFAULT '0' NOT NULL,
mbruid INT DEFAULT '0' NOT NULL,
KEY site(site),
KEY list(list),
KEY data(data),
KEY gid(gid)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'list_index'],$DB_CONNECT);
}
//데이타 인덱스
$_tmp = db_query( "select count(*) from ".$table[$module.'index'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'index']." (
site INT DEFAULT '0' NOT NULL,
display TINYINT DEFAULT '0' NOT NULL,
format TINYINT DEFAULT '0' NOT NULL,
gid INT DEFAULT '0' NOT NULL,
KEY site(site),
KEY display(display),
KEY format(format),
KEY gid(gid)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'index'],$DB_CONNECT);
}
//카테고리 인덱스
$_tmp = db_query( "select count(*) from ".$table[$module.'category_index'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'category_index']." (
site INT DEFAULT '0' NOT NULL,
category INT DEFAULT '0' NOT NULL,
display TINYINT DEFAULT '0' NOT NULL,
format TINYINT DEFAULT '0' NOT NULL,
data INT DEFAULT '0' NOT NULL,
gid INT DEFAULT '0' NOT NULL,
depth TINYINT DEFAULT '0' NOT NULL,
KEY site(site),
KEY category(category),
KEY data(data),
KEY display(display),
KEY format(format),
KEY gid(gid)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'category_index'],$DB_CONNECT);
}
//카테고리
$_tmp = db_query( "select count(*) from ".$table[$module.'category'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'category']." (
uid INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
gid INT DEFAULT '0' NOT NULL,
site INT DEFAULT '0' NOT NULL,
id VARCHAR(50) DEFAULT '' NOT NULL,
is_child TINYINT DEFAULT '0' NOT NULL,
parent INT DEFAULT '0' NOT NULL,
depth TINYINT DEFAULT '0' NOT NULL,
hidden TINYINT DEFAULT '0' NOT NULL,
reject TINYINT DEFAULT '0' NOT NULL,
name VARCHAR(50) DEFAULT '' NOT NULL,
layout VARCHAR(50) DEFAULT '' NOT NULL,
layout_mobile VARCHAR(50) DEFAULT '' NOT NULL,
skin VARCHAR(50) DEFAULT '' NOT NULL,
skin_mobile VARCHAR(50) DEFAULT '' NOT NULL,
imghead VARCHAR(100) DEFAULT '' NOT NULL,
imgfoot VARCHAR(100) DEFAULT '' NOT NULL,
puthead TINYINT DEFAULT '0' NOT NULL,
putfoot TINYINT DEFAULT '0' NOT NULL,
recnum INT DEFAULT '0' NOT NULL,
num INT DEFAULT '0' NOT NULL,
featured_img VARCHAR(50) DEFAULT '' NOT NULL,
sosokmenu VARCHAR(50) DEFAULT '' NOT NULL,
KEY gid(gid),
KEY parent(parent),
KEY depth(depth),
KEY hidden(hidden)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'category'],$DB_CONNECT);
}
//멤버
$_tmp = db_query( "select count(*) from ".$table[$module.'member'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'member']." (
mbruid INT DEFAULT '0' NOT NULL,
site INT DEFAULT '0' NOT NULL,
gid INT DEFAULT '0' NOT NULL,
data INT DEFAULT '0' NOT NULL,
display TINYINT DEFAULT '0' NOT NULL,
format TINYINT DEFAULT '0' NOT NULL,
auth TINYINT DEFAULT '0' NOT NULL,
level TINYINT DEFAULT '0' NOT NULL,
d_regis VARCHAR(14) DEFAULT '' NOT NULL,
KEY mbruid(mbruid),
KEY gid(gid),
KEY data(data),
KEY display(display),
KEY format(format),
KEY auth(auth),
KEY level(level)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'member'],$DB_CONNECT);
}
//리스트
$_tmp = db_query( "select count(*) from ".$table[$module.'list'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'list']." (
uid INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
gid INT DEFAULT '0' NOT NULL,
site INT DEFAULT '0' NOT NULL,
id VARCHAR(30) DEFAULT '' NOT NULL,
name VARCHAR(200) DEFAULT '' NOT NULL,
review VARCHAR(300) DEFAULT '' NOT NULL,
mbruid INT DEFAULT '0' NOT NULL,
display TINYINT DEFAULT '0' NOT NULL,
num INT DEFAULT '0' NOT NULL,
tag VARCHAR(200) DEFAULT '' NOT NULL,
d_last VARCHAR(14) DEFAULT '' NOT NULL,
d_regis VARCHAR(14) DEFAULT '' NOT NULL,
imghead VARCHAR(100) DEFAULT '' NOT NULL,
imgfoot VARCHAR(100) DEFAULT '' NOT NULL,
puthead VARCHAR(20) DEFAULT '' NOT NULL,
putfoot VARCHAR(20) DEFAULT '' NOT NULL,
addinfo TEXT NOT NULL,
writecode TEXT NOT NULL,
KEY gid(gid),
KEY mbruid(mbruid),
KEY id(id)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'list'],$DB_CONNECT);
}
//리스트 멤버
$_tmp = db_query( "select count(*) from ".$table[$module.'list_member'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'list_member']." (
mbruid INT DEFAULT '0' NOT NULL,
site INT DEFAULT '0' NOT NULL,
gid INT DEFAULT '0' NOT NULL,
list INT DEFAULT '0' NOT NULL,
display TINYINT DEFAULT '0' NOT NULL,
auth TINYINT DEFAULT '0' NOT NULL,
level TINYINT DEFAULT '0' NOT NULL,
d_regis VARCHAR(14) DEFAULT '' NOT NULL,
KEY mbruid(mbruid),
KEY gid(gid),
KEY list(list),
KEY display(display),
KEY auth(auth),
KEY level(level)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'list_member'],$DB_CONNECT);
}
//포스트 월별수량
$_tmp = db_query( "select count(*) from ".$table[$module.'month'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'month']." (
date CHAR(6) DEFAULT '' NOT NULL,
site INT DEFAULT '0' NOT NULL,
data INT DEFAULT '0' NOT NULL,
hit INT DEFAULT '0' NOT NULL,
likes INT DEFAULT '0' NOT NULL,
dislikes INT DEFAULT '0' NOT NULL,
comment INT DEFAULT '0' NOT NULL,
mobile INT DEFAULT '0' NOT NULL,
desktop INT DEFAULT '0' NOT NULL,
inside INT DEFAULT '0' NOT NULL,
outside INT DEFAULT '0' NOT NULL,
yt INT DEFAULT '0' NOT NULL,
kt INT DEFAULT '0' NOT NULL,
ks INT DEFAULT '0' NOT NULL,
bd INT DEFAULT '0' NOT NULL,
ig INT DEFAULT '0' NOT NULL,
fb INT DEFAULT '0' NOT NULL,
tt INT DEFAULT '0' NOT NULL,
nb INT DEFAULT '0' NOT NULL,
KEY date(date),
KEY data(data),
KEY hit(hit),
KEY likes(likes),
KEY dislikes(dislikes),
KEY comment(comment),
KEY site(site)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'month'],$DB_CONNECT);
}
//포스트 일별수량
$_tmp = db_query( "select count(*) from ".$table[$module.'day'], $DB_CONNECT );
if ( !$_tmp ) {
$_tmp = ("
CREATE TABLE ".$table[$module.'day']." (
date CHAR(8) DEFAULT '' NOT NULL,
site INT DEFAULT '0' NOT NULL,
data INT DEFAULT '0' NOT NULL,
display TINYINT DEFAULT '0' NOT NULL,
hit INT DEFAULT '0' NOT NULL,
likes INT DEFAULT '0' NOT NULL,
dislikes INT DEFAULT '0' NOT NULL,
comment INT DEFAULT '0' NOT NULL,
mobile INT DEFAULT '0' NOT NULL,
desktop INT DEFAULT '0' NOT NULL,
inside INT DEFAULT '0' NOT NULL,
outside INT DEFAULT '0' NOT NULL,
yt INT DEFAULT '0' NOT NULL,
kt INT DEFAULT '0' NOT NULL,
ks INT DEFAULT '0' NOT NULL,
bd INT DEFAULT '0' NOT NULL,
ig INT DEFAULT '0' NOT NULL,
fb INT DEFAULT '0' NOT NULL,
tt INT DEFAULT '0' NOT NULL,
nb INT DEFAULT '0' NOT NULL,
KEY date(date),
KEY data(data),
KEY hit(hit),
KEY likes(likes),
KEY dislikes(dislikes),
KEY comment(comment),
KEY site(site)) ENGINE=".$DB['type']." CHARSET=UTF8MB4");
db_query($_tmp, $DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table[$module.'day'],$DB_CONNECT);
}
?>

View File

@@ -0,0 +1,12 @@
<?php
$table[$module.'data'] = $DB['head'].'_'.$module.'_data'; //데이터
$table[$module.'member'] = $DB['head'].'_'.$module.'_member'; //멤버
$table[$module.'index'] = $DB['head'].'_'.$module.'_index'; //데이타 인덱스
$table[$module.'category'] = $DB['head'].'_'.$module.'_category'; //카테고리
$table[$module.'category_index'] = $DB['head'].'_'.$module.'_category_index'; //카테고리 인덱스
$table[$module.'list'] = $DB['head'].'_'.$module.'_list'; //리스트
$table[$module.'list_member'] = $DB['head'].'_'.$module.'_list_member'; //리스트 멤버
$table[$module.'list_index'] = $DB['head'].'_'.$module.'_list_index'; //리스트 인덱스
$table[$module.'month']= $DB['head'].'_'.$module.'_month'; //월별수량
$table[$module.'day'] = $DB['head'].'_'.$module.'_day'; //일별수량
?>

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.','','');
}
}
?>

7
modules/post/admin.php Normal file
View File

@@ -0,0 +1,7 @@
<?php
if(!defined('__KIMS__')) exit; // 비정상적인 호출 차단
include_once $g['path_module'].$module.'/_main.php';
include $g['path_module'].$module.'/admin/'.$front.'.php';
?>

View File

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

View File

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

View File

@@ -0,0 +1,114 @@
#accordion > .card .card-body {
height: calc(100vh - 10rem);
overflow: auto;
}
.rb-tree .fa-mobile {
font-size: 18px;
color: #999
}
/**
* Nestable
*/
.dd {
position: relative;
display: block;
margin: 0;
padding: 0;
list-style: none;
font-size: 13px;
line-height: 20px;
}
.dd-list {
display: block;
position: relative;
margin: 0;
padding: 0;
list-style: none;
}
.dd-item,
.dd-empty,
.dd-placeholder {
display: block;
position: relative;
margin: 0;
padding: 0;
min-height: 20px;
line-height: 20px;
}
.dd-handle {
display: block;
margin: 5px 0;
padding: 10px;
text-decoration: none;
border: 1px solid #ccc;
background: #eee;
-webkit-border-radius: 3px;
border-radius: 3px;
box-sizing: border-box;
-moz-box-sizing: border-box;
cursor: move;
font-size: 13px
}
.dd-handle:hover {
color: #2ea8e5;
}
.dd-item > button {
display: block;
position: relative;
cursor: pointer;
float: left;
width: 35px;
height: 35px;
margin: 5px 0;
padding: 0;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
border: 0;
background: transparent;
font-size: 13px;
line-height: 1;
text-align: center;
}
.dd-placeholder,
.dd-empty {
margin: 5px 0;
padding: 0;
min-height: 30px;
background: #f2fbff;
border: 1px dashed #b6bcbf;
box-sizing: border-box;
-moz-box-sizing: border-box
}
.dd-empty {
border: 1px dashed #bbb;
min-height: 100px;
background-color: #e5e5e5;
background-image: -webkit-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff), background-image: -moz-linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff), background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff), background-size: 60px 60px;
background-position: 0 0, 30px 30px;
}
.dd-dragel {
position: absolute;
pointer-events: none;
z-index: 9999;
}
.dd-dragel > .dd-item .dd-handle {
margin-top: 0;
}
.dd-dragel .dd-handle {
-webkit-box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, .1);
box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, .1);
}

View File

@@ -0,0 +1,505 @@
<style>
/*임시*/
input[type=radio],
input[type=checkbox] {
margin-left: -1.25rem;
}
</style>
<?php
include_once $g['path_module'].$module.'/_main.php';
$ISCAT = getDbRows($table[$module.'category'],'');
if($cat){
$CINFO = getUidData($table[$module.'category'],$cat);
$ctarr = getPostCategoryCodeToPath($table[$module.'category'],$cat,0);
$ctnum = count($ctarr);
for ($i = 0; $i < $ctnum; $i++) {
$CXA[] = $ctarr[$i]['uid'];
$CINFO['code'] .= $ctarr[$i]['id'].($i < $ctnum-1 ? '/' : '');
$_code .= $ctarr[$i]['uid'].($i < $ctnum-1 ? '/' : '');
}
$code = $code ? $code : $_code;
}
$catcode = '';
$is_fcategory = $CINFO['uid'] && $vtype != 'sub';
$is_regismode = !$CINFO['uid'] || $vtype == 'sub';
if ($is_regismode){ $CINFO['name'] = '';
$CINFO['hidden'] = '';
$CINFO['imghead'] = '';
$CINFO['imgfoot'] = '';
}
?>
<div id="catebody" class="row">
<div id="category" class="col-sm-4 col-md-4 col-lg-3 sidebar">
<div id="accordion">
<div class="card border-0">
<div class="card-header p-0">
<a class="d-block accordion-toggle muted-link<?php if($_SESSION['post_category_collapse']):?> collapsed<?php endif?>"
data-toggle="collapse"
onclick="sessionSetting('post_category_collapse','','','');"
href="#categoryTree">
<i class="fa fa-sitemap fa-lg fa-fw"></i>
분류
</a>
</div>
<div class="collapse<?php if(!$_SESSION['post_category_collapse']):?> show<?php endif?>" id="categoryTree" data-parent="#accordion">
<div class="card-body">
<?php if($ISCAT):?>
<?php $_treeOptions=array('site'=>$s,'table'=>$table[$module.'category'],'dispNum'=>true,'dispHidden'=>false,'dispCheckbox'=>false,'allOpen'=>false,'bookmark'=>'site-cafe-info')?>
<?php $_treeOptions['link'] = $g['adm_href'].'&amp;cat='?>
<?php echo getTreeMenu($_treeOptions,$code,0,0,'')?>
<?php else:?>
<div class="none">등록된 카테고리가 없습니다.</div>
<?php endif?>
</div><!-- /.card-body -->
</div>
</div><!-- /.card -->
<?php if($CINFO['is_child']||(!$cat&&$ISCAT)):?>
<div class="card">
<div class="card-header p-0">
<a class="d-block accordion-toggle muted-link<?php if($_SESSION['post_category_collapse']!='order'):?> collapsed<?php endif?>"
data-toggle="collapse"
onclick="sessionSetting('post_category_collapse','order','','');"
href="#categoryOrder">
<i class="fa fa-retweet fa-lg fa-fw"></i>
순서 조정
</a>
</div>
<div class="collapse<?php if($_SESSION['post_category_collapse']=='order'):?> show<?php endif?>" id="categoryOrder" data-parent="#accordion" >
<form role="form" action="<?php echo $g['s']?>/" method="post">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="modifycategorygid">
<div class="card-body">
<div class="dd" id="nestable-category">
<ol class="dd-list">
<?php $_MENUS=getDbSelect($table[$module.'category'],'site='.$s.' and parent='.intval($CINFO['uid']).' and depth='.($CINFO['depth']+1).' order by gid asc','*')?>
<?php while($_M=db_fetch_array($_MENUS)):?>
<li class="dd-item" data-id="<?php echo $_i?>">
<input type="checkbox" name="categorymembers[]" value="<?php echo $_M['uid']?>" checked class="d-none">
<div class="dd-handle"><i class="fa fa-arrows fa-fw"></i> <?php echo $_M['name']?></div>
</li>
<?php $_i++;endwhile?>
</ol>
</div>
</div><!-- /.card-body -->
</form>
<!-- nestable : https://github.com/dbushell/Nestable -->
<?php getImport('nestable','jquery.nestable',false,'js') ?>
<script>
$('#nestable-category').nestable();
$('.dd').on('change', function() {
var f = document.forms[0];
getIframeForAction(f);
f.submit();
});
</script>
</div>
</div>
<?php endif?>
</div>
</div>
<div id="catinfo" class="col-sm-8 col-md-8 ml-sm-auto col-xl-9">
<form name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" enctype="multipart/form-data" onsubmit="return saveCheck(this);" autocomplete="off">
<input type="hidden" name="r" value="<?php echo $r?>" />
<input type="hidden" name="m" value="<?php echo $module?>" />
<input type="hidden" name="a" value="regiscategory" />
<input type="hidden" name="cat" value="<?php echo $CINFO['uid']?>" />
<input type="hidden" name="code" value="<?php echo $code?>">
<input type="hidden" name="vtype" value="<?php echo $vtype?>" />
<input type="hidden" name="depth" value="<?php echo intval($CINFO['depth'])?>" />
<input type="hidden" name="parent" value="<?php echo intval($CINFO['uid'])?>" />
<div class="d-flex justify-content-between my-3">
<h3 class="mb-0">
<?php if($is_regismode):?>
<?php if($vtype == 'sub'):?>하위 카테고리 만들기<?php else:?>최상위 카테고리 만들기<?php endif?>
<?php else:?>
카테고리 등록정보
<?php endif?>
</h3>
<div>
<a class="btn btn-light" href="<?php echo $g['adm_href']?>&amp;type=makesite">최상위카테고리 등록</a>
</div>
</div>
<p>
<small class="text-muted">
<?php if($is_regismode):?>
복수의 카테고리을 한번에 등록하시려면 카테고리명을 콤마(,)로 구분해 주세요.<br />
보기)정치경제,문화예술,비즈니스
<?php else:?>
속성을 변경하려면 설정값을 변경한 후 [속성변경] 버튼을 클릭해주세요.<br />
카테고리을 삭제하면 소속된 하위카테고리까지 모두 삭제됩니다.
<?php endif?>
</small>
</p>
<?php if($vtype == 'sub'):?>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">상위 카테고리</label>
<div class="col-md-10 col-lg-9">
<ol class="breadcrumb">
<?php for ($i = 0; $i < $ctnum; $i++): ?>
<li class="breadcrumb-item"><?php echo $ctarr[$i]['name']?></li>
<?php $catcode .= $ctarr[$i]['id'].'/'; endfor?>
</ol>
</div>
</div>
<?php else:?>
<?php if($cat):?>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">상위 카테고리</label>
<div class="col-md-10 col-lg-9 form-inline">
<ol class="breadcrumb">
<?php for ($i = 0; $i < $ctnum-1; $i++): ?>
<li class="breadcrumb-item"><?php echo $ctarr[$i]['name']?></li>
<?php
$delparent=$ctarr[$i]['uid'];
$catcode .= $ctarr[$i]['id'].'/';
endfor
?>
<?php if(!$delparent):?>
<li class="breadcrumb-item active" aria-current="page">최상위카테고리</li>
<?php endif?>
</ol>
</div>
</div>
<?php endif?>
<?php endif?>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">카테고리 명칭</label>
<div class="col-md-10 col-lg-9">
<div class="input-group input-group-lg">
<input type="text" name="name" value="<?php echo $CINFO['name']?>" class="form-control sname<?php echo $is_fcategory?1:2?>"<?php if(!$code || $vtype):?> autofocus<?php endif?>>
<?php if($is_fcategory):?>
<span class="input-group-append">
<?php if($CINFO['depth']<5):?>
<a class="btn btn-light" href="<?php echo $g['adm_href']?>&amp;cat=<?php echo $cat?>&amp;code=<?php echo $code?>&amp;vtype=sub" data-toggle="tooltip" title="하위 카테고리만들기">
<i class="fa fa-share fa-rotate-90 fa-lg"></i>
</a>
<?php endif?>
<a class="btn btn-light"
href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>&amp;a=deletecategory&amp;cat=<?php echo $cat?>&amp;parent=<?php echo $delparent?>"
target="_action_frame_<?php echo $m?>" onclick="return confirm('정말로 삭제하시겠습니까? ')" data-toggle="tooltip" title="카테고리삭제">
<i class="fa fa-trash-o fa-lg"></i>
</a>
</span>
<?php endif?>
</div>
</div>
</div>
<div class="form-group row rb-outside">
<label class="col-lg-2 col-form-label text-lg-right">코드</label>
<div class="col-lg-10 col-xl-9">
<input class="form-control" placeholder="미등록시 자동생성 됩니다." type="text" name="id" value="<?php echo $CINFO['id']?>" maxlength="20">
<button type="button" class="btn btn-link text-muted mt-2 pl-0" data-toggle="collapse" data-target="#guide_menucode">
<i class="fa fa-question-circle fa-fw"></i>
카테고리를 잘 표현할 수 있는 단어로 입력해 주세요.
</button>
<div id="guide_menucode" class="collapse">
<small>
<ul class="form-text text-muted pl-3 mt-2">
<li>영문대소문자/숫자/_/- 조합으로 등록할 수 있습니다.</li>
<li>보기) 호출주소 : <code><?php echo RW('category=CODE')?></code></li>
<li>코드는 중복될 수 없습니다.</li>
</ul>
</small>
</div>
</div>
</div>
<?php if($CINFO['uid']&&!$vtype):?>
<?php $_url = $g['s'].'/?r='.$r.'&m=post&cat='.$CINFO['id'].'&code='.$code?>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">주소</label>
<div class="col-lg-10 col-xl-9">
<div class="input-group" style="margin-bottom: 5px">
<input id="_url_m_1_" type="text" class="form-control" value="<?php echo $_url?>" readonly>
<span class="input-group-append">
<a href="#." class="btn btn-light js-clipboard" data-tooltip="tooltip" title="클립보드에 복사" data-clipboard-target="#_url_m_1_"><i class="fa fa-clipboard"></i></a>
<a href="<?php echo $_url?>" target="_blank" class="btn btn-light" data-tooltip="tooltip" title="접속">Go!</a>
</span>
</div>
</div>
</div>
<?php endif?>
<hr>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">숨김처리</label>
<div class="col-md-10 col-lg-9">
<div class="form-check form-check-inline">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="hidden" id="cat_hidden" value="1"<?php if($CINFO['hidden']):?> checked="checked"<?php endif?>> 카테고리숨김
</label>
</div>
<div class="form-check form-check-inline">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="reject" id="cat_reject" value="1"<?php if($CINFO['reject']):?> checked="checked"<?php endif?>> 카테고리차단
</label>
</div>
<small class="form-text text-muted">
<strong>카테고리숨김 : </strong>메뉴를 출력하지 않습니다.(링크접근 가능)<br>
<strong>카테고리차단 : </strong>메뉴의 접근을 차단합니다.(링크접근 불가)
</small>
</div>
</div>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">포스트 출력</label>
<div class="col-md-10 col-lg-9">
<div class="input-group w-25">
<input type="text" name="recnum" value="<?php echo $CINFO['recnum']?$CINFO['recnum']:20?>" size="3" class="form-control">
<div class="input-group-append">
<span class="input-group-text">개</span>
</div>
</div>
</div>
</div>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">레이아웃</label>
<div class="col-md-10 col-lg-9">
<select name="layout" class="form-control custom-select">
<option value="">포스트 대표레이아웃</option>
<?php $dirs = opendir($g['path_layout'])?>
<?php while(false !== ($tpl = readdir($dirs))):?>
<?php if($tpl=='.' || $tpl == '..' || $tpl == '_blank' || is_file($g['path_layout'].$tpl))continue?>
<?php $dirs1 = opendir($g['path_layout'].$tpl)?>
<?php while(false !== ($tpl1 = readdir($dirs1))):?>
<?php if(!strstr($tpl1,'.php') || $tpl1=='_main.php')continue?>
<option value="<?php echo $tpl?>/<?php echo $tpl1?>"<?php if($CINFO['layout']==$tpl.'/'.$tpl1):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($g['path_layout'].$tpl)?>(<?php echo str_replace('.php','',$tpl1)?>)</option>
<?php endwhile?>
<?php closedir($dirs1)?>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</div>
</div>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center"><span class="badge badge-dark">모바일</span></label>
<div class="col-md-10 col-lg-9">
<select name="layout_mobile" class="form-control custom-select">
</select>
</div>
</div>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">카테고리 테마</label>
<div class="col-md-10 col-lg-9">
<select name="skin" class="form-control custom-select">
<option value="">포스트 대표테마</option>
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($CINFO['skin']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</div>
</div>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center"><span class="badge badge-dark">모바일</span></label>
<div class="col-md-10 col-lg-9">
<select name="skin_mobile" class="form-control custom-select">
<option value="">포스트 대표테마</option>
</select>
</div>
</div>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">소속메뉴</label>
<div class="col-md-10 col-lg-9">
<select name="sosokmenu" class="form-control custom-select">
<option value="">사용안함</option>
<?php include_once $g['path_core'].'function/menu1.func.php' ?>
<?php $cat=$CINFO['sosokmenu']?>
<?php getMenuShowSelect($s,$table['s_menu'],0,0,0,0,0,'')?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-center">대표이미지</label>
<div class="col-md-10 col-lg-9">
<div class="input-group">
<input class="form-control rb-modal-photo-drop" onmousedown="_mediasetField='meta_image_src&dfiles='+this.value;" data-tooltip="tooltip" data-toggle="modal" data-target="#modal_window" type="text" name="featured_img" id="meta_image_src" value="<?php echo $CINFO['featured_img']?>">
<div class="input-group-append">
<button class="btn btn-light rb-modal-photo1" type="button" title="포토셋" data-tooltip="tooltip" data-toggle="modal" data-target="#modal_window">
<i class="fa fa-photo fa-lg"></i>
</button>
</div>
</div>
</div>
</div>
<?php if($CINFO['uid']):?>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">코드확장</label>
<div class="col-md-10 col-lg-9">
<div class="form-check form-check-inline">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" <?php if($CINFO['imghead']||is_file($g['path_file'].$module.'/code/'.sprintf('%05d',$CINFO['uid']).'.header.php')):?> checked="checked"<?php endif?> disabled="disabled">
카테고리 헤더
<button class="btn btn-sm btn-light ml-2" type="button" data-toggle="collapse" data-target="#menu_header" aria-expanded="false" aria-controls="menu_header">
<i class="fa fa-angle-down" aria-hidden="true"></i>
</button>
</label>
</div>
<div class="form-check form-check-inline">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" <?php if($CINFO['imgfoot']||is_file($g['path_file'].$module.'/code/'.sprintf('%05d',$CINFO['uid']).'.footer.php')):?> checked="checked"<?php endif?> disabled="disabled">
카테고리 풋터
<button class="btn btn-sm btn-light ml-2" type="button" data-toggle="collapse" data-target="#menu_footer" aria-expanded="false" aria-controls="menu_footer">
<i class="fa fa-angle-down" aria-hidden="true"></i>
</button>
</label>
</div>
</div>
</div>
<div id="menu_header" class="collapse multi-collapse">
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">헤더파일</label>
<div class="col-md-10 col-lg-9">
<input type="file" name="imghead" class="upfile" />
<?php if($CINFO['imghead']):?>
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>&amp;a=category_file_delete&amp;cat=<?php echo $CINFO['uid']?>&amp;dtype=head" target="_action_frame_<?php echo $m?>" class="u" onclick="return confirm('정말로 삭제하시겠습니까? ');">삭제</a>
<?php else:?>
<span>(gif/jpg/png/swf 가능)</span>
<?php endif?>
</div>
</div>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">헤더코드</label>
<div class="col-md-10 col-lg-9">
<textarea name="codhead" class="form-control" rows="4" id="codheadArea"><?php if(is_file($g['path_file'].$module.'/code/'.sprintf('%05d',$CINFO['uid']).'.header.php')) echo htmlspecialchars(implode('',file($g['path_file'].$module.'/code/'.sprintf('%05d',$CINFO['uid']).'.header.php')))?></textarea>
</div>
</div>
</div>
<div id="menu_footer" class="collapse multi-collapse">
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">풋터파일</label>
<div class="col-md-10 col-lg-9">
<input type="file" name="imgfoot" class="upfile" />
<?php if($CINFO['imgfoot']):?>
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=admin&amp;module=filemanager&amp;front=main&amp;editmode=Y&amp;pwd=./modules/<?php echo $module?>/var/files/&file=<?php echo $CINFO['imgfoot']?>" target="_blank" title="<?php echo $CINFO['imgfoot']?>" class="u">파일수정</a>
<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>&amp;a=category_file_delete&amp;cat=<?php echo $CINFO['uid']?>&amp;dtype=foot" target="_action_frame_<?php echo $m?>" class="u" onclick="return confirm('정말로 삭제하시겠습니까? ');">삭제</a>
<?php else:?>
<span>(gif/jpg/png/swf 가능)</span>
<?php endif?>
</div>
</div>
<div class="form-group form-row">
<label class="col-md-2 col-form-label text-center">풋터코드</label>
<div class="col-md-10 col-lg-9">
<textarea name="codfoot" id="codfootArea" class="form-control" rows="4"><?php if(is_file($g['path_file'].$module.'/code/'.sprintf('%05d',$CINFO['uid']).'.footer.php')) echo htmlspecialchars(implode('',file($g['path_file'].$module.'/code/'.sprintf('%05d',$CINFO['uid']).'.footer.php')))?></textarea>
</div>
</div>
</div>
<?php endif?>
<div class="form-group row my-4">
<div class="col-2"></div>
<div class="col-10">
<?php if($is_fcategory && $CINFO['is_child']):?>
<div class="custom-control custom-checkbox mb-4">
<input type="checkbox" class="custom-control-input" name="subcopy" id="cubcopy" value="1" checked="checked">
<label class="custom-control-label" for="cubcopy">이 설정(숨김처리,레이아웃)을 하위카테고리에도 일괄적용합니다.</label>
</div>
<?php endif?>
<?php if($vtype=='sub'):?><input type="button" class="btn btn-light" value="등록취소" onclick="history.back();" /><?php endif?>
<input type="submit" class="btn btn-primary" value="<?php echo $is_fcategory?'카테고리속성 변경':'신규카테고리 등록'?>" />
</div>
</div>
</form>
</div>
</div>
<script type="text/javascript">
var orderopen = false;
//사이트 셀렉터 출력
$('[data-role="siteSelector"]').removeClass('d-none')
function orderOpen() {
if (orderopen == false) {
getId('menuorder').style.display = 'block';
orderopen = true;
} else {
getId('menuorder').style.display = 'none';
orderopen = false;
}
}
function displaySelect(obj) {
var f = document.procForm;
if (obj.value == '1') {
getId('jointBox').style.display = 'block';
getId('widgetBox').style.display = 'none';
getId('codeBox').style.display = 'none';
f.joint.focus();
} else if (obj.value == '2') {
getId('jointBox').style.display = 'none';
getId('widgetBox').style.display = 'block';
getId('codeBox').style.display = 'none';
} else if (obj.value == '3') {
getId('jointBox').style.display = 'none';
getId('widgetBox').style.display = 'none';
getId('codeBox').style.display = 'block';
} else {
getId('jointBox').style.display = 'none';
getId('widgetBox').style.display = 'none';
getId('codeBox').style.display = 'none';
}
}
function codShowHide(layer, show, hide, img) {
if (getId(layer).style.display != show) {
getId(layer).style.display = show;
img.src = img.src.replace('ico_under', 'ico_over');
setCookie('ck_' + layer, show, 1);
} else {
getId(layer).style.display = hide;
img.src = img.src.replace('ico_over', 'ico_under');
setCookie('ck_' + layer, hide, 1);
}
}
function saveCheck(f) {
if (f.name.value == '') {
alert('카테고리명칭을 입력해 주세요. ');
f.name.focus();
return false;
}
}
putCookieAlert('result_post_category') // 실행결과 알림 메시지 출력
$('.rb-modal-photo1').on('click',function() {
modalSetting('modal_window','<?php echo getModalLink('&amp;m=mediaset&amp;mdfile=modal.photo.media&amp;dropfield=meta_image_src')?>');
});
$('.rb-modal-photo-drop').on('click',function() {
modalSetting('modal_window','<?php echo getModalLink('&amp;m=mediaset&amp;mdfile=modal.photo.media&amp;dropfield=')?>'+_mediasetField);
});
</script>

View File

@@ -0,0 +1,462 @@
<form class="row no-gutters" role="form" name="procForm" action="<?php echo $g['s']?>/" method="post" target="_action_frame_<?php echo $m?>" onsubmit="return saveCheck(this);">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="config">
<div class="col-sm-3 col-md-3 col-xl-3 d-none d-sm-block sidebar">
<div class="card border-0">
<div class="card-header">
메뉴
</div>
<div class="list-group list-group-flush" id="list-tab" role="tablist">
<a class="list-group-item d-flex justify-content-between align-items-center list-group-item-action<?php if(!$_SESSION['post_config_nav'] || $_SESSION['post_config_nav']=='basic'):?> active<?php endif?>" data-toggle="list" href="#basic" role="tab" onclick="sessionSetting('post_config_nav','basic','','');" aria-selected="false">
일반
</a>
<a class="list-group-item d-flex justify-content-between align-items-center list-group-item-action<?php if($_SESSION['post_config_nav']=='theme'):?> active<?php endif?>" data-toggle="list" href="#theme" role="tab" onclick="sessionSetting('post_config_nav','theme','','');" aria-selected="true">
레이아웃/테마
</a>
<a class="list-group-item d-flex justify-content-between align-items-center list-group-item-action<?php if($_SESSION['post_config_nav']=='perm'):?> active<?php endif?>" data-toggle="list" href="#perm" role="tab" onclick="sessionSetting('post_config_nav','perm','','');" aria-selected="true">
권한설정
</a>
</div>
</div>
</div><!-- /.sidebar -->
<div class="col-sm-9 col-md-9 ml-sm-auto col-xl-9">
<div class="tab-content">
<div class="tab-pane <?php if(!$_SESSION['post_config_nav'] || $_SESSION['post_config_nav']=='basic'):?> show active<?php endif?>" id="basic">
<div class="card border-0 rounded-0 mb-0">
<div class="card-header page-body-header">
일반 설정
</div>
<div class="card-body">
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">평가 제한</label>
<div class="col-md-10 col-xl-9">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="denylikemy" name="denylikemy" value="1" <?php if($d['post']['denylikemy']):?> checked<?php endif?>>
<label class="custom-control-label" for="denylikemy">내글에 대한 좋아요와 싫어요 참여를 제한합니다.</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">조회수 증가</label>
<div class="col-md-10 col-xl-9">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="hitcount_1" name="hitcount" value="1" <?php if($d['post']['hitcount']):?> checked<?php endif?> class="custom-control-input">
<label class="custom-control-label" for="hitcount_1">무조건 증가</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="hitcount_0" name="hitcount" value="0"<?php if(!$d['post']['hitcount']):?> checked<?php endif?> class="custom-control-input">
<label class="custom-control-label" for="hitcount_0">1회만 증가</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">목록 출력수</label>
<div class="col-md-4">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">페이지당</span>
</div>
<input type="text" name="recnum" value="<?php echo $d['post']['recnum']?$d['post']['recnum']:20?>" class="form-control text-center">
<div class="input-group-append">
<span class="input-group-text">개</span>
</div>
</div>
<small class="form-text text-muted">한페이지에 출력할 포스트의 수</small>
</div>
<div class="col-md-4">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">라인당</span>
</div>
<input type="text" name="rownum" value="<?php echo $d['post']['rownum']?$d['post']['rownum']:'4'?>" class="form-control text-center">
<div class="input-group-append">
<span class="input-group-text">개</span>
</div>
</div>
<small class="form-text text-muted">한줄에 표시할 카드의 수, 카드형 레이아웃에 해당</small>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">새글 유지시간</label>
<div class="col-md-4 col-xl-3">
<div class="input-group">
<input type="text" name="newtime" value="<?php echo $d['post']['newtime']?$d['post']['newtime']:24?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">시간</span>
</div>
</div>
<small class="form-text text-muted">새글로 인식되는 시간</small>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">불량글 처리</label>
<div class="col-md-10 col-xl-9">
<div class="form-inline">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="singo_del"name="singo_del" value="1" <?php if($d['post']['singo_del']):?> checked<?php endif?> >
<label class="custom-control-label" for="singo_del">신고건 수가</label>
</div>
<div class="input-group ml-3">
<input type="text" name="singo_del_num" value="<?php echo $d['post']['singo_del_num']?>" class="form-control">
<div class="input-group-append">
<span class="input-group-text">건 이상인 경우</span>
</div>
</div>
<select name="singo_del_act" class="form-control custom-select ml-2">
<option value="1"<?php if($d['post']['singo_del_act']==1):?> selected="selected"<?php endif?>>자동삭제</option>
<option value="2"<?php if($d['post']['singo_del_act']==2):?> selected="selected"<?php endif?>>비밀처리</option>
</select>
</div> <!-- .form-inline -->
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">제한단어</label>
<div class="col-md-10 col-xl-9">
<textarea name="badword" rows="5" class="form-control"><?php echo $d['post']['badword']?></textarea>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">제한단어 처리</label>
<div class="col-sm-10">
<div class="custom-control custom-radio">
<input type="radio" id="badword_action_0" class="custom-control-input" name="badword_action" value="0" <?php if($d['post']['badword_action']==0):?> checked<?php endif?>>
<label class="custom-control-label" for="badword_action_0">제한단어 체크하지 않음</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="badword_action_1" class="custom-control-input" name="badword_action" value="1"<?php if($d['post']['badword_action']==1):?> checked<?php endif?>>
<label class="custom-control-label" for="badword_action_1">등록을 차단함</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="badword_action_2" class="custom-control-input" name="badword_action" value="2"<?php if($d['post']['badword_action']==2):?> checked<?php endif?>>
<label class="custom-control-label" for="badword_action_2">
제한단어를 다음의 문자로 치환하여 등록함
<input type="text" name="badword_escape" value="<?php echo $d['post']['badword_escape']?>" maxlength="1" class="d-inline form-control form-control-sm mt-2">
</label>
</div>
</div><!-- .col-sm-10 -->
</div>
</div><!-- /.card-body -->
</div><!-- /.card -->
</div><!-- /.tab-pane -->
<div class="tab-pane <?php if($_SESSION['post_config_nav']=='theme'):?> show active<?php endif?>" id="theme">
<div class="card border-0 rounded-0 mb-0">
<div class="card-header page-body-header">
<i class="fa fa-columns fa-fw" aria-hidden="true"></i> 레이아웃 설정
</div>
<div class="card-body">
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">레이아웃</label>
<div class="col-lg-10 col-xl-9">
<select name="layout" class="form-control custom-select">
<option value="">사이트 대표 레이아웃</option>
<option disabled>--------------------</option>
<?php $dirs = opendir($g['path_layout'])?>
<?php while(false !== ($tpl = readdir($dirs))):?>
<?php if($tpl=='.' || $tpl == '..' || $tpl == '_blank' || is_file($g['path_layout'].$tpl))continue?>
<?php $dirs1 = opendir($g['path_layout'].$tpl)?>
<optgroup label="<?php echo getFolderName($g['path_layout'].$tpl)?>">
<?php while(false !== ($tpl1 = readdir($dirs1))):?>
<?php if(!strstr($tpl1,'.php') || $tpl1=='_main.php')continue?>
<option value="<?php echo $tpl?>/<?php echo $tpl1?>"<?php if($d['post']['layout']==$tpl.'/'.$tpl1):?> selected="selected"<?php endif?>><?php echo $tpl?> &gt; <?php echo str_replace('.php','',$tpl1)?></option>
<?php endwhile?>
</optgroup>
<?php closedir($dirs1)?>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">
<span class="badge badge-dark">모바일 접속</span>
</label>
<div class="col-lg-10 col-xl-9">
<select name="m_layout" class="form-control custom-select" id="" tabindex="-1">
<?php if ($_HS['m_layout']): ?>
<option value="0">사이트 레이아웃</option>
<?php else: ?>
<option value="0">&nbsp;사용안함 (기본 레이아웃 적용)</option>
<?php endif; ?>
<option disabled>--------------------</option>
<?php $dirs = opendir($g['path_layout'])?>
<?php while(false !== ($tpl = readdir($dirs))):?>
<?php if($tpl=='.' || $tpl == '..' || $tpl == '_blank' || is_file($g['path_layout'].$tpl))continue?>
<?php $dirs1 = opendir($g['path_layout'].$tpl)?>
<optgroup label="<?php echo getFolderName($g['path_layout'].$tpl)?>">
<?php while(false !== ($tpl1 = readdir($dirs1))):?>
<?php if(!strstr($tpl1,'.php') || $tpl1=='_main.php')continue?>
<option value="<?php echo $tpl?>/<?php echo $tpl1?>"<?php if($d['post']['m_layout']==$tpl.'/'.$tpl1):?> selected="selected"<?php endif?>><?php echo $tpl?> &gt; <?php echo str_replace('.php','',$tpl1)?></option>
<?php endwhile?>
</optgroup>
<?php closedir($dirs1)?>
<?php endwhile?>
<?php closedir($dirs)?>
</select>
</div>
</div>
</div><!-- /.card-body -->
</div><!-- /.card -->
<div class="card border-left-0 rounded-0 mb-0">
<div class="card-header page-body-header">
<i class="fa fa-picture-o fa-fw" aria-hidden="true"></i> 테마 설정
</div>
<div class="card-body">
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
대표 테마
</label>
<div class="col-md-10 col-xl-9">
<select name="skin_main" class="form-control custom-select">
<option value="">선택하세요</option>
<option value="" disabled>--------------------------------</option>
<optgroup label="데스크탑">
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['post']['skin_main']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="모바일">
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['post']['skin_main']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
<small class="form-text text-muted">
지정된 대표테마는 포스트설정시 별도의 테마지정없이 자동으로 적용됩니다.
가장 많이 사용하는 테마를 지정해 주세요.
</small>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
<div class="form-group row">
<label class="col-md-2 col-form-label text-md-right">
<span class="badge badge-dark">모바일 대표테마</span>
</label>
<div class="col-md-10 col-xl-9">
<select name="skin_mobile" class="form-control custom-select">
<option value="">모바일 테마 사용안함</option>
<option value="" disabled>--------------------------------</option>
<optgroup label="모바일">
<?php $tdir = $g['path_module'].$module.'/themes/_mobile/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_mobile/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['post']['skin_mobile']=='_mobile/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
<optgroup label="데스크탑">
<?php $tdir = $g['path_module'].$module.'/themes/_desktop/'?>
<?php $dirs = opendir($tdir)?>
<?php while(false !== ($skin = readdir($dirs))):?>
<?php if($skin=='.' || $skin == '..' || is_file($tdir.$skin))continue?>
<option value="_desktop/<?php echo $skin?>" title="<?php echo $skin?>"<?php if($d['post']['skin_mobile']=='_desktop/'.$skin):?> selected="selected"<?php endif?>>ㆍ<?php echo getFolderName($tdir.$skin)?>(<?php echo $skin?>)</option>
<?php endwhile?>
<?php closedir($dirs)?>
</optgroup>
</select>
<small class="form-text text-muted">
선택하지 않으면 데스크탑 대표테마로 설정됩니다.
</small>
</div> <!-- .col-sm-10 -->
</div> <!-- .form-group -->
</div><!-- /.card-body -->
</div><!-- /.card -->
</div><!-- /.tab-pane -->
<div class="tab-pane <?php if($_SESSION['post_config_nav']=='perm'):?> show active<?php endif?>" id="perm">
<div class="card border-0 rounded-0 mb-0">
<div class="card-header page-body-header">
포스트 작성
</div>
<div class="card-body">
<fieldset>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">허용등급</label>
<div class="col-lg-10 col-xl-9">
<select name="perm_l_write" class="form-control custom-select">
<option value="0">&nbsp;+ 전체허용</option>
<option value="0">--------------------------------</option>
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
<?php while($_L=db_fetch_array($_LEVEL)):?>
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==$d['post']['perm_l_write']):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
<?php if($_L['gid'])break; endwhile?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">차단그룹</label>
<div class="col-lg-10 col-xl-9">
<select name="perm_g_write" class="form-control custom-select" multiple size="5">
<option value=""<?php if(!$d['post']['perm_g_write']):?> selected="selected"<?php endif?>>ㆍ차단안함</option>
<?php $_SOSOK=getDbArray($table['s_mbrgroup'],'','*','gid','asc',0,1)?>
<?php while($_S=db_fetch_array($_SOSOK)):?>
<option value="<?php echo $_S['uid']?>"<?php if(strstr($d['post']['perm_g_write'],'['.$_S['uid'].']')):?> selected="selected"<?php endif?>>ㆍ<?php echo $_S['name']?>(<?php echo number_format($_S['num'])?>)</option>
<?php endwhile?>
</select>
</div>
</div>
</fieldset>
</div><!-- /.card-body -->
</div><!-- /.card -->
<div class="card border-left-0 rounded-0 mb-0">
<div class="card-header page-body-header">
카테고리 지정
</div>
<div class="card-body">
<fieldset>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">허용등급</label>
<div class="col-lg-10 col-xl-9">
<select name="perm_l_category" class="form-control custom-select">
<option value="0">&nbsp;+ 전체허용</option>
<option value="0">--------------------------------</option>
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
<?php while($_L=db_fetch_array($_LEVEL)):?>
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==$d['post']['perm_l_category']):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
<?php if($_L['gid'])break; endwhile?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">차단그룹</label>
<div class="col-lg-10 col-xl-9">
<select name="perm_g_category" class="form-control custom-select" multiple size="5">
<option value=""<?php if(!$d['post']['perm_g_category']):?> selected="selected"<?php endif?>>ㆍ차단안함</option>
<?php $_SOSOK=getDbArray($table['s_mbrgroup'],'','*','gid','asc',0,1)?>
<?php while($_S=db_fetch_array($_SOSOK)):?>
<option value="<?php echo $_S['uid']?>"<?php if(strstr($d['post']['perm_g_category'],'['.$_S['uid'].']')):?> selected="selected"<?php endif?>>ㆍ<?php echo $_S['name']?>(<?php echo number_format($_S['num'])?>)</option>
<?php endwhile?>
</select>
</div>
</div>
</fieldset>
</div><!-- /.card-body -->
</div><!-- /.card -->
<div class="card rounded-0 mb-0 d-none">
<div class="card-header">
상품연결
</div>
<div class="card-body">
<fieldset>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">허용등급</label>
<div class="col-lg-10 col-xl-9">
<select name="perm_l_goods" class="form-control custom-select">
<option value="0">&nbsp;+ 전체허용</option>
<option value="0">--------------------------------</option>
<?php $_LEVEL=getDbArray($table['s_mbrlevel'],'','*','uid','asc',0,1)?>
<?php while($_L=db_fetch_array($_LEVEL)):?>
<option value="<?php echo $_L['uid']?>"<?php if($_L['uid']==$d['post']['perm_l_goods']):?> selected="selected"<?php endif?>>ㆍ<?php echo $_L['name']?>(<?php echo number_format($_L['num'])?>) 이상</option>
<?php if($_L['gid'])break; endwhile?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label text-lg-right">차단그룹</label>
<div class="col-lg-10 col-xl-9">
<select name="perm_g_goods" class="form-control custom-select" multiple size="5">
<option value=""<?php if(!$d['post']['perm_g_goods']):?> selected="selected"<?php endif?>>ㆍ차단안함</option>
<?php $_SOSOK=getDbArray($table['s_mbrgroup'],'','*','gid','asc',0,1)?>
<?php while($_S=db_fetch_array($_SOSOK)):?>
<option value="<?php echo $_S['uid']?>"<?php if(strstr($d['post']['perm_g_goods'],'['.$_S['uid'].']')):?> selected="selected"<?php endif?>>ㆍ<?php echo $_S['name']?>(<?php echo number_format($_S['num'])?>)</option>
<?php endwhile?>
</select>
</div>
</div>
</fieldset>
</div><!-- /.card-body -->
</div><!-- /.card -->
</div>
<div class="row">
<div class="offset-md-2 col-md-10 col-xl-9">
<button type="submit" class="btn btn-outline-primary btn-block my-4">저장하기</button>
</div>
</div>
</div><!-- /.tab-content -->
</div><!-- /.col -->
</form>
<script type="text/javascript">
//사이트 셀렉터 출력
$('[data-role="siteSelector"]').removeClass('d-none')
putCookieAlert('post_config_result') // 실행결과 알림 메시지 출력
function saveCheck(f)
{
if (f.skin_main.value == '')
{
alert('대표테마를 선택해 주세요. ');
f.skin_main.focus();
return false;
}
// if (f.skin_mobile.value == '')
// {
// alert('모바일테마를 선택해 주세요. ');
// f.skin_mobile.focus();
// return false;
// }
getIframeForAction(f);
f.submit();
}
</script>

368
modules/post/admin/list.php Normal file
View File

@@ -0,0 +1,368 @@
<?php
include $g['path_module'].$module.'/var/var.php';
$bbs_time=$d['bbs']['time']; // 아래 $d 배열과 충돌을 피하기 위해서 별도로 지정
$sort = $sort ? $sort : 'gid';
$orderby= $orderby ? $orderby : 'desc';
$recnum = $recnum && $recnum < 301 ? $recnum : 30;
$listque = 'uid';
$account = $SD['uid'];
if ($account) $listque .= ' and site='.$account;
if ($where && $keyw)
{
if (strstr('[id]',$where)) $listque .= " and ".$where."='".$keyw."'";
else $listque .= getSearchSql($where,$keyw,$ikeyword,'or');
}
$RCD = getDbArray($table[$module.'list'],$listque,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table[$module.'list'],$listque);
$TPG = getTotalPage($NUM,$recnum);
$SITES = getDbArray($table['s_site'],'','*','gid','asc',0,1);
$SITEN = db_num_rows($SITES);
?>
<div class="row">
<div class="col-sm-4 col-md-4 col-xl-3 d-none sidebar">
<div id="accordion" role="tablist" style="height: calc(100vh - 10rem);">
<form name="procForm" action="<?php echo $g['s']?>/" method="get">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="module" value="<?php echo $module?>">
<input type="hidden" name="front" value="<?php echo $front?>">
<div class="card border-0">
<div class="card-header p-0">
<a class="d-block muted-link collapsed" href="#collapse-sort" data-toggle="collapse" role="button" aria-expanded="true" aria-controls="collapse-sort">
정렬
</a>
</div>
<div id="collapse-sort" class="collapse" role="tabpanel" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
<div class="btn-group btn-group-toggle btn-group-sm mb-2" data-toggle="buttons">
<label class="btn btn-light<?php if($sort=='gid'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="gid" name="sort"<?php if($sort=='gid'):?> checked<?php endif?>> 지정순서
</label>
<label class="btn btn-light<?php if($sort=='uid'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="uid" name="sort"<?php if($sort=='uid'):?> checked<?php endif?>> 개설일
</label>
<label class="btn btn-light<?php if($sort=='num_r'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="num_r" name="sort"<?php if($sort=='num_r'):?> checked<?php endif?>> 게시물수
</label>
<label class="btn btn-light<?php if($sort=='d_last'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="d_last" name="sort"<?php if($sort=='d_last'):?> checked<?php endif?>> 최근게시
</label>
</div>
<div class="btn-group btn-group-toggle btn-group-sm mb-3" data-toggle="buttons">
<label class="btn btn-light<?php if($orderby=='desc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="desc" name="orderby"<?php if($orderby=='desc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-desc"></i> 정순
</label>
<label class="btn btn-light<?php if($orderby=='asc'):?> active<?php endif?>" onclick="btnFormSubmit(this);">
<input type="radio" value="asc" name="orderby"<?php if($orderby=='asc'):?> checked<?php endif?>> <i class="fa fa-sort-amount-asc"></i> 역순
</label>
</div>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">출력수</span>
</div>
<select name="recnum" onchange="this.form.submit();" class="form-control custom-select">
<option value="20"<?php if($recnum==20):?> selected="selected"<?php endif?>>20 개</option>
<option value="35"<?php if($recnum==35):?> selected="selected"<?php endif?>>35 개</option>
<option value="50"<?php if($recnum==50):?> selected="selected"<?php endif?>>50 개</option>
<option value="75"<?php if($recnum==75):?> selected="selected"<?php endif?>>75 개</option>
<option value="90"<?php if($recnum==90):?> selected="selected"<?php endif?>>90 개</option>
</select>
</div>
</div>
</div>
</div> <!-- .card -->
<div class="card">
<div class="card-header p-0">
<a class="collapsed d-block muted-link" href="#collapse-search" data-toggle="collapse" href="#collapse-search" role="button" aria-expanded="false" aria-controls="collapse-search">
리스트 검색
</a>
</div>
<div class="collapse<?php if($_SESSION['sh_mediaset']):?> show<?php endif?>" id="collapse-search">
<div class="card-body">
<div class="input-group mb-3">
<select name="where" class="form-control custom-select" style="width: 30px">
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>리스트명</option>
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
</select>
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control">
</div>
<button class="btn btn-outline-secondary" type="submit">검색</button>
</div>
</div>
</div>
<!-- 고급검색 시작 -->
<div id="search-more" class="collapse<?php if($_SESSION['sh_mediaset']):?> in<?php endif?>">
<div class="form-group">
<label class="col-sm-1 control-label">검색</label>
<div class="col-sm-10">
<div class="input-group input-group-sm">
<span class="input-group-btn hidden-xs" style="width:165px">
<select name="where" class="form-control btn btn-light">
<option value="name"<?php if($where=='name'):?> selected="selected"<?php endif?>>리스트명</option>
<option value="id"<?php if($where=='id'):?> selected="selected"<?php endif?>>아이디</option>
</select>
</span>
<input type="text" name="keyw" value="<?php echo stripslashes($keyw)?>" class="form-control">
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">검색</button>
</span>
<span class="input-group-btn">
<button class="btn btn-light" type="button" onclick="location.href='<?php echo $g['adm_href']?>';">리셋</button>
</span>
</div>
</div>
</div> <!-- .form-group -->
</div>
<!-- 고급검색 끝 -->
<div class="form-group">
<div class="col-sm-offset-1 col-sm-10">
<button type="button" class="btn btn-link rb-advance<?php if(!$_SESSION['sh_mediaset']):?> collapsed<?php endif?>" data-toggle="collapse" data-target="#search-more" onclick="sessionSetting('sh_mediaset','1','','1');">고급검색 <small></small></button>
</div>
</div>
</form>
</div> <!-- .rb-heading well well-sm : 검색영역 회색 박스 -->
<?php if($NUM):?>
<div class="p-2">
<a href="<?php echo $g['adm_href']?>" class="btn btn-light btn-block">검색조건 초기화</a>
</div>
<?php endif?>
</div><!-- /.sidebar -->
<div class="col-sm-12 col-md-12 col-xl-12">
<div class="card p-2 mb-0 bg-dark d-flex justify-content-between pr-4">
<form class="form-inline" name="procForm" action="<?php echo $g['s']?>/" method="get">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="module" value="<?php echo $module?>">
<input type="hidden" name="front" value="<?php echo $front?>">
<select class="form-control custom-select" name="sort" onchange="this.form.submit();">
<option value="gid" selected="selected">지정순서</option>
<option value="uid">개설일</option>
<option value="num_r">게시물수</option>
<option value="d_last">최근게시</option>
</select>
<select class="form-control custom-select" name="orderby" onchange="this.form.submit();">
<option value="desc">역순</option>
<option value="asc" selected="selected">정순</option>
</select>
<select class="form-control custom-select mr-sm-2" name="recnum" onchange="this.form.submit();">
<option value="30" selected="selected">30개</option>
<option value="60">60개</option>
<option value="90">90개</option>
<option value="120">120개</option>
<option value="150">150개</option>
<option value="180">180개</option>
<option value="210">210개</option>
<option value="240">240개</option>
<option value="270">270개</option>
<option value="300">300개</option>
</select>
<select class="form-control custom-select mr-sm-1" name="where">
<option value="name">리스트명</option>
<option value="id">아이디</option>
</select>
<label class="sr-only" for="inlineFormInputName2">검색</label>
<input type="text" class="form-control mr-sm-2" placeholder="" name="keyw" value="<?php echo stripslashes($keyw)?>" >
<button type="submit" class="btn btn-light">검색</button>
<button type="button" class="btn btn-light" onclick="location.href='<?php echo $g['adm_href']?>';">리셋</button>
</form>
</div>
<?php if($NUM):?>
<!-- 리스트 시작 -->
<form class="card rounded-0 border-0" name="listForm" action="<?php echo $g['s']?>/" method="post">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="">
<div class="table-responsive">
<table class="table table-striped text-center mb-0">
<thead class="small text-muted">
<tr>
<th>번호</th>
<th>아이디</th>
<th>리스트명</th>
<th>게시물</th>
<th>업데이트</th>
<th>상태</th>
<th>등록자</th>
<th>관리</th>
</tr>
</thead>
<?php while($R=db_fetch_array($RCD)):?>
<?php $L=getOverTime($date['totime'],$R['d_last'])?>
<tr>
<td><?php echo $NUM-((($p-1)*$recnum)+$_rec++)?></td>
<td><a href="<?php echo getListLink($R,0) ?>" target="_blank"><?php echo $R['id']?></a></td>
<td><span><?php echo $R['name']?></span></td>
<td>
<span class="badge badge-pill badge-dark"><?php echo number_format($R['num'])?></span>
</td>
<td>
<time class="small text-muted" data-plugin="timeago" datetime="<?php echo getDateFormat($R['d_last'],'c')?>">
<?php echo getDateFormat($R['d_last'],'Y.m.d')?>
</time>
<?php if(getNew($R['d_last'],24)):?> <small class="text-danger">N</small><?php endif?>
</td>
<td>
<span class="badge badge-pill badge-dark"><?php echo $g['displaySet']['label'][$R['display']]?></span>
</td>
<td>
<span class="badge badge-pill badge-dark"><?php echo getProfileInfo($R['mbruid'],$_HS['nametype'])?></span>
</td>
<td>
<a class="btn btn-light" href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>&amp;a=deletelist&amp;uid=<?php echo $R['uid']?>&amp;usertype=admin" onclick="return hrefCheck(this,true,'정말로 삭제하시겠습니까?');" class="del">삭제</a>
</td>
</tr>
<?php endwhile?>
</table>
</div><!-- /.table-responsive -->
<div class="card-footer d-flex justify-content-between">
<div>
<button type="button" onclick="chkFlag('bbs_members[]');checkboxCheck();" class="btn btn-sm btn-light">선택/해제</button>
<button type="button" onclick="actCheck('multi_config');" class="btn btn-sm btn-light" id="rb-action-btn">수정</button>
</div>
<ul class="pagination">
<script>getPageLink(5,<?php echo $p?>,<?php echo $TPG?>,'');</script>
<?php //echo getPageLink(5,$p,$TPG,'')?>
</ul>
</div><!-- .card-footer -->
</form><!-- .card -->
<?php else: ?>
<div class="text-center text-muted d-flex align-items-center justify-content-center" style="height: calc(100vh - 10rem);">
<div><i class="fa fa-exclamation-circle fa-3x mb-3" aria-hidden="true"></i>
<p>등록된 리스트가 없습니다.</p>
</div>
</div>
<?php endif?>
</div>
</div><!-- /.row -->
<!-- timeago -->
<?php getImport('jquery-timeago','jquery.timeago','1.6.1','js')?>
<?php getImport('jquery-timeago','locales/jquery.timeago.ko','1.6.1','js')?>
<!-- basic -->
<script>
$(function () {
//사이트 셀렉터 출력
$('[data-role="siteSelector"]').removeClass('d-none')
$('[data-plugin="timeago"]').timeago();
$('[data-toggle="popover"]').popover({
html: true,
trigger: 'hover'
})
putCookieAlert('list_action_result') // 실행결과 알림 메시지 출력
})
$(".checkAll-file-user").click(function(){
$(".rb-file-user").prop("checked",$(".checkAll-file-user").prop("checked"));
checkboxCheck();
});
function checkboxCheck()
{
var f = document.listForm;
var l = document.getElementsByName('bbs_members[]');
var n = l.length;
var i;
var j=0;
for (i = 0; i < n; i++)
{
if (l[i].checked == true) j++;
}
if (j) getId('rb-action-btn').disabled = false;
else getId('rb-action-btn').disabled = true;
}
function dropDate(date1,date2)
{
var f = document.procForm;
f.d_start.value = date1;
f.d_finish.value = date2;
f.submit();
}
function actCheck(act)
{
var f = document.listForm;
var l = document.getElementsByName('bbs_members[]');
var n = l.length;
var j = 0;
var i;
for (i = 0; i < n; i++)
{
if(l[i].checked == true)
{
j++;
}
}
if (!j)
{
alert('선택된 리스트이 없습니다. ');
return false;
}
if (act == 'multi_config')
{
if (confirm('정말로 실행하시겠습니까? '))
{
getIframeForAction(f);
f.a.value = act;
f.submit();
}
}
return false;
}
</script>

View File

374
modules/post/admin/main.php Normal file
View File

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

View File

@@ -0,0 +1,149 @@
html,
#rb-body,
#content-main,
#rb-admin-page-content,
.rb-post-regis {
min-height: 100%;
background-color: #fff;
color: #333;
}
.rb-post-regis {
position: fixed;
top:0;
left:0;
right:0;
bottom:0;
padding-top:53px;
background-color:#fafafa
color: #333;
font-size: 14px;
line-height: 1.5;
}
.rb-post-regis .form-control {
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: 0;
transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.rb-post-regis header {
position: fixed;
left: 0;
right: 0;
height: 64px;
z-index: 99;
}
.document-editor__toolbar {
position: fixed;
top: 117px;
right: 0;
left: 0;
}
.document-editor {
position: absolute;
top: 157px;
right: 0;
bottom: 0;
left: 0;
overflow: auto;
-webkit-transition-property: left,right,top,bottom,width,margin;
transition-property: left,right,top,bottom,width,margin;
-webkit-transition-duration: .2s;
transition-duration: .2s;
}
.rb-fixed-sidebar .document-editor {
right: 350px;
}
.rb-fixed-sidebar{
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.rb-attach-sidebar {
position: fixed;
top: 157px;
bottom:0;
right: -350px;
left:auto;
width: 350px;
overflow-x: hidden;
overflow-y: scroll;
box-shadow: -1px 0 3px rgba(0, 0, 0, 0.5);
-webkit-transition: 250ms cubic-bezier(0.1,.57,.1,1);
transition: 250ms cubic-bezier(0.1,.57,.1,1);
-webkit-transform: translate(0px,0) translateZ(0px);
-ms-transform: translate(0px,0) translateZ(0px);
transform: translate(0px,0) translateZ(0px);
}
.rb-fixed-sidebar .rb-attach-sidebar {
right: 0;
}
.rb-attach-sidebar .nav-tabs .nav-item {
margin-bottom: -1px;
}
.rb-attach-sidebar .nav-tabs .nav-link {
padding: 14px 12px;
font-size: 14px;
line-height: 14px;
color: #586069;
cursor: pointer;
background-color: transparent;
border-top-left-radius: .25rem;
border-top-right-radius: .25rem;
}
.rb-attach-sidebar .nav-tabs .nav-link.active {
color: #495057;
background-color: #fff;
border-color: #ddd #ddd #fff;
}
.rb-attach-sidebar.nav-tabs .nav-link:not(.active) {
border-right: none
}
.rb-attach-sidebar .nav-tabs a:not(.active):hover,
.rb-attach-sidebar .nav-tabs a:not(.active):focus {
border-top-color: transparent;
border-left-color: transparent;
border-right-color: transparent;
border-bottom: 0
}
.rb-attach-sidebar .nav-tabs .nav-link.active:first-child {
border-left: 1px solid #ddd;
}
.rb-attach-sidebar label {
color: #666;
}
.opener {
position: fixed;
right: 40px;
bottom: 15px;
}
.opener .btn {
width: 50px;
height: 50px;
border-radius: 50%
}
.rb-fixed-sidebar .opener {
display: none
}
.ck-toc:empty {
padding: 2rem;
text-align: center;
}
.ck-toc:empty::before {
content: "문서에 추가한 제목이 여기 표시됩니다.";
color: rgb(153, 153, 153);
}

View File

@@ -0,0 +1,287 @@
<?php
$R=array();
$upfile = '';
if ($uid) {
$R=getUidData($table[$module.'data'],$uid);
$u_arr = getArrayString($R['upfiles']);
$_tmp=array();
$i=0;
foreach ($u_arr['data'] as $val) {
$U=getUidData($table['s_upload'],$val);
if(!$U['fileonly']) $_tmp[$i]=$val;
$i++;
}
$insert_array='';
// 중괄로로 재조립
foreach ($_tmp as $uid) {
$insert_array.='['.$uid.']';
}
}
?>
<!-- smooth-scroll : https://github.com/cferdinandi/smooth-scroll -->
<?php getImport('smooth-scroll','smooth-scroll.polyfills.min','16.1.0','js') ?>
<div class="rb-post-regis<?php if($_SESSION['editor_sidebar']=='right'):?> rb-fixed-sidebar<?php endif?>">
<form name="procForm" action="<?php echo $g['s']?>/" method="post">
<input type="hidden" name="r" value="<?php echo $r?>">
<input type="hidden" name="m" value="<?php echo $module?>">
<input type="hidden" name="a" value="regis_post">
<input type="hidden" name="uid" value="<?php echo $R['uid']?>">
<input type="hidden" name="category_members">
<input type="hidden" name="upload" id="upfilesValue" value="<?php echo $R['upload']?>">
<input type="hidden" name="featured_img" value="<?php echo $R['featured_img'] ?>">
<input type="hidden" name="html" value="HTML">
<input type="hidden" name="content" value="">
<header class="d-flex justify-content-between align-items-center py-2 pl-4 pr-5 bg-white">
<div class="form-group w-50 mb-0">
<label class="sr-only">제목</label>
<input type="text" name="subject" value="<?php echo $R['subject']?$R['subject']:'[제목없음]'?>" class="form-control-plaintext px-2 py-0" placeholder="제목을 입력하세요">
</div>
<div class="">
<a class="btn btn-light" href="<?php echo $g['adm_href'] ?>&front=main" title="매장보기">
포스트 목록
</a>
<?php if ($uid): ?>
<a class="btn btn btn-outline-success" href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=<?php echo $module?>&amp;mod=view&amp;cid=<?php echo $R['cid']?>" target="_blank">
보기
</a>
<?php endif; ?>
<button type="button" class="btn btn-primary js-submit">
<span class="not-loading">
저장하기
</span>
<span class="is-loading"><i class="fa fa-spinner fa-lg fa-spin fa-fw"></i></span>
</button>
</div>
</header>
<main>
<?php
$__SRC__ = getContents($R['content'],$R['html']);
include $g['path_plugin'].'ckeditor5/import.desktop.post.php';
?>
</main>
<aside class="rb-attach-sidebar bg-white">
<div class="sidebar-header d-flex justify-content-between align-items-center pt-1 px-2 position-absolute" style="top:1px;right:1px;">
<div class=""></div>
<button type="button" class="close js-closeSidebar btn" aria-label="Close" data-toggle="tooltip" title="첨부패널 닫기">
<span aria-hidden="true">&times;</span>
</button>
</div>
<ul class="nav nav-pills nav-fill" role="tablist">
<li class="nav-item">
<a class="nav-link rounded-0 border-top-0 border-left-0<?php if(!$_SESSION['editor_sidebar_tab']):?> active<?php endif?>" id="tab-file" data-toggle="tab" href="#pane-file" role="tab" aria-controls="file" aria-selected="true" onclick="sessionSetting('editor_sidebar_tab','','','');">
첨부
</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-0 border-top-0 <?php if($_SESSION['editor_sidebar_tab']=='link'):?> active<?php endif?>" id="tab-link" data-toggle="tab" href="#pane-link" role="tab" aria-controls="media" aria-selected="false" onclick="sessionSetting('editor_sidebar_tab','link','','');">
링크
</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-0 border-top-0 <?php if($_SESSION['editor_sidebar_tab']=='category'):?> active<?php endif?>" id="tab-category" data-toggle="tab" href="#pane-category" role="tab" aria-controls="media" aria-selected="false" onclick="sessionSetting('editor_sidebar_tab','category','','');">
카테고리
</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-0 border-top-0 <?php if($_SESSION['editor_sidebar_tab']=='toc'):?> active<?php endif?>" id="tab-toc" data-toggle="tab" href="#pane-toc" role="tab" aria-controls="media" aria-selected="false" onclick="sessionSetting('editor_sidebar_tab','toc','','');">
목차
</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-0 border-top-0 border-right-0<?php if($_SESSION['editor_sidebar_tab']=='cog'):?> active<?php endif?>" id="tab-cog" data-toggle="tab" href="#pane-cog" role="tab" aria-controls="media" aria-selected="false" onclick="sessionSetting('editor_sidebar_tab','cog','','');">
설정
</a>
</li>
</ul>
<div class="tab-content mt-3">
<div class="tab-pane px-2<?php if(!$_SESSION['editor_sidebar_tab']):?> show active <?php endif?>" id="pane-file" role="tabpanel">
<?php getWidget('_default/attach',array('parent_module'=>'post','theme'=>'_desktop/bs4-default-attach','attach_handler_photo'=>'[data-role="attach-handler-photo"]','parent_data'=>$R,'attach_object_type'=>'file','wysiwyg'=>'Y'));?>
<p>
<small class="text-muted">
사진,파일,비디오,오디오를 한번에 최대 최대 <?php echo str_replace('M','',ini_get('upload_max_filesize'))?>MB 까지 업로드 할수 있습니다.<br>
</small>
</p>
</div>
<div class="tab-pane px-2<?php if($_SESSION['editor_sidebar_tab']=='link'):?> show active <?php endif?>" id="pane-link" role="tabpanel">
<?php getWidget('_default/attach',array('parent_module'=>'post','theme'=>'_desktop/bs4-default-link','attach_handler_photo'=>'[data-role="attach-handler-photo"]','parent_data'=>$R,'wysiwyg'=>'Y'));?>
</div><!-- /.tab-pane -->
<div class="tab-pane px-4<?php if($_SESSION['editor_sidebar_tab']=='toc'):?> show active <?php endif?>" id="pane-toc" role="tabpanel">
<ul id="toc" class=" ck-toc list-unstyled"></ul>
</div><!-- /.tab-pane -->
<div class="tab-pane px-4<?php if($_SESSION['editor_sidebar_tab']=='category'):?> show active <?php endif?>" id="pane-category" role="tabpanel">
<?php $_treeOptions=array('site'=>$s,'table'=>$table[$module.'category'],'dispNum'=>true,'dispHidden'=>false,'dispCheckbox'=>true,'allOpen'=>true,'bookmark'=>'site-menu-info')?>
<?php $_treeOptions['link'] = $g['adm_href'].'&amp;cat='?>
<?php echo getTreePostCategoryCheck($_treeOptions,$uid,0,0,'')?>
</div><!-- /.tab-pane -->
<div class="tab-pane px-4<?php if($_SESSION['editor_sidebar_tab']=='cog'):?> show active <?php endif?>" id="pane-cog" role="tabpanel">
<div class="form-group">
<label class="sr-only">요약설명</label>
<textarea class="form-control" rows="2" name="review" placeholder="요약설명을 입력하세요"><?php echo $R['review']?></textarea>
<small class="form-text text-muted">500자 이내로 등록할 수 있으며 태그를 사용할 수 있습니다.</small>
</div>
<div class="form-group mt-4">
<label class="sr-only">태그</label>
<input type="text" name="tag" value="<?php echo $R['tag']?>" class="form-control" placeholder="태그를 입력하세요">
<small class="form-text text-muted">콤마(,)로 구분하여 입력해 주세요.</small>
</div>
<div class="card">
<div class="card-header">
연결메뉴
</div>
<div class="card-body">
<select name="linkedmenu" class="form-control custom-select">
<option value="">사용 안함</option>
<option disabled>--------------------</option>
<?php include_once $g['path_core'].'function/menu1.func.php'?>
<?php $cat=$R['linkedmenu']?>
<?php getMenuShowSelect($s,$table['s_menu'],0,0,0,0,0,'')?>
</select>
<small class="form-text text-muted">
이 포스트를 메뉴에 연결하였을 경우 해당메뉴를 지정해 주세요.<br>
연결메뉴를 지정하면 로케이션이 동기화 됩니다.
</small>
</div>
</div>
<div class="card">
<div class="card-header">
연결 상품
</div>
<div class="card-body">
<input class="form-control" name="linkedshop" type="text" placeholder="연결할 상품" value="<?php echo $R['linkedshop']?>">
<small class="form-text text-muted">
[상품고유번호][상품고유번호].. 형식으로 입력해주세요
</small>
</div>
</div>
</div><!-- /.tab-pane -->
</div><!-- /.tab-content -->
</aside>
</form>
</div>
<!-- 요약부분 글자수 체크 -->
<?php getImport('bootstrap-maxlength','bootstrap-maxlength.min',false,'js') ?>
<script type="text/javascript">
//사이트 셀렉터 출력
$('[data-role="siteSelector"]').removeClass('d-none')
putCookieAlert('result_post_regis') // 실행결과 알림 메시지 출력
// $("#toc").toc({content: ".ck-content", headings: "h2,h3,h4"});
var scroll = new SmoothScroll('a[href*="#"]');
$(".js-openSidebar").click(function(){
$('.rb-post-regis').addClass('rb-fixed-sidebar');
sessionSetting('editor_sidebar','right','','');
});
$(".js-closeSidebar").click(function(){
$('.rb-post-regis').removeClass('rb-fixed-sidebar');
sessionSetting('editor_sidebar','','','');
$('[data-toggle="tooltip"]').tooltip('hide')
});
$(".js-submit").click(function(e) {
$(this).attr("disabled",true);
var f = document.procForm;
if (f.subject.value == '')
{
alert('제목 입력해 주세요.');
f.subject.focus();
return false;
}
var editorData = editor.getData();
$('[name="content"]').val(editorData);
// 카테고리 체크
var cat_sel=$('input[name="tree_members[]"]');
var cat_sel_n=cat_sel.length;
var cat_arr=$('input[name="tree_members[]"]:checked').map(function(){return $(this).val();}).get();
var cat_n=cat_arr.length;
if(cat_sel_n>0 && cat_arr==''){
alert('지정된 카테고리가 없습니다.\n적어도 하나이상의 카테고리를 지정해 주세요.');
return false;
} else {
var s='';
for (var i=0;i <cat_n;i++) {
if(cat_arr[i]!='') s += '['+cat_arr[i]+']';
}
f.category_members.value = s;
}
// 대표이미지가 없을 경우, 첫번째 업로드 사진을 지정함
var featured_img_input = $('input[name="featured_img"]'); // 대표이미지 input
var featured_img_uid = $(featured_img_input).val();
if(featured_img_uid ==0){ // 대표이미지로 지정된 값이 없는 경우
var first_attach_img_li = $('.rb-attach-photo li:first'); // 첫번째 첨부된 이미지 리스트 li
var first_attach_img_uid = $(first_attach_img_li).attr('data-id');
featured_img_input.val(first_attach_img_uid);
}
// 첨부파일 uid 를 upfiles 값에 추가하기
var attachfiles=$('input[name="attachfiles[]"]').map(function(){return $(this).val()}).get();
var new_upfiles='';
if(attachfiles){
for(var i=0;i<attachfiles.length;i++) {
new_upfiles+=attachfiles[i];
}
$('input[name="upload"]').val(new_upfiles);
}
// $("#toc").empty().toc({content: ".ck-content", headings: "h2,h3,h4"}); // TOC 갱신
setTimeout(function(){
getIframeForAction(f);
f.submit();
}, 500);
});
</script>

View File

@@ -0,0 +1,11 @@
<link href="<?php echo $g['s']?>/_core/css/github-markdown.css" rel="stylesheet">
<div class="px-5 py-4 markdown-body">
<?php @readfile($g['path_module'].$module.'/README.md')?>
</div>
<?php getImport('jquery-markdown','jquery.markdown','0.0.10','js')?>
<script>
$('.markdown-body').markdown();
</script>

View File

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

View File

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

View File

@@ -0,0 +1,8 @@
<?php
$d['amenu']['config'] = '환경설정';
$d['amenu']['main'] = '포스트';
$d['amenu']['list'] = '리스트';
$d['amenu']['category'] = '카테고리';
$d['amenu']['theme'] = '테마';
$d['amenu']['readme'] = '도움말';
?>

View File

@@ -0,0 +1,104 @@
<?php
/**************************************************************
아래의 변수를 이용합니다.
$_iscallpage 통합검색 이거나 더보기일경우 true 아니면 false
$where 검색위치
$q 검색키워드
$orderby (desc 최신순 / asc 오래된순)
$d['search']['num1'] 전체검색 출력수
$d['search']['num2'] 전용검색 한 페이당 출력수
$d['search']['term'] 검색기간(월단위)
검색결과 DIV id 정의방법 : <div id="rb-search-모듈id-검색파일명"> ... </div>
***************************************************************
검색결과 추출 예제 ::
$sqlque = ''; // 검색용 SQL 초기화
if ($q)
{
$sqlque .= getSearchSql('검색필드',$q,'','or'); //검색필드 설정방법 : 1개의 필드 -> 필드명 , 복수의 필드 -> 필드명을 |(파이프) 로 구분
}
// 더보기 검색일 경우에만 실행함
if ($swhere == $_key)
{
$sort = 'uid'; // 기본 정렬필드
$RCD = getDbArray($table['테이블명'],$sqlque,'*',$sort,$orderby,$d['search']['num'.($swhere=='all'?1:2)],$p);
while($_R = db_fetch_array($RCD))
{
echo $_R['필드네임'];
}
}
$_ResultArray['num'][$_key] = getDbRows($table['테이블명'],$sqlque); // 검색어에 해당되는 결과갯수 <- 무조건 실행해야 됨
**************************************************************
아래의 예제는 실제로 페이지를 검색하는 샘플입니다.
페이징,더보기,검색결과 없을경우 안내등은 모두 자동으로 처리되니 결과 리스트만 출력해 주시면 됩니다.
최초 설치시 "이용약관" 이나 "개인정보" 로 검색하시면 결과값을 얻으실 수 있습니다.
**************************************************************/
?>
<?php
$sqlque = 'uid';
if ($d_start) $sqlque .= ' and d_regis > '.str_replace('/','',$d_start).'000000';
if ($d_finish) $sqlque .= ' and d_regis < '.str_replace('/','',$d_finish).'240000';
$sqlque .= getSearchSql('subject|review|tag',$q,'','or'); // 게시물 제목과 내용 검색
$orderby = $orderby?$orderby:'desc';
if ($my['uid']) $sqlque .= ' and display > 3'; // 회원공개와 전체공개 포스트 출력
else $sqlque .= ' and display = 5'; // 전체공개 포스트만 출력
if($_iscallpage):
$RCD = getDbArray($table['postdata'],$sqlque,'*','uid',$orderby,$d['search']['num'.($swhere=='all'?1:2)],$p);
include_once $g['path_module'].'post/var/var.php';
$g['url_module_skin'] = $g['s'].'/modules/post/themes/'.$d['post']['skin_main'];
$g['dir_module_skin'] = $g['path_module'].'post/themes/'.$d['post']['skin_main'].'/';
include_once $g['dir_module_skin'].'_widget.php';
?>
<article>
<ul class="list-unstyled" data-role="post-list">
<?php while($_R=db_fetch_array($RCD)):?>
<li class="media my-3">
<?php if ($_R['featured_img']): ?>
<a href="<?php echo getPostLink($_R,0) ?>" class="position-relative mr-3" target="_blank">
<img src="<?php echo checkPostPerm($_R) ?getPreviewResize(getUpImageSrc($_R),'140x78'):getPreviewResize('/files/noimage.png','140x78') ?>" alt="">
<time class="badge badge-dark rounded-0 position-absolute f14" style="right:1px;bottom:1px"><?php echo checkPostPerm($_R)?getUpImageTime($_R):'' ?></time>
</a>
<?php endif; ?>
<div class="media-body">
<h5>
<a class="link_title" href="<?php echo getPostLink($_R,0) ?>" target="_blank">
<?php echo getStrCut(stripslashes($_R['subject']),40,'..')?>
</a>
<time data-plugin="timeago" class="ml-2" datetime="<?php echo getDateFormat($_R['d_regis'],'c')?>"></time>
</h5>
<p class="text-muted my-2"><?php echo $_R['review']?></p>
<div class="mb-1">
<span class="text-muted">
<!-- 태그 -->
<?php $_tags=explode(',',$_R['tag'])?>
<?php $_tagn=count($_tags)?>
<?php $i=0;for($i = 0; $i < $_tagn; $i++):?>
<?php $_tagk=trim($_tags[$i])?>
<a class="badge badge-light" href="<?php echo RW('m=post&mod=keyword&') ?>keyword=<?php echo urlencode($_tagk)?>"><?php echo $_tagk?></a>
<?php endfor?>
</span>
<span class="badge badge-light"><?php echo checkPostOwner($_R) && $_R['display']!=5?$g['displaySet']['label'][$_R['display']]:'' ?></span>
</div>
</div>
</li>
<?php endwhile?>
</ul>
</article>
<?php
endif;
$_ResultArray['num'][$_key] = getDbRows($table['postdata'],$sqlque);
?>

View File

@@ -0,0 +1,64 @@
<?php
$sqlque = 'uid';
if ($d_start) $sqlque .= ' and d_regis > '.str_replace('/','',$d_start).'000000';
if ($d_finish) $sqlque .= ' and d_regis < '.str_replace('/','',$d_finish).'240000';
$sqlque .= getSearchSql('name|tag',$q,'','or'); // 게시물 제목과 내용 검색
$orderby = $orderby?$orderby:'desc';
if ($my['uid']) $sqlque .= ' and display > 3'; // 회원공개와 전체공개 포스트 출력
else $sqlque .= ' and display = 5'; // 전체공개 포스트만 출력
if($_iscallpage):
$RCD = getDbArray($table['postlist'],$sqlque,'*','uid',$orderby,$d['search']['num'.($swhere=='all'?1:2)],$p);
$_NUM = getDbRows($table['postlist'],$sqlque);
$c_recnum = 3; // 한 열에 출력할 카드 갯수
$totalCardDeck=ceil($_NUM/$c_recnum); // card-deck 갯수 ($_NUM 은 해당 데이타의 총 card 갯수 getDbRows 이용)
$total_card_num = $totalCardDeck*$c_recnum;// 총 출력되야 할 card 갯수(빈카드 포함)
$print_card_num = 0; // 실제 출력된 카드 숫자 (아래 card 출력될 때마다 1 씩 증가)
$lack_card_num = $total_card_num;
?>
<div class="card-deck">
<?php $i=0;foreach($RCD as $R):$i++?>
<div class="card mb-3">
<a href="<?php echo getListLink($R,0) ?>" class="position-relative" target="_blank">
<img src="<?php echo getPreviewResize(getListImageSrc($R['uid']),'320x180') ?>" class="img-fluid" alt="">
<span class="list_mask">
<span class="txt"><?php echo $R['num']?><i class="fa fa-list-ul d-block" aria-hidden="true"></i></span>
</span>
<img class="list_avatar border" src="<?php echo getAvatarSrc($R['mbruid'],'50') ?>" width="50" height="50" alt="">
</a>
<div class="card-body pt-5 p-3">
<h5 class="card-title h6 mb-1">
<a class="muted-link" href="<?php echo getListLink($R,0) ?>" target="_blank">
<?php echo $R['name']?>
</a>
</h5>
<span class="small text-muted">업데이트: <time class="text-muted" data-plugin="timeago" datetime="<?php echo getDateFormat($R['d_last'],'c')?>"></time></span>
<?php if(getNew($R['d_last'],$d['post']['newtime'])):?><span class="rb-new ml-1"></span><?php endif?>
</div><!-- /.card-body -->
</div><!-- /.card -->
<?php
$print_card_num++; // 카드 출력될 때마 1씩 증가
$lack_card_num = $total_card_num - $print_card_num;
?>
<?php if(!($i%$c_recnum)):?></div><div class="card-deck"><?php endif?>
<?php endforeach?>
<?php if($lack_card_num ):?>
<?php for($j=0;$j<$lack_card_num;$j++):?>
<div class="card border-0"></div>
<?php endfor?>
<?php endif?>
</div><!-- /.card-deck -->
<?php
endif;
$_ResultArray['num'][$_key] = $_NUM;
?>

View File

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

View File

@@ -0,0 +1,97 @@
<?php
// 게시물 태그추출 함수
function getPostTag($tag){
global $g,$r;
$_tags=explode(',',$tag);
$_tagn=count($_tags);
$html='';
$post_list = $g['url_root'].'/?r='.$r.'&m=post&bid=';
$i=0;
for($i = 0; $i < $_tagn; $i++):;
$_tagk=trim($_tags[$i]);
$html.='<span data-toggle="tag" data-tag="'.$_tagk.'" class="badge badge-primary badge-inverted f13">#';
$html.=$_tagk;
$html.='</span>';
endfor;
return $html;
}
/*
댓글 삭제 함수
$d : 설정 파일 내역 배열, $m : 모듈명 $B : 블로그 uid
parent 가 $m.$R['uid'] 형식인점에 유의 !!!
*/
function DeleteComment($R,$d,$m,$B)
{
global $table,$date;
$CCD = getDbArray($table['s_comment'],"parent='".$m.$R['uid']."'",'*','uid','asc',0,0);
while($C=db_fetch_array($CCD))
{
if ($C['upload']) DeleteUpfile($C,$d);
if ($C['oneline']) DeleteOneline($C,$d);
getDbDelete($table['s_comment'],'uid='.$C['uid']);
if ($d['blog']['c_give_opoint']&&$C['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$C['mbruid']."','0','-".$d['blog']['c_give_opoint']."','댓글삭제(".getStrCut($C['subject'],15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$d['blog']['c_give_opoint'],'memberuid='.$C['mbruid']);
}
getDbUpdate($table[$m.'members'],'num_c=num_c-1','blog='.$B['uid'].' and mbruid='.$C['mbruid']);
}
}
//한줄의견 삭제 함수
function DeleteOneline($C,$d)
{
global $table,$date;
$_ONELINE = getDbSelect($table['s_oneline'],'parent='.$C['uid'],'*');
while($_O=db_fetch_array($_ONELINE))
{
if ($d['blog']['c_give_opoint']&&$_O['mbruid'])
{
getDbInsert($table['s_point'],'my_mbruid,by_mbruid,price,content,d_regis',"'".$_O['mbruid']."','0','-".$d['blog']['c_give_opoint']."','한줄의견삭제(".getStrCut(str_replace('&amp;',' ',strip_tags($_O['content'])),15,'').")환원','".$date['totime']."'");
getDbUpdate($table['s_mbrdata'],'point=point-'.$d['blog']['c_give_opoint'],'memberuid='.$_O['mbruid']);
}
}
getDbDelete($table['s_oneline'],'parent='.$C['uid']);
}
//첨부파일 삭제 함수
function DeleteUpfile($R,$d)
{
global $g,$table;
$UPFILES = getArrayString($R['upload']);
foreach($UPFILES['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if ($U['uid'])
{
if ($U['url']==$d['blog']['ftp_urlpath'])
{
$FTP_CONNECT = ftp_connect($d['blog']['ftp_host'],$d['blog']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['blog']['ftp_user'],$d['blog']['ftp_pass']);
if ($d['blog']['ftp_pasv']) ftp_pasv($FTP_CONNECT, true);
if (!$FTP_CONNECT) getLink('','','FTP서버 연결에 문제가 발생했습니다.','');
if (!$FTP_CRESULT) getLink('','','FTP서버 아이디나 패스워드가 일치하지 않습니다.','');
ftp_delete($FTP_CONNECT,$d['blog']['ftp_folder'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) ftp_delete($FTP_CONNECT,$d['blog']['ftp_folder'].$U['folder'].'/'.$U['thumbname']);
ftp_close($FTP_CONNECT);
}
else {
unlink('.'.$U['url'].$U['folder'].'/'.$U['tmpname']);
if($U['type']==2) unlink('.'.$U['url'].$U['folder'].'/'.$U['thumbname']);
}
getDbDelete($table['s_upload'],'uid='.$U['uid']);
}
}
}
?>

View File

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

View File

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

View File

@@ -0,0 +1,433 @@
<?php
//메뉴출력
function getMenuShowPost($Post,$table,$j,$parent,$depth,$uid,$CXA,$hidden)
{
global $cat;
global $MenuOpen,$numhidden,$checkbox,$headfoot;
static $j;
$CD=getDbSelect($table,($Post?'Post='.$Post.' and ':'').'depth='.($depth+1).' and parent='.$parent.($hidden ? ' and hidden=0':'').' order by gid asc','*');
while($C=db_fetch_array($CD))
{
$j++;
if(@in_array($C['uid'],$CXA)) $MenuOpen .= 'trees[0].tmB('.$j.');';
$numprintx = !$numhidden && $C['num_open'] ? '&lt;span class="num"&gt;('.$C['num_open'].')&lt;/span&gt;' : '';
if($GLOBALS['d']['Post']['writeperm']) $numprintx.= !$numhidden && $C['num_reserve'] ? '&lt;span class="num1"&gt;('.$C['num_reserve'].')&lt;/span&gt;' : '';
$C['name'] = $headfoot && ($C['imghead']||$C['imgfoot']||$C['codhead']||$C['codfoot']) ? '&lt;b&gt;'.$C['name'].'&lt;b&gt;' : $C['name'];
$name = $C['uid'] != $cat ? addslashes($C['name']): '&lt;span class="on"&gt;'.addslashes($C['name']).'&lt;/span&gt;';
if($checkbox)
{
$icon1 = '&lt;input type="checkbox" name="category_members[]" value="'.$C['uid'].'"'.($cat==$C['uid']||getDbRows($GLOBALS['table'][$GLOBALS['m'].'catidx'],'category='.$C['uid'].' and parent='.$GLOBALS['R']['uid'])?' checked="checked"':'').' /&gt;';
}
$icon2 = $C['mobile'] ? ' &lt;img src="'.$GLOBALS['g']['img_core'].'/_public/ico_mobile.gif" class="mobile" alt="" /&gt;' : '';
$icon3 = $C['reject'] ? ' &lt;img src="'.$GLOBALS['g']['img_core'].'/_public/ico_hidden.gif" alt="" /&gt;' : '';
if ($C['isson'])
{
echo "['".$icon1.$name.$icon2.$numprintx."','".($GLOBALS['g']['Post_home_rw']?$C['id']:$C['uid'])."',";
getMenuShowPost($Post,$table,$j,$C['uid'],$C['depth'],$uid,$CXA,$hidden);
echo "],\n";
}
else {
echo "['".$icon1.$name.$icon2.$icon3.$numprintx."','".($GLOBALS['g']['Post_home_rw']?$C['id']:$C['uid'])."',''],\n";
}
}
}
//메뉴코드->경로
function getMenuCodeToPathPost($table,$cat,$j)
{
global $DB_CONNECT;
static $arr;
$R=getUidData($table,$cat);
if($R['parent'])
{
$arr[$j]['uid'] = $R['uid'];
$arr[$j]['id'] = $R['id'];
$arr[$j]['name']= $R['name'];
getMenuCodeToPathPost($table,$R['parent'],$j+1);
}
else {
$C=getUidData($table,$cat);
$arr[$j]['uid'] = $C['uid'];
$arr[$j]['id'] = $C['id'];
$arr[$j]['name']= $C['name'];
}
sort($arr);
reset($arr);
return $arr;
}
//메뉴코드->SQL
function getMenuCodeToSqlPost($table,$cat,$f)
{
static $sql;
$R=getUidData($table,$cat);
if ($R['uid']) $sql .= $f.'='.$R['uid'].' or ';
if ($R['isson'])
{
$RDATA=getDbSelect($table,'parent='.$R['uid'],'uid');
while($C=db_fetch_array($RDATA)) getMenuCodeToSqlPost($table,$C['uid'],$f);
}
return substr($sql,0,strlen($sql)-4);
}
function getMenuCodeToSqlPost1($tbl,$cat,$Post,$sql)
{
global $sql;
$R=getUidData($tbl,$cat);
if(!strstr($sql,'['.$R['uid'].']')) $sql = $sql.'['.$R['uid'].']';
if($R['parent'])
{
$C=getUidData($tbl,$R['parent']);
if(!strstr($sql,'['.$C['uid'].']')) $sql = $sql.'['.$C['uid'].']';
getMenuCodeToSqlPost1($tbl,$C['uid'],$Post,$sql);
}
return $sql;
}
function getMenuCodeToSqlPost2($tbl,$cat,$Post,$sql)
{
global $sql;
$R=getUidData($tbl,$cat);
if(!strstr($sql,'['.$R['uid'].']')) $sql = $sql.'['.$R['uid'].']';
if($R['isson'])
{
$RDATA=getDbSelect($tbl,'Post='.$Post.' and parent='.$R['uid'],'uid');
while($C=db_fetch_array($RDATA))
{
if(!strstr($sql,'['.$C['uid'].']')) $sql = $sql.'['.$C['uid'].']';
getMenuCodeToSqlPost2($tbl,$C['uid'],$Post,$sql);
}
}
return $sql;
}
//트리(@ 2.0.0)
function getTreeCategory($conf,$code,$depth,$parent,$tmpcode)
{
$ctype = $conf['ctype']?$conf['ctype']:'uid';
$id = 'tree_'.filterstr(microtime());
$tree = '<div class="rb-tree"><ul id="'.$id.'">';
$CD=getDbSelect($conf['table'],($conf['Post']?'Post='.$conf['Post'].' and ':'').'depth='.($depth+1).' and parent='.$parent.($conf['dispHidden']?' and hidden=0':'').($conf['mobile']?' and mobile=1':'').' order by gid asc','*');
$_i = 0;
while($C=db_fetch_array($CD))
{
$rcode= $tmpcode?$tmpcode.'/'.$C[$ctype]:$C[$ctype];
$t_arr = explode('/', $code);
$t1_arr = explode('/', $rcode);
$topen= in_array($t1_arr[count($t1_arr)-1], $t_arr)?true:false;
$tree.= '<li>';
if ($C['isson'])
{
$tree.= '<a data-toggle="collapse" href="#'.$id.'-'.$_i.'-'.$C['uid'].'" class="rb-branch'.($conf['allOpen']||$topen?'':' collapsed').'"></a>';
if ($conf['userMenu']=='link') $tree.= '<a href="'.RW('c='.$rcode).'"><span'.($code==$rcode?' class="rb-active"':'').'>';
else if($conf['userMenu']=='bookmark') $tree.= '<a data-scroll href="#rb-tree-menu-'.$C['id'].'"><span'.($code==$rcode?' class="rb-active"':'').'>';
//else $tree.= '<a href="'.$conf['link'].$C['uid'].'&amp;code='.$rcode.($conf['bookmark']?'#'.$conf['bookmark']:'').'"><span'.($code==$rcode?' class="rb-active"':'').'>';
else $tree.= '<a href="'.$conf['link'].$C['uid'].'"><span'.($code==$rcode?' class="rb-active"':'').'>';
if($conf['dispCheckbox']) $tree.= '<input type="checkbox" name="tree_members[]" value="'.$C['uid'].'">';
if($C['hidden']) $tree.='<u title="'._LANG('fs002','admin').'" data-tooltip="tooltip">';
$tree.= $C['name'];
if($C['hidden']) $tree.='</span>';
$tree.='</u></a>';
if($conf['dispNum']&&$C['num']) $tree.= ' <small>('.$C['num'].')</small>';
if(!$conf['hideIcon'])
{
//if($C['mobile']) $tree.= '<i class="glyphicon glyphicon-phone" title="'._LANG('fs005','admin').'" data-tooltip="tooltip"></i>&nbsp;';
if($C['target']) $tree.= '<i class="glyphicon glyphicon-new-window" title="'._LANG('fs004','admin').'" data-tooltip="tooltip"></i>&nbsp;';
if($C['reject']) $tree.= '<i class="glyphicon glyphicon-ban-circle" title="'._LANG('fs003','admin').'" data-tooltip="tooltip"></i>';
}
$tree.= '<ul id="'.$id.'-'.$_i.'-'.$C['uid'].'" class="collapse'.($conf['allOpen']||$topen?' in':'').'">';
$tree.= getTreeCategory($conf,$code,$C['depth'],$C['uid'],$rcode);
$tree.= '</ul>';
}
else {
$tree.= '<a href="#." class="rb-leaf"></a>';
if ($conf['userMenu']=='link') $tree.= '<a href="'.RW('c='.$rcode).'"><span'.($code==$rcode?' class="rb-active"':'').'>';
else if ($conf['userMenu']=='bookmark') $tree.= '<a data-scroll href="#rb-tree-menu'.$C['id'].'"><span'.($code==$rcode?' class="rb-active"':'').'>';
//else $tree.= '<a href="'.$conf['link'].$C['uid'].'&amp;code='.$rcode.($conf['bookmark']?'#'.$conf['bookmark']:'').'"><span'.($code==$rcode?' class="rb-active"':'').'>';
else $tree.= '<a href="'.$conf['link'].$C['uid'].'"><span'.($code==$rcode?' class="rb-active"':'').'>';
if($conf['dispCheckbox']) $tree.= '<input type="checkbox" name="tree_members[]" value="'.$C['uid'].'">';
if($C['hidden']) $tree.='<u title="'._LANG('fs002','admin').'" data-tooltip="tooltip">';
$tree.= $C['name'];
if($C['hidden']) $tree.='</u>';
$tree.='</span></a>';
if($conf['dispNum']&&$C['num']) $tree.= ' <small>('.$C['num'].')</small>';
if(!$conf['hideIcon'])
{
//if($C['mobile']) $tree.= '<i class="glyphicon glyphicon-phone" title="'._LANG('fs005','admin').'" data-tooltip="tooltip"></i>&nbsp;';
if($C['target']) $tree.= '<i class="glyphicon glyphicon-new-window" title="'._LANG('fs004','admin').'" data-tooltip="tooltip"></i>&nbsp;';
if($C['reject']) $tree.= '<i class="glyphicon glyphicon-ban-circle" title="'._LANG('fs003','admin').'" data-tooltip="tooltip"></i>';
}
}
$tree.= '</li>';
$_i++;
}
$tree.= '</ul></div>';
return $tree;
}
//트리 카테고리 - write_plus 전용
function getTreeCategoryForWrite($conf,$code,$depth,$parent,$tmpcode)
{
global $m,$table;
$ctype = $conf['ctype']?$conf['ctype']:'uid';
$id = 'tree_'.filterstr(microtime());
$tree = '<div class="rb-tree"><ul id="'.$id.'">';
$CD=getDbSelect($table[$m.'category'],($conf['Post']?'Post='.$conf['Post'].' and ':'').'depth='.($depth+1).' and parent='.$parent.($conf['dispHidden']?' and hidden=0':'').($conf['mobile']?' and mobile=1':'').' order by gid asc','*');
$_i = 0;
while($C=db_fetch_array($CD))
{
$rcode= $tmpcode?$tmpcode.'/'.$C[$ctype]:$C[$ctype];
$t_arr = explode('/', $code);
$t1_arr = explode('/', $rcode);
$topen= in_array($t1_arr[count($t1_arr)-1], $t_arr)?true:false;
$cat_link=$conf['link']?$conf['link'].$C['uid']:'#'; // 링크는 있는 경우에만
$NUM=getDbRows($table[$m.'category'],'parent='.$C['uid']);
// $dispNum='<span class="badge">'.$NUM.'</span>';
$is_selected=getDbRows($table[$m.'catidx'],'Post='.$conf['Post'].' and post='.$conf['post'].' and category='.$C['uid']);
$catCheckbox='<input type="checkbox" name="category[]" value="'.$C['uid'].'" data-role="category-checkbox" data-name="'.$C['name'].'" '.($is_selected?'checked':'').'>';
$tree.= '<li>';
if ($C['isson'])
{
$tree.=$code;
$tree.= '<a data-toggle="collapse" href="#'.$id.'-'.$_i.'-'.$C['uid'].'" class="rb-branch'.($conf['allOpen']||$topen?'':' collapsed').'"></a>';
$tree.= '<a href="'.$cat_link.'"><span'.($code==$rcode?' class="rb-active"':'').'>';
if($conf['dispCheckbox']) $tree.= $catCheckbox;
$tree.= $C['name'];
$tree.='</span></a>';
if($conf['dispNum']) $tree.=$dispNum;
$tree.= '<ul id="'.$id.'-'.$_i.'-'.$C['uid'].'" class="collapse'.($conf['allOpen']||$topen?' in':'').'">';
$tree.= getTreeCategoryForWrite($conf,$code,$C['depth'],$C['uid'],$rcode);
$tree.= '</ul>';
}
else {
$tree.= '<a href="#." class="rb-leaf"></a>';
$tree.= '<a href="'.$cat_link.'"><span'.($code==$rcode?' class="rb-active"':'').'>';
if($conf['dispCheckbox']) $tree.= $catCheckbox;
$tree.= $C['name'];
$tree.='</span></a>';
if($conf['dispNum']) $tree.=$dispNum;
}
$tree.= '</li>';
$_i++;
}
$tree.= '</ul></div>';
return $tree;
}
// 포스트 상태별 라벨 출력 함수
function postLabel($mod,$step,$isreserve)
{
$user_step=array('임시보관','발행요청','발행보류','발행완료');
$manager_step=array('임시보관','대기','보류','발행');
$step_label=array('default','success','danger','default');
$html='';
if($mod=='user') $html.='<span class="badge badge-'.$step_label[$step].'">'.$user_step[$step].'</span>';
else $html.='<span class="badge badge-'.$step_label[$step].'">'.$mamager_step[$step].'</span>';
// 예약발행 체크
if($isreserve) $html.=' <span class="label label-info">예약</span>';
return $html;
}
/** 날짜 출력함수
$R : 해당 row 배열
$mod : d_regis,d_modify,d_published (최초등록, 수정, 발행)
**/
function getTimeagoDate($date,$mod)
{
if($date){
$html='<time class="timeago" data-toggle="tooltip" datetime="'.getDateFormat($date,'c').'" data-tooltip="tooltip" title="'.getDateFormat($date,'Y.m.d H:i').'"></time>';
}else{
if($mod=='d_published') $html ='<span class="text-mute">발행 전</span>';
else $html='';
}
return $html;
}
/* 알림을 보내는 방법 ************************************************************
- 다음의 함수를 실행합니다.
putNotice($rcvmember,$sendmodule,$sendmember,$message,$referer,$target);
$rcvmember : 받는회원 UID
$sendmodule : 보내는모듈 ID
$sendmember : 보내는회원 UID (시스템으로 보낼경우 0)
$message : 보내는 메세지 (관리자 및 허가된 사용자는 HTML태그 사용가능 / 일반 회원은 불가)
$referer : 연결해줄 URL이 있을 경우 http:// 포함하여 지정
$target : 연결할 URL의 링크 TARGET (새창으로 연결하려면 _blank)
/* 포스트 알림 전송함수 ************************************************************
$SM : 보내는 회원 정보 배열
$RM : 받는 회원 정보 배열
$Post_id : 블로그 아이디
$mod : 승인요청, 보류, 발행 (req,hold,publish)
********************************************************************************/
function putPostNotice($SM,$RM,$Post_id,$mod)
{
global $g,$r,$_HS;
// 기본값 설정
$target='_self'; // _blank 처리하지 않는다.
$base_link=$g['url_root'].'/?r='.$r.'&mod=';
// 모드별 메세지 세팅
$mod_to_msg=array(
'req'=>'포스트 발행승인 요청이 도착했습니다.',
'hold'=>$RM[$_HS['nametype']].'님이 등록한 포스트가 발행보류 처리되었습니다.',
'publish'=>$RM[$_HS['nametype']].'님이 등록한 포스트가 발행되었습니다.',
);
// 모드별 링크 세팅
$mod_to_link=array('req'=>'post-confirm','hold'=>'post-all','publish'=>'post-all');
// 알림함수 공통인수 설정
$rcvmbr=$RM['memberuid'];
$sendmbr=$SM['memberuid'];
$sendmodule='Post';
// 모드별 알림 메세지 & 링크 세팅
$msg=$mod_to_msg[$mod];
$link=$base_link.$mod_to_link[$mod];
// 알림 발송
putNotice($rcvmbr,$sendmodule,$sendmbr,$msg,$link,$target);
// 메일 발송
setSendMail($SM,$RM,$mod,$link);
}
/* 포스트 알림 메일전송 함수 ************************************************************
$SM : 보내는 회원 정보 배열
$RM : 받는 회원 정보 배열
$mod : 승인요청, 보류, 발행 (req,hold,publish)
$link : 해당 포스트 링크
********************************************************************************/
function setSendMail($SM,$RM,$mod,$link)
{
global $g,$_HS;
include_once $g['path_core'].'function/email.func.php';
// 공통 인수 설정
$to_email=$RM['email'];
$to_name=$RM['name'];
// $from_email=$SM['email'];
$from_email='notifications@kimsq.com'; // 시스템 보내는 메일주소, 보낸 사람의 주소가 실제 발송 주소와 다를 경우 스펨처리 될 가능성
$from_name='경기방송';
if($mod=='req'){ // 승인자에게 보냄
$title='['.$_HS['name'].'] 사이트에 등록된 포스트의 승인요청 입니다. ';
$content='아래와 같이 '.$RM[$_HS['nametype']].'님의 승인요청 포스트가 등록되었습니다. <br />';
}else if($mod=='hold'){
$title='['.$_HS['name'].'] 사이트에 등록된 포스트가 발행보류 처리되었습니다. ';
$content='아래와 같이 '.$RM[$_HS['nametype']].'님이 등록한 포스트가 발행보류 처리되었습니다. <br />';
}else if($mod=='publish'){
$title='['.$_HS['name'].'] 사이트에 등록된 포스트가 발행 처리되었습니다. ';
$content='아래와 같이 '.$RM[$_HS['nametype']].'님이 등록한 포스트가 발행 처리되었습니다. <br />';
}
// content 내용에 링크 추가
$content .='<a href="'.$link.'" target="_blank">'.$link.'</a>';
getSendMail($to_email.'|'.$to_name, $from_email.'|'.$from_name,$title, $content, 'HTML');
}
// 포스트 위젯에서 사용되는 base 쿼리 정의
function getPostBaseQry($m)
{
global $table,$s;
return $table[$m.'data'].'.isreserve=0 and '.$table[$m.'data'].'.step=3';
}
// 포스트 데이타 추출 함수
function getPostData($R,$data)
{
global $g,$table,$r,$_HS,$d;
$m='Post';
include_once $g['path_module'].$m.'/var/var.php';
$result=array();
$B=getUidData($table[$m.'list'],$R['Post']);
if($d['Post']['rewrite']) $result['link']=$g['s'].($r?'/'.$r:'').'/archive/'.$B['id'].'/';
else $result['link'] = $g['s'].'/?r='.$r.'&amp;m='.$m.'&amp;Post='.$B['id'].'&amp;front=list&uid=';
if($R['isphoto']&&$R['upload'])
{
$upArray = getArrayString($R['upload']);
$_U = getUidData($table['s_upload'],$upArray['data'][0]);
$img = $_U['url'].$_U['folder'].'/'.$_U['tmpname'];
}
$img_arr=getImgs($R['content'],'jpg');
$result['preview_img']=$img_arr[0]?$img_arr[0]:'';
// 회원정보 세팅
$M=getDbData($table['s_mbrdata'],'memberuid='.$R['mbruid'],'*');
$M2=getDbData($table['s_mbrid'],'uid='.$R['mbruid'],'*');
// 회원이름
$result['mbr_name']=$M[$_HS['nametype']];
// 회원 아이디
$result['mbr_id']=$M2['id'];
// 아바타 사진 url 세팅
if($M['photo']) $result['avatar_img']=$g['url_root'].'/_var/avatar/'.$M['photo'];
else $result['avatar_img']=$g['url_root'].'/_var/avatar/0.gif';
return $result[$data];
}
// 권기택 추가
//분류코드->SQL
function getPostCategoryCodeToSql($table,$cat)
{
$R=getUidData($table,$cat);
if ($R['uid']) $sql .= 'category='.$R['uid'].' or ';
if ($R['isson'])
{
$RDATA=getDbSelect($table,'parent='.$R['uid'],'uid,isson');
while($C=db_fetch_array($RDATA)) $sql .= getPostCategoryCodeToSqlX($table,$C['uid'],$C['isson']);
}
return substr($sql,0,strlen($sql)-4);
}
//분류코드->SQL
function getPostCategoryCodeToSqlX($table,$cat,$isson)
{
$sql = 'category='.$cat.' or ';
if ($isson)
{
$RDATA=getDbSelect($table,'parent='.$cat,'uid,isson');
while($C=db_fetch_array($RDATA)) $sql .= getPostCategoryCodeToSqlX($table,$C['uid'],$C['isson']);
}
return $sql;
}
// daum 송고용 채널명 추출함수
function getDaumChannel($post){
global $table,$DB_CONNECT;
$tbl_idx = $table['Postcatidx'];
$tbl_cat = $table['Postcategory'];
$query="SELECT i.*,c.* FROM ".$tbl_idx." as i left join ".$tbl_cat." as c on i.category=c.uid
WHERE i.post=".$post." and c.hidden=0 and c.daum_cat<>''";
$result = db_fetch_array(db_query($query,$DB_CONNECT));
$channel = $result['daum_cat'];
return $channel;
}
?>

191
modules/post/main.php Normal file
View File

@@ -0,0 +1,191 @@
<?php
if(!defined('__KIMS__')) exit;
include_once $g['dir_module'].'_main.php';
$d['post']['isperm'] = true;
$mod = $mod ? $mod : 'post';
$sort = $sort ? $sort : 'gid';
$orderby= $orderby && strpos('[asc][desc]',$orderby) ? $orderby : 'asc';
$recnum = $recnum && $recnum < 200 ? $recnum : $d['post']['recnum'];
$_perm = array();
if ($cat) $mod='category';
if ($cid) {
$R=getDbData($table[$m.'data'],"cid='".$cid."'",'*');
$g['browtitle'] = strip_tags(stripslashes(getStrCut($R['subject'],10,''))).' - '.$_HS['name'];
$g['meta_tit'] = strip_tags(stripslashes($R['subject'])).' - '.$_HS['name'];
$g['meta_sbj'] = str_replace('"','\'',stripslashes($R['subject']));
$g['meta_key'] = $R['tag'] ?$R['tag'] : str_replace('"','\'',stripslashes($R['subject']));
$g['meta_des'] = getStrCut(getStripTags($R['review']),150,'');
$g['meta_img'] = getPreviewResize(getUpImageSrc($R),'z');
$_POSTMBR = getDbData($table[$m.'members'],'mbruid='.$my['uid'].' and data='.$R['uid'],'*');
$_IS_POSTMBR=getDbRows($table[$m.'member'],'mbruid='.$my['uid'].' and data='.$R['uid']);
$_IS_POSTOWN=getDbRows($table[$m.'member'],'mbruid='.$my['uid'].' and data='.$R['uid'].' and level=1');
$_perm['post_member'] = $my['admin'] || $_IS_POSTMBR ? true : false;
$_perm['post_owner'] = $my['admin'] || $_IS_POSTOWN ? true : false;
$_perm['post_write'] = $_POSTMBR['auth'];
// 로그인한 사용자가 게시물에 좋아요/싫어요를 했는지 여부 체크
$check_like_qry = "mbruid='".$my['uid']."' and module='".$m."' and entry='".$R['uid']."' and opinion='like'";
$check_dislike_qry = "mbruid='".$my['uid']."' and module='".$m."' and entry='".$R['uid']."' and opinion='dislike'";
$is_liked = getDbRows($table['s_opinion'],$check_like_qry);
$is_disliked = getDbRows($table['s_opinion'],$check_dislike_qry);
// 로그인한 사용자가 게시물을 저장했는지 여부 체크
$check_saved_qry = "mbruid='".$my['uid']."' and module='".$m."' and entry='".$R['uid']."'";
$is_saved = getDbRows($table['s_saved'],$check_saved_qry);
$mod = $mod ? $mod : 'view';
include_once $g['dir_module'].'mod/_view.php';
}
if ($c) {
$g['post_reset'] = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').'c='.$c,array($skin?'skin':'',$iframe?'iframe':'',$cat?'cat':''));
if ($_HS['rewrite']) $g['post_reset'] = getLinkFilter2(($_HS['usescode']?'/'.$r:'').RW('c='.$c),array($skin?'skin':'',$iframe?'iframe':'',$cat?'cat':''));
} else {
$g['post_reset'] = getLinkFilter($g['s'].'/?'.($_HS['usescode']?'r='.$r.'&amp;':'').'m='.$m,array($skin?'skin':'',$iframe?'iframe':'',$cat?'cat':''));
if ($_HS['rewrite']) $g['post_reset']= $g['r'].'/post';
}
switch ($mod) {
case 'category' :
$CAT = getDbData($table[$m.'category'],"id='".$cat."'",'*');
include_once $g['dir_module'].'mod/_category.php';
if ( $cat && (!$CAT['uid']||($CAT['reject']&&!$my['admin']))) $mod = '_404';
if ($_HS['rewrite']) {
if ($cat) $g['post_reset']= $g['r'].'/post/category/'.$cat;
else $g['post_reset']= $g['r'].'/post';
}
$g['browtitle'] = ($CAT['name']?$CAT['name']:'전체 카테고리').' - '.$_HS['name'];
$g['post_list'] = $g['post_reset'].getLinkFilter2('',array($sort!='gid'?'sort':'',$orderby!='asc'?'orderby':'',$keyword?'keyword':'',$code?'code':''));
$g['pagelink'] = $g['post_list'];
$_N = !$_GET['sort'] && !$_GET['where'] && !$_GET['keyword'] && !$_GET['code']?$g['post_list'].'?':'';
break;
case 'post' :
include_once $g['dir_module'].'mod/_post.php';
if ($_HS['rewrite']) $g['post_reset']= $g['r'].'/post';
$g['browtitle'] = '전체 포스트 - '.$_HS['name'];
$g['post_list'] = $g['post_reset'].getLinkFilter2('',array('sort',$orderby!='asc'?'orderby':'',$keyword?'keyword':''));
$g['pagelink'] = $g['post_list'];
$_N = !$_GET['sort'] && !$_GET['where'] && !$_GET['keyword']?$g['post_list'].'?':'';
break;
case 'keyword' :
if (!$keyword) getLink('','','키워드를 입력해주세요.','-1');
include_once $g['dir_module'].'mod/_category.php';
if ($_HS['rewrite']) $g['post_reset']= $g['r'].'/post/search';
$g['browtitle'] = '#'.$keyword.' - '.$_HS['name'];
$g['post_list'] = $g['post_reset'].getLinkFilter2('',array('keyword'));
$g['pagelink'] = $g['post_list'];
break;
case 'list' :
include_once $g['dir_module'].'mod/_list.php';
if ($_HS['rewrite']) $g['post_reset']= $g['r'].'/list';
$g['browtitle'] = '전체 리스트 - '.$_HS['name'];
$g['post_list'] = $g['post_reset'].getLinkFilter2('',array($sort!='gid'?'sort':'',$orderby!='asc'?'orderby':'',$keyword?'keyword':'','code'));
$g['pagelink'] = $g['post_list'];
$_N = $_HS['rewrite'] && !$_GET['sort']?$g['page_list'].'?':'';
break;
case 'list_view' :
$LIST=getDbData($table[$m.'list'],"id='".$listid."'",'*');
include_once $g['dir_module'].'mod/_list.php';
if ($_HS['rewrite']) $g['post_reset']= $g['r'].'/list/'.$listid;
$g['meta_img'] = getPreviewResize(getListImageSrc($LIST['uid']),'z');
$g['browtitle'] = $LIST['name'].' - '.$_HS['name'];
$g['post_list'] = $g['post_reset'].getLinkFilter2('',array());
$g['pagelink'] = $g['post_list'];
$_N = $_HS['rewrite'] && !$_GET['sort']?$g['page_list'].'?':'';
break;
case 'view' :
if (!checkPostPerm($R)) {
$mod = '_404';
$d['post']['isperm'] = false;
}
include_once $g['dir_module'].'mod/_view.php';
break;
case 'write' :
if (!$d['post']['writeperm']) getLink('','','잘못된 접근입니다.','-1');
if ($cid &&!$_perm['post_owner']) getLink('','','접근권한이 없습니다.','-1'); // 수정권한 체크
if (!$g['mobile']||$_SESSION['pcmode']=='Y') {
$layoutArr = explode('/',$d['post']['layout']);
$d['post']['layout'] = $layoutArr[0].'/blank.php';
}
$g['browtitle'] = '글쓰기 - '.$_HS['name'];
break;
}
$_HM['layout'] = $_HM['layout'] ? $_HM['layout'] : $d['post']['layout'];
$d['post']['skin'] = $d['post']['skin'] ? $d['post']['skin'] : $d['post']['skin_main'];
$d['post']['m_skin'] = $d['post']['m_skin'] ? $d['post']['m_skin'] : $d['post']['skin_mobile'];
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$_HM['m_layout'] = $_HM['m_layout'] ? $_HM['m_layout'] : $d['post']['m_layout'];
$d['post']['skin'] = $d['post']['m_skin'] ? $d['post']['m_skin'] : ($d['post']['skin_mobile']?$d['post']['skin_mobile']:$d['post']['skin_main']);
}
include_once $g['path_module'].$m.'/themes/'.$d['post']['skin'].'/_var.php';
$g['post_base'] = $g['s'].'/?r='.$r.'&amp;'.'m=post';
$g['pagelink'] = $g['post_list'];
$g['post_orign'] = $g['post_reset'];
$g['post_view'] = $g['post_list'].'&amp;mod=view&amp;cid=';
$g['post_write'] = $g['post_list'].'&amp;mod=write';
$g['post_modify']= $g['post_write'].'&amp;cid=';
$g['post_action']= $g['post_base'].'&amp;a=';
$g['post_delete']= $g['post_action'].'delete&amp;cid=';
$g['post_print'] = $g['post_reset'].'&amp;iframe=Y&amp;print=Y&amp;cid=';
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$_HM['m_layout'] = $_HM['m_layout'] ? $_HM['m_layout'] : $d['post']['m_layout'];
$g['dir_module_skin'] = $g['dir_module'].'themes/'.$d['post']['skin_mobile'].'/';
$g['url_module_skin'] = $g['url_module'].'/themes/'.$d['post']['skin_mobile'];
$g['img_module_skin'] = $g['url_module_skin'].'/images';
} else {
$_HM['layout'] = $_HM['layout'] ? $_HM['layout'] : $d['post']['layout'];
$g['dir_module_skin'] = $g['dir_module'].'themes/'.$d['post']['skin_main'].'/';
$g['url_module_skin'] = $g['url_module'].'/themes/'.$d['post']['skin_main'];
$g['img_module_skin'] = $g['url_module_skin'].'/images';
}
$g['dir_module_mode'] = $g['dir_module_skin'].$mod;
$g['url_module_mode'] = $g['url_module_skin'].'/'.$mod;
$g['url_reset'] = $g['s'].'/?r='.$r.'&m='.$m;
$g['push_location'] = '<li class="active">'.$_HMD['name'].'';
if($R['linkedmenu'])
{
$c=substr($R['linkedmenu'],-1)=='/'?str_replace('/','',$R['linkedmenu']):$R['linkedmenu'];
$_CA = explode('/',$c);
$_FHM = getDbData($table['s_menu'],"id='".$_CA[0]."' and site=".$s,'*');
$_tmp['count'] = count($_CA);
$_tmp['split_id'] = '';
for ($_i = 0; $_i < $_tmp['count']; $_i++)
{
$_tmp['location'] = getDbData($table['s_menu'],"id='".$_CA[$_i]."'",'*');
$_tmp['split_id'].= ($_i?'/':'').$_tmp['location']['id'];
$g['location'] .= ' &gt; <a href="'.RW('c='.$_tmp['split_id']).'">'.$_tmp['location']['name'].'</a>';
$_HM['uid'] = $_tmp['location']['uid'];
$_HM['name'] = $_tmp['location']['name'];
$_HM['addinfo'] = $_tmp['location']['addinfo'];
}
}
$g['main'] = $g['dir_module_mode'].'.php';
?>

View File

@@ -0,0 +1,33 @@
<?php
$_WHERE = 'site='.$s;
$where = $where?$where:'subject|tag|review';
if ($sort == 'gid' && !$keyword && !$listid) {
if (!$my['uid']) $_WHERE .= ' and display<>4';
if ($cat) $_WHERE .= ' and ('.getPostCategoryCodeToSql($table[$m.'category'],$cat).')';
$TCD = getDbArray($table[$m.'category_index'],$_WHERE,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table[$m.'category_index'],$_WHERE);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table[$m.'data'],'uid='.$_R['data'],'*');
} else {
if (!$my['uid']) $_WHERE .= ' and display<>4';
if ($where && $keyword) {
if (strpos('[nic][id][ip]',$where)) $_WHERE .= " and ".$where."='".$keyword."'";
else if ($where == 'term') $_WHERE .= " and d_regis like '".$keyword."%'";
else $_WHERE .= getSearchSql($where,$keyword,$ikeyword,'or');
}
if ($cat) $_WHERE .= ' and ('.getPostCategoryCodeToSql2($table[$m.'category'],$cat).')';
$orderby = $sort == 'gid'?'asc':'desc';
$TCD = getDbArray($table[$m.'data'],$_WHERE,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table[$m.'data'],$_WHERE);
while($_R = db_fetch_array($TCD)) $RCD[] = $_R;
}
$TPG = getTotalPage($NUM,$recnum);
?>

View File

@@ -0,0 +1,390 @@
<!-- modal : 포스트 좋아요/싫어요 목록 -->
<div class="modal" tabindex="-1" role="dialog" id="modal-post-opinion">
<div class="modal-dialog modal-dialog-centered" role="document" style="width: 400px">
<div class="modal-content">
<div class="modal-header border-bottom-0 bg-light">
<div class="media align-items-center">
<span class="position-relative mr-3">
<img class="border" data-role="featured_img" src="" alt="" style="width:100px">
</span>
<div class="media-body">
<h5 class="f14 my-1 line-clamp-2">
<span class="font-weight-light" data-role="subject"></span>
</h5>
<div class="mb-1">
<ul class="list-inline d-inline-block f13 text-muted mb-0">
<li class="list-inline-item">조회 <span data-role="hit"></span></li>
<li class="list-inline-item">좋아요 <span data-role="likes"></span></li>
<li class="list-inline-item">댓글 <span data-role="comment"></span></li>
</ul>
</div>
</div>
</div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<nav class="bg-light" style="margin-top: -5px;">
<div class="nav nav-tabs nav-fill" role="tablist">
<a class="nav-item nav-link active rounded-0 border-left-0" data-toggle="tab" href="#post-likesList" role="tab" data-opinion="like">
좋아요 <span class="badge" data-role="like-num"></span>
</a>
<a class="nav-item nav-link rounded-0" data-toggle="tab" href="#post-dislikesList" role="tab" data-opinion="dislike">
싫어요 <span class="badge" data-role="dislike-num"></span>
</a>
</div>
</nav>
<div class="modal-body p-0" style="min-height: 300px">
<div data-role="loader" class="d-none">
<div class="d-flex justify-content-center align-items-center" style="height:300px">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
<div class="tab-content p-0">
<div class="tab-pane active" id="post-likesList" role="tabpanel" data-role="like">
<div class="list-group list-group-flush" data-role="list"></div>
</div>
<div class="tab-pane" id="post-dislikesList" role="tabpanel" data-role="dislike">
<div class="list-group list-group-flush" data-role="list"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- modal : 포스트 통계 -->
<div class="modal" tabindex="-1" role="dialog" id="modal-post-analytics">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header border-bottom-0 bg-light">
<div class="media align-items-center">
<span class="position-relative mr-3">
<img class="border" data-role="featured_img" src="" alt="" style="width:100px">
</span>
<div class="media-body">
<h5 class="f14 my-1 line-clamp-2">
<span class="font-weight-light" data-role="subject"></span>
</h5>
<div class="mb-1">
<ul class="list-inline d-inline-block f13 text-muted mb-0">
<li class="list-inline-item">조회 <span data-role="hit"></span></li>
<li class="list-inline-item">좋아요 <span data-role="likes"></span></li>
<li class="list-inline-item">싫어요 <span data-role="dislikes"></span></li>
<li class="list-inline-item">댓글 <span data-role="comment"></span></li>
</ul>
</div>
</div>
</div>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<nav class="bg-light" style="margin-top: -5px;">
<div class="nav nav-tabs nav-fill" role="tablist">
<a class="nav-item nav-link active rounded-0 border-left-0" data-toggle="tab" href="#chart-post-hit" data-mod="hit" data-start="<?php echo date("Ymd", strtotime("-1 week")); ?>" data-unit="day" role="tab">
유입추이
</a>
<a class="nav-item nav-link rounded-0 " data-toggle="tab" href="#chart-post-referer" data-mod="referer" data-start="<?php echo date("Ymd", strtotime("-1 week")); ?>" data-unit="day" role="tab">
유입경로
</a>
<a class="nav-item nav-link rounded-0" data-toggle="tab" href="#chart-post-device" data-mod="device" data-start="<?php echo date("Ymd", strtotime("-1 week")); ?>" data-unit="day" role="tab">
디바이스별
</a>
<a class="nav-item nav-link rounded-0" data-toggle="tab" href="#chart-post-side" data-mod="side" data-start="<?php echo date("Ymd", strtotime("-1 week")); ?>" data-unit="day" role="tab">
외부유입
</a>
<a class="nav-item nav-link rounded-0" data-toggle="tab" href="#chart-post-likes" data-mod="likes" data-start="<?php echo date("Ymd", strtotime("-1 week")); ?>" data-unit="day" role="tab">
좋아요
</a>
<a class="nav-item nav-link rounded-0" data-toggle="tab" href="#chart-post-dislikes" data-mod="dislikes" data-start="<?php echo date("Ymd", strtotime("-1 week")); ?>" data-unit="day" role="tab">
싫어요
</a>
<a class="nav-item nav-link rounded-0 border-right-0" data-toggle="tab" href="#chart-post-comment" data-mod="comment" data-start="<?php echo date("Ymd", strtotime("-1 week")); ?>" data-unit="day" role="tab">
댓글
</a>
</div>
</nav>
<div class="modal-body" style="min-height: 420px">
<div data-role="loader">
<div class="d-flex justify-content-center align-items-center" style="height:385px">
<div class="spinner-border text-muted" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
<div class="tab-content">
<div class="tab-pane active" id="chart-post-hit" role="tabpanel"></div>
<div class="tab-pane" id="chart-post-referer" role="tabpanel"></div>
<div class="tab-pane" id="chart-post-device" role="tabpanel"></div>
<div class="tab-pane" id="chart-post-side" role="tabpanel"></div>
<div class="tab-pane" id="chart-post-likes" role="tabpanel"></div>
<div class="tab-pane" id="chart-post-dislikes" role="tabpanel"></div>
<div class="tab-pane" id="chart-post-comment" role="tabpanel"></div>
</div>
</div>
<div class="modal-footer bg-light">
<div class="mr-auto">
<select class="form-control custom-select mr-2" data-toggle="term" data-mod="hit" style="width: 150px">
<option selected value="<?php echo date("Ymd", strtotime("-1 week")); ?>" data-d_start="<?php echo date("Y.m.d", strtotime("-1 week")); ?>" data-unit="day">
최근 1
</option>
<option value="<?php echo date("Ymd", strtotime("-2 week")); ?>" data-d_start="<?php echo date("Y.m.d", strtotime("-2 week")); ?>" data-unit="day">
최근 2
</option>
<option value="<?php echo date("Ymd", strtotime("-3 week")); ?>" data-d_start="<?php echo date("Y.m.d", strtotime("-3 week")); ?>" data-unit="day">
최근 3
</option>
<option value="<?php echo date("Ymd", strtotime("-1 month")); ?>" data-d_start="<?php echo date("Y.m.d", strtotime("-1 month")); ?>" data-unit="day">
최근 1
</option>
<option value="<?php echo date("Ymd", strtotime("-1 year")); ?>" data-d_start="<?php echo date("Y.m", strtotime("-1 year")); ?>.01" data-unit="month">
최근 1
</option>
</select>
</div>
<span data-role="term">
<span data-role="d_start"><?php echo date("Y.m.d", strtotime("-1 week")); ?></span>
~
<?php echo date("Y.m.d", strtotime("now")) ?></span>
</div>
</div>
</div>
</div>
<script>
function setPostTrendChart(ctx,uid,mod,unit,start) {
ctx.addClass('d-none');
$('[data-role="loader"]').removeClass('d-none');
$.post(rooturl+'/?r='+raccount+'&m=post&a=get_postTrend',{
uid : uid,
mod : mod,
unit : unit,
d_start : start
},function(response,status){
if(status=='success'){
var result = $.parseJSON(response);
var type=result.type;
var data=result.data;
var options=result.options;
var postChart = new Chart(ctx, {
type: type,
data: data,
options: options
});
ctx.removeClass('d-none');
$('[data-role="loader"]').addClass('d-none');
} else {
alert(status);
}
});
}
$( document ).ready(function() {
$('#modal-post-opinion').on('shown.bs.modal', function (e) {
var modal = $(this);
var button = $(e.relatedTarget);
var uid = button.attr('data-uid');
var opinion = button.attr('data-opinion');
var item = button.closest('[data-role="item"]');
var subject = item.attr('data-subject');
var featured_img = item.attr('data-featured_img');
var hit = item.attr('data-hit');
var likes = item.attr('data-likes');
var comment = item.attr('data-comment');
modal.find('[data-role="loader"]').removeClass('d-none');
modal.find('[data-role="like"] [data-role="list"]').html(''); //초기화
modal.find('[data-role="like-num"]').text('');
modal.find('[data-role="dislike"] [data-role="list"]').html('');
modal.find('[data-role="dislike-num"]').text('');
if (opinion=='like') modal.find('.nav-tabs .nav-link:first-child').tab('show');
else modal.find('.nav-tabs .nav-link[data-opinion="dislike"]').tab('show');
modal.attr('data-uid',uid);
modal.find('[data-role="subject"]').text(subject);
modal.find('[data-role="featured_img"]').attr('src',featured_img);
$.post(rooturl+'/?r='+raccount+'&m=post&a=get_postData',{
uid : uid
},function(response,status){
if(status=='success'){
var result = $.parseJSON(response);
var hit=result.hit;
var likes=result.likes;
var comment=result.comment;
modal.find('[data-role="hit"]').text(hit);
modal.find('[data-role="likes"]').text(likes);
modal.find('[data-role="comment"]').text(comment);
} else {
alert(status);
}
});
setTimeout(function(){
$.post(rooturl+'/?r='+raccount+'&m=post&a=get_opinionList',{
uid : uid,
opinion : opinion,
markup_file : 'opinion-item'
},function(response){
var result = $.parseJSON(response);
var _uid=result.uid;
var list=result.list;
var num=result.num;
var num_like=result.num_like;
var num_dislike=result.num_dislike;
modal.find('[data-role="loader"]').addClass('d-none');
if (num_like) modal.find('[data-role="like-num"]').text(num_like);
if (num_dislike) modal.find('[data-role="dislike-num"]').text(num_dislike);
if (num) {
modal.find('[data-role="'+opinion+'"] [data-role="list"]').html(list);
} else {
modal.find('[data-role="'+opinion+'"] [data-role="list"]').html('<div class="py-5 text-center text-muted">자료가 없습니다.</div>');
}
});
}, 300);
})
//좋아요/싫어요 탭 선택시
$('#modal-post-opinion').find('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
var modal = $('#modal-post-opinion');
var uid = modal.attr('data-uid');
var tab = e.target;
var opinion = $(tab).attr('data-opinion');
modal.find('[data-role="loader"]').removeClass('d-none');
modal.find('[data-role="'+opinion+'"] [data-role="list"]').html(''); //초기화
setTimeout(function(){
$.post(rooturl+'/?r='+raccount+'&m=post&a=get_opinionList',{
uid : uid,
opinion : opinion,
markup_file : 'opinion-item'
},function(response){
var result = $.parseJSON(response);
var _uid=result.uid;
var list=result.list;
var num=result.num;
modal.find('[data-role="loader"]').addClass('d-none');
if (num) {
modal.find('[data-role="'+opinion+'"] [data-role="list"]').html(list);
modal.find('[data-role="'+opinion+'-num"]').text(num);
} else {
modal.find('[data-role="'+opinion+'"] [data-role="list"]').html('<div class="py-5 text-center text-muted">자료가 없습니다.</div>');
}
});
}, 100);
})
$('#modal-post-analytics').on('shown.bs.modal', function (e) {
var modal = $(this);
var button = $(e.relatedTarget);
var uid = button.attr('data-uid');
var mod = 'hit';
var item = button.closest('[data-role="item"]');
var subject = item.attr('data-subject');
var featured_img = item.attr('data-featured_img');
modal.find('.tab-pane').html('<canvas style="height: 450px"></canvas>')
var ctx = $('#chart-post-hit').find('canvas');
modal.attr('data-uid',uid);
modal.find('[data-role="subject"]').text(subject);
modal.find('[data-role="featured_img"]').attr('src',featured_img);
$.post(rooturl+'/?r='+raccount+'&m=post&a=get_postData',{
uid : uid
},function(response,status){
if(status=='success'){
var result = $.parseJSON(response);
var hit=result.hit;
var likes=result.likes;
var dislikes=result.dislikes;
var comment=result.comment;
modal.find('[data-role="hit"]').text(hit);
modal.find('[data-role="likes"]').text(likes);
modal.find('[data-role="dislikes"]').text(dislikes);
modal.find('[data-role="comment"]').text(comment);
} else {
alert(status);
}
});
setPostTrendChart(ctx,uid,mod,'day',<?php echo date("Ymd", strtotime("-1 week")); ?>);
modal.find('.nav-tabs .nav-link:first-child').tab('show');
})
$('#modal-post-analytics').on('hidden.bs.modal', function (e) {
var modal = $(this);
modal.find('.tab-pane canvas').remove()
modal.find('[data-toggle="term"] option:first').prop("selected", true);
})
$('#modal-post-analytics').find('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var modal = $('#modal-post-analytics')
var tab = $(e.target).attr('href');
var uid = modal.attr('data-uid');
var start = $(e.target).attr('data-start');
var mod = $(e.target).attr('data-mod');
var unit = $(e.target).attr('data-unit');
var ctx = $('#chart-post-'+mod).find('canvas');
modal.find('[data-toggle="term"]').attr('data-mod',mod);
setPostTrendChart(ctx,uid,mod,unit,start);
})
$('#modal-post-analytics').find('[data-toggle="term"]').change(function(){
var modal = $('#modal-post-analytics');
var uid = modal.attr('data-uid');
var start = $(this).val();
var mod = $(this).attr('data-mod');
var unit = $(this).find(':selected').attr('data-unit');
var d_start = $(this).find(':selected').attr('data-d_start');
var ctx = $('#chart-post-'+mod).find('canvas');
setPostTrendChart(ctx,uid,mod,unit,start);
modal.find('a[data-toggle="tab"]').attr('data-start',start)
modal.find('[data-role="d_start"]').text(d_start)
});
});
</script>

View File

@@ -0,0 +1,36 @@
<?php
$_WHERE = 'site='.$s;
$where = 'name|tag';
if ($listid) {
$_IS_LISTOWN=getDbRows($table[$m.'list'],'mbruid='.$my['uid'].' and uid='.$LIST['uid']);
$_perm['list_owner'] = $my['admin'] || $_IS_LISTOWN ? true : false;
if (!$LIST['uid'] || ($LIST['display']==1&&!$_perm['list_owner']) || ($LIST['display']==4 && !$my['uid'])) $mod = '_404';
if ($mbrid) {
$M = getDbData($table['s_mbrid'],"id='".$mbrid."'",'*');
$MBR = getDbData($table['s_mbrdata'],'memberuid='.$M['uid'],'*');
}
$_WHERE .= ' and list="'.$LIST['uid'].'"';
$TCD = getDbArray($table[$m.'list_index'],$_WHERE,'*','gid','asc',$recnum,$p);
$NUM = getDbRows($table[$m.'list_index'],$_WHERE);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table[$m.'data'],'uid='.$_R['data'],'*');
} else {
if ($my['uid']) $_WHERE .= ' and display > 3'; // 회원공개와 전체공개 리스트 출력
else $_WHERE .= ' and display = 5'; // 전체공개 리스트만 출력
if ($keyword) $_WHERE .= getSearchSql($where,$keyword,$ikeyword,'or');
$sort = $sort?$sort:'d_regis';
$RCD = getDbArray($table[$m.'list'],$_WHERE,'*',$sort,'desc',$recnum,$p);
$NUM = getDbRows($table[$m.'list'],$_WHERE);
$TPG = getTotalPage($NUM,$recnum);
}
?>

View File

@@ -0,0 +1,32 @@
<?php
if(!defined('__KIMS__')) exit;
$postque = 'site='.$s;
if (!$my['uid']) $postque .= ' and display=5';
else $postque .= ' and display>3';
$RCD = array();
if ($sort == 'gid' && !$keyword)
{
$NUM = getDbRows($table[$m.'index'],$postque);
$TCD = getDbArray($table[$m.'index'],$postque,'gid',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = getDbData($table[$m.'data'],'gid='.$_R['gid'],'*');
}
else {
$orderby = 'desc';
$where = 'subject|review|tag';
if ($where && $keyword) {
if (strpos('[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[$m.'data'],$postque);
$TCD = getDbArray($table[$m.'data'],$postque,'*',$sort,$orderby,$recnum,$p);
while($_R = db_fetch_array($TCD)) $RCD[] = $_R;
}
$TPG = getTotalPage($NUM,$recnum);
?>

101
modules/post/mod/_view.php Normal file
View File

@@ -0,0 +1,101 @@
<?php
if(!defined('__KIMS__')) exit;
// 조회기록
if ($mod=='view' && $d['post']['isperm'] && $my['uid'] && $R['uid']) {
if(!getDbRows($table['s_history'],"date='".$date['today']."' and site=".$s.' and entry='.$R['uid'].' and mbruid='.$my['uid'])) {
getDbInsert($table['s_history'],'site,mbruid,module,entry,date,d_regis',"'".$s."','".$my['uid']."','".$m."','".$R['uid']."','".$date['today']."','".$date['totime']."'");
$_REFCNT = getDbRows($table['s_history'],'');
if ($_REFCNT > 10000) {
$_REFOVER = getDbArray($table['s_history'],'','*','uid','asc',($_REFCNT - 9000),1);
while($_REFK=db_fetch_array($_REFOVER)) getDbDelete($table['s_history'],'uid='.$_REFK['uid']);
}
}
}
if ($mod=='view' && $d['post']['isperm'] && ($d['post']['hitcount'] || !strpos('_'.$_SESSION['module_'.$m.'_view'],'['.$R['uid'].']'))) {
getDbUpdate($table[$m.'data'],'hit=hit+1','uid='.$R['uid']);
getDbUpdate($table['s_mbrdata'],'hit_post=hit_post+1','memberuid='.$R['mbruid']);
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']."'");
}
$device = isMobileConnect($_SERVER['HTTP_USER_AGENT'])?'mobile':'desktop';
$side = strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])?'inside':'outside';
getDbUpdate($table['s_mbrmonth'],'post_hit=post_hit+1',"date='".$date['month']."' and site=".$s.' and mbruid='.$R['mbruid']); //회원별 월별 조회수 갱신
getDbUpdate($table['s_mbrday'],'post_hit=post_hit+1',"date='".$date['today']."' and site=".$s.' and mbruid='.$R['mbruid']); //회원별 일별조회수 갱신
if ($ref) $_QVAL = ','.$ref.'='.$ref.'+1';
getDbUpdate($table[$m.'month'],'hit=hit+1,'.$device.'='.$device.'+1,'.$side.'='.$side.'+1'.$_QVAL,"date='".$date['month']."' and site=".$s.' and data='.$R['uid']); //포스트별 월별 조회수 갱신
getDbUpdate($table[$m.'day'],'hit=hit+1,display='.$R['display'].','.$device.'='.$device.'+1,'.$side.'='.$side.'+1'.$_QVAL,"date='".$date['today']."' and site=".$s.' and data='.$R['uid']); //포스트별 일별 조회수 갱신
$_SESSION['module_'.$m.'_view'] .= '['.$R['uid'].']';
}
if ($d['post']['isperm'] && $R['upload'])
{
$d['upload'] = array();
$d['upload']['tmp'] = $R['upload'];
$d['_pload'] = getArrayString($R['upload']);
$attach_file_num=0;// 첨부파일 수량 체크 ---------------------------------> 2015.1.1 추가 by kiere.
foreach($d['_pload']['data'] as $_val)
{
$U = getUidData($table['s_upload'],$_val);
if (!$U['uid'])
{
$R['upload'] = str_replace('['.$_val.']','',$R['upload']);
$d['_pload']['count']--;
}
else {
$d['upload']['data'][] = $U;
if (!$U['sync'])
{
$_SYNC = "sync='[".$m."][".$R['uid']."][uid,down][".$table[$m.'data']."][".$R['mbruid']."][m:".$m.",bid:".$R['bbsid'].",uid:".$R['uid']."]'";
getDbUpdate($table['s_upload'],$_SYNC,'uid='.$U['uid']);
}
}
if($U['hidden']==0) $attach_file_num++; // 숨김처리 안했으면 수량 ++
}
if ($R['upload'] != $d['upload']['tmp'])
{
// getDbUpdate($table[$m.'data'],"upload='".$R['upload']."'",'uid='.$R['uid']);
}
$d['upload']['count'] = $d['_pload']['count'];
}
$mod = $mod ? $mod : 'view';
if ($mbrid) {
$M = getDbData($table['s_mbrid'],"id='".$mbrid."'",'*');
$MBR = getDbData($table['s_mbrdata'],'memberuid='.$M['uid'],'*');
}
//최초등록자
$M1 = getDbData($table['s_mbrdata'],'memberuid='.$R['mbruid'],'*');
//구독(팔로우)여부
$_isFollowing = getDbRows($table['s_friend'],'my_mbruid='.$my['uid'].' and by_mbruid='.$M1['memberuid']);
$LIST=getDbData($table[$m.'list'],"id='".$list."'",'*');
//포스트 멤버
$_POSTMBR_RCD = getDbArray($table[$m.'member'],'data='.$R['uid'].' and auth=1','*','d_regis','asc',0,1);
while($_POSTMBR_R = db_fetch_array($_POSTMBR_RCD)) $MBR_RCD[] = getDbData($table['s_mbrdata'],'memberuid='.$_POSTMBR_R['mbruid'],'*');
?>

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

@@ -0,0 +1 @@
포스트

View File

@@ -0,0 +1,18 @@
<div class="jumbotron jumbotron-fluid bg-white py-5 mb-0">
<div class="container">
<h1 class="display-2 text-center">404</h1>
<p class="lead text-center text-muted">잘못된 주소이거나 비공개 또는 삭제된 글입니다.</p>
<div class="text-center">
<?php if (!$my['uid']): ?>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-login">로그인 하기</button>
<?php endif; ?>
<button type="button" class="btn btn-light" onclick="history.back();">이전가기</button>
</div>
</div>
</div>
<script type="text/javascript">
document.title = 'Page not found · 킴스큐';
</script>

View File

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

View File

@@ -0,0 +1,43 @@
<li class="list-group-item media align-items-center serial"
data-role="item"
data-subject="{$subject}"
data-featured_img="{$featured_img}">
<div class="pr-3 text-muted counter"></div>
<a href="{$link}" class="position-relative mr-3" target="_blank">
<img class="border" src="{$featured_img}" alt="" style="width:100px">
<time class="badge badge-dark rounded-0 position-absolute" style="right:1px;bottom:1px">{$time}</time>
</a>
<div class="media-body">
<h5 class="f14 my-1 line-clamp-2">
<a href="{$edit_link}" class="font-weight-light muted-link">
{$subject}
</a>
</h5>
<div class="mb-1">
<ul class="list-inline d-inline-block f12 text-muted">
<li class="list-inline-item">조회 {$hit}</li>
<li class="list-inline-item">
<a href="#modal-post-opinion" data-toggle="modal" data-backdrop="static" data-uid="{$uid}" data-opinion="like" class="text-reset">
좋아요 {$likes}
</a>
</li>
<li class="list-inline-item">
<a href="#modal-post-opinion" data-toggle="modal" data-backdrop="static" data-uid="{$uid}" data-opinion="dislike" class="text-reset">
싫어요 {$dislikes}
</a>
</li>
<li class="list-inline-item">댓글 {$comment}</li>
<li class="list-inline-item">
<time data-plugin="timeago" datetime="{$d_modify}"></time>
</li>
</ul>
</div>
</div>
<div class="ml-3 align-self-center form-inline">
<span class="text-muted mr-1 f14 rounded-0 px-2 align-middle">{$num}</span>
<button type="button" class="btn btn-white btn-sm" data-target="#modal-post-analytics" data-toggle="modal" data-backdrop="static" data-uid="{$uid}">
<i class="fa fa-bar-chart" aria-hidden="true"></i>
</button>
</div>
</li>

View File

@@ -0,0 +1,11 @@
<a class="list-group-item list-group-item-action" href="{$profile_link}" class="media" target="_blank">
<div class="position-relative pull-left mr-2">
<img class="media-object border rounded-circle" src="{$avatar}" style="width:42px" data-toggle="tooltip" title="{$nic}" role="button">
<i class="position-absolute fa fa-heart text-danger" aria-hidden="true" style="bottom:0;right:0"></i>
</div>
<div class="media-body">
{$nic}
<div><time data-plugin="timeago" class="small">{$d_regis}</time></div>
</div>
</a>

View File

@@ -0,0 +1,104 @@
<?php
$_WTIT=strip_tags($g['meta_tit']);
$link_url = explode("?", $g['url_root'].$_SERVER['REQUEST_URI']); // 파라미터 제외
$_link_url = $link_url[0] ;
?>
<ul class="list-inline" data-role="linkshare">
<li data-toggle="tooltip" title="페이스북" class="list-inline-item">
<a href="" role="button" onclick="snsWin('fb');">
<img src="<?php echo $g['img_core']?>/sns/facebook.png" alt="페이스북공유" class="rounded-circle" width="50">
</a>
</li>
<li data-toggle="tooltip" title="카카오스토리" class="list-inline-item">
<a href="" role="button" onclick="snsWin('ks');">
<img src="<?php echo $g['img_core']?>/sns/kakaostory.png" alt="카카오스토리" class="rounded-circle" width="50">
</a>
</li>
<li data-toggle="tooltip" title="네이버" class="list-inline-item">
<a href="" role="button" onclick="snsWin('nv');">
<img src="<?php echo $g['img_core']?>/sns/naver.png" alt="네이버" class="rounded-circle" width="50">
</a>
</li>
<li data-toggle="tooltip" title="트위터" class="list-inline-item">
<a href="" role="button" onclick="snsWin('tt');">
<img src="<?php echo $g['img_core']?>/sns/twitter.png" alt="트위터" class="rounded-circle" width="50">
</a>
</li>
</ul>
<div class="mt-5 mb-4">
<div class="input-group mt-3" data-role="ref_selector">
<div class="input-group-prepend">
<button class="btn btn-white dropdown-toggle text-primary" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
선택
</button>
<div class="dropdown-menu shadow" data-url="<?php echo $_link_url?>">
<a class="dropdown-item" href="#" data-ref="kt">카카오톡</a>
<a class="dropdown-item" href="#" data-ref="yt">유튜브</a>
<a class="dropdown-item" href="#" data-ref="fb">페이스북</a>
<a class="dropdown-item" href="#" data-ref="ig">인스타그램</a>
<a class="dropdown-item" href="#" data-ref="nb">네이버 블로그</a>
<a class="dropdown-item" href="#" data-ref="ks">카카오스토리</a>
<a class="dropdown-item" href="#" data-ref="tt">트위터</a>
<div role="separator" class="dropdown-divider"></div>
<a class="dropdown-item" href="#" data-ref="em">이메일</a>
<a class="dropdown-item" href="#" data-ref="sm">SMS</a>
<a class="dropdown-item" href="#" data-ref="et">기타</a>
</div>
</div>
<input type="text" class="form-control" readonly value="<?php echo $_link_url?>" id="_url_">
<div class="input-group-append">
<button class="btn btn-white js-clipboard js-tooltip" type="button" title="클립보드에 복사" data-clipboard-target="#_url_">
<i class="fa fa-clone" aria-hidden="true"></i>
</button>
</div>
</div>
<span class="form-text text-muted mt-3 f13">통계분석을 위해 매체별 전용URL 사용해주세요.</span>
</div>
<?php getImport('clipboard','clipboard.min','2.0.4','js'); ?>
<script type="text/javascript">
// sns 이벤트
function snsWin(sns) {
var snsset = new Array();
var enc_sbj = "<?php echo urlencode($_WTIT)?>";
var enc_url = "<?php echo $_link_url?>?ref="+sns;
var enc_tag = "<?php echo urlencode(str_replace(',',' ',$R['tag']))?>";
snsset['tt'] = 'https://twitter.com/intent/tweet?url=' + enc_url + '&text=' + enc_sbj;
snsset['fb'] = 'http://www.facebook.com/sharer.php?u=' + enc_url;
snsset['nv'] = 'http://share.naver.com/web/shareView.nhn?url=' + enc_url + '&title=' + enc_sbj;
snsset['ks'] = 'https://story.kakao.com/share?url=' + enc_url + '&title=' + enc_sbj;
window.open(snsset[sns]);
}
$( document ).ready(function() {
var clipboard = new ClipboardJS('.js-clipboard');
clipboard.on('success', function (e) {
$(e.trigger)
.attr('title', '복사완료!')
.tooltip('_fixTitle')
.tooltip('show')
.attr('title', '클립보드 복사')
.tooltip('_fixTitle')
e.clearSelection()
})
$('[data-role="ref_selector"]').find('.dropdown-item').click(function(){
var item = $(this)
var selector = $('[data-role="ref_selector"]')
var ref = item.attr('data-ref');
var url = selector.find('.dropdown-menu').attr('data-url');
var label = item.text();
selector.find('[data-toggle="dropdown"]').text(label)
selector.find('[type="text"]').val(url+'?ref='+ref)
selector.find('.js-tooltip').click();
});
});
</script>

View File

@@ -0,0 +1,23 @@
<?php
$listque = 'mbruid='.$my['uid'];
$_RCD = getDbArray($table[$m.'list'],$listque,'*','gid','asc',30,1);
$NUM = getDbRows($table[$m.'list'],$listque);
?>
<div data-role="list-selector">
<?php foreach($_RCD as $_R):?>
<?php $is_list = getDbRows($table[$m.'list_index'],'data='.$R['uid'].' and list='.$_R['uid']) ?>
<div class="d-flex justify-content-between align-items-center px-3 py-2">
<div class="custom-control custom-checkbox">
<input type="checkbox" id="listRadio<?php echo $_R['uid'] ?>" name="postlist_members[]" value="<?php echo $_R['uid'] ?>" class="custom-control-input" <?php echo $is_list?' checked':'' ?>>
<label class="custom-control-label" for="listRadio<?php echo $_R['uid'] ?>"><?php echo $_R['name'] ?></label>
</div>
<i class="material-icons text-muted mr-2" data-toggle="tooltip" title="<?php echo $g['displaySet']['label'][$_R['display']] ?>"><?php echo $g['displaySet']['icon'][$_R['display']] ?></i>
</div>
<?php endforeach?>
</div>
<?php if(!$NUM):?>
<div class="text-center text-muted p-5">리스트가 없습니다.</div>
<?php endif?>

View File

@@ -0,0 +1,244 @@
/* form */
.dropdown-filter .dropdown-toggle {
position: relative;
text-align: left;
min-width: 10rem
}
.dropdown-filter .dropdown-toggle::after {
position: absolute;
top: 50%;
right: 10px;
margin-top: -2px;
}
.dropdown-filter.show .dropdown-toggle::after {
border-bottom: .3em solid;
border-top: 0;
}
.dropdown-menu {
border-radius: 0;
}
.input-group .form-control:focus {
border-color: #ced4da;
outline: 0;
box-shadow: none;
}
.input-group .btn:hover {
background-color: inherit;
border-color: rgba(27,31,35,0.2);
}
/*attach*/
.post-section .gallery figure,
.post-section .gallery .card {
position: relative;
}
.post-section .gallery figcaption,
.post-section .gallery .card-img-overlay {
opacity: 0;
position: absolute;
top:0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
word-break: break-all;
cursor: pointer;
transition-timing-function: ease-in;
transition-duration: .3s;
transition-property: all;
transition-delay: 0s;
}
.post-section .gallery figcaption {
color: #fff;
}
.post-section .gallery .card-img-overlay:hover,
.post-section .gallery figcaption:hover {
opacity: 1 !important;
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
text-decoration: none;
}
.post-section .gallery .card-img-overlay:hover {
background-color: #fff !important
}
.post-section .gallery [data-role="caption"] {
display: none;
}
.post-section .clearfix .float-left:first-child {
margin-right: 10px
}
.card__corner {
position: absolute;
top: 0;
right: 0;
width: 2em;
height: 2em;
background-color: #e6e7e8;
border: 1px solid rgba(0,0,0,.045);
border-top: 0;
}
.card .card__corner {
top: -1px;
right: -1px;
}
.card__corner .card__corner-triangle {
position: absolute;
width: 0;
height: 0;
border-style: solid;
border-width: 0 2em 2em 0;
border-color: transparent #fff transparent transparent;
}
.post-section .gallery .card:hover .card__corner,
.post-section .gallery figure:hover .card__corner {
display: none
}
/* 보기 */
.serial {
counter-increment: Serial;
}
.serial .counter:before {
content: counter(Serial);
}
.serial.active .counter:before {
content: '▶';
}
[data-role="follow"].active {
background-color: #e0e0e0 !important;
color: #696969 !important;
border: none !important
}
[data-role="follow"].active::after {
content: '중'
}
/* 쓰기 */
.rb-post-write header {
position: fixed;
top: 0;
left: 0;
right:0;
bottom:auto
}
.rb-post-write aside {
position: fixed;
top: 64px;
bottom: 0;
right:0;
left: auto;
width: 350px;
z-index: 99
}
.rb-post-write aside .inner {
position: relative;
height: 100%
}
.rb-post-write aside .nav-tabs {
position: absolute;
top: 0;
left:0;
right:0
}
.rb-post-write aside .tab-content {
position: absolute;
top: 40px;
left: 0;
right:0;
bottom:0;
overflow-x: hidden;
overflow-y: auto;
}
.nav-tabs .nav-link {
border: 1px solid transparent;
border-top-left-radius: 0;
border-top-right-radius: 0;
color: #999;
background-color: rgba(0,0,0,.03);
}
.nav-tabs .nav-item.show .nav-link,
.nav-tabs .nav-link.active {
color: #495057;
background-color: #fff;
border-color: #fff #dee2e6 #fff;
}
.nav-tabs .nav-item:first-child.show .nav-link,
.nav-tabs .nav-item:first-child .nav-link.active {
border-color: #fff #dee2e6 #fff #fff;
}
.nav-tabs .nav-link:focus,
.nav-tabs .nav-link:hover {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.nav-tabs .nav-link.disabled {
color: #ccc;
background-color: rgba(0,0,0,.03);
}
.document-editor {
position: absolute;
top: 104px;
right: 350px;
bottom: 0;
left: 0;
overflow: auto;
}
.document-editor__toolbar {
position: fixed;
top: 64px;
right: 350px;
left: 0;
}
.rb-post-write [name="subject"] {
border-color: #fff;
color: #000;
font-size: 18px;
height: calc(1.5em + .5rem + 2px);
padding: .3rem .5rem;
font-size: 18px;
line-height: 1.5;
}
.rb-post-write [name="subject"]:hover {
border-color: #ced4da
}
.rb-post-write fieldset:disabled button {
opacity: 0
}
/* 관리 */
.modal .nav-tabs .nav-link {
border: 1px solid transparent;
color: #999;
background-color: transparent;
}
.modal .nav-tabs .nav-item.show .nav-link,
.modal .nav-tabs .nav-link.active {
color: #495057;
background-color: #fff;
border-color: #dee2e6 #dee2e6 #fff;
}

View File

@@ -0,0 +1,196 @@
var submitFlag = false;
function listCheckedNum() {
var checked_num = $('[data-role="list-selector"] :checkbox:checked').length;
if(checked_num==0) checked_num='';
$('[data-role="list_num"]').text(checked_num);
}
function doToc() {
Toc.init({
$nav: $("#toc"),
$scope: $(".document-editor__editable-container h2, .document-editor__editable-container h3, .document-editor__editable-container h4")
});
}
function showSaveButton(changed) {
if (changed) {
$('[data-role="postsubmit"]').removeClass('d-none');
$('[data-role="library"]').addClass('d-none');
} else {
$('[data-role="postsubmit"]').addClass('d-none');
$('[data-role="library"]').removeClass('d-none');
}
}
function savePost(f) {
if (submitFlag == true) {
alert('포스트를 등록하고 있습니다. 잠시만 기다려 주세요.');
return false;
}
// if (f.subject.value == '') {
// alert('제목 입력해 주세요.');
// f.subject.focus();
// return false;
// }
var editorData = editor.getData();
if (editorData == '')
{
$.notify({message: '본문 입력후 저장해 주세요.'},{type: 'primary'});
editor.editing.view.focus();
return false;
} else {
$('[name="content"]').val(editorData)
}
// 카테고리 체크
var cat_sel=$('input[name="tree_members[]"]');
var cat_sel_n=cat_sel.length;
var cat_arr=$('input[name="tree_members[]"]:checked').map(function(){return $(this).val();}).get();
var cat_n=cat_arr.length;
// if(cat_sel_n>0 && cat_arr==''){
// alert('지정된 카테고리가 없습니다.\n적어도 하나이상의 카테고리를 지정해 주세요.');
// $('#advan').tab('show')
// return false;
// }
var s='';
for (var i=0;i <cat_n;i++) {
if(cat_arr[i]!='') s += '['+cat_arr[i]+']';
}
f.category_members.value = s;
// 리스트 체크
var list_sel=$('input[name="postlist_members[]"]');
var list_arr=$('input[name="postlist_members[]"]:checked').map(function(){return $(this).val();}).get();
var list_n=list_arr.length;
var l='';
for (var i=0;i <list_n;i++) {
if(list_arr[i]!='') l += '['+list_arr[i]+']';
}
$('input[name="list_members"]').val(l);
// 대표이미지가 없을 경우, 첫번째 업로드 사진을 지정함
var featured_img_input = $('input[name="featured_img"]'); // 대표이미지 input
var featured_img_uid = $(featured_img_input).val();
if(featured_img_uid ==0){ // 대표이미지로 지정된 값이 없는 경우
var first_attach_img_li = $('.rb-attach-featured li:first'); // 첫번째 첨부된 이미지 리스트 li
var first_attach_img_uid = $(first_attach_img_li).attr('data-id');
featured_img_input.val(first_attach_img_uid);
}
// 첨부파일 uid 를 upfiles 값에 추가하기
var attachfiles=$('input[name="attachfiles[]"]').map(function(){return $(this).val()}).get();
var new_upfiles='';
if(attachfiles){
for(var i=0;i<attachfiles.length;i++) {
new_upfiles+=attachfiles[i];
}
$('input[name="upload"]').val(new_upfiles);
}
// 공유회원 uid 를 members 값에 추가하기
var postmembers=$('input[name="postmembers[]"]').map(function(){return $(this).val()}).get();
var new_members='';
if(postmembers){
for(var i=0;i<postmembers.length;i++) {
new_members+=postmembers[i];
}
$('input[name="members"]').val(new_members);
}
// 첨부상품 uid 를 gooods 값에 추가하기
var postgoods=$('input[name="attachGoods[]"]').map(function(){return $(this).val()}).get();
var new_goods='';
if(postgoods){
for(var i=0;i<postgoods.length;i++) {
new_goods+=postgoods[i];
}
$('input[name="goods"]').val(new_goods);
}
checkUnload = false;
$('[data-role="postsubmit"]').attr( 'disabled', true );
var form = $('[name="writeForm"]')
var uid = form.find('[name="uid"]').val();
var category_members = form.find('[name="category_members"]').val();
var list_members = form.find('[name="list_members"]').val();
var members = form.find('[name="members"]').val();
var upload = form.find('[name="upload"]').val();
var featured_img = form.find('[name="featured_img"]').val();
var html = form.find('[name="html"]').val();
var subject = form.find('[name="subject"]').val();
var review = form.find('[name="review"]').val();
var tag = form.find('[name="tag"]').val();
var display = form.find('[name="display"]').val();
var format = form.find('[name="format"]').val();
var goods = form.find('[name="goods"]').val();
var dis_rating = form.find('[name="use_rating"]').is(":checked")?0:1;
var dis_like = form.find('[name="use_like"]').is(":checked")?0:1;
var dis_comment = form.find('[name="use_comment"]').is(":checked")?0:1;
var dis_listadd = form.find('[name="use_listadd"]').is(":checked")?0:1;
if (uid) {
setTimeout(function(){
$.post(rooturl+'/?r='+raccount+'&m=post&a=write',{
content : editorData,
uid : uid,
category_members : category_members,
list_members : list_members,
members : members,
upload : upload,
featured_img : featured_img,
html : html,
subject : subject,
review : review,
tag : tag,
format : format,
goods : goods,
display : display,
dis_rating : dis_rating,
dis_like : dis_like,
dis_comment : dis_comment,
dis_listadd : dis_listadd
},function(response,status){
if(status=='success'){
var result = $.parseJSON(response);
var error=result.error;
if (!error) {
var d_modify=result.d_modify;
form.find('[data-role="postsubmit"]').attr( 'disabled', false );
form.find('[data-role="d_modify"]').attr('data-original-title',d_modify);
form.find('[data-plugin="timeago"]').timeago("update", new Date());
form.find('[data-role="postsubmit"]').addClass('d-none');
form.find('[data-role="library"]').removeClass('d-none');
form.find('[data-role="share"]').removeClass('d-none');
} else {
alert(error);
}
} else {
alert(status);
}
});
}, 200);
} else {
form.find('[name="dis_rating"]').val(1); //평점 사용안함
form.find('[name="dis_like"]').val(dis_like);
form.find('[name="dis_comment"]').val(dis_comment);
form.find('[name="dis_listadd"]').val(dis_listadd);
setTimeout(function(){
getIframeForAction(f);
f.submit()
}, 200);
}
}

View File

@@ -0,0 +1,54 @@
<?php
$wdgvar['limit'] = 3; //전체 출력수
$wdgvar['title'] ='최근 리스트';
$listque = 'mbruid='.$M1['memberuid'].' and site='.$s;
if ($my['uid']) $listque .= ' and display > 3'; // 회원공개와 전체공개 포스트 출력
else $listque .= ' and display = 5'; // 전체공개 포스트만 출력
if ($list) $listque .= ' and id <>'.$list;
$_RCD=getDbArray($table['postlist'],$listque,'*','gid','asc',$wdgvar['limit'],1);
$_NUM = getDbRows($table['postlist'],$listque);
?>
<section class="widget-post-card-01">
<header class="d-flex justify-content-between align-items-center py-2">
<span><?php echo $wdgvar['title']?></span>
</header>
<?php if ($_NUM): ?>
<ul class="list-unstyled">
<?php $i=0;foreach($_RCD as $LIST):$i++;?>
<li class="media mb-2">
<a href="<?php echo getListLink($LIST,1) ?>" class="position-relative mr-2">
<img class="" src="<?php echo getPreviewResize(getListImageSrc($LIST['uid']),'160x90') ?>" alt="">
<span class="list_mask">
<span class="txt"><?php echo $LIST['num']?><i class="fa fa-list-ul d-block" aria-hidden="true"></i></span>
</span>
</a>
<div class="media-body">
<h5 class="h6 my-1 font-weight-light line-clamp-3">
<a href="<?php echo getListLink($LIST,1) ?>" class="text-reset" ><?php echo $LIST['name']?></a>
</h5>
<div class="mb-1">
<ul class="list-inline d-inline-block f13 text-muted">
<li class="list-inline-item">
<time data-plugin="timeago" datetime="<?php echo getDateFormat($LIST['d_regis'],'c')?>"></time>
</li>
</ul>
</div>
</div>
</li>
<?php endforeach?>
</ul>
<?php else: ?>
<div class="p-5 text-muted text-center border mb-3">
리스트가 없습니다.
</div>
<?php endif; ?>
</section><!-- /.widget -->

View File

@@ -0,0 +1,60 @@
<?php
$wdgvar['limit'] = 3; //전체 출력수
$wdgvar['title'] = $M1[$_HS['nametype']].'님의 포스트';
$postque = 'mbruid='.$M1['memberuid'].' 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',$wdgvar['limit'],1);
while($_R = db_fetch_array($_RCD)) $RCD[] = getDbData($table['postdata'],'gid='.$_R['gid'],'*');
$_NUM = getDbRows($table['postmember'],$postque);
?>
<section class="widget-post-card-01">
<header class="d-flex justify-content-between align-items-center pb-2">
<span><?php echo $wdgvar['title']?></span>
<?php if($wdgvar['link']):?>
<a href="<?php echo $wdgvar['link']?>" class="muted-link small">
더보기 <i class="fa fa-angle-right" aria-hidden="true"></i>
</a>
<?php endif?>
</header>
<?php if ($_NUM): ?>
<ul class="list-unstyled">
<?php $i=0;foreach($RCD as $POST):$i++;?>
<li class="media mb-2">
<a href="<?php echo getPostLink($POST,0) ?>" class="position-relative mr-2">
<img class="" src="<?php echo getPreviewResize(getUpImageSrc($POST),'160x90') ?>" alt="" >
<time class="badge badge-dark rounded-0 position-absolute" style="right:1px;bottom:1px"><?php echo getUpImageTime($POST) ?></time>
</a>
<div class="media-body">
<h5 class="h6 my-1 font-weight-light line-clamp-3">
<a href="<?php echo getPostLink($POST,0) ?>" class="text-reset" ><?php echo stripslashes($POST['subject'])?></a>
</h5>
<div class="mb-1">
<ul class="list-inline d-inline-block f13 text-muted">
<li class="list-inline-item">조회수 <?php echo $POST['hit']?>회 </li>
<li class="list-inline-item">
<time data-plugin="timeago" datetime="<?php echo getDateFormat($POST['d_regis'],'c')?>"></time>
</li>
</ul>
</div>
</div>
</li>
<?php endforeach?>
</ul>
<?php else: ?>
<div class="p-5 text-muted text-center border mb-3">
내역이 없습니다.
</div>
<?php endif; ?>
</section><!-- /.widget -->

View File

@@ -0,0 +1,43 @@
<div class="custom-control custom-radio my-1">
<input type="radio" id="report-radio-01" name="report-radio" class="custom-control-input">
<label class="custom-control-label" for="report-radio-01">성적인 콘텐츠</label>
</div>
<div class="custom-control custom-radio my-1">
<input type="radio" id="report-radio-02" name="report-radio" class="custom-control-input">
<label class="custom-control-label" for="report-radio-02">폭력적 또는 혐오스러운 콘텐츠</label>
</div>
<div class="custom-control custom-radio my-1">
<input type="radio" id="report-radio-03" name="report-radio" class="custom-control-input">
<label class="custom-control-label" for="report-radio-03">증오 또는 악의적인 콘텐츠</label>
</div>
<div class="custom-control custom-radio my-1">
<input type="radio" id="report-radio-04" name="report-radio" class="custom-control-input">
<label class="custom-control-label" for="report-radio-04">유해한 위험 행위</label>
</div>
<div class="custom-control custom-radio my-1">
<input type="radio" id="report-radio-05" name="report-radio" class="custom-control-input">
<label class="custom-control-label" for="report-radio-05">아동 학대</label>
</div>
<div class="custom-control custom-radio my-1">
<input type="radio" id="report-radio-06" name="report-radio" class="custom-control-input">
<label class="custom-control-label" for="report-radio-06">테러 조장</label>
</div>
<div class="custom-control custom-radio my-1">
<input type="radio" id="report-radio-07" name="report-radio" class="custom-control-input">
<label class="custom-control-label" for="report-radio-07">스팸 또는 사용자를 현혹하는 콘텐츠</label>
</div>
<div class="custom-control custom-radio my-1">
<input type="radio" id="report-radio-08" name="report-radio" class="custom-control-input">
<label class="custom-control-label" for="report-radio-08">권리 침해</label>
</div>
<div class="custom-control custom-radio my-1">
<input type="radio" id="report-radio-09" name="report-radio" class="custom-control-input">
<label class="custom-control-label" for="report-radio-09">기타</label>
</div>
<div class="mt-3">
<small class="text-muted">
운영팀 팀에서는 신고된 동영상 사용자의 커뮤니티 가이드 위반 여부를 판단하기 위해 연중무휴 24시간 검토 작업을 하고 있습니다.
커뮤니티 가이드를 위반한 계정은 제재를 받게 되며 심각하거나 반복적인 위반 행위에 대해서는 계정 해지 조치가 취해질 있습니다.
</small>
</div>

View File

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

View File

@@ -0,0 +1,3 @@
<?php
$d['theme']['format'] = "doc,video,adv"; // 포맷 (문서형,비디오형,포토갤러리형,카드형) , 테마폴더 view_doc.php .. 연계
?>

View File

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

View File

@@ -0,0 +1,205 @@
<?php
switch ($sort) {
case 'gid' : $sort_txt='생성순';break;
case 'd_modify' : $sort_txt='최신순';break;
case 'hit' : $sort_txt='조회순';break;
case 'likes' : $sort_txt='좋아요순';break;
case 'comment' : $sort_txt='댓글순';break;
}
?>
<section>
<div class="row">
<div class="col-3">
<div class="card">
<div class="card-header">
<a href="<?php echo RW('m=post&mod=category') ?>" class="muted-link" title="전체보기">카테고리</a>
</div>
<div class="card-body">
<?php $_treeOptions=array('site'=>$s,'table'=>$table[$m.'category'],'dispNum'=>$my['uid']?true:false,'dispHidden'=>true,'dispCheckbox'=>false,'allOpen'=>true)?>
<?php $_treeOptions['link'] = RW('m=post&cat=')?>
<?php echo getTreeCategory($_treeOptions,$code,0,0,'')?>
</div>
</div><!-- /.card -->
</div>
<div class="col-9">
<header class="d-flex justify-content-between align-items-center border-bottom border-dark mt-2 pb-2">
<h3 class="mb-0">
<?php echo $CAT['name']?$CAT['name']:'전체 카테고리' ?>
</h3>
<div class="">
</div>
</header>
<div class="d-flex align-items-center py-3" role="filter">
<span class="f18">전체 <span class="text-primary"><?php echo number_format($NUM)?></span> 개</span>
<form name="postsearchf" action="<?php echo $g['page_reset'] ?>" method="get" class="form-inline ml-auto">
<?php if ($_HS['rewrite']): ?>
<input type="hidden" name="sort" value="<?php echo $sort?>">
<?php else: ?>
<input type="hidden" name="r" value="<?php echo $r?>">
<?php if($_mod):?>
<input type="hidden" name="mod" value="<?php echo $_mod?>">
<?php else:?>
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="front" value="<?php echo $front?>">
<?php endif?>
<input type="hidden" name="page" value="<?php echo $page?>">
<input type="hidden" name="sort" value="<?php echo $sort?>">
<input type="hidden" name="orderby" value="<?php echo $orderby?>">
<input type="hidden" name="recnum" value="<?php echo $recnum?>">
<input type="hidden" name="type" value="<?php echo $type?>" />
<input type="hidden" name="mbrid" value="<?php echo $_MP['id']?>">
<?php endif; ?>
<input type="hidden" name="code" value="<?php echo $code?>">
<label class="mt-1 mr-2 sr-only">정열</label>
<div class="dropdown" data-role="sort">
<a class="btn btn-white dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
정열 : <?php echo $sort_txt ?>
</a>
<div class="dropdown-menu shadow-sm" aria-labelledby="dropdownMenuLink" style="min-width: 116px;">
<button class="dropdown-item d-flex justify-content-between align-items-center<?php echo $sort=='gid'?' active':'' ?>" type="button" data-value="gid">
생성순
</button>
<button class="dropdown-item d-flex justify-content-between align-items-center<?php echo $sort=='d_modify'?' active':'' ?>" type="button" data-value="d_modify">
최신순
</button>
<button class="dropdown-item d-flex justify-content-between align-items-center<?php echo $sort=='hit'?' active':'' ?>" type="button" data-value="hit">
조회순
</button>
<button class="dropdown-item d-flex justify-content-between align-items-center<?php echo $sort=='likes'?' active':'' ?>" type="button" data-value="likes">
좋아요순
</button>
<button class="dropdown-item d-flex justify-content-between align-items-center<?php echo $sort=='comment'?' active':'' ?>" type="button" data-value="comment">
댓글순
</button>
</div>
</div>
<div class="input-group ml-2">
<input type="text" name="keyword" class="form-control" placeholder="제목,요약,태그 검색" value="<?php echo $_keyword?>">
<div class="input-group-append">
<button class="btn btn-white text-muted border-left-0" type="submit">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
<?php if ($keyword): ?>
<a class="btn btn-white ml-1" href="<?php echo $g['post_reset'] ?>">리셋</a>
<?php endif; ?>
</div>
</div>
</form><!-- /.form-inline -->
</div><!-- /.d-flex -->
<?php if ($NUM): ?>
<ul class="list-unstyled" data-plugin="markjs">
<?php foreach($RCD as $R):?>
<li class="media my-4">
<?php if ($R['featured_img']): ?>
<a href="<?php echo getPostLink($R,0) ?>" class="position-relative mr-3">
<img src="<?php echo checkPostPerm($R) ?getPreviewResize(getUpImageSrc($R),'180x100'):getPreviewResize('/files/noimage.png','180x100') ?>" alt="">
<time class="badge badge-dark rounded-0 position-absolute f14" style="right:1px;bottom:1px"><?php echo checkPostPerm($R)?getUpImageTime($R):'' ?></time>
</a>
<?php endif; ?>
<div class="media-body">
<h5 class="mt-0 mb-1">
<a class="text-decoration-none text-reset" href="<?php echo getPostLink($R,0) ?>">
<?php echo checkPostPerm($R)?stripslashes($R['subject']):'[비공개 포스트]'?>
</a>
</h5>
<?php if (checkPostPerm($R)): ?>
<div class="mb-1">
<ul class="list-inline d-inline-block f13 text-muted">
<li class="list-inline-item">조회 <?php echo $R['hit']?> </li>
<li class="list-inline-item">좋아요 <?php echo $R['likes']?> </li>
<li class="list-inline-item">댓글 <?php echo $R['comment']?> </li>
<li class="list-inline-item">
<time class="text-muted" data-plugin="timeago" datetime="<?php echo getDateFormat($R['d_modify']?$R['d_modify']:$R['d_regis'],'c')?>"></time>
</li>
</ul>
<?php if ($R['category']): ?>
<span class="ml-2 f13 text-muted">
<i class="fa fa-folder-o mr-1" aria-hidden="true"></i> <?php echo getAllPostCat($m,$R['category']) ?>
</span>
<?php endif; ?>
<span class="ml-2 f13 text-muted">
<!-- 태그 -->
<?php $_tags=explode(',',$R['tag'])?>
<?php $_tagn=count($_tags)?>
<?php $i=0;for($i = 0; $i < $_tagn; $i++):?>
<?php $_tagk=trim($_tags[$i])?>
<a class="badge badge-light" href="<?php echo RW('m=post&mod=keyword&') ?>keyword=<?php echo urlencode($_tagk)?>"><?php echo $_tagk?></a>
<?php endfor?>
</span>
<span class="badge badge-secondary ml-2"><?php echo checkPostOwner($R) && $R['display']!=5?$g['displaySet']['label'][$R['display']]:'' ?></span>
</div>
</div>
<?php else: ?>
<p class="text-muted py-3">
이 포스트에 대한 액세스 권한이 없습니다.
</p>
<?php endif; ?>
</li>
<?php endforeach?>
</ul>
<?php else: ?>
<div class="d-flex align-items-center justify-content-center" style="height: 50vh">
<div class="text-muted">
포스트가 없습니다.
</div>
</div>
<?php endif; ?>
<footer class="d-flex justify-content-between mt-5">
<div class=""></div>
<?php if ($NUM > $recnum): ?>
<ul class="pagination mb-0">
<?php echo getPageLink(10,$p,$TPG,$_N)?>
</ul>
<?php endif; ?>
<div class="">
</div>
</footer>
</div>
</div><!-- /.row -->
</section>
<script>
$( document ).ready(function() {
// 툴바
$('[name="postsearchf"] .dropdown-item').click(function(){
var form = $('[name="postsearchf"]');
var value = $(this).attr('data-value');
var role = $(this).closest('.dropdown').attr('data-role');
form.find('[name="'+role+'"]').val(value)
form.submit();
});
// marks.js
$('[data-plugin="markjs"]').mark("<?php echo $keyword ?>");
});
</script>

View File

@@ -0,0 +1,192 @@
<div class="modal" id="modal-post-share" tabindex="-1" role="dialog">
<div class="modal-dialog modal-dialog-centered" role="document" style="width: 400px">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">공유하기</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-center p-5">
<?php include $g['dir_module_skin'].'_linkshare.php'?>
</div>
</div>
</div>
</div>
<div class="modal" id="modal-post-listadd" tabindex="-1" role="dialog">
<div class="modal-dialog modal-dialog-centered" role="document" style="width: 400px">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">저장하기</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body p-2" style="min-height: 200px">
<?php if ($my['uid']) include $g['dir_module_skin'].'_listadd.php'?>
</div>
<div class="modal-footer py-2 f13">
<button type="button" class="btn btn-link mr-auto text-reset text-decoration-none" data-role="list-add-button">
<i class="material-icons text-muted align-bottom mr-1">add</i>
새 리스트 만들기
</button>
<div class="input-group my-2 d-none" data-role="list-add-input">
<input type="text" class="form-control" placeholder="리스트명 입력" name="list_name">
<div class="input-group-append">
<button class="btn btn-white" type="button" data-act="list-add-submit">
<span class="not-loading">
추가
</span>
<span class="is-loading">
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
</span>
</button>
<button class="btn btn-white" type="button" data-act="list-add-cancel">취소</button>
</div>
</div><!-- /.input-group -->
<button type="button" class="btn btn-link" data-act="submit">
<span class="not-loading">
저장하기
</span>
<span class="is-loading">
<span class="spinner-border spinner-border-sm mr-1" role="status" aria-hidden="true"></span>
저장중...
</span>
</button>
</div>
</div>
</div>
</div>
<div class="modal" id="modal-post-report" tabindex="-1" role="dialog">
<div class="modal-dialog modal-dialog-centered" role="document" style="width: 400px">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">신고하기</h5>
</div>
<div class="modal-body" style="min-height: 200px">
<?php include $g['dir_module_skin'].'_report.php'?>
</div>
<div class="modal-footer py-2">
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">취소</button>
<button type="button" class="btn btn-link">접수하기</button>
</div>
</div>
</div>
</div>
<script>
$( document ).ready(function() {
$('#modal-post-listadd').on('show.bs.modal', function (e) {
var modal = $(this);
var button = $(e.relatedTarget);
var uid = button.attr('data-uid');
var submit = modal.find('[data-act="submit"]')
modal.attr('data-uid',uid);
submit.attr('disabled',false );
})
$('#modal-post-listadd').find('[data-act="submit"]').click(function(){
var modal = $('#modal-post-listadd');
var uid = modal.attr('data-uid');
// 리스트 체크
var list_sel=$('input[name="postlist_members[]"]');
var list_arr=$('input[name="postlist_members[]"]:checked').map(function(){return $(this).val();}).get();
var list_n=list_arr.length;
var list_members='';
for (var i=0;i <list_n;i++) {
if(list_arr[i]!='') list_members += '['+list_arr[i]+']';
}
$(this).attr('disabled',true );
setTimeout(function(){
$.post(rooturl+'/?r='+raccount+'&m=post&a=update_listindex',{
uid : uid,
list_members : list_members
},function(response,status){
if(status=='success'){
modal.modal('hide');
$.notify({message: '리스트에 저장되었습니다.'},{type: 'default'});
} else {
alert(status);
}
});
}, 500);
});
$('#modal-post-listadd').find('[data-role="list-add-button"]').click( function() {
$(this).addClass('d-none');
$('#modal-post-listadd').find('[data-role="list-add-input"]').removeClass('d-none');
$('#modal-post-listadd').find('[data-act="submit"]').addClass('d-none');
$('#modal-post-listadd').find('[data-role="list-add-input"]').find('.form-control').val('').focus();
} );
$('#modal-post-listadd').find('[data-act="list-add-cancel"]').click( function() {
$('#modal-post-listadd').find('[data-role="list-add-button"]').removeClass('d-none');
$('#modal-post-listadd').find('[data-act="submit"]').removeClass('d-none');
$('#modal-post-listadd').find('[data-role="list-add-input"]').addClass('d-none')
} );
$('#modal-post-listadd').find('[data-act="list-add-submit"]').click(function(e){
var modal = $('#modal-post-listadd');
var button = $(this)
var input = modal.find('[name="list_name"]');
var list = $('[data-role="list-selector"]');
var checked_num = list.find('[data-role="list_num"]');
var checked_num_val = Number(checked_num.text());
var name = input.val();
if (!name) {
input.focus();
return false
}
button.attr( 'disabled', true );
setTimeout(function(){
$.post(rooturl+'/?r='+raccount+'&m=post&a=regis_list',{
name : name,
send_mod : 'ajax'
},function(response,status){
if(status=='success'){
var result = $.parseJSON(response);
var uid=result.uid;
var icon=result.icon;
var label=result.label;
var item = '<div class="d-flex justify-content-between align-items-center px-3 py-2"><div class="custom-control custom-checkbox">'+
'<input type="checkbox" id="listRadio'+uid+'" name="postlist_members[]" value="'+uid+'" class="custom-control-input" checked>'+
'<label class="custom-control-label" for="listRadio'+uid+'">'+name+'</label>'+
'</div><i class="material-icons text-muted mr-2" data-toggle="tooltip" title="" data-original-title="'+label+'">'+icon+'</i></div>';
button.attr( 'disabled', false );
input.val('');
$('#modal-post-listadd').find('[data-role="list-add-button"]').removeClass('d-none');
$('#modal-post-listadd').find('[data-role="list-add-input"]').addClass('d-none')
$('#modal-post-listadd').find('[data-act="submit"]').removeClass('d-none');
list.append(item);
$('#modal-post-listadd').find('[data-toggle="tooltip"]').tooltip();
} else {
alert(status);
}
});
}, 200);
});
$('#modal-post-report').on('show.bs.modal', function (e) {
if (!memberid) {
alert('로그인 해주세요.');
return false;
}
})
});
</script>

View File

@@ -0,0 +1,97 @@
<section>
<h1 class="h4 my-5 text-center">'<?php echo $keyword ?>' <small class="text-muted">포스트 검색결과 <?php echo $NUM ?>개</small></h1>
<hr>
<?php if ($NUM): ?>
<ul class="list-unstyled" data-plugin="markjs">
<?php foreach($RCD as $R):?>
<?php $R['mobile']=isMobileConnect($R['agent'])?>
<li class="media my-4">
<?php if ($R['featured_img']): ?>
<a href="<?php echo getPostLink($R,0) ?>" class="position-relative mr-3">
<img src="<?php echo checkPostPerm($R) ?getPreviewResize(getUpImageSrc($R),'180x100'):getPreviewResize('/files/noimage.png','180x100') ?>" alt="">
<time class="badge badge-dark rounded-0 position-absolute f14" style="right:1px;bottom:1px"><?php echo checkPostPerm($R)?getUpImageTime($R):'' ?></time>
</a>
<?php endif; ?>
<div class="media-body">
<h5 class="mt-0 mb-1">
<a href="<?php echo getPostLink($R,0) ?>">
<?php echo checkPostPerm($R)?stripslashes($R['subject']):'[비공개 포스트]'?>
</a>
</h5>
<?php if (checkPostPerm($R)): ?>
<div class="text-muted mb-1"><?php echo $R['review']?></div>
<div class="mb-1">
<ul class="list-inline d-inline-block ml-2 f13 text-muted">
<li class="list-inline-item">조회 <?php echo $R['hit']?> </li>
<li class="list-inline-item">좋아요 <?php echo $R['likes']?> </li>
<li class="list-inline-item">댓글 <?php echo $R['comment']?> </li>
<li class="list-inline-item"><?php echo getDateFormat($R['d_regis'],'Y.m.d H:i')?></li>
</ul>
<span class="ml-2 f13 text-muted">
<i class="fa fa-folder-o mr-1" aria-hidden="true"></i> <?php echo getAllPostCat($m,$R['category']) ?>
</span>
<span class="ml-2 f13 text-muted">
<!-- 태그 -->
<?php $_tags=explode(',',$R['tag'])?>
<?php $_tagn=count($_tags)?>
<?php $i=0;for($i = 0; $i < $_tagn; $i++):?>
<?php $_tagk=trim($_tags[$i])?>
<a class="badge badge-light" href="<?php echo RW('m=post&mod=keyword&') ?>keyword=<?php echo urlencode($_tagk)?>">
# <?php echo $_tagk?>
</a>
<?php endfor?>
</span>
<span class="badge badge-secondary ml-2"><?php echo checkPostOwner($R) && $R['display']!=5?$g['displaySet']['label'][$R['display']]:'' ?></span>
</div>
<?php else: ?>
<div class="text-muted py-3">
이 포스트에 대한 액세스 권한이 없습니다.
</div>
<?php endif; ?>
</div>
</li>
<?php endforeach?>
</ul>
<?php else: ?>
<div class="p-5 text-center text-muted">
자료가 없습니다.
</div>
<?php endif; ?>
<footer class="d-flex justify-content-between mt-5">
<div class=""></div>
<?php if ($NUM > $recnum): ?>
<ul class="pagination mb-0">
<?php echo getPageLink(10,$p,$TPG,'')?>
</ul>
<?php endif; ?>
<div class="">
</div>
</footer>
</section>
<!-- markjs js : https://github.com/julmot/mark.js -->
<?php getImport('markjs','jquery.mark.min','8.11.1','js')?>
<script>
$( document ).ready(function() {
// marks.js
$('[data-plugin="markjs"]').mark("<?php echo $keyword ?>");
});
</script>

View File

@@ -0,0 +1,161 @@
<?php
$c_recnum = $d['post']['rownum']; // 한 열에 출력할 카드 갯수
$totalCardDeck=ceil($NUM/$c_recnum); // card-deck 갯수 ($NUM 은 해당 데이타의 총 card 갯수 getDbRows 이용)
$total_card_num = $totalCardDeck*$c_recnum;// 총 출력되야 할 card 갯수(빈카드 포함)
$print_card_num = 0; // 실제 출력된 카드 숫자 (아래 card 출력될 때마다 1 씩 증가)
$lack_card_num = $total_card_num;
switch ($sort) {
case 'gid' : $sort_txt='생성순';break;
case 'd_last' : $sort_txt='최신순';break;
}
?>
<section>
<div class="d-flex justify-content-between align-items-center mt-4">
<h3 class="mb-0">
전체 리스트
</h3>
<div class="">
</div>
</div>
<div class="d-flex align-items-center border-top border-dark pt-4 pb-3" role="filter">
<span class="f18">전체 <span class="text-primary"><?php echo number_format($NUM)?></span> 개</span>
<form name="listsearchf" action="<?php echo $g['page_reset'] ?>" method="get" class="form-inline ml-auto">
<?php if ($_HS['rewrite']): ?>
<input type="hidden" name="sort" value="<?php echo $sort?>">
<?php else: ?>
<input type="hidden" name="r" value="<?php echo $r?>">
<?php if($_mod):?>
<input type="hidden" name="mod" value="<?php echo $_mod?>">
<?php else:?>
<input type="hidden" name="m" value="<?php echo $m?>">
<input type="hidden" name="front" value="<?php echo $front?>">
<?php endif?>
<input type="hidden" name="page" value="<?php echo $page?>">
<input type="hidden" name="sort" value="<?php echo $sort?>">
<input type="hidden" name="orderby" value="<?php echo $orderby?>">
<input type="hidden" name="recnum" value="<?php echo $recnum?>">
<input type="hidden" name="type" value="<?php echo $type?>" />
<input type="hidden" name="mbrid" value="<?php echo $_MP['id']?>">
<?php endif; ?>
<label class="mt-1 mr-2 sr-only">정열</label>
<div class="dropdown" data-role="sort">
<a class="btn btn-white dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
정열 : <?php echo $sort_txt ?>
</a>
<div class="dropdown-menu shadow-sm" aria-labelledby="dropdownMenuLink" style="min-width: 116px;">
<button class="dropdown-item d-flex justify-content-between align-items-center<?php echo $sort=='gid'?' active':'' ?>" type="button" data-value="gid">
생성순
</button>
<button class="dropdown-item d-flex justify-content-between align-items-center<?php echo $sort=='d_last'?' active':'' ?>" type="button" data-value="d_last">
최신순
</button>
</div>
</div>
<div class="input-group ml-2">
<input type="text" name="keyword" class="form-control" placeholder="리스트명 검색" value="<?php echo $_keyword?>">
<div class="input-group-append">
<button class="btn btn-white text-muted border-left-0" type="submit">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
<?php if ($keyword): ?>
<a class="btn btn-white ml-1" href="<?php echo $g['post_reset'] ?>">리셋</a>
<?php endif; ?>
</div>
</div>
</form><!-- /.form-inline -->
</div><!-- /.d-flex -->
<?php if ($NUM): ?>
<div class="card-deck" data-plugin="markjs">
<?php $i=0;foreach($RCD as $R):$i++?>
<div class="card mb-3">
<a href="<?php echo getListLink($R,0) ?>" class="position-relative">
<img src="<?php echo getPreviewResize(getListImageSrc($R['uid']),'320x180') ?>" class="img-fluid" alt="">
<span class="list_mask">
<span class="txt"><?php echo $R['num']?><i class="fa fa-list-ul d-block" aria-hidden="true"></i></span>
</span>
<img class="list_avatar shadow-sm" src="<?php echo getAvatarSrc($R['mbruid'],'50') ?>" width="50" height="50" alt="">
</a>
<div class="card-body pt-5 p-3">
<h5 class="card-title h6 mb-1">
<a class="muted-link" href="<?php echo getListLink($R,0) ?>">
<?php echo $R['name']?>
</a>
</h5>
<span class="small text-muted">업데이트: <time class="text-muted" data-plugin="timeago" datetime="<?php echo getDateFormat($R['d_last'],'c')?>"></time></span>
<?php if(getNew($R['d_last'],$d['post']['newtime'])):?><span class="rb-new ml-1"></span><?php endif?>
</div><!-- /.card-body -->
</div><!-- /.card -->
<?php
$print_card_num++; // 카드 출력될 때마 1씩 증가
$lack_card_num = $total_card_num - $print_card_num;
?>
<?php if(!($i%$c_recnum)):?></div><div class="card-deck mt-3" data-role="post-list"><?php endif?>
<?php endforeach?>
<?php if($lack_card_num ):?>
<?php for($j=0;$j<$lack_card_num;$j++):$i++;?>
<div class="card border-0" style="background-color: transparent"></div>
<?php if(!($i%$c_recnum)):?></div><div class="card-deck mt-3" data-role="post-list"><?php endif?>
<?php endfor?>
<?php endif?>
</div><!-- /.card-deck -->
<?php else: ?>
<div class="p-5 text-center text-muted">
등록된 리스트가 없습니다.
</div>
<?php endif; ?>
<footer class="d-flex justify-content-between mt-5">
<div class=""></div>
<?php if ($NUM > $recnum): ?>
<ul class="pagination mb-0">
<?php echo getPageLink(10,$p,$TPG,$_N)?>
</ul>
<?php endif; ?>
<div class="">
</div>
</footer>
</section>
<script>
$( document ).ready(function() {
// 툴바
$('[name="listsearchf"] .dropdown-item').click(function(){
var form = $('[name="listsearchf"]');
var value = $(this).attr('data-value');
var role = $(this).closest('.dropdown').attr('data-role');
form.find('[name="'+role+'"]').val(value)
form.submit();
});
// marks.js
$('[data-plugin="markjs"]').mark("<?php echo $keyword ?>");
});
</script>

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