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

View File

@@ -0,0 +1,14 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
include $g['path_core'].'function/dir.func.php';
$w_dir = $g['path_tmp'].'widget';
DirDelete($w_dir);
mkdir($w_dir,0707);
@chmod($w_dir,0707);
getLink('reload','parent.frames._ADMPNL_.','위젯 캐시가 재생성 되었습니다.','');
?>

View File

@@ -0,0 +1,37 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$_HS = getDbData($table['s_site'],"id='".$r."'",'*');
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$layout = dirname($_HS['m_layout']);
$noti_type = 'default';
} else {
$layout = dirname($_HS['layout']);
$noti_type = 'success';
}
//사이트별 레이아웃 메인화면 위젯
$g['layoutPageVarForSite'] = $g['path_var'].'site/'.$r.'/layout.'.$layout.'.'.$page.'.php';
@unlink($g['layoutPageVarForSite'] );
$result=array();
$result['error'] = false;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
include $g['path_layout'].$layout.'/_var/_var.'.$page.'.php';
$result['list'] = getWidgetListEdit($d['layout'][$area]);
} else {
setrawcookie('site_common_result', rawurlencode('구성이 초기화 되었습니다|'.$noti_type.'')); // 처리여부 cookie 저장
}
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,55 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if (!$cat) getLink('./?m=admin&module='.$m.'&front=menu','parent.','','');
include $g['path_core'].'function/menu.func.php';
$subQue = getMenuCodeToSql($table['s_menu'],$cat,'uid');
if ($subQue)
{
$DAT = getDbSelect($table['s_menu'],$subQue,'*');
while($R=db_fetch_array($DAT))
{
getDbDelete($table['s_menu'],'uid='.$R['uid']);
getDbDelete($table['s_seo'],'rel=1 and parent='.$R['uid']);
$_xfile = $g['path_page'].$r.'-menus/'.$R['id'];
unlink($_xfile.'.php');
@unlink($_xfile.'.mobile.php');
@unlink($_xfile.'.css');
@unlink($_xfile.'.js');
@unlink($_xfile.'.header.php');
@unlink($_xfile.'.footer.php');
@unlink($_xfile.'.txt');
@unlink($_xfile.'.cache');
@unlink($_xfile.'.mobile.cache');
@unlink($g['path_var'].'menu/'.$R['imghead']);
@unlink($g['path_var'].'menu/'.$R['imgfoot']);
}
if ($parent)
{
if (!getDbRows($table['s_menu'],'parent='.$parent))
{
getDbUpdate($table['s_menu'],'is_child=0','uid='.$parent);
}
}
db_query("OPTIMIZE TABLE ".$table['s_menu'],$DB_CONNECT);
}
setrawcookie('result_menu', rawurlencode('메뉴가 삭제 되었습니다.|success')); // 처리여부 cookie 저장
if ($back=='Y')
{
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=menu','parent.','','');
}
else {
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=menu&cat='.$parent.'&amp;code='.$code,'parent.','','');
}
?>

View File

@@ -0,0 +1,39 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$R = getUidData($table['s_page'],$uid);
getDbDelete($table['s_page'],'uid='.$R['uid']);
getDbDelete($table['s_seo'],'rel=2 and parent='.$R['uid']);
$_xfile = $g['path_page'].$r.'-pages/'.$R['id'];
unlink($_xfile.'.php');
@unlink($_xfile.'.mobile.php');
@unlink($_xfile.'.css');
@unlink($_xfile.'.js');
@unlink($_xfile.'.txt');
@unlink($_xfile.'.cache');
@unlink($_xfile.'.mobile.cache');
if($_HS['startpage'] && $_HS['startpage'] == $R['uid'])
{
getDbUpdate($table['s_site'],'startpage=0','uid='.$s);
}
db_query("OPTIMIZE TABLE ".$table['s_page'],$DB_CONNECT);
setrawcookie('result_page', rawurlencode('페이지가 삭제 되었습니다.|success')); // 처리여부 cookie 저장
if ($back=='Y')
{
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=page','parent.','','');
}
else {
getLink('reload','parent.','','');
}
?>

View File

@@ -0,0 +1,59 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$exists_bbs = getDbRows($table['bbslist'],'site='.$account);
if ($exists_bbs) {
setrawcookie('result_site', rawurlencode('사이트에 소속된 게시판을 삭제해 주세요.|danger'));
getLink('reload','parent.parent.','','');
}
$R = getUidData($table['s_site'],$account);
if ($R['uid'])
{
getDbDelete($table['s_site'],'uid='.$R['uid']);
getDbDelete($table['s_seo'],'rel=0 and parent='.$R['uid']);
$_MENUS = getDbSelect($table['s_menu'],'site='.$R['uid'].' order by gid asc','*');
while($_M = db_fetch_array($_MENUS))
{
@unlink($g['path_var'].'menu/'.$_M['imghead']);
@unlink($g['path_var'].'menu/'.$_M['imgfoot']);
getDbDelete($table['s_seo'],'rel=1 and parent='.$_M['uid']);
}
$_PAGES = getDbSelect($table['s_page'],'site='.$R['uid'].' order by uid asc','*');
while($_P = db_fetch_array($_PAGES))
{
getDbDelete($table['s_seo'],'rel=2 and parent='.$_P['uid']);
}
getDbDelete($table['s_menu'],'site='.$R['uid']);
getDbDelete($table['s_page'],'site='.$R['uid']);
getDbDelete($table['s_uploadcat'],'site='.$R['uid']);
db_query("OPTIMIZE TABLE ".$table['s_site'],$DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table['s_menu'],$DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table['s_page'],$DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table['s_seo'],$DB_CONNECT);
db_query("OPTIMIZE TABLE ".$table['s_uploadcat'],$DB_CONNECT);
unlink($g['path_var'].'sitephp/'.$account.'.php');
include $g['path_core'].'function/dir.func.php';
if(is_dir($g['path_page'].$R['id'].'-menus')) DirDelete($g['path_page'].$R['id'].'-menus');
if(is_dir($g['path_page'].$R['id'].'-pages')) DirDelete($g['path_page'].$R['id'].'-pages');
if(is_dir($g['path_var'].'site/'.$R['id'])) DirDelete($g['path_var'].'site/'.$R['id']);
}
setrawcookie('result_site', rawurlencode('사이트가 삭제 되었습니다.|success')); // 처리여부 cookie 저장
if (!getDbRows($table['s_site'],''))
{
getLink($g['s'].'/','parent.parent.','','');
}
else {
getLink($g['s'].'/?m=admin&pickmodule='.$m.'&panel=Y','parent.parent.','','');
}
?>

View File

@@ -0,0 +1,15 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$pwd = trim($pwd);
if (!$pwd || !strstr(substr($pwd,0,10),'widget')) exit;
include $g['path_core'].'function/dir.func.php';
DirDelete($pwd);
$newPwd = str_replace('/'.basename($pwd).'/','/',$pwd);
getLink($g['s'].'/?r='.$r.'&system=popup.widget&iframe=Y&isWcode=Y&pwd='.urlencode($newPwd),'parent.','','');
?>

View File

@@ -0,0 +1,238 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
//메뉴->XML출력
function getMenuXml($site,$table,$j,$parent,$depth,$uid,$code)
{
global $g;
static $j,$string;
$xdepth = $depth+1;
$CD=getDbSelect($table,($site?'site='.$site.' and ':'').'depth='.$xdepth.' and parent='.$parent.' and hidden=0 order by gid asc','*');
while($C=db_fetch_array($CD))
{
$j++;
$code = $code.$C['id'].'/';
$_code = substr($code,0,strlen($code)-1);
if ($xdepth==1)
{
$string .= "\t<!-- ".$C['name']."-->\n\t";
}
else {
for ($i = 0; $i < $xdepth; $i++) $string .= "\t";
}
$string .= '<depth'.$xdepth.' name="'.$C['name'].'" ename="'.$C['id'].'" link="'.RW('c='.$_code).'" target="'.$C['target'];
if ($C['is_child'])
{
$string .= '">'."\n";
getMenuXml($site,$table,$j,$C['uid'],$C['depth'],$uid,$code);
for ($i = 0; $i < $xdepth; $i++) $string .= "\t";
$string .= '</depth'.$xdepth.'>'."\n";
}
else {
$string .= '" />'."\n";
}
if ($xdepth==1) $string .= "\n";
$code = '';
}
return $string;
}
//메뉴->XLS출력
function getMenuXls($site,$table,$j,$parent,$depth,$uid,$mset,$code)
{
global $g,$r;
static $j,$string;
$xdepth = $depth+1;
$CD=getDbSelect($table,($site?'site='.$site.' and ':'').'depth='.$xdepth.' and parent='.$parent.' order by gid asc','*');
while($C=db_fetch_array($CD))
{
$j++;
$code = $code.$C['id'].'/';
$_code = substr($code,0,strlen($code)-1);
$string .= '<tr>';
$string .= '<td>'.$xdepth.'</td>';
$string .= '<td>'.($xdepth==1?$C['name']:'').'</td>';
$string .= '<td>'.($xdepth==2?$C['name']:'').'</td>';
$string .= '<td>'.($xdepth==3?$C['name']:'').'</td>';
$string .= '<td>'.($xdepth==4?$C['name']:'').'</td>';
$string .= '<td>'.($xdepth==5?$C['name']:'').'</td>';
$string .= '<td>'.$C['uid'].'</td>';
$string .= '<td>'.$C['id'].'</td>';
$string .= '<td>'.RW('c='.$_code).'</td>';
$string .= '<td>'.$g['s'].'/index.php?r='.$r.'&amp;c='.$_code.'</td>';
$string .= '<td>'.$mset[$C['menutype']].'</td>';
$string .= '<td>'.($C['mobile']?'Y':'').'</td>';
$string .= '<td>'.($C['target']?'Y':'').'</td>';
$string .= '<td>'.($C['hidden']?'Y':'').'</td>';
$string .= '<td>'.($C['reject']?'Y':'').'</td>';
$string .= '<td>'.($C['redirect']?'Y':'').'</td>';
$string .= '<td>'.$C['joint'].'</td>';
$string .= '</tr>';
if ($C['is_child'])
{
getMenuXls($site,$table,$j,$C['uid'],$C['depth'],$uid,$mset,$code);
}
$code = '';
}
return $string;
}
//메뉴->TXT출력
function getMenuTxt($site,$table,$j,$parent,$depth,$uid,$code)
{
global $g;
static $j,$string;
$xdepth = $depth+1;
$CD=getDbSelect($table,($site?'site='.$site.' and ':'').'depth='.$xdepth.' and parent='.$parent.' order by gid asc','*');
while($C=db_fetch_array($CD))
{
$j++;
$code = $code.$C['id'].'/';
$_code = substr($code,0,strlen($code)-1);
for ($i = 0; $i < $depth; $i++) $string .= "\t";
$string .= '['.$xdepth.']'.($C['hidden']?'[숨김]':'').($C['reject']?'[차단]':'').($C['target']?'[새창]':'').$C['name']." = ".RW('c='.$_code)."\r\n";
if ($C['is_child'])
{
getMenuTxt($site,$table,$j,$C['uid'],$C['depth'],$uid,$code);
}
if ($xdepth==1) $string .= "\r\n";
$code = '';
}
return $string;
}
//메뉴->패키지용
function getMenuPackage($site,$table,$j,$parent,$depth,$uid)
{
global $g;
static $j,$string;
$xdepth = $depth+1;
$CD=getDbSelect($table,($site?'site='.$site.' and ':'').'depth='.$xdepth.' and parent='.$parent.' order by gid asc','*');
while($C=db_fetch_array($CD))
{
$_parent = $C['parent'] ? getDbData($table,($site?'site='.$site.' and ':'').'uid='.$C['parent'],'id') : array();
$j++;
for ($i = 0; $i < $depth; $i++) $string .= "\t";
$string .= "\tarray('name'=>'".$C['name']."','id'=>'".$C['id']."','menutype'=>'".$C['menutype']."','mobile'=>'".$C['mobile']."','hidden'=>'".$C['hidden']."','target'=>'".$C['target']."','redirect'=>'".$C['redirect']."','joint'=>'".$C['joint']."','layout'=>'".$C['layout']."','imghead'=>'".$C['imghead']."','imgfoot'=>'".$C['imgfoot']."','imgicon'=>'".$C['imgicon']."','addinfo'=>'".$C['addinfo']."','depth'=>'".$C['depth']."','parent'=>'".$_parent['id']."','is_child'=>'".$C['is_child']."','gid'=>'".$C['gid']."',),\r\n";
if ($C['is_child'])
{
getMenuPackage($site,$table,$j,$C['uid'],$C['depth'],$uid);
}
}
return $string;
}
if ($type == 'xml')
{
$filename = 'menu_'.$_HS['id'].'.xml';
$filepath = $g['path_var'].'xml/'.$filename;
$fp = fopen($filepath,'w');
fwrite($fp,"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
fwrite($fp,"<menu>\n\n");
fwrite($fp,"\t<!-- ".$_HS['name']."-메뉴구조 -->\n");
fwrite($fp,getMenuXml($s,$table['s_menu'],0,0,0,0,''));
fwrite($fp,"</menu>\n");
fclose($fp);
@chmod($filepath,0707);
$filesize = filesize($filepath);
header("Content-Type: application/octet-stream");
header("Content-Length: " .$filesize);
header('Content-Disposition: attachment; filename="'.$filename.'"');
header("Cache-Control: private, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");
$fp = fopen($filepath, 'rb');
if (!fpassthru($fp)) fclose($fp);
exit;
}
else if($type == 'xls')
{
header("Content-type: application/vnd.ms-excel;" );
header("Content-Disposition: attachment; filename=menu_".$_HS['id'].".xls" );
header("Content-Description: PHP4 Generated Data" );
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
echo '<table border="1">';
echo '<thead>';
echo '<th>단계</th>';
echo '<th>1차메뉴</th>';
echo '<th>2차메뉴</th>';
echo '<th>3차메뉴</th>';
echo '<th>4차메뉴</th>';
echo '<th>5차메뉴</th>';
echo '<th>고유키(PK)</th>';
echo '<th>메뉴코드</th>';
echo '<th>현재주소</th>';
echo '<th>물리주소</th>';
echo '<th>메뉴형식</th>';
echo '<th>모바일</th>';
echo '<th>새창</th>';
echo '<th>숨김</th>';
echo '<th>차단</th>';
echo '<th>리다이렉트</th>';
echo '<th>연결주소</th>';
echo '</thead>';
echo '<tbody>';
echo getMenuXls($s,$table['s_menu'],0,0,0,0,array('','모듈','위젯','코딩'),'');
echo '</tbody>';
echo '</table>';
exit;
}
else if($type == 'txt')
{
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=menu_".$_HS['id'].".txt" );
header("Content-Description: PHP4 Generated Data" );
echo $_HS['name']."-메뉴구조\r\n";
echo "-------------------------------------------------------------------------\r\n\r\n";
echo getMenuTxt($s,$table['s_menu'],0,0,0,0,'');
exit;
}
else if($type == 'package_menu')
{
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=var.menu.php" );
header("Content-Description: PHP4 Generated Data" );
echo "<?php\r\n";
echo "\$d['package']['menus'] = array(\r\n";
echo getMenuPackage($s,$table['s_menu'],0,0,0,0);
echo ");\r\n";
echo "?>\r\n";
exit;
}
else if($type == 'package_page')
{
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=var.page.php" );
header("Content-Description: PHP4 Generated Data" );
echo "<?php\r\n";
echo "\$d['package']['pages'] = array(\r\n";
$PAGES = getDbArray($table['s_page'],'site='.$s,'*','d_update','desc',0,1);
while($R = db_fetch_array($PAGES))
{
echo "\tarray('name'=>'".$R['name']."','id'=>'".$R['id']."','pagetype'=>'".$R['pagetype']."','ismain'=>'".$R['ismain']."','mobile'=>'".$R['mobile']."','category'=>'".$R['category']."','layout'=>'".$R['layout']."','joint'=>'".$R['joint']."','linkedmenu'=>'".$R['linkedmenu']."'),\r\n";
}
echo ");\r\n";
echo "?>\r\n";
exit;
}
?>

View File

@@ -0,0 +1,42 @@
<?php
if(!defined('__KIMS__')) exit;
$result=array();
$result['error']=false;
if ($_mtype == 'page')
{
if (is_file($g['path_page'].$r.'-pages/'.$id.'.mobile.php')) {
$_filekind = $r.'-pages/'.$id.'.mobile';
} else {
$_filekind = $r.'-pages/'.$id;
}
$_filesbj = $_HP['name'];
}
if ($_mtype == 'menu')
{
if (is_file($g['path_page'].$r.'-menus/'.$id.'.mobile.php')) {
$_filekind = $r.'-menus/'.$id.'.mobile';
} else {
$_filekind = $r.'-menus/'.$id;
}
$_filesbj = $_HM['name'];
}
$__SRC__ = is_file($g['path_page'].$_filekind.'.php') ? implode('',file($g['path_page'].$_filekind.'.php')) : '';
if (!$__SRC__) {
$result['error']='존재하기 않는 페이지 입니다.';
echo json_encode($result);
exit;
}
$result['article'] = getContents($__SRC__,'HTML');
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,30 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$_HS = getDbData($table['s_site'],"id='".$r."'",'*');
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$layout = dirname($_HS['m_layout']);
} else {
$layout = dirname($_HS['layout']);
}
include_once $g['path_layout'].$layout.'/_var/_var.php';
$fdset = array($d['layout']['site_code']);
$svfile = $g['path_var'].'sitephp/'.$s.'.php';
include_once $svfile;
$result=array();
$result['error'] = false;
foreach ($fdset as $val) {
$result[$val] = $d['site'][$val];
}
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,302 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$readme_file = $g['path_widget'].$widget.'/readme.txt';
$readme_skin = @fopen($readme_file, 'r');
$readme = @fread($readme_skin, filesize($readme_file));
$readme = nl2br($readme);
if ($g['mobile']&&$_SESSION['pcmode']!='Y'&& !$panel) $is_mobile = 1;
else $is_mobile = 0;
//카테고리출력
function getCategoryShowSelect($table,$j,$parent,$depth,$uid,$hidden,$cat) {
static $j;
$html = '';
$CD=getDbSelect($table,'depth='.($depth+1).' and parent='.$parent.($hidden ? ' and hidden=0':'').' order by gid asc','*');
while($C=db_fetch_array($CD)){
$j++;
$html .= '<option class="selectcat'.$C['depth'].'" value="'.$C['uid'].'" data-category="'.$C['name'].'" '.($C['uid']==$cat?' selected="selected"':'').'>';
if(!$depth) $html .= 'ㆍ';
for($i=1;$i<$C['depth'];$i++) $html .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
if ($C['depth'] > 1) $html .= 'ㄴ';
$html .= $C['name'].'</option>';
if ($C['is_child']) $html .= getCategoryShowSelect($table,$j,$C['uid'],$C['depth'],$uid,$hidden,$cat);
}
return $html;
}
//메뉴 출력
function getMenuShowSelect($site,$table,$j,$parent,$depth,$uid,$hidden,$id) {
global $cat,$_isUid;
static $j;
$html = '';
$CD=getDbSelect($table,($site?'site='.$site.' and ':'').'depth='.($depth+1).' and parent='.$parent.($hidden ? ' and hidden=0':'').' order by gid asc','*');
while($C=db_fetch_array($CD)){
$nId = ($id?$id.'/':'').$C[$_isUid.'id'];
$j++;
$html .= '<option class="selectcat'.$C['depth'].'" value="'.$nId.'"'.($nId==$cat?' selected':'').'>';
for($i=1;$i<$C['depth'];$i++) $html .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
if ($C['depth'] > 1) $html .= 'ㄴ';
$html .= $C['name'].($C['num']?' ('.$C['num'].')':'').'</option>';
if ($C['is_child']) $html .= getMenuShowSelect($site,$table,$j,$C['uid'],$C['depth'],$uid,$hidden,$nId);
}
return $html;
}
$widget = $_POST['widget'];
$wdgvar = $_POST['wdgvar'];
$area = $_POST['area'];
$wdgvar = str_replace('[','', $wdgvar);
$wdgvar = str_replace(']','', $wdgvar);
$wdgvar_arr = explode('^',$wdgvar);
$wdgkey_arr = explode(',',$wdgvar_arr[3]);
$_wdgvar = array();
foreach ($wdgkey_arr as $key) {
$key_arr = explode('=',$key);
$_wdgvar[$key_arr[0]]=$key_arr[1];
}
if (file_exists($g['path_widget'].$widget.'/_var.config.php')) {
include_once $g['path_widget'].$widget.'/_var.config.php';
$d['layout']['dom'] = array();
$html='';
$_i=1;
foreach ($d['widget']['dom'] as $_key => $_val) {
$__i=sprintf('%02d',$_i);
if ($is_mobile) {
$html .= '<div class="">
<div class="">';
} else {
$html .= '<div class="modal-content border-0 rounded-0" style="height:100%">
<div class="modal-header bg-primary text-white rounded-0 d-flex justify-content-between align-items-center py-2">
<span data-dismiss="modal" role="button"><i class="fa fa-chevron-left mr-2" aria-hidden="true"></i>'.$_val[0].'</span>
<small class=""></span>
</div>
<div class="modal-body" style="overflow:auto" data-role="form">';
}
if (count($_val[1])) {
foreach ($_val[1] as $_v) {
$html .= '<div class="form-group">';
if ($_v[1]!='hidden') {
$html .= '<label class="text-muted f12 mb-1">'.$_v[2].'</label>';
}
if ($_v[1]=='hidden') {
$html .= '<input type="hidden" name="'.$_v[0].'" value="'.$_v[3].'">';
}
if ($_v[1]=='input') {
$html .= '<input type="text" class="form-control" name="'.$_v[0].'" value="'.stripslashes($_wdgvar[$_v[0]]).'" placeholder="'.$_v[3].'" autocomplete="off">';
}
if ($_v[1]=='select') {
$html .= '<select name="'.$_v[0].'" class="form-control custom-select">';
$_sk=explode(',',$_v[3]);
foreach ($_sk as $_sa) {
$_sa1=explode('=',$_sa);
if ($_wdgvar[$_v[0]]) {
$html .= '<option value="'.$_sa1[1].'" '.($_sa1[1]==$_wdgvar[$_v[0]]?' selected':'').' >'.$_sa1[0].'</option>';
} else {
$html .= '<option value="'.$_sa1[1].'" '.($_sa1[1]==$_v[4]?' selected':'').' >'.$_sa1[0].'</option>';
}
}
$html .= '</select>';
}
if ($_v[1]=='radio') {
$_sk=explode(',',$_v[3]);
foreach ($_sk as $_sa) {
$_sa1=explode('=',$_sa);
$html .= '<label class="rb-rabel"><input type="radio" name="'.$_v[0].'" value="'.$_sa1[1].'"> '.$_sa1[0].'</label>';
}
}
if ($_v[1]=='checkbox') {
$_sk=explode(',',$_v[3]);
foreach ($_sk as $_sa) {
$_sa1=explode('=',$_sa);
$html .= '<label class="rb-rabel"><input type="checkbox" name="'.$_v[0].'" value="'.$_sa1[1].'"> '.$_sa1[0].'</label>';
}
}
if ($_v[1]=='textarea') {
$html .= '<textarea type="text" rows="'.$_v[3].'" class="form-control" name="'.$_v[0].'">'.stripslashes($_wdgvar[$_v[0]]).'</textarea>';
}
if ($_v[1]=='postlist') {
$html .= '<div class="input-group">';
$html .= '<select name="'.$_v[0].'" class="form-control custom-select" size="1">
<option value="">선택하세요.</option>
<option value="" disabled>----------------------------------</option>';
$_sk=explode(',',$_v[3]);
$POSTLIST = getDbArray($table['postlist_member'],'site='.$s.' and mbruid="'.$my['uid'].'" and display<>1','*','gid','asc',0,1);
while ($R=db_fetch_array($POSTLIST)) {
$L = getUidData($table['postlist'],$R['list']);
$html .= '<option data-name="'.$L['name'].'" value="'.$L['id'].'" '.($L['id']==$_wdgvar[$_v[0]]?' selected':'').'>
ㆍ'.$L['name'].'
</option>';
}
$html .= '</select>';
$html .= '<div class="input-group-append input-group-btn"><button class="btn btn-white btn-light" type="button" data-toggle="tooltip" title="리스트 추가" data-act="make" data-mod="postlist">+</button></div>';
$html .= '</div>';
}
if ($_v[1]=='postcat') {
$html .= '<select name="'.$_v[0].'" class="form-control custom-select">
<option value="">선택하세요.</option>
<option value="" disabled>----------------------------------</option>';
$html .= getCategoryShowSelect($table['postcategory'],0,0,0,0,0,$_wdgvar[$_v[0]]);
$html .= '</select>';
}
if ($_v[1]=='mediasetcat') {
$html .= '<div class="input-group">';
$html .= '<select name="'.$_v[0].'" class="form-control custom-select">
<option value="">선택하세요.</option>
<option value="" disabled>----------------------------------</option>';
$MEDIASETCAT = getDbArray($table['s_uploadcat'],'site='.$s.' and mbruid="'.$my['uid'].'" and hidden=0','*','gid','asc',0,1);
while ($R=db_fetch_array($MEDIASETCAT)) {
if ($R['uid']==1 || $R['uid']==2) continue;
$html .= '<option data-name="'.$R['name'].'" value="'.$R['name'].'" '.($R['name']==$_wdgvar[$_v[0]]?' selected':'').'>
ㆍ'.$R['name'].'
</option>';
}
$html .= '</select>';
$html .= '<div class="input-group-append input-group-btn"><button class="btn btn-white btn-light rb-modal-photo" type="button" data-toggle="modal" data-target="#modal_window" title="포토셋 열기">+</button></div>';
$html .= '</div>';
}
if ($_v[1]=='menu') {
$cat = $_wdgvar[$_v[0]];
$html .= '<div class="input-group">';
$html .= '<select name="'.$_v[0].'" class="form-control custom-select" size="1">
<option value="">선택하세요</option>
<option value="" disabled>----------------------------------</option>';
$html .= getMenuShowSelect($s,$table['s_menu'],0,0,0,0,0,'');
$html .= '</select>';
$html .= '</div>';
}
if ($_v[1]=='bbs') {
$html .= '<div class="input-group">';
$html .= '<select name="'.$_v[0].'" class="form-control custom-select" size="1">
<option value="">선택하세요</option>
<option value="" disabled>----------------------------------</option>';
$BBSLIST = getDbArray($table['bbslist'],'','*','gid','asc',0,1);
while ($R=db_fetch_array($BBSLIST)) {
$html .= '<option value="'.$R['id'].'" '.($R['id']==$_wdgvar[$_v[0]]?' selected':'').' data-name="'.$R['name'].'" data-link="'.RW('m=bbs&bid='.$R['id']).'">
ㆍ'.$R['name'].'('.$R['id'].')
</option>';
}
$html .= '</select>';
$html .= '<div class="input-group-append input-group-btn"><button class="btn btn-white btn-light" type="button" data-toggle="tooltip" title="게시판 추가" data-act="make" data-mod="bbs">+</button></div>';
$html .= '</div>';
}
if ($_v[1]=='date') {
$html .= '<div class="input-group input-daterange">
<input type="text" class="form-control" name="" id="" value="">
<span class="input-group-append">
<button class="btn btn-light" type="button"><i class="fa fa-calendar"></i></button>
</span>
</div>';
}
if ($_v[1]=='color') {
$html .= '<div class="input-group">
<input type="text" class="form-control" name="layout_'.$_key.'_'.$_v[0].'" id="layout_'.$_key.'_'.$_v[0].'" value="">
<span class="input-group-append">
<button class="btn btn-light" type="button" data-toggle="modal"
data-target=".bs-example-modal-sm"
onclick="getColorLayer(getId("layout_'.$_key.'_'. $_v[0].').value.replace("#",""),"layout_'.$_key.'_'.$_v[0].');"><i class="fa fa-tint"></i></button>
</span>
</div>';
}
if ($_v[1]=='mediaset') {
$html .= '<div class="input-group">
<input type="text" class="form-control rb-modal-photo-drop js-tooltip" value="" onmousedown="" title="선택된 사진" data-toggle="modal" data-target="#modal_window">
<span class="input-group-append">
<button class="btn btn-light rb-modal-photo-drop js-tooltip" type="button" title="포토셋" data-toggle="modal" data-target="#modal_window"><i class="fa fa-picture-o"></i></button>
</span>
</div>';
}
if ($_v[1]=='videoset') {
$html .= '<div class="input-group">
<input type="text" class="form-control rb-modal-video-drop js-tooltip" name="" id="" value="" onmousedown="" title="선택된 비디오" data-toggle="modal" data-target="#modal_window">
<span class="input-group-append">
<button onmousedown="" class="btn btn-light rb-modal-video-drop js-tooltip" type="button" title="비디오셋" data-toggle="modal" data-target="#modal_window"><i class="fa fa-video-camera"></i></button>
</span>
</div>';
}
$html .= '</div>';
}
}
$html .= '<div class="text-right mt-4"><a class="text-muted f12" data-toggle="collapse" href="#widgetMore"><u>위젯정보</u></a></div>';
$html .= '<div class="collapse" id="widgetMore">
<blockquote class="blockquote py-3 text-muted">'.$readme.'</blockquote>
<div class="card mt-2 p-2 shadow-sm"><img src="/widgets/'.$widget.'/thumb.png" class="img-fluid" style="filter: grayscale(100%);"></div>
<dl class="row f12 text-muted mt-5 mb-0 mx-1">
<dt class="col-3 col-xs-3">위젯명</dt>
<dd class="col-9 col-xs-9 pl-0">'.$_val[0].'</dd>
<dt class="col-3 col-xs-3">경로</dt>
<dd class="col-9 col-xs-9 pl-0">/widgets/'.$widget.'</dd>
</dl>
<div class="form-group mb-0 mx-1"><label class="text-muted f12 mb-1 font-weight-bold">삽입코드</label><div class="input-group input-group-sm">
<input type="text" class="form-control rounded-0 text-muted" id="widgetCode" readonly>
<div class="input-group-append">
<button class="btn btn-white js-clipboard text-muted rounded-0" data-act="code" type="button" data-toggle="tooltip" title="" data-clipboard-target="#widgetCode">추출</button>
</div>
</div></div></div>';
$html .= '</div>';
if (!$is_mobile) {
$html .= '<footer class="modal-footer d-flex rounded-0 py-1 rb-tab-pane-bottom bg-white">
<div class="flex-fill"><button type="button" data-act="cancel" data-dismiss="modal" class="btn btn-link text-reset btn-block">취소</button></div>
<div class="flex-fill"><button type="button" data-act="save" data-mod="'.($wdgvar?'edit':'add').'" data-area="'.$area.'" class="btn btn-link btn-block">
<span class="not-loading">'.($wdgvar?'적용':'추가').'</span>
<span class="is-loading"><div class="spinner-border spinner-border-sm" role="status"><span class="sr-only">처리중...</span></div></span>
</button></div>
</footer>';
}
$html .= '</div>';
}
}
$result=array();
$result['error'] = false;
$result['widget'] = $widget;
$result['widget_name'] = $_val[0];
$result['page'] = $html;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,20 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$widget = $_POST['widget'];
$result=array();
$result['error'] = false;
$readme_file = $g['path_widget'].$widget.'/readme.txt';
$readme_skin = @fopen($readme_file, 'r');
$readme = @fread($readme_skin, filesize($readme_file));
$result['readme'] = nl2br($readme);
$result['thumb'] = $g['path_widget'].$widget.'/thumb.png';
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,20 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$g['layoutPageVarForSite'] = $g['path_var'].'site/'.$r.'/layout.'.$layout.'.'.$page.'.php';
$_tmpdfile = is_file($g['layoutPageVarForSite']) ? $g['layoutPageVarForSite'] : $g['path_layout'].$layout.'/_var/_var.'.$page.'.php';
include $_tmpdfile;
$result['list'] = getWidgetListEdit($d['layout']['main_widgets'],'');
if (is_file($g['layoutPageVarForSite'])) {
$result['layoutPageVarForSite'] = true;
} else {
$result['layoutPageVarForSite'] = false;
}
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,28 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
?>
<script>
var tags = '';
var block = parent.getId('<?php echo $sid?>');
<?php if($layout):?>
tags += '<select class="form-control<?php echo $sclass?' '.$sclass:''?>" name="<?php echo $sname?>">';
<?php $dirs1 = opendir($g['path_layout'].$layout)?>
<?php while(false !== ($tpl1 = readdir($dirs1))):?>
<?php if(!strstr($tpl1,'.php') || $tpl1=='_main.php')continue?>
tags += '<option value="<?php echo $tpl1?>"><?php echo str_replace('.php','',$tpl1)?></option>';
<?php endwhile?>
<?php closedir($dirs1)?>
<?php else:?>
tags += '<select class="form-control<?php echo $sclass?' '.$sclass:''?>" name="<?php echo $sname?>" disabled>';
tags += '<option>서브 레이아웃</option>';
<?php endif?>
tags += '</select>';
block.innerHTML = tags;
</script>
<?php
exit;
?>

View File

@@ -0,0 +1,23 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$instFp = $g['path_var'].'install.txt';
$instIp = is_file($instFp) ? implode('',file($instFp)) : $_SERVER['REMOTE_ADDR'];
?>
<?php if(!strstr($instIp,'127.0.')&&!strstr($instIp,'192.168.')):?>
<?php include_once $g['path_module'].'market/var/var.php'?>
<?php $fp=fopen($instFp,'w');fwrite($fp,$_SERVER['REMOTE_ADDR']);fclose($fp);@chmod($instFp,0707);?>
<form name="installForm" action="<?php echo $d['market']['url']?>" method="post" target="_action_frame_<?php echo $m?>">
<input type="hidden" name="m" value="qmarket" />
<input type="hidden" name="a" value="rb_install" />
<input type="hidden" name="url" value="<?php echo $g['url_root']?>" />
<input type="hidden" name="ip" value="<?php echo $_SERVER['REMOTE_ADDR']?>" />
<input type="hidden" name="server" value="<?php echo $_SERVER['SERVER_SOFTWARE']?>" />
<input type="hidden" name="version" value="<?php echo $d['admin']['version']?>" />
<input type="hidden" name="language" value="<?php echo $g['sys_selectlang']?>" />
</form>
<script>
window.onload=function(){document.installForm.submit();}
</script>
<?php endif?>

View File

@@ -0,0 +1,160 @@
<?php
if(!defined('__KIMS__')) exit;
$history = $__target ? '-1' : '';
$id = trim($_POST['id']);
$pw = trim($_POST['pw']);
if (!$id || !$pw) getLink('reload','parent.','이메일과 패스워드를 입력해 주세요.',$history);
if (strpos($id,'@') && strpos($id,'.')) {
$M2 = getDbData($table['s_mbremail'],"email='".$id."'",'*');
$M = getUidData($table['s_mbrid'],$M2['mbruid']);
$M1 = getDbData($table['s_mbrdata'],'memberuid='.$M['uid'],'*');
} else if (substr($id,0,3)=='010' || substr($id,0,3)=='011' || substr($id,0,3)=='016' || substr($id,0,3)=='017' || substr($id,0,3)=='018' || substr($id,0,3)=='019') {
$M2 = getDbData($table['s_mbrphone'],"phone='".$id."'",'*');
$M = getUidData($table['s_mbrid'],$M2['mbruid']);
$M1 = getDbData($table['s_mbrdata'],'memberuid='.$M['uid'],'*');
} else {
$M = getDbData($table['s_mbrid'],"id='".$id."'",'*');
$M1 = getDbData($table['s_mbrdata'],'memberuid='.$M['uid'],'*');
}
if (!$M['uid'] || $M1['auth'] == 4) {
echo "<script>";
echo "parent.$('".$form."').removeClass('was-validated');";
echo "parent.$('".$form."').find('[type=submit]').prop('disabled', false);";
echo "parent.$('".$form."').find('[data-role=idErrorBlock]').text('존재하지 않는 계정입니다.');";
echo "parent.$('".$form."').find('[name=id]').focus().addClass('is-invalid');";
echo "</script>";
exit();
}
if ($M1['auth'] == 2) getLink('reload','parent.','회원님은 인증보류 상태입니다.',$history);
if ($M1['auth'] == 3) getLink('reload','parent.','회원님은 본인 인증대기 상태입니다.',$history);
$password_alert = "<script>";
$password_alert .= "parent.$('".$form."').removeClass('was-validated');";
$password_alert .= "parent.$('".$form."').find('[type=submit]').prop('disabled', false);";
$password_alert .= "parent.$('".$form."').find('[data-role=passwordErrorBlock]').text('패스워드가 일치하지 않습니다.');";
$password_alert .= "parent.$('".$form."').find('[name=pw]').val('').focus().addClass('is-invalid');";
$password_alert .= "</script>";
if (strlen($M['pw']) == 60) {
if (!password_verify($pw,$M['pw']) && !password_verify($pw,$M1['tmpcode'])) {
echo $password_alert;
exit();
}
} else {
if ($M['pw'] != getCrypt($pw,$M1['d_regis']) && $M1['tmpcode'] != getCrypt($pw,$M1['d_regis'])) {
echo $password_alert;
exit();
}
}
if ($usertype == 'admin')
if (!$M1['admin']) getLink('reload','parent.','회원님은 관리자가 아닙니다.',$history);
getDbUpdate($table['s_mbrdata'],"tmpcode='',num_login=num_login+1,now_log=1,last_log='".$date['totime']."'",'memberuid='.$M['uid']);
getDbUpdate($table['s_referer'],'mbruid='.$M['uid'],"d_regis like '".$date['today']."%' and site=".$s." and mbruid=0 and ip='".$_SERVER['REMOTE_ADDR']."'");
//소셜 로그인 후, 계정통합 처리
if ($snsuid && $snsname) {
$d_regis = $date['totime'];
// SNS에 등록된 아바타가 있고, 회원정보에 저장된 아바타가 없을 경우
if (!$M['photo'] && $_photo) {
if (strpos($_photo,'facebook'))
{
$_facebookHeaders = get_headers($_photo, 1);
if (array_key_exists('Location', $_facebookHeaders))
{
$_photo = $_facebookHeaders['Location'];
$_photodata = getCURLData($_photo,'');
}
}
else {
$_photodata = getCURLData($_photo,'');
}
if ($_photodata)
{
$fileExt = 'jpg';
$fp = fopen($g['path_var'].'avatar/snstmp.jpg','w');
fwrite($fp,$_photodata);
fclose($fp);
$photo = $id.'.'.$fileExt;
$saveFile1 = $g['path_var'].'avatar/'.$photo;
include $g['path_core'].'function/thumb.func.php';
ResizeWidth($g['path_var'].'avatar/snstmp.jpg',$saveFile1,360);
@chmod($saveFile1,0707);
unlink($g['path_var'].'avatar/snstmp.jpg');
}
getDbUpdate($table['s_mbrdata'],"photo='".$photo."'",'memberuid='.$M['uid']); // 회원정보 아바타 이미지 저장
}
getDbUpdate($table['s_mbrdata'],"sns='".$snsname."'",'memberuid='.$M['uid']); // 회원정보 sns 로그인 기록
getDbUpdate($table['s_mbremail'],"d_verified='".$d_regis."'",'mbruid='.$M['uid'].' and email="'.$id.'"'); // // 소셜미디어에서 전달받은 이메일 본인확인 처리
getDbInsert($table['s_mbrsns'],'mbruid,sns,id,access_token,refresh_token,expires_in,d_regis',"'".$M['uid']."','".$snsname."','$snsuid','$sns_access_token','$sns_refresh_token','$sns_expires_in','$d_regis'");
$_SESSION['SL'] = ''; // 소셜로그인 세션 초기화
}
if($login_cookie=='checked'){
setAccessToken($M1['memberuid'],'login');
}
$_SESSION['mbr_uid'] = $M['uid'];
$_SESSION['mbr_pw'] = $M['pw'];
$referer = $referer ? urldecode($referer) : $_SERVER['HTTP_REFERER'];
$referer = str_replace('&panel=Y','',$referer);
$referer = str_replace('&a=logout','',$referer);
$fmktile = mktime();
$ffolder = $g['path_tmp'].'session/';
$opendir = opendir($ffolder);
while(false !== ($file = readdir($opendir)))
{
if(!is_file($ffolder.$file)) continue;
if($fmktile - filemtime($ffolder.$file) > 1800 ) unlink($ffolder.$file);
}
closedir($opendir);
if ($usertype == 'admin' || $M1['admin']) {
if (!$M1['super'] && !$M1['adm_site']) getLink($g['s'].'/?r='.$r,'parent.','관리 사이트가 지정되지 않았습니다.','');
if ($M1['adm_site']) {
$_siteArray = getArrayString($M1['adm_site']);
$SD = getUidData($table['s_site'],$_siteArray[data][0]);
$r = $SD['id'];
}
}
if ($usertype == 'admin' && $M1['admin']) {
if ($pickgoods) {
getLink($g['s'].'/?r='.$r.'&panel=Y&pickmodule=market&amp;pickgoods='.$pickgoods.'&amp;important=panel','parent.parent.','','');
} else {
getLink($g['s'].'/?r='.$r.'&panel=Y&pickmodule=dashboard&amp;important=panel','parent.parent.','','');
}
}
if ($M1['admin']) {
setrawcookie('site_common_result', rawurlencode('관리자 로그인 되었습니다.|default')); // 알림처리를 위한 로그인 상태 cookie 저장
$site = getUidData($table['s_site'],$s);
$site_array = explode('/',$site['layout']);
$nopanel_file = $g['path_layout'].$site_array[0].'/_var/nopanel.txt';
if (is_file($nopanel_file) || ($g['mobile']&&$_SESSION['pcmode']!='Y')) {
getLink($referer?$referer:$g['s'].'/?r='.$r,'parent.','','');
} else {
getLink($g['s'].'/?r='.$r.'&_admpnl_='.urlencode($referer).'&panel=Y','parent.','','');
}
} else {
setrawcookie('site_common_result', rawurlencode($M1['name'].'님 로그인 되었습니다.')); // 알림처리를 위한 로그인 상태 cookie 저장
getLink($referer?$referer:$g['s'].'/?r='.$r,'parent.','','');
}
?>

View File

@@ -0,0 +1,19 @@
<?php
if(!defined('__KIMS__')) exit;
if ($my['uid'])
{
getDbUpdate($table['s_mbrdata'],"now_log=0,sns=''",'memberuid='.$my['uid']);
$_SESSION['mbr_logout'] = '1';
unset($_SESSION['mbr_uid']);
unset($_SESSION['SL']); //소셜로그인 세션 삭제
setAccessToken($my['uid'],'logout'); // 토큰 데이타 삭제 및 쿠키 초기화
}
$referer = $referer ? urldecode($referer) : $_SERVER['HTTP_REFERER'];
$referer = explode('&_admpnl_',$referer);
$referer = $referer[0];
setrawcookie('site_common_result', rawurlencode('로그아웃 되었습니다.')); // 처리여부 cookie 저장
getLink($referer,'top.','','');
?>

View File

@@ -0,0 +1,14 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$R = getUidData($table['s_menu'],$cat);
if ($R['img'.$dtype])
{
getDbUpdate($table['s_menu'],"img".$dtype."=''",'uid='.$R['uid']);
unlink($g['path_var'].'menu/'.$R['img'.$dtype]);
}
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,7 @@
<?php
if(!defined('__KIMS__')) exit;
$_SESSION['pcmode'] = '';
getLink($referer ? urldecode($referer) : $_SERVER['HTTP_REFERER'],'','','');
?>

View File

@@ -0,0 +1,10 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$i = 0;
foreach($menumembers as $val) getDbUpdate($table['s_menu'],'gid='.($i++),'uid='.$val);
setrawcookie('result_menu', rawurlencode('순서가 변경되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,7 @@
<?php
if(!defined('__KIMS__')) exit;
$_SESSION['pcmode'] = 'Y';
getLink($referer ? urldecode($referer) : ($_SERVER['HTTP_REFERER']?$_SERVER['HTTP_REFERER']:$g['s'].'/?r='.$r.'&m=admin'),'','','');
?>

View File

@@ -0,0 +1,64 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$tmpname = $_FILES['site_manifest_icon']['tmp_name'];
$realname = $_FILES['site_manifest_icon']['name'];
$iconsURL = $g['s'].'/_core/images/touch/';
if ($tmpname && is_uploaded_file($tmpname)) {
$fileExt = strtolower(getExt($realname));
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
$fileName = 'homescreen.'.$fileExt;
$iconsURL = $g['s'].'/_var/site/'.$r.'/';
$saveFile = $g['path_var'].'site/'.$r.'/'.$fileName;
if (!strstr('[gif][jpg][png]',$fileExt)) {
getLink('reload','parent.','허용되지 않는 확장자 입니다..','');
}
move_uploaded_file($tmpname,$saveFile);
@chmod($saveFile,0707);
} else {
if (!$tmpname && $site_manifest_icon_del) {
unlink( $g['path_var'].'site/'.$r.'/homescreen.jpg');
unlink( $g['path_var'].'site/'.$r.'/homescreen.png');
unlink( $g['path_var'].'site/'.$r.'/homescreen.gif');
$iconsURL = $g['s'].'/_core/images/touch/';
$fileExt = 'png';
}
}
//사이트별 매니페스트
$g['manifestForSite'] = $g['path_var'].'site/'.$r.'/manifest.json'; // 사이트 회원모듈 변수파일
$_manifestfile = $g['manifestForSite'] ? $g['manifestForSite'] : $g['path_module'].'site/var/manifest.json';
include $_manifestfile;
$fp = fopen($_manifestfile,'w');
$icons = array(
array('src'=>$iconsURL.'homescreen-128x128.png','sizes'=>'128x128','type'=>'image/png'),
array('src'=>$iconsURL.'homescreen-144x144.png','sizes'=>'144x144','type'=>'image/png'),
array('src'=>$iconsURL.'homescreen-168x168.png','sizes'=>'168x168','type'=>'image/png'),
array('src'=>$iconsURL.'homescreen-192x192.png','sizes'=>'192x192','type'=>'image/png'),
array('src'=>$iconsURL.'homescreen-512x512.png','sizes'=>'512x512','type'=>'image/png')
);
$myObj->name = $site_manifest_name;
$myObj->short_name = $site_manifest_short_name;
$myObj->icons = $icons;
$myObj->start_url = '/';
$myObj->display = $site_manifest_display;
$myObj->background_color = $site_manifest_background_color;
$myObj->theme_color = $site_manifest_theme_color;
if ($site_manifest_orientation) $myObj->orientation = $site_manifest_orientation;
$myObj->gcm_sender_id = '103953800507'; //FCM 자바스크립트 클라이언트에 공통되는 고정된 값입니다.
$manifestJSON = json_encode($myObj,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
$_manifestJSON = str_replace("\/", "/", $manifestJSON);
fwrite($fp, $_manifestJSON );
fclose($fp);
@chmod($_manifestfile,0707);
// getLink('reload','parent.frames._ADMPNL_.','변경되었습니다.','');
setrawcookie('site_common_result', rawurlencode('변경 되었습니다.')); // 알림처리를 위한 로그인 상태 cookie 저장
getLink('reload','parent.frames._ADMPNL_.','','');
?>

View File

@@ -0,0 +1,31 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$_HS = getDbData($table['s_site'],"id='".$r."'",'*');
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$layout = dirname($_HS['m_layout']);
$notify_type = 'default';
} else {
$layout = dirname($_HS['layout']);
$notify_type = 'success';
}
$g['layoutPageVarForSite'] = $g['path_var'].'site/'.$r.'/layout.'.$layout.'.'.$page.'.php';
$_tmpdfile = is_file($g['layoutPageVarForSite']) ? $g['layoutPageVarForSite'] : $g['path_layout'].$layout.'/_var/_var.'.$page.'.php';
include $_tmpdfile;
$fp = fopen($g['layoutPageVarForSite'],'w');
fwrite($fp, "<?php\n");
fwrite($fp, "\$d['layout']['main_widgets'] = \"".trim($main_widgets)."\";\n");
fwrite($fp, "?>");
fclose($fp);
@chmod($g['layoutPageVarForSite'],0707);
setrawcookie('site_common_result', rawurlencode('저장 되었습니다'));
getLink('reload','parent.frames._ADMPNL_.','','');
?>

View File

@@ -0,0 +1,84 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$device = $_POST['device'];
$_HS = getDbData($table['s_site'],"id='".$r."'",'*');
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$layout = dirname($_HS['m_layout']);
$device = 'mobile';
} else {
$layout = dirname($_HS['layout']);
$device = 'desktop';
}
$g['layoutVarForSite'] = $g['path_var'].'site/'.$r.'/layout.'.$layout.'.var.php';
$_tmpdfile = is_file($g['layoutVarForSite']) ? $g['layoutVarForSite'] : $g['path_layout'].$layout.'/_var/_var.php';
include $themelang2 ? $themelang2 : $themelang1;
include $_tmpdfile;
$fp = fopen($g['layoutVarForSite'],'w');
fwrite($fp, "<?php\n");
foreach($d['layout']['dom'] as $_key => $_val)
{
if(!count($_val[2])) continue;
foreach($_val[2] as $_v)
{
if($_v[1] == 'checkbox')
{
foreach(${'layout_'.$_key.'_'.$_v[0].'_chk'} as $_chk)
{
${'layout_'.$_key.'_'.$_v[0]} .= $_chk.',';
}
fwrite($fp, "\$d['layout']['".$_key.'_'.$_v[0]."'] = \"".trim(${'layout_'.$_key.'_'.$_v[0]})."\";\n");
${'layout_'.$_key.'_'.$_v[0]} = '';
}
else if ($_v[1] == 'textarea')
{
fwrite($fp, "\$d['layout']['".$_key.'_'.$_v[0]."'] = \"".htmlspecialchars(str_replace('$','',trim(${'layout_'.$_key.'_'.$_v[0]})))."\";\n");
}
else if ($_v[1] == 'file')
{
$tmpname = $_FILES['layout_'.$_key.'_'.$_v[0]]['tmp_name'];
if (is_uploaded_file($tmpname))
{
$realname = $_FILES['layout_'.$_key.'_'.$_v[0]]['name'];
$fileExt = strtolower(getExt($realname));
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
$fileName = $_key.'_'.$_v[0].'.'.$fileExt;
$saveFile = $g['path_var'].'site/'.$r.'/'.$fileName;
if (!strstr('[gif][jpg][png][swf]',$fileExt))
{
continue;
}
move_uploaded_file($tmpname,$saveFile);
@chmod($saveFile,0707);
}
else {
$fileName = $d['layout'][$_key.'_'.$_v[0]];
if ($fileName && ${'layout_'.$_key.'_'.$_v[0].'_del'})
{
unlink( $g['path_var'].'site/'.$r.'/'.$fileName);
$fileName = '';
}
}
fwrite($fp, "\$d['layout']['".$_key.'_'.$_v[0]."'] = \"".$fileName."\";\n");
}
else {
fwrite($fp, "\$d['layout']['".$_key.'_'.$_v[0]."'] = \"".htmlspecialchars(str_replace('$','',trim(${'layout_'.$_key.'_'.$_v[0]})))."\";\n");
}
}
}
fwrite($fp, "?>");
fclose($fp);
@chmod($g['layoutVarForSite'],0707);
setrawcookie('site_common_result', rawurlencode('변경 되었습니다.')); // 알림처리를 위한 로그인 상태 cookie 저장
getLink('reload','parent.frames._ADMPNL_.','','');
?>

View File

@@ -0,0 +1,97 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$_HS = getDbData($table['s_site'],"id='".$r."'",'*');
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$layout = dirname($_HS['m_layout']);
$device = 'mobile';
} else {
$layout = dirname($_HS['layout']);
$device = 'desktop';
}
//사이트별 레이아웃 설정 변수
$g['layoutVarForSite'] = $g['path_var'].'site/'.$r.'/layout.'.$layout.'.var.php';
include $g['path_layout'].$layout.'/_var/_var.config.php';
$fp = fopen($g['layoutVarForSite'],'w');
fwrite($fp, "<?php\n");
foreach($d['layout']['dom'] as $_key => $_val)
{
if(!count($_val[2])) continue;
foreach($_val[2] as $_v)
{
if($_v[1] == 'checkbox')
{
foreach(${'layout_'.$_key.'_'.$_v[0].'_chk'} as $_chk)
{
${'layout_'.$_key.'_'.$_v[0]} .= $_chk.',';
}
fwrite($fp, "\$d['layout']['".$_key.'_'.$_v[0]."'] = \"".trim(${'layout_'.$_key.'_'.$_v[0]})."\";\n");
${'layout_'.$_key.'_'.$_v[0]} = '';
}
else if ($_v[1] == 'textarea')
{
fwrite($fp, "\$d['layout']['".$_key.'_'.$_v[0]."'] = \"".htmlspecialchars(str_replace('$','',trim(${'layout_'.$_key.'_'.$_v[0]})))."\";\n");
}
else if ($_v[1] == 'file')
{
$tmpname = $_FILES['layout_'.$_key.'_'.$_v[0]]['tmp_name'];
if (is_uploaded_file($tmpname))
{
$realname = $_FILES['layout_'.$_key.'_'.$_v[0]]['name'];
$fileExt = strtolower(getExt($realname));
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
$fileName = $r.'_'.$_key.'_'.$_v[0].'.'.$fileExt;
$saveFile = $g['path_layout'].$layout.'/_var/'.$fileName;
if (!strstr('[gif][jpg][png][swf]',$fileExt))
{
continue;
}
move_uploaded_file($tmpname,$saveFile);
@chmod($saveFile,0707);
}
else {
$fileName = $d['layout'][$_key.'_'.$_v[0]];
if ($fileName && ${'layout_'.$_key.'_'.$_v[0].'_del'})
{
unlink( $g['path_layout'].$layout.'/_var/'.$fileName);
$fileName = '';
}
}
fwrite($fp, "\$d['layout']['".$_key.'_'.$_v[0]."'] = \"".$fileName."\";\n");
}
else {
fwrite($fp, "\$d['layout']['".$_key.'_'.$_v[0]."'] = \"".htmlspecialchars(str_replace('$','',trim(${'layout_'.$_key.'_'.$_v[0]})))."\";\n");
}
}
}
fwrite($fp, "?>");
fclose($fp);
@chmod($g['layoutVarForSite'],0707);
if ($send_mod=='ajax') {
echo '<script type="text/javascript">';
echo 'parent.$.notify({message: "저장 되었습니다"},{type: "default"});';
echo 'parent.$("[data-act=submit]").attr("disabled", false);';
echo '</script>';
exit();
} else {
setrawcookie('site_common_result', rawurlencode('저장 되었습니다|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
}
?>

View File

@@ -0,0 +1,259 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if ($menutype==3) {
$joint = $joint_menu;
$redirect = 1;
}
$joint = trim(str_replace('&amp;','&',$joint));
$codhead = trim($codhead);
$codfoot = trim($codfoot);
$addinfo = trim($addinfo);
$id = trim($id);
$title = trim($title);
$keywords = trim($keywords);
$description = trim($description);
$classification = trim($classification);
$addattr = trim($addattr);
$upload = trim($upload);
$image_src = trim($image_src);
if (!$redirect&&(strstr($joint,'&c=')||strstr($joint,'?c=')))
{
getLink('','','연결주소에 사용할 수 없는 파라미터가 있습니다.','');
}
if(!$redirect&&$menutype==1)
{
include $g['path_core'].'function/menu.func.php';
}
// 임시-icon 필드 없는 경우, 생성
$_tmp = db_query("SHOW COLUMNS FROM ".$table['s_menu']." WHERE `Field` = 'imgicon'",$DB_CONNECT);
if(!db_num_rows($_tmp)) {
$_tmp = ("alter table ".$table['s_menu']." ADD imgicon varchar(100) NOT NULL");
db_query($_tmp, $DB_CONNECT);
}
if ($cat && !$vtype)
{
$R = getUidData($table['s_menu'],$cat);
$imghead = $R['imghead'];
$imgfoot = $R['imgfoot'];
$imgset = array('head','foot','icon');
if ($id != $R['id'])
{
$ISMCODE = getDbData($table['s_menu'],"id='".$id."' and site=".$s,'*');
if ($ISMCODE['uid']) getLink('','',sprintf('메뉴코드 [%s] 는 다른메뉴 [%s] 에서 사용중입니다.',$ISMCODE['id'],$ISMCODE['name']),'');
}
for ($i = 0; $i < 3; $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_var'].'menu/'.$userimg;
if (is_uploaded_file($tmpname))
{
if (!strstr('[gif][jpg][png]',$fileExt))
{
getLink('','','헤더/풋터파일은 gif/jpg/png 파일만 등록할 수 있습니다.','');
}
move_uploaded_file($tmpname,$saveFile);
@chmod($saveFile,0707);
${'img'.$imgset[$i]} = $userimg;
}
}
if(!$redirect&&$menutype==1&&strstr($joint,'cync=Y'))
{
$ctarr = getMenuCodeToPath($table['s_menu'],$R['uid'],0);
$catcode = '';
$ctnum = count($ctarr);
for ($i = 0; $i < $ctnum; $i++) $catcode .= $ctarr[$i]['id'].'/';
$c = substr($catcode,0,strlen($catcode)-1);
$joint = str_replace('cync=Y','cync=['.$m.'][c'.$R['uid'].'][,,,][][][c:'.$c.']',$joint);
}
$QVAL = "id='$id',menutype='$menutype',mobile='$mobile',hidden='$hidden',reject='$reject',name='$name',target='$target',";
$QVAL.= "redirect='$redirect',joint='$joint',perm_g='$perm_g',perm_l='$perm_l',";
$QVAL.= "layout='$layout',m_layout='$m_layout',imghead='$imghead',imgfoot='$imgfoot',addattr='$addattr',addinfo='$addinfo',upload='$upload',imgicon='$imgicon'";
getDbUpdate($table['s_menu'],$QVAL,'uid='.$cat);
$_SEO = getDbData($table['s_seo'],'uid='.(int)$seouid,'uid');
if($_SEO['uid']) getDbUpdate($table['s_seo'],"title='$title',keywords='$keywords',description='$description',classification='$classification',image_src='$image_src'",'uid='.$_SEO['uid']);
else getDbInsert($table['s_seo'],'rel,parent,title,keywords,description,classification,image_src',"'1','$cat','$title','$keywords','$description','$classification','$image_src'");
$vfile = $g['path_page'].$r.'-menus/'.$id;
if ($id != $R['id'])
{
$vfile1 = $g['path_page'].$r.'-menus/'.$R['id'];
rename($vfile1.'.php',$vfile.'.php');
if(is_file($vfile1.'.css')) rename($vfile1.'.css',$vfile.'.css');
if(is_file($vfile1.'.js')) rename($vfile1.'.js',$vfile.'.js');
if(is_file($vfile1.'.header.php')) rename($vfile1.'.header.php',$vfile.'.header.php');
if(is_file($vfile1.'.footer.php')) rename($vfile1.'.footer.php',$vfile.'.footer.php');
if(is_file($vfile1.'.txt')) rename($vfile1.'.txt',$vfile.'.txt');
if(is_file($vfile1.'.cache')) rename($vfile1.'.cache',$vfile.'.cache');
if(is_file($vfile1.'.mobile.cache')) rename($vfile1.'.mobile.cache',$vfile.'.mobile.cache');
}
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 ($cachetime)
{
$fp = fopen($vfile.'.txt','w');
fwrite($fp, $cachetime);
fclose($fp);
@chmod($vfile.'.txt',0707);
}
else {
if(is_file($vfile.'.txt'))
{
unlink($vfile.'.txt');
}
}
if ($subcopy == 1)
{
include_once $g['path_core'].'function/menu.func.php';
$subQue = getMenuCodeToSql($table['s_menu'],$cat,'uid');
if ($subQue)
{
getDbUpdate($table['s_menu'],"hidden='".$hidden."',reject='".$reject."',perm_g='".$perm_g."',perm_l='".$perm_l."',layout='".$layout."',m_layout='".$m_layout."'","uid <> ".$cat." and (".$subQue.")");
}
}
setrawcookie('result_menu', rawurlencode('메뉴 등록정보가 변경 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
}
else {
$MAXC = getDbCnt($table['s_menu'],'max(gid)','depth='.($depth+1).' and parent='.$parent);
$sarr = explode(',' , trim($name));
$slen = count($sarr);
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,is_child,parent,depth,id,menutype,mobile,hidden,reject,name,target,redirect,joint,perm_g,perm_l,layout,m_layout,imghead,imgfoot,addattr,num,d_last,addinfo,upload,imgicon";
$QVAL = "'$gid','".$_HS['uid']."','0','$parent','$xdepth','$xnarr[1]','$menutype','$mobile','$hidden','$reject','$xnarr[0]','$target','$redirect','$joint','$perm_g','$perm_l','$layout','$m_layout','','','$addattr','0','','$addinfo','$upload','$imgicon'";
getDbInsert($table['s_menu'],$QKEY,$QVAL);
$lastmenu = getDbCnt($table['s_menu'],'max(uid)','');
getDbInsert($table['s_seo'],'rel,parent,title,keywords,description,classification,image_src',"'1','$lastmenu','$title','$keywords','$description','$classification','$image_src'");
if(!$redirect&&$menutype==1&&strstr($joint,'cync=Y'))
{
$ctarr = getMenuCodeToPath($table['s_menu'],$lastmenu,0);
$catcode = '';
$ctnum = count($ctarr);
for ($j = 0; $j < $ctnum; $j++) $catcode .= $ctarr[$j]['id'].'/';
$c = substr($catcode,0,strlen($catcode)-1);
$joint = str_replace('cync=Y','cync=['.$m.'][c'.$lastmenu.'][,,,][][][c:'.$c.']',$joint);
}
if (!$xnarr[1])
{
$_newId = $lastmenu;
getDbUpdate($table['s_menu'],"id='".$lastmenu."',joint='".$joint."'",'uid='.$lastmenu);
}
else {
$_newId = $xnarr[1];
$ISMCODE = getDbData($table['s_menu'],"uid<> ".$lastmenu." and id='".$xnarr[1]."' and site=".$s,'*');
if ($ISMCODE['uid'])
{
$_newId = $lastmenu;
getDbUpdate($table['s_menu'],"id='".$lastmenu."',joint='".$joint."'",'uid='.$lastmenu);
}
}
$mfile = $g['path_page'].$r.'-menus/'.$_newId;
$fp = fopen($mfile.'.php','w');
fwrite($fp,'');
fclose($fp);
@chmod($mfile.'.php',0707);
if (trim($codhead))
{
$fp = fopen($mfile.'.header.php','w');
fwrite($fp, trim(stripslashes($codhead)));
fclose($fp);
@chmod($mfile.'.header.php',0707);
}
if (trim($codfoot))
{
$fp = fopen($mfile.'.footer.php','w');
fwrite($fp, trim(stripslashes($codfoot)));
fclose($fp);
@chmod($mfile.'.footer.php',0707);
}
if ($cachetime)
{
$fp = fopen($mfile.'.txt','w');
fwrite($fp, $cachetime);
fclose($fp);
@chmod($mfile.'.txt',0707);
}
}
if ($parent)
{
getDbUpdate($table['s_menu'],'is_child=1','uid='.$parent);
}
db_query("OPTIMIZE TABLE ".$table['s_menu'],$DB_CONNECT);
if ($i > 1)
{
setrawcookie('result_menu', rawurlencode('복수의 메뉴가 등록 되었습니다.|success')); // 처리여부 cookie 저장
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=menu&cat='.$parent.'&code='.$code.'&vtype='.$vtype,'parent.','','');
}
else {
setrawcookie('result_menu', rawurlencode('메뉴가 등록 되었습니다.|success')); // 처리여부 cookie 저장
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=menu&cat='.$lastmenu.'&code='.($code?$code.'/'.$lastmenu:$lastmenu).'#site-menu-info','parent.','','');
}
}
?>

View File

@@ -0,0 +1,114 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$id = trim($id);
$category = trim($category);
$name = trim($name);
$joint = trim(str_replace('&amp;','&',$joint));
$hit = 0;
$d_regis = $date['totime'];
$title = trim($title);
$keywords = trim($keywords);
$description = trim($description);
$classification = trim($classification);
$upload = trim($upload);
$image_src = trim($image_src);
$extra = trim($extra);
if (strstr($joint,'&c=')||strstr($joint,'?c='))
{
getLink('','','연결주소에 사용할 수 없는 파라미터가 있습니다.','');
}
if (($orign_id && $orign_id != $id) || !$orign_id)
{
$R = getDbData($table['s_page'],"site=".$s." and id='".$id."'",'*');
if ($R['uid']) getLink('','','동일한 아이디의 페이지가 존재합니다.','');
}
if ($uid)
{
if ($orign_id != $id)
{
$mfile1 = $g['path_page'].$r.'-pages/'.$orign_id.'.php';
$mfile2 = $g['path_page'].$r.'-pages/'.$id.'.php';
@rename($mfile1,$mfile2);
@chmod($mfile2,0707);
@unlink($g['path_page'].$r.'-pages/'.$orign_id.'.txt');
}
if ($cachetime)
{
$fp = fopen($g['path_page'].$r.'-pages/'.$id.'.txt','w');
fwrite($fp, $cachetime);
fclose($fp);
@chmod($g['path_page'].$r.'-pages/'.$id.'.txt',0707);
}
else {
if (file_exists($g['path_page'].$r.'-pages/'.$id.'.txt'))
{
unlink($g['path_page'].$r.'-pages/'.$id.'.txt');
}
}
$QVAL = "pagetype='$pagetype',ismain='$ismain',mobile='$mobile',id='$id',category='$category',name='$name',perm_g='$perm_g',perm_l='$perm_l',layout='$layout',m_layout='$m_layout',joint='$joint',linkedmenu='$linkedmenu',d_last='$d_regis',upload='$upload',extra='$extra'";
getDbUpdate($table['s_page'],$QVAL,'uid='.$uid);
$_SEO = getDbData($table['s_seo'],'uid='.(int)$seouid,'uid');
if($_SEO['uid']) getDbUpdate($table['s_seo'],"title='$title',keywords='$keywords',description='$description',classification='$classification',image_src='$image_src'",'uid='.$_SEO['uid']);
else getDbInsert($table['s_seo'],'rel,parent,title,keywords,description,classification,image_src',"'2','$uid','$title','$keywords','$description','$classification','$image_src'");
if ($backgo)
{
if ($iframe=='Y') getLink(RW('mod='.$id),'parent.parent.','','');
else getLink(RW('mod='.$id),'parent.','','');
}
else {
setrawcookie('result_page', rawurlencode('페이지 등록정보가 변경 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
}
}
else {
$sarr = explode(',' , trim($name));
$slen = count($sarr);
for ($i = 0 ; $i < $slen; $i++)
{
if (!$sarr[$i]) continue;
$xname = trim($sarr[$i]);
$xnarr = explode('=',$xname);
$xnid = $xnarr[1] ? $xnarr[1] : $id;
if(getDbRows($table['s_page'],"site=".$s." and id='".$xnid."'")) continue;
$mfile = $g['path_page'].$r.'-pages/'.$xnid.'.php';
$fp = fopen($mfile,'w');
fwrite($fp,'');
fclose($fp);
@chmod($mfile,0707);
if ($cachetime)
{
$fp = fopen($g['path_page'].$r.'-pages/'.$xnid.'.txt','w');
fwrite($fp, $cachetime);
fclose($fp);
@chmod($g['path_page'].$r.'-pages/'.$xnid.'.txt',0707);
}
$QKEY = "site,pagetype,ismain,mobile,id,category,name,perm_g,perm_l,layout,m_layout,joint,hit,linkedmenu,d_regis,d_last,upload,mbruid,extra";
$QVAL = "'$s','$pagetype','$ismain','$mobile','$xnid','$category','$xnarr[0]','$perm_g','$perm_l','$layout','$m_layout','$joint','$hit','$linkedmenu','$d_regis','$d_regis','$upload','".$my['uid']."','$extra'";
getDbInsert($table['s_page'],$QKEY,$QVAL);
$lastpage = getDbCnt($table['s_page'],'max(uid)','');
getDbInsert($table['s_seo'],'rel,parent,title,keywords,description,classification,image_src',"'2','$lastpage','$title','$keywords','$description','$classification','$image_src'");
}
db_query("OPTIMIZE TABLE ".$table['s_page'],$DB_CONNECT);
setrawcookie('result_page', rawurlencode('페이지가 등록 되었습니다.|success')); // 처리여부 cookie 저장
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=page&uid='.$lastpage.'&cat='.urlencode($cat).'&renum='.$recnum.'&p='.$p.'&keyw='.urlencode($keyw),'parent.','','');
}
?>

View File

@@ -0,0 +1,161 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$id = trim($id);
$name = trim($name);
$label = trim($label);
$title = trim($title);
$headercode = trim($headercode);
$footercode = trim($footercode);
$meta_title = trim($meta_title);
$meta_keywords = trim($meta_keywords);
$meta_description = trim($meta_description);
$meta_classification = trim($meta_classification);
$meta_image_src = trim($meta_image_src);
if ($site_uid)
{
$ISID = getDbData($Table['s_site'],"uid<>".$site_uid." and id='".$id."'",'*');
if ($ISID['uid']) getLink('','','이미 동일한 명칭의 사이트 코드가 존재합니다.','');
if(strstr(','.$d['admin']['site_cutid'].',',','.$id.',')) {
getLink('','','사용할 수 없는 사이트 코드 입니다.','');
}
if ($iconaction)
{
getDbUpdate($table['s_site'],"icon='$icon'",'uid='.$site_uid);
exit;
}
$QVAL = "id='$id',name='$name',label='$label',title='$title',titlefix='$titlefix',icon='$icon',layout='$layout',startpage='$startpage',m_layout='$m_layout',m_startpage='$m_startpage',lang='$sitelang',open='$open',dtd='$dtd',nametype='$nametype',timecal='$timecal',rewrite='$rewrite',buffer='$buffer',usescode='$usescode',headercode='$headercode',footercode='$footercode'";
getDbUpdate($table['s_site'],$QVAL,'uid='.$site_uid);
$_SEO = getDbData($table['s_seo'],'uid='.(int)$seouid,'uid');
if($_SEO['uid']) getDbUpdate($table['s_seo'],"title='$meta_title',keywords='$meta_keywords',description='$meta_description',classification='$meta_classification',image_src='$meta_image_src'",'uid='.$_SEO['uid']);
else getDbInsert($table['s_seo'],'rel,parent,title,keywords,description,classification,image_src',"'0','$site_uid','$meta_title','$meta_keywords','$meta_description','$meta_classification','$meta_image_src'");
$vfile = $g['path_var'].'sitephp/'.$site_uid.'.php';
$fp = fopen($vfile,'w');
fwrite($fp, trim(stripslashes($sitephpcode)));
fclose($fp);
@chmod($vfile,0707);
if ($r != $id)
{
rename($g['path_page'].$r.'-menus',$g['path_page'].$id.'-menus');
rename($g['path_page'].$r.'-pages',$g['path_page'].$id.'-pages');
rename($g['path_var'].'site/'.$r,$g['path_var'].'site/'.$id);
}
setrawcookie('result_site', rawurlencode('사이트가 등록정보가 변경되었습니다.|success')); // 처리여부 cookie 저장
if ($r != $id || $name != $_HS['name'])
{
getLink($g['s'].'/?r='.$id.'&pickmodule='.$m.'&panel=Y','parent.parent.','','');
}
else {
if ($iframe=='Y') getLink('reload','parent.parent.','','');
else getLink('reload','parent.','','');
}
}
else {
if (!$id)
{
$id = 's'.date('His');
}
if (!$title)
{
$title = $name;
}
$ISID = getDbData($Table['s_site'],"id='".$id."'",'*');
if ($ISID['uid']) getLink('','','이미 동일한 명칭의 사이트 코드가 존재합니다.','');
$MAXC = getDbCnt($table['s_site'],'max(gid)','');
$gid = $MAXC + 1;
$name = $name?trim($name):trim($label);
$QKEY = "gid,id,name,label,title,titlefix,icon,layout,startpage,m_layout,m_startpage,lang,open,dtd,nametype,timecal,rewrite,buffer,usescode,headercode,footercode";
$QVAL = "'$gid','$id','$name','$label','$title','$titlefix','$icon','$layout','$startpage','$m_layout','$m_startpage','$sitelang','$open','$dtd','$nametype','$timecal','$rewrite','$buffer','$usescode','$headercode','$footercode'";
getDbInsert($table['s_site'],$QKEY,$QVAL);
$LASTUID = getDbCnt($table['s_site'],'max(uid)','');
db_query("OPTIMIZE TABLE ".$table['s_site'],$DB_CONNECT);
getDbInsert($table['s_seo'],'rel,parent,title,keywords,description,classification,image_src',"'0','$LASTUID','$meta_title','$meta_keywords','$meta_description','$meta_classification','$meta_image_src'");
$vfile = $g['path_var'].'sitephp/'.$LASTUID.'.php';
$fp = fopen($vfile,'w');
fwrite($fp, trim(stripslashes($sitephpcode)));
fclose($fp);
@chmod($vfile,0707);
mkdir($g['path_page'].$id.'-menus',0707);
mkdir($g['path_page'].$id.'-pages',0707);
mkdir($g['path_page'].$id.'-menus/images',0707);
mkdir($g['path_page'].$id.'-pages/images',0707);
mkdir($g['path_var'].'site/'.$id,0707);
@chmod($g['path_page'].$id.'-menus',0707);
@chmod($g['path_page'].$id.'-pages',0707);
@chmod($g['path_page'].$id.'-menus/images',0707);
@chmod($g['path_page'].$id.'-pages/images',0707);
@chmod($g['path_var'].'site/'.$id,0707);
$mfile = $g['path_page'].$id.'-menus/_main';
$fp = fopen($mfile.'.css','w');
fwrite($fp,'');
fclose($fp);
@chmod($mfile.'.css',0707);
$fp = fopen($mfile.'.js','w');
fwrite($fp,'');
fclose($fp);
@chmod($mfile.'.js',0707);
$pfile = $g['path_page'].$id.'-pages/_main';
$fp = fopen($pfile.'.css','w');
fwrite($fp,'');
fclose($fp);
@chmod($pfile.'.css',0707);
$fp = fopen($pfile.'.js','w');
fwrite($fp,'');
fclose($fp);
@chmod($pfile.'.js',0707);
//매니페스트 파일생성
$manifestfile = $g['path_var'].'site/'.$id.'/manifest.json';
$fp = fopen($manifestfile,'w');
$iconsURL = $g['s'].'/_core/images/touch/';
$icons = array(
array('src'=>$iconsURL.'homescreen-128x128.png','sizes'=>'128x128','type'=>'image/png'),
array('src'=>$iconsURL.'homescreen-144x144.png','sizes'=>'144x144','type'=>'image/png'),
array('src'=>$iconsURL.'homescreen-168x168.png','sizes'=>'168x168','type'=>'image/png'),
array('src'=>$iconsURL.'homescreen-192x192.png','sizes'=>'192x192','type'=>'image/png'),
array('src'=>$iconsURL.'homescreen-512x512.png','sizes'=>'512x512','type'=>'image/png')
);
$mnObj->name = $name;
$mnObj->short_name = $name;
$mnObj->icons = $icons;
$mnObj->start_url = '/';
$mnObj->display = 'standalone';
$mnObj->background_color = '#333';
$mnObj->theme_color = '#333';
$mnObj->gcm_sender_id = '103953800507'; //FCM 자바스크립트 클라이언트에 공통되는 고정된 값입니다.
$manifestJSON = json_encode($mnObj,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
$_manifestJSON = str_replace("\/", "/", $manifestJSON);
fwrite($fp, $_manifestJSON);
fclose($fp);
@chmod($manifestfile,0707);
setrawcookie('result_site', rawurlencode('사이트가 등록 되었습니다.|success')); // 처리여부 cookie 저장
if ($nosite=='Y')
{
getLink($g['s'].'/?r='.$id.'&m=admin&pickmodule='.$m.'&panel=Y','parent.','','');
}
else {
getLink($g['s'].'/?r='.$id.'&m=admin&pickmodule='.$m.'&panel=Y','parent.parent.','','');
}
}
?>

View File

@@ -0,0 +1,34 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$id = trim($id);
$name = trim($name);
$title = trim($title);
if ($site_uid)
{
$ISID = getDbData($Table['s_site'],"uid<>".$site_uid." and id='".$id."'",'*');
if ($ISID['uid']) getLink('','','이미 동일한 명칭의 계정아이디가 존재합니다.','');
$QVAL = "id='$id',name='$name',title='$title',layout='$layout',startpage='$startpage',m_layout='$m_layout',m_startpage='$m_startpage',open='$open'";
getDbUpdate($table['s_site'],$QVAL,'uid='.$site_uid);
if ($_HS['id'] != $id)
{
rename($g['path_page'].$_HS['id'].'-menus',$g['path_page'].$id.'-menus');
rename($g['path_page'].$_HS['id'].'-pages',$g['path_page'].$id.'-pages');
}
}
if ($_HS['id'] != $id || $_HS['name'] != $name)
{
getLink($g['s'].'/?r='.$id.'&panel=Y&_admpnl_='.urlencode($referer),'parent.parent.','변경되었습니다','');
}
else {
//getLink('reload','parent.frames._ADMPNL_.','변경되었습니다','');
setrawcookie('site_common_result', rawurlencode('변경 되었습니다.')); // 알림처리를 위한 로그인 상태 cookie 저장
getLink('reload','parent.frames._ADMPNL_.','','');
}
?>

View File

@@ -0,0 +1,14 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if ($check) $_SESSION[$name] = $_SESSION[$name] ? '' : $value;
else $_SESSION[$name] = $value;
if ($target)
{
getLink('reload',$target,'','');
}
exit;
?>

View File

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

View File

@@ -0,0 +1,92 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if ($wysiwyg == 'Y') {
$__SRC__ = trim(stripslashes($source));
$source = preg_replace("'<tmp[^>]*?>'si",'',$__SRC__);
$__MSRC__ = trim(stripslashes($mobile));
$mobile = $__MSRC__;
}
$seo_src = '['.$featured_img.']';
if($editFilter) include $g['path_plugin'].$editFilter.'/filter.php';
$vfile = $type == 'menu' ? $g['path_page'].$r.'-menus/'.$id : $g['path_page'].$r.'-pages/'.$id;
$fp = fopen($vfile.'.php','w');
fwrite($fp, trim(stripslashes($source)));
fclose($fp);
@chmod($vfile.'.php',0707);
if (trim($mobile))
{
$fp = fopen($vfile.'.mobile.php','w');
fwrite($fp, trim(stripslashes($mobile)));
fclose($fp);
@chmod($vfile.'.mobile.php',0707);
}
else {
if(is_file($vfile.'.mobile.php'))
{
unlink($vfile.'.mobile.php');
}
}
if (trim($css))
{
$fp = fopen($vfile.'.css','w');
fwrite($fp, trim(stripslashes($css))."\n");
fclose($fp);
@chmod($vfile.'.css',0707);
}
else {
if(is_file($vfile.'.css'))
{
unlink($vfile.'.css');
}
}
if (trim($js))
{
$fp = fopen($vfile.'.js','w');
fwrite($fp, trim(stripslashes($js))."\n");
fclose($fp);
@chmod($vfile.'.js',0707);
}
else {
if(is_file($vfile.'.js'))
{
unlink($vfile.'.js');
}
}
$cachefile_mobile = str_replace('.php','.cache',$vfile.'.mobile');
if(file_exists($cachefile_mobile)) unlink($cachefile_mobile);
if ($type == 'menu') {
getDbUpdate($table['s_menu'],"upload='".$upload."',featured_img='".$featured_img."',d_last='".$date['totime']."'",'uid='.$uid);
$_SEO = getDbData($table['s_seo'],'rel=1 and parent='.$uid,'image_src');
if (!$_SEO['image_src']) getDbUpdate($table['s_seo'],"image_src='$seo_src'",'parent='.$uid);
} else {
getDbUpdate($table['s_page'],"upload='".$upload."',featured_img='".$featured_img."',d_last='".$date['totime']."'",'uid='.$uid);
$_SEO = getDbData($table['s_seo'],'rel=2 and parent='.$uid,'image_src');
if (!$_SEO['image_src']) getDbUpdate($table['s_seo'],"image_src='$seo_src'",'parent='.$uid);
}
$cachefile_pc = str_replace('.php','.cache',$vfile);
if(file_exists($cachefile_pc)) unlink($cachefile_pc);
echo '<script type="text/javascript">';
echo 'parent.$.notify({message: "저장 되었습니다."},{type: "success"});';
echo 'parent.$("[data-role=d_last]").text("'.getDateFormat($date['totime'],'Y.m.d H:i').'");';
echo 'parent.$(".js-submit").prop("disabled",false);';
echo '</script>';
exit;
?>