테마기능 추가
This commit is contained in:
@ -12,11 +12,30 @@ if (!get_session('ss_admin')) {
|
||||
// 스킨디렉토리를 SELECT 형식으로 얻음
|
||||
function get_skin_select($skin_gubun, $id, $name, $selected='', $event='')
|
||||
{
|
||||
$skins = get_skin_dir($skin_gubun);
|
||||
global $config;
|
||||
|
||||
$skins = array();
|
||||
|
||||
if(defined('G5_THEME_PATH') && $config['cf_theme']) {
|
||||
$dirs = get_skin_dir($skin_gubun, G5_THEME_PATH.'/'.G5_SKIN_DIR);
|
||||
if(!empty($dirs)) {
|
||||
foreach($dirs as $dir) {
|
||||
$skins[] = 'theme/'.$dir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$skins = array_merge($skins, get_skin_dir($skin_gubun));
|
||||
|
||||
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
|
||||
for ($i=0; $i<count($skins); $i++) {
|
||||
if ($i == 0) $str .= "<option value=\"\">선택</option>";
|
||||
$str .= option_selected($skins[$i], $selected);
|
||||
if(preg_match('#^theme/(.+)$#', $skins[$i], $match))
|
||||
$text = '(테마) '.$match[1];
|
||||
else
|
||||
$text = $skins[$i];
|
||||
|
||||
$str .= option_selected($skins[$i], $selected, $text);
|
||||
}
|
||||
$str .= "</select>";
|
||||
return $str;
|
||||
@ -25,11 +44,30 @@ function get_skin_select($skin_gubun, $id, $name, $selected='', $event='')
|
||||
// 모바일 스킨디렉토리를 SELECT 형식으로 얻음
|
||||
function get_mobile_skin_select($skin_gubun, $id, $name, $selected='', $event='')
|
||||
{
|
||||
$skins = get_skin_dir($skin_gubun, G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
global $config;
|
||||
|
||||
$skins = array();
|
||||
|
||||
if(defined('G5_THEME_PATH') && $config['cf_theme']) {
|
||||
$dirs = get_skin_dir($skin_gubun, G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
if(!empty($dirs)) {
|
||||
foreach($dirs as $dir) {
|
||||
$skins[] = 'theme/'.$dir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$skins = array_merge($skins, get_skin_dir($skin_gubun, G5_MOBILE_PATH.'/'.G5_SKIN_DIR));
|
||||
|
||||
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
|
||||
for ($i=0; $i<count($skins); $i++) {
|
||||
if ($i == 0) $str .= "<option value=\"\">선택</option>";
|
||||
$str .= option_selected($skins[$i], $selected);
|
||||
if(preg_match('#^theme/(.+)$#', $skins[$i], $match))
|
||||
$text = '(테마) '.$match[1];
|
||||
else
|
||||
$text = $skins[$i];
|
||||
|
||||
$str .= option_selected($skins[$i], $selected, $text);
|
||||
}
|
||||
$str .= "</select>";
|
||||
return $str;
|
||||
@ -44,6 +82,9 @@ function get_skin_dir($skin, $skin_path=G5_SKIN_PATH)
|
||||
$result_array = array();
|
||||
|
||||
$dirname = $skin_path.'/'.$skin.'/';
|
||||
if(!is_dir($dirname))
|
||||
return;
|
||||
|
||||
$handle = opendir($dirname);
|
||||
while ($file = readdir($handle)) {
|
||||
if($file == '.'||$file == '..') continue;
|
||||
@ -57,6 +98,101 @@ function get_skin_dir($skin, $skin_path=G5_SKIN_PATH)
|
||||
}
|
||||
|
||||
|
||||
// 테마
|
||||
function get_theme_dir()
|
||||
{
|
||||
$result_array = array();
|
||||
|
||||
$dirname = G5_PATH.'/'.G5_THEME_DIR.'/';
|
||||
$handle = opendir($dirname);
|
||||
while ($file = readdir($handle)) {
|
||||
if($file == '.'||$file == '..') continue;
|
||||
|
||||
if (is_dir($dirname.$file)) {
|
||||
$theme_path = $dirname.$file;
|
||||
if(is_file($theme_path.'/index.php') && is_file($theme_path.'/head.php') && is_file($theme_path.'/tail.php'))
|
||||
$result_array[] = $file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
natsort($result_array);
|
||||
|
||||
return $result_array;
|
||||
}
|
||||
|
||||
|
||||
// 테마정보
|
||||
function get_theme_info($dir)
|
||||
{
|
||||
$info = array();
|
||||
$path = G5_PATH.'/'.G5_THEME_DIR.'/'.$dir;
|
||||
|
||||
if(is_dir($path)) {
|
||||
$screenshot = $path.'/screenshot.png';
|
||||
if(is_file($screenshot)) {
|
||||
$size = @getimagesize($screenshot);
|
||||
|
||||
if($size[2] == 3)
|
||||
$screenshot_url = str_replace(G5_PATH, G5_URL, $screenshot);
|
||||
}
|
||||
|
||||
$info['screenshot'] = $screenshot_url;
|
||||
|
||||
$text = $path.'/readme.txt';
|
||||
if(is_file($text)) {
|
||||
$content = file($text, false);
|
||||
$content = array_map('trim', $content);
|
||||
|
||||
preg_match('#^Theme Name:(.+)$#i', $content[0], $m0);
|
||||
preg_match('#^Theme URI:(.+)$#i', $content[1], $m1);
|
||||
preg_match('#^Maker:(.+)$#i', $content[2], $m2);
|
||||
preg_match('#^Maker URI:(.+)$#i', $content[3], $m3);
|
||||
preg_match('#^Version:(.+)$#i', $content[4], $m4);
|
||||
preg_match('#^Detail:(.+)$#i', $content[5], $m5);
|
||||
preg_match('#^License:(.+)$#i', $content[6], $m6);
|
||||
preg_match('#^License URI:(.+)$#i', $content[7], $m7);
|
||||
|
||||
$info['theme_name'] = trim($m0[1]);
|
||||
$info['theme_uri'] = trim($m1[1]);
|
||||
$info['maker'] = trim($m2[1]);
|
||||
$info['maker_uri'] = trim($m3[1]);
|
||||
$info['version'] = trim($m4[1]);
|
||||
$info['detail'] = trim($m5[1]);
|
||||
$info['license'] = trim($m6[1]);
|
||||
$info['license_uri'] = trim($m7[1]);
|
||||
}
|
||||
|
||||
if(!$info['theme_name'])
|
||||
$info['theme_name'] = $dir;
|
||||
}
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
// 테마설정 정보
|
||||
function get_theme_config_value($dir, $key='*')
|
||||
{
|
||||
$tconfig = array();
|
||||
|
||||
$theme_config_file = G5_PATH.'/'.G5_THEME_DIR.'/'.$dir.'/theme.config.php';
|
||||
if(is_file) {
|
||||
include($theme_config_file);
|
||||
|
||||
if($key == '*') {
|
||||
$tconfig = $theme_config;
|
||||
} else {
|
||||
$keys = array_map('trim', explode(',', $key));
|
||||
foreach($keys as $v) {
|
||||
$tconfig[$v] = trim($theme_config[$v]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $tconfig;
|
||||
}
|
||||
|
||||
|
||||
// 회원권한을 SELECT 형식으로 얻음
|
||||
function get_member_level_select($name, $start_id=0, $end_id=10, $selected="", $event="")
|
||||
{
|
||||
@ -95,26 +231,48 @@ function get_member_id_select($name, $level, $selected="", $event="")
|
||||
}
|
||||
|
||||
// 권한 검사
|
||||
function auth_check($auth, $attr)
|
||||
function auth_check($auth, $attr, $return=false)
|
||||
{
|
||||
global $is_admin;
|
||||
|
||||
if ($is_admin == 'super') return;
|
||||
|
||||
if (!trim($auth))
|
||||
alert('이 메뉴에는 접근 권한이 없습니다.\\n\\n접근 권한은 최고관리자만 부여할 수 있습니다.');
|
||||
if (!trim($auth)) {
|
||||
$msg = '이 메뉴에는 접근 권한이 없습니다.\\n\\n접근 권한은 최고관리자만 부여할 수 있습니다.';
|
||||
if($return)
|
||||
return $msg;
|
||||
else
|
||||
alert($msg);
|
||||
}
|
||||
|
||||
$attr = strtolower($attr);
|
||||
|
||||
if (!strstr($auth, $attr)) {
|
||||
if ($attr == 'r')
|
||||
alert('읽을 권한이 없습니다.');
|
||||
else if ($attr == 'w')
|
||||
alert('입력, 추가, 생성, 수정 권한이 없습니다.');
|
||||
else if ($attr == 'd')
|
||||
alert('삭제 권한이 없습니다.');
|
||||
else
|
||||
alert('속성이 잘못 되었습니다.');
|
||||
if ($attr == 'r') {
|
||||
$msg = '읽을 권한이 없습니다.';
|
||||
if($return)
|
||||
return $msg;
|
||||
else
|
||||
alert($msg);
|
||||
} else if ($attr == 'w') {
|
||||
$msg = '입력, 추가, 생성, 수정 권한이 없습니다.';
|
||||
if($return)
|
||||
return $msg;
|
||||
else
|
||||
alert($msg);
|
||||
} else if ($attr == 'd') {
|
||||
$msg = '삭제 권한이 없습니다.';
|
||||
if($return)
|
||||
return $msg;
|
||||
else
|
||||
alert($msg);
|
||||
} else {
|
||||
$msg = '속성이 잘못 되었습니다.';
|
||||
if($return)
|
||||
return $msg;
|
||||
else
|
||||
alert($msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ $menu['menu100'] = array (
|
||||
array('100000', '환경설정', G5_ADMIN_URL.'/config_form.php', 'config'),
|
||||
array('', '기본환경설정', G5_ADMIN_URL.'/config_form.php', 'cf_basic'),
|
||||
array('', '관리권한설정', G5_ADMIN_URL.'/auth_list.php', 'cf_auth'),
|
||||
array('', '테마설정', G5_ADMIN_URL.'/theme.php', 'cf_theme', 1),
|
||||
array('', '메뉴설정', G5_ADMIN_URL.'/menu_list.php', 'cf_menu', 1),
|
||||
array('100300', '메일 테스트', G5_ADMIN_URL.'/sendmail_test.php', 'cf_mailtest'),
|
||||
array('100310', '팝업레이어관리', G5_ADMIN_URL.'/newwinlist.php', 'scf_poplayer'),
|
||||
|
||||
@ -8,5 +8,6 @@ $menu['menu300'] = array (
|
||||
array('300500', '1:1문의설정', ''.G5_ADMIN_URL.'/qa_config.php', 'qa'),
|
||||
array('300600', '내용관리', G5_ADMIN_URL.'/contentlist.php', 'scf_contents', 1),
|
||||
array('300700', 'FAQ관리', G5_ADMIN_URL.'/faqmasterlist.php', 'scf_faq', 1),
|
||||
array('300820', '글,댓글 현황', G5_ADMIN_URL.'/write_count.php', 'scf_write_count'),
|
||||
);
|
||||
?>
|
||||
@ -153,10 +153,9 @@ $pg_anchor = '<ul class="anchor">
|
||||
$frm_submit = '<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="확인" class="btn_submit" accesskey="s">
|
||||
<a href="./board_list.php?'.$qstr.'">목록</a>'.PHP_EOL;
|
||||
if ($w == 'u') $frm_submit .= ' <a href="./board_copy.php?bo_table='.$bo_table.'" id="board_copy" target="win_board_copy">게시판복사</a>
|
||||
if ($w == 'u') $frm_submit .= '<a href="./board_copy.php?bo_table='.$bo_table.'" id="board_copy" target="win_board_copy">게시판복사</a>
|
||||
<a href="'.G5_BBS_URL.'/board.php?bo_table='.$board['bo_table'].'" class="btn_frmline">게시판 바로가기</a>
|
||||
<a href="./board_thumbnail_delete.php?bo_table='.$board['bo_table'].'&'.$qstr.'" onclick="return delete_confirm2(\'게시판 썸네일 파일을 삭제하시겠습니까?\');">게시판 썸네일 삭제</a>
|
||||
'.PHP_EOL;
|
||||
<a href="./board_thumbnail_delete.php?bo_table='.$board['bo_table'].'&'.$qstr.'" onclick="return delete_confirm2(\'게시판 썸네일 파일을 삭제하시겠습니까?\');">게시판 썸네일 삭제</a>'.PHP_EOL;
|
||||
$frm_submit .= '</div>';
|
||||
?>
|
||||
|
||||
@ -1118,7 +1117,7 @@ $frm_submit .= '</div>';
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
<?php echo preg_replace('#</div>$#i', '<button type="button" class="get_theme_galc">테마 이미지설정 가져오기</button></div>', $frm_submit); ?>
|
||||
|
||||
<section id="anc_bo_point">
|
||||
<h2 class="h2_frm">게시판 포인트 설정</h2>
|
||||
@ -1240,6 +1239,37 @@ $(function(){
|
||||
window.open(this.href, "win_board_copy", "left=10,top=10,width=500,height=400");
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".get_theme_galc").on("click", function() {
|
||||
if(!confirm("현재 테마의 게시판 이미지 설정을 적용하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./theme_config_load.php",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: { type: "board" },
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
var field = Array('bo_gallery_cols', 'bo_gallery_width', 'bo_gallery_height', 'bo_mobile_gallery_width', 'bo_mobile_gallery_height', 'bo_image_width');
|
||||
var count = field.length;
|
||||
var key;
|
||||
|
||||
for(i=0; i<count; i++) {
|
||||
key = field[i];
|
||||
|
||||
if(data[key] != undefined && data[key] != "")
|
||||
$("input[name="+key+"]").val(data[key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function board_copy(bo_table) {
|
||||
|
||||
@ -9,12 +9,9 @@ $token = get_token();
|
||||
if ($is_admin != 'super')
|
||||
alert('최고관리자만 접근 가능합니다.');
|
||||
|
||||
if (!isset($config['cf_include_index'])) {
|
||||
if (!isset($config['cf_add_script'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_include_index` VARCHAR(255) NOT NULL AFTER `cf_admin`,
|
||||
ADD `cf_include_head` VARCHAR(255) NOT NULL AFTER `cf_include_index`,
|
||||
ADD `cf_include_tail` VARCHAR(255) NOT NULL AFTER `cf_include_head`,
|
||||
ADD `cf_add_script` TEXT NOT NULL AFTER `cf_include_tail` ", true);
|
||||
ADD `cf_add_script` TEXT NOT NULL AFTER `cf_admin_email_name` ", true);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_mobile_new_skin'])) {
|
||||
@ -212,7 +209,7 @@ $frm_submit = '<div class="btn_confirm01 btn_confirm">
|
||||
if (!$config['cf_icode_server_ip']) $config['cf_icode_server_ip'] = '211.172.232.124';
|
||||
if (!$config['cf_icode_server_port']) $config['cf_icode_server_port'] = '7295';
|
||||
|
||||
if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
|
||||
}
|
||||
?>
|
||||
@ -341,105 +338,41 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_new_skin">최근게시물 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_new_skin" id="cf_new_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('new');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_new_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_skin_select('new', 'cf_new_skin', 'cf_new_skin', $config['cf_new_skin'], 'required'); ?>
|
||||
</td>
|
||||
<th scope="row"><label for="cf_mobile_new_skin">모바일<br>최근게시물 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_mobile_new_skin" id="cf_mobile_new_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('new', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_mobile_new_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_mobile_skin_select('new', 'cf_mobile_new_skin', 'cf_mobile_new_skin', $config['cf_mobile_new_skin'], 'required'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_search_skin">검색 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_search_skin" id="cf_search_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('search');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_search_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_skin_select('search', 'cf_search_skin', 'cf_search_skin', $config['cf_search_skin'], 'required'); ?>
|
||||
</td>
|
||||
<th scope="row"><label for="cf_mobile_search_skin">모바일 검색 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_mobile_search_skin" id="cf_mobile_search_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('search', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_mobile_search_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_mobile_skin_select('search', 'cf_mobile_search_skin', 'cf_mobile_search_skin', $config['cf_mobile_search_skin'], 'required'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_connect_skin">접속자 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_connect_skin" id="cf_connect_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('connect');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_connect_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_skin_select('connect', 'cf_connect_skin', 'cf_connect_skin', $config['cf_connect_skin'], 'required'); ?>
|
||||
</td>
|
||||
<th scope="row"><label for="cf_mobile_connect_skin">모바일 접속자 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_mobile_connect_skin" id="cf_mobile_connect_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('connect', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_mobile_connect_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_mobile_skin_select('connect', 'cf_mobile_connect_skin', 'cf_mobile_connect_skin', $config['cf_mobile_connect_skin'], 'required'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_faq_skin">FAQ 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_faq_skin" id="cf_faq_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('faq');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_faq_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_skin_select('faq', 'cf_faq_skin', 'cf_faq_skin', $config['cf_faq_skin'], 'required'); ?>
|
||||
</td>
|
||||
<th scope="row"><label for="cf_mobile_faq_skin">모바일 FAQ 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_mobile_faq_skin" id="cf_mobile_faq_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('faq', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_mobile_faq_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_mobile_skin_select('faq', 'cf_mobile_faq_skin', 'cf_mobile_faq_skin', $config['cf_mobile_faq_skin'], 'required'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -532,7 +465,7 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
<?php echo preg_replace('#</div>$#i', '<button type="button" class="get_theme_confc" data-type="conf_skin">테마 스킨설정 가져오기</button></div>', $frm_submit); ?>
|
||||
|
||||
<section id="anc_cf_board">
|
||||
<h2 class="h2_frm">게시판 기본 설정</h2>
|
||||
@ -636,27 +569,11 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_member_skin">회원 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_member_skin" id="cf_member_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('member');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo '<option value="'.$arr[$i].'"'.get_selected($config['cf_member_skin'], $arr[$i]).'>'.$arr[$i].'</option>'."\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_skin_select('member', 'cf_member_skin', 'cf_member_skin', $config['cf_member_skin'], 'required'); ?>
|
||||
</td>
|
||||
<th scope="row"><label for="cf_mobile_member_skin">모바일<br>회원 스킨<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<select name="cf_mobile_member_skin" id="cf_mobile_member_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('member', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo '<option value="'.$arr[$i].'"'.get_selected($config['cf_mobile_member_skin'], $arr[$i]).'>'.$arr[$i].'</option>'."\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_mobile_skin_select('member', 'cf_mobile_member_skin', 'cf_mobile_member_skin', $config['cf_mobile_member_skin'], 'required'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -761,7 +678,7 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
<?php echo preg_replace('#</div>$#i', '<button type="button" class="get_theme_confc" data-type="conf_member">테마 회원스킨설정 가져오기</button></div>', $frm_submit); ?>
|
||||
|
||||
<section id="anc_cf_cert">
|
||||
<h2 class="h2_frm">본인확인 설정</h2>
|
||||
@ -1082,27 +999,6 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_include_index">초기화면 파일 경로</label></th>
|
||||
<td>
|
||||
<?php echo help('입력이 없으면 index.php가 초기화면 파일로 설정됩니다.<br>초기화면 파일은 index.php 파일과 동일한 위치에 존재해야 합니다.') ?>
|
||||
<input type="text" name="cf_include_index" value="<?php echo $config['cf_include_index'] ?>" id="cf_include_index" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_include_head">상단 파일 경로</label></th>
|
||||
<td>
|
||||
<?php echo help('입력이 없으면 head.php가 상단 파일로 설정됩니다.<br>상단 파일은 head.php 파일과 동일한 위치에 존재해야 합니다.') ?>
|
||||
<input type="text" name="cf_include_head" value="<?php echo $config['cf_include_head'] ?>" id="cf_include_head" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_include_tail">하단 파일 경로</label></th>
|
||||
<td>
|
||||
<?php echo help('입력이 없으면 tail.php가 하단 파일로 설정됩니다.<br>초기화면 파일은 tail.php 파일과 동일한 위치에 존재해야 합니다.') ?>
|
||||
<input type="text" name="cf_include_tail" value="<?php echo $config['cf_include_tail'] ?>" id="cf_include_tail" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_add_script">추가 script, css</label></th>
|
||||
<td>
|
||||
@ -1250,6 +1146,42 @@ $(function(){
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
$(".get_theme_confc").on("click", function() {
|
||||
var type = $(this).data("type");
|
||||
var msg = "기본환경 스킨 설정";
|
||||
if(type == "conf_member")
|
||||
msg = "기본환경 회원스킨 설정";
|
||||
|
||||
if(!confirm("현재 테마의 "+msg+"을 적용하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./theme_config_load.php",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: { type: type },
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
var field = Array('cf_member_skin', 'cf_mobile_member_skin', 'cf_new_skin', 'cf_mobile_new_skin', 'cf_search_skin', 'cf_mobile_search_skin', 'cf_connect_skin', 'cf_mobile_connect_skin', 'cf_faq_skin', 'cf_mobile_faq_skin');
|
||||
var count = field.length;
|
||||
var key;
|
||||
|
||||
for(i=0; i<count; i++) {
|
||||
key = field[i];
|
||||
|
||||
if(data[key] != undefined && data[key] != "")
|
||||
$("select[name="+key+"]").val(data[key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function fconfigform_submit(f)
|
||||
|
||||
@ -29,9 +29,6 @@ $sql = " update {$g5['config_table']}
|
||||
cf_admin = '{$_POST['cf_admin']}',
|
||||
cf_admin_email = '{$_POST['cf_admin_email']}',
|
||||
cf_admin_email_name = '{$_POST['cf_admin_email_name']}',
|
||||
cf_include_index = '{$_POST['cf_include_index']}',
|
||||
cf_include_head = '{$_POST['cf_include_head']}',
|
||||
cf_include_tail = '{$_POST['cf_include_tail']}',
|
||||
cf_add_script = '{$_POST['cf_add_script']}',
|
||||
cf_use_point = '{$_POST['cf_use_point']}',
|
||||
cf_point_term = '{$_POST['cf_point_term']}',
|
||||
|
||||
@ -880,3 +880,48 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
.svc_sms:after{display:block;visibility:hidden;clear:both;content:""}
|
||||
.svc_sms .svc_btn2{position:absolute;top:0;right:0}
|
||||
.svc_sms .svc_btn2 a{display:inline-block; width:220px; height:63px; background:#fbfbfb; text-align:center; padding:20px 0 0;}
|
||||
|
||||
/*테마*/
|
||||
.theme_p{padding:0 20px}
|
||||
#theme_list{padding:0;margin:0 10px;list-style:none; width: 1000px;position:relative}
|
||||
#theme_list:after{display:block;visibility:hidden;clear:both;content:""}
|
||||
#theme_list li{padding:10px;margin:0;float:left;width:302px}
|
||||
#theme_list li:after{display:block;visibility:hidden;clear:both;content:""}
|
||||
#theme_list li .tmli_if{border: 1px solid #d1dee2;width:300px;}
|
||||
#theme_list li .tmli_if>img{width:300px;height:225px;}
|
||||
#theme_list li .tmli_if:hover>img{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter: alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity: 0.5;opacity: 0.5;}
|
||||
#theme_list li .tmli_tit{position:relative; border-top: 1px solid #d1dee2; background: #e5ecef;}
|
||||
#theme_list li .tmli_tit p{height:40px;line-height:40px;padding:0 10px 0;font-weight:bold;text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
#theme_list li .tmli_tit button.tmli_dt{position:absolute;top:8px;right:10px;padding:5px;background:#111;color:#fff;display:none;border:none}
|
||||
#theme_list li .tmli_if:hover button.tmli_dt{display:block}
|
||||
#theme_list li .theme_sl{float:left;border:none;margin-top:5px;padding:0 5px;height:26px;background:#999;color:#fff}
|
||||
#theme_list li .theme_sl:hover{background:#ff3061}
|
||||
#theme_list li .theme_deactive{margin-left:4px}
|
||||
#theme_list li .theme_sl_use{background:#ff3061;line-height:26px}
|
||||
#theme_list li .theme_pr{float:right;margin-top:5px;padding:0 5px;height:24px;line-height:24px; border: 1px solid #ccc; background: #fafafa; }
|
||||
#theme_list li .theme_preview{ float: right; margin-top: 5px; padding:0 5px;height:26px; border: 1px solid #ccc; background: #fafafa; margin-right:3px}
|
||||
|
||||
#theme_detail{position:fixed;_position:absolute;top:50%;left:20px;_top:300px;width:950px;height:490px;margin-top:-245px;background:#fff;border:1px solid #000;z-index:99999;}
|
||||
#theme_detail .thdt_img{padding:20px 0 20px 20px;float:left;}
|
||||
#theme_detail .thdt_img img{width:600px;height:450px;}
|
||||
#theme_detail .thdt_if{float:right;width:290px;padding:40px 20px 0 0;position:relative}
|
||||
#theme_detail .thdt_if h2{padding:0 ;margin:0}
|
||||
#theme_detail .thdt_if p{font-weight:normal;padding:10px;background:#f5f5f5;height:250px;overflow-y:auto;}
|
||||
#theme_detail .thdt_if a{vertical-align:middle;}
|
||||
#theme_detail .thdt_if .thdt_home{background:url(../img/link_icon.gif) no-repeat bottom right;padding-right:13px;}
|
||||
#theme_detail .close_btn{position:absolute;top:10px;right:10px;background:url(../img/close.gif) no-repeat 50% 50%;border:none;width:30px;height:30px;overflow:hidden;text-indent:-9999px;}
|
||||
#theme_detail table{border-collapse:collapse;margin:5px 0 10px}
|
||||
#theme_detail table th{padding: 5px 0; border: 1px solid #d1dee2; background: #e5ecef;width:50px;padding:10px;text-align:left}
|
||||
#theme_detail table td{ border: 1px solid #ececec;padding:10px}
|
||||
.no_theme{text-align:center;padding:100px 0;color:#555}
|
||||
|
||||
/*글,댓글현황*/
|
||||
#wr_cont{position:relative;margin:10px 20px}
|
||||
#wr_cont input[type="submit"]{background:#ff3061;border:none;color:#fff;padding: 0 5px;height: 24px;}
|
||||
#wr_cont select{height: 24px;}
|
||||
#grp_color{border:2px solid #ddd;position:absolute;top:0;right:0;list-style:none;padding: 5px 5px; margin:0;}
|
||||
#grp_color li{padding:5px 10px;}
|
||||
#grp_color li span{width:10px;height:10px; display:inline-block;background:rgb(75, 178, 197);margin-right:5px;}
|
||||
#grp_color li.color2 span{background:rgb(234, 162, 40);}
|
||||
#chart_wr h5{text-align:center;border:1px solid #eee;padding:30px 0}
|
||||
#chart_wr{margin:20px }
|
||||
|
||||
8
adm/css/theme.css
Normal file
8
adm/css/theme.css
Normal file
@ -0,0 +1,8 @@
|
||||
@charset "utf-8";
|
||||
#preview_item{height:50px}
|
||||
#preview_item ul{margin:0;padding:0;top:0;width:100%;border-bottom:1px solid #eee; margin:0 auto;text-align:center;background:#333;position:fixed;top:0;z-index:999999;width:100%;}
|
||||
#preview_item ul li{list-style:none;display:inline-block;height:50px;line-height:50px;padding:0 3px;*display:inline; zoom:1;}
|
||||
#preview_item ul li a{color:#555;padding:0 8px;height:24px;line-height:24px;background:#f2f2f2;border-radius:3px;display:inline-block;vertical-align:middle;border:1px solid #dcdcdc;}
|
||||
#preview_item ul li a:hover{background:#ccc;text-decoration:none;border:1px solid #ccc;}
|
||||
#preview_item ul li button{color:#fff;padding:0 8px;background:#FF5191;border-radius:3px;height:26px;line-height:24px;vertical-align:middle;border:none}
|
||||
#preview_item ul li button:hover{background:#e40d5c;color:#fff;text-decoration:none;}
|
||||
@ -8,7 +8,7 @@ auth_check($auth[$sub_menu], "w");
|
||||
$sql = " select * from {$g5['faq_master_table']} where fm_id = '$fm_id' ";
|
||||
$fm = sql_fetch($sql);
|
||||
|
||||
$html_title = 'FAQ '.$fm['fm_subject'];;
|
||||
$html_title = 'FAQ '.$fm['fm_subject'];
|
||||
|
||||
if ($w == "u")
|
||||
{
|
||||
|
||||
BIN
adm/img/close.gif
Normal file
BIN
adm/img/close.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 200 B |
BIN
adm/img/link_icon.gif
Normal file
BIN
adm/img/link_icon.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 B |
BIN
adm/img/theme_img.jpg
Normal file
BIN
adm/img/theme_img.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
@ -52,14 +52,14 @@ $(function() {
|
||||
);
|
||||
});
|
||||
|
||||
$("#add_manual").live("click", function() {
|
||||
$(document).on("click", "#add_manual", function() {
|
||||
var me_name = $.trim($("#me_name").val());
|
||||
var me_link = $.trim($("#me_link").val());
|
||||
|
||||
add_menu_list(me_name, me_link, "<?php echo $code; ?>");
|
||||
});
|
||||
|
||||
$(".add_select").live("click", function() {
|
||||
$(document).on("click", ".add_select", function() {
|
||||
var me_name = $.trim($(this).siblings("input[name='subject[]']").val());
|
||||
var me_link = $.trim($(this).siblings("input[name='link[]']").val());
|
||||
|
||||
|
||||
@ -136,12 +136,12 @@ $colspan = 7;
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$(".btn_add_submenu").live("click", function() {
|
||||
$(document).on("click", ".btn_add_submenu", function() {
|
||||
var code = $(this).closest("tr").find("input[name='code[]']").val().substr(0, 2);
|
||||
add_submenu(code);
|
||||
});
|
||||
|
||||
$(".btn_del_menu").live("click", function() {
|
||||
$(document).on("click", ".btn_del_menu", function() {
|
||||
if(!confirm("메뉴를 삭제하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
|
||||
@ -1,10 +1,17 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
if($type == 'mobile')
|
||||
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$dir;
|
||||
else
|
||||
$skin_dir = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$dir;
|
||||
if($type == 'mobile') {
|
||||
if(preg_match('#^theme/(.+)$#', $dir, $match))
|
||||
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$dir;
|
||||
} else {
|
||||
if(preg_match('#^theme/(.+)$#', $dir, $match))
|
||||
$skin_dir = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$skin_dir = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$dir;
|
||||
}
|
||||
|
||||
echo get_list_skin_options("^list.[0-9]+\.skin\.php", $skin_dir, $sval);
|
||||
?>
|
||||
@ -118,13 +118,21 @@ if(!sql_query(" select ca_mobile_list_row from {$g5['g5_shop_category_table']} l
|
||||
// 스킨 Path
|
||||
if(!$ca['ca_skin_dir'])
|
||||
$g5_shop_skin_path = G5_SHOP_SKIN_PATH;
|
||||
else
|
||||
$g5_shop_skin_path = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_skin_dir'];
|
||||
else {
|
||||
if(preg_match('#^theme/(.+)$#', $ca['ca_skin_dir'], $match))
|
||||
$g5_shop_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$g5_shop_skin_path = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_skin_dir'];
|
||||
}
|
||||
|
||||
if(!$ca['ca_mobile_skin_dir'])
|
||||
$g5_mshop_skin_path = G5_MSHOP_SKIN_PATH;
|
||||
else
|
||||
$g5_mshop_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
|
||||
else {
|
||||
if(preg_match('#^theme/(.+)$#', $ca['ca_mobile_skin_dir'], $match))
|
||||
$g5_mshop_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$g5_mshop_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="fcategoryform" action="./categoryformupdate.php" onsubmit="return fcategoryformcheck(this);" method="post" enctype="multipart/form-data">
|
||||
@ -191,29 +199,13 @@ else
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_skin_dir">PC용 스킨명</label></th>
|
||||
<td colspan="3">
|
||||
<select name="ca_skin_dir" id="ca_skin_dir">
|
||||
<?php
|
||||
$arr = get_skin_dir('shop');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($ca['ca_skin_dir'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_skin_select('shop', 'ca_skin_dir', 'ca_skin_dir', $ca['ca_skin_dir']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_mobile_skin_dir">모바일용 스킨명</label></th>
|
||||
<td colspan="3">
|
||||
<select name="ca_mobile_skin_dir" id="ca_mobile_skin_dir">
|
||||
<?php
|
||||
$arr = get_skin_dir('shop', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($ca['ca_mobile_skin_dir'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_mobile_skin_select('shop', 'ca_mobile_skin_dir', 'ca_mobile_skin_dir', $ca['ca_mobile_skin_dir']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -238,7 +230,7 @@ else
|
||||
<th scope="row"><label for="ca_skin">출력스킨</label></th>
|
||||
<td>
|
||||
<?php echo help('기본으로 제공하는 스킨은 '.str_replace(G5_PATH.'/', '', $g5_shop_skin_path).'/list.*.skin.php 입니다.'); ?>
|
||||
<select id="ca_skin" name="ca_skin">
|
||||
<select id="ca_skin" name="ca_skin" required class="required">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", $g5_shop_skin_path, $ca['ca_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
@ -275,7 +267,7 @@ else
|
||||
<th scope="row"><label for="ca_mobile_skin">모바일 출력스킨</label></th>
|
||||
<td>
|
||||
<?php echo help('기본으로 제공하는 스킨은 '.str_replace(G5_PATH.'/', '', $g5_mshop_skin_path).'/list.*.skin.php 입니다.'); ?>
|
||||
<select id="ca_mobile_skin" name="ca_mobile_skin">
|
||||
<select id="ca_mobile_skin" name="ca_mobile_skin" required class="required">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", $g5_mshop_skin_path, $ca['ca_mobile_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
@ -343,7 +335,7 @@ else
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
<?php echo preg_replace('#</div>$#i', '<button type="button" class="shop_category">테마설정 가져오기</button></div>', $frm_submit); ?>
|
||||
|
||||
<section id="anc_scatefrm_optional">
|
||||
<h2 class="h2_frm">선택 입력</h2>
|
||||
@ -533,6 +525,35 @@ function fcategoryformcheck(f)
|
||||
return true;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$(".shop_category").on("click", function() {
|
||||
if(!confirm("현재 테마의 스킨, 이미지 사이즈 등의 설정을 적용하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "../theme_config_load.php",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: { type: 'shop_category' },
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
$.each(data, function(key, val) {
|
||||
if(key == "error")
|
||||
return true;
|
||||
|
||||
$("#"+key).val(val);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/*document.fcategoryform.ca_name.focus(); 포커스 해제*/
|
||||
</script>
|
||||
|
||||
|
||||
@ -7,19 +7,6 @@ auth_check($auth[$sub_menu], "r");
|
||||
$g5['title'] = '분류관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
// 스킨 DIR
|
||||
$skin_dir = '<option value="">선택</option>'.PHP_EOL;
|
||||
$arr = get_skin_dir('shop');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
$skin_dir .= '<option value="'.$arr[$i].'">'.$arr[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
|
||||
$mskin_dir = '<option value="">선택</option>'.PHP_EOL;
|
||||
$arr = get_skin_dir('shop', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
$mskin_dir .= '<option value="'.$arr[$i].'">'.$arr[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
|
||||
$where = " where ";
|
||||
$sql_search = "";
|
||||
if ($stx != "") {
|
||||
@ -162,13 +149,21 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
|
||||
// 스킨 Path
|
||||
if(!$row['ca_skin_dir'])
|
||||
$g5_shop_skin_path = G5_SHOP_SKIN_PATH;
|
||||
else
|
||||
$g5_shop_skin_path = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$row['ca_skin_dir'];
|
||||
else {
|
||||
if(preg_match('#^theme/(.+)$#', $row['ca_skin_dir'], $match))
|
||||
$g5_shop_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$g5_shop_skin_path = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$row['ca_skin_dir'];
|
||||
}
|
||||
|
||||
if(!$row['ca_mobile_skin_dir'])
|
||||
$g5_mshop_skin_path = G5_MSHOP_SKIN_PATH;
|
||||
else
|
||||
$g5_mshop_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$row['ca_mobile_skin_dir'];
|
||||
else {
|
||||
if(preg_match('#^theme/(.+)$#', $row['ca_mobile_skin_dir'], $match))
|
||||
$g5_mshop_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$g5_mshop_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$row['ca_mobile_skin_dir'];
|
||||
}
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
@ -197,9 +192,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
|
||||
</td>
|
||||
<td headers="sct_pcskin">
|
||||
<label for="ca_skin_dir<?php echo $i; ?>" class="sound_only">PC스킨폴더</label>
|
||||
<select id="ca_skin_dir<?php echo $i; ?>" name="ca_skin_dir[<?php echo $i; ?>]" class="skin_dir">
|
||||
<?php echo conv_selected_option($skin_dir, $row['ca_skin_dir']); ?>
|
||||
</select>
|
||||
<?php echo get_skin_select('shop', 'ca_skin_dir'.$i, 'ca_skin_dir['.$i.']', $row['ca_skin_dir'], 'class="skin_dir"'); ?>
|
||||
<label for="ca_skin<?php echo $i; ?>" class="sound_only">PC스킨파일</label>
|
||||
<select id="ca_skin<?php echo $i; ?>" name="ca_skin[<?php echo $i; ?>]" required class="required">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", $g5_shop_skin_path, $row['ca_skin']); ?>
|
||||
@ -244,9 +237,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
|
||||
</td>
|
||||
<td headers="sct_mskin">
|
||||
<label for="ca_mobile_skin_dir<?php echo $i; ?>" class="sound_only">모바일스킨폴더</label>
|
||||
<select id="ca_mobile_skin_dir<?php echo $i; ?>" name="ca_mobile_skin_dir[<?php echo $i; ?>]" class="skin_dir">
|
||||
<?php echo conv_selected_option($mskin_dir, $row['ca_mobile_skin_dir']); ?>
|
||||
</select>
|
||||
<?php echo get_mobile_skin_select('shop', 'ca_mobile_skin_dir'.$i, 'ca_mobile_skin_dir['.$i.']', $row['ca_mobile_skin_dir'], 'class="skin_dir"'); ?>
|
||||
<label for="ca_mobile_skin<?php echo $i; ?>" class="sound_only">모바일스킨파일</label>
|
||||
<select id="ca_mobile_skin<?php echo $i; ?>" name="ca_mobile_skin[<?php echo $i; ?>]" required class="required">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", $g5_mshop_skin_path, $row['ca_mobile_skin']); ?>
|
||||
|
||||
@ -8,7 +8,7 @@ auth_check($auth[$sub_menu], "r");
|
||||
if (!$config['cf_icode_server_ip']) $config['cf_icode_server_ip'] = '211.172.232.124';
|
||||
if (!$config['cf_icode_server_port']) $config['cf_icode_server_port'] = '7295';
|
||||
|
||||
if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
|
||||
}
|
||||
|
||||
@ -17,7 +17,6 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$pg_anchor = '<ul class="anchor">
|
||||
<li><a href="#anc_scf_info">사업자정보</a></li>
|
||||
<li><a href="#anc_scf_lay">레이아웃 설정</a></li>
|
||||
<li><a href="#anc_scf_skin">스킨설정</a></li>
|
||||
<li><a href="#anc_scf_index">쇼핑몰 초기화면</a></li>
|
||||
<li><a href="#anc_mscf_index">모바일 초기화면</a></li>
|
||||
@ -32,24 +31,12 @@ $frm_submit = '<div class="btn_confirm01 btn_confirm">
|
||||
<a href="'.G5_SHOP_URL.'">쇼핑몰</a>
|
||||
</div>';
|
||||
|
||||
// index 선택 설정 필드추가
|
||||
if(!isset($default['de_root_index_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_root_index_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_admin_info_email` ", true);
|
||||
}
|
||||
|
||||
// 무이자 할부 사용설정 필드 추가
|
||||
if(!isset($default['de_card_noint_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_card_noint_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_card_use` ", true);
|
||||
}
|
||||
|
||||
// 레이아웃 선택 설정 필드추가
|
||||
if(!isset($default['de_shop_layout_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_shop_layout_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_root_index_use` ", true);
|
||||
}
|
||||
|
||||
// 모바일 관련상품 설정 필드추가
|
||||
if(!isset($default['de_mobile_rel_list_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
@ -88,15 +75,6 @@ if(!isset($default['de_inicis_mid'])) {
|
||||
}
|
||||
|
||||
|
||||
// 레이아웃 파일 필드 추가
|
||||
if(!isset($default['de_include_index'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_include_index` varchar(255) NOT NULL DEFAULT '' AFTER `de_admin_info_email`,
|
||||
ADD `de_include_head` varchar(255) NOT NULL DEFAULT '' AFTER `de_include_index`,
|
||||
ADD `de_include_tail` varchar(255) NOT NULL DEFAULT '' AFTER `de_include_head` ", true);
|
||||
|
||||
}
|
||||
|
||||
// 모바일 초기화면 이미지 줄 수 필드 추가
|
||||
if(!isset($default['de_mobile_type1_list_row'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
@ -201,70 +179,6 @@ if(!isset($default['de_mobile_search_list_row'])) {
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
|
||||
<section id="anc_scf_lay">
|
||||
<h2 class="h2_frm">레이아웃 설정</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>기본 설정된 파일 등을 변경할 수 있습니다.</p>
|
||||
</div>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption>레이아웃 설정</caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_include_index">초기화면 파일</label></th>
|
||||
<td>
|
||||
<?php echo help('입력이 없으면 '.G5_SHOP_DIR.'/index.php가 초기화면 파일로 설정됩니다.<br>초기화면 파일은 '.G5_SHOP_DIR.'/index.php 파일과 동일한 위치에 존재해야 합니다.') ?>
|
||||
<input type="text" name="de_include_index" value="<?php echo $default['de_include_index'] ?>" id="de_include_index" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_include_head">상단 파일</label></th>
|
||||
<td>
|
||||
<?php echo help('입력이 없으면 '.G5_SHOP_DIR.'/shop.head.php가 상단 파일로 설정됩니다.<br>상단 파일은 '.G5_SHOP_DIR.'/shop.head.php 파일과 동일한 위치에 존재해야 합니다.') ?>
|
||||
<input type="text" name="de_include_head" value="<?php echo $default['de_include_head'] ?>" id="de_include_head" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_include_tail">하단 파일</label></th>
|
||||
<td>
|
||||
<?php echo help('입력이 없으면 '.G5_SHOP_DIR.'/shop.tail.php가 하단 파일로 설정됩니다.<br>하단 파일은 '.G5_SHOP_DIR.'/shop.tail.php 파일과 동일한 위치에 존재해야 합니다.') ?>
|
||||
<input type="text" name="de_include_tail" value="<?php echo $default['de_include_tail'] ?>" id="de_include_tail" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_root_index_use">루트 index 사용</label></th>
|
||||
<td>
|
||||
<?php echo help('쇼핑몰의 접속경로를 '.G5_SHOP_URL.' 에서 '.G5_URL.' 으로 변경하시려면 사용으로 설정해 주십시오.'); ?>
|
||||
<select name="de_root_index_use" id="de_root_index_use">
|
||||
<option value="0" <?php echo get_selected($default['de_root_index_use'], 0); ?>>사용안함</option>
|
||||
<option value="1" <?php echo get_selected($default['de_root_index_use'], 1); ?>>사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_shop_layout_use">쇼핑몰 레이아웃 사용</label></th>
|
||||
<td>
|
||||
<?php echo help('커뮤니티의 레이아웃을 쇼핑몰과 동일하게 적용하시려면 사용으로 설정해 주십시오.'); ?>
|
||||
<select name="de_shop_layout_use" id="de_shop_layout_use">
|
||||
<option value="0" <?php echo get_selected($default['de_shop_layout_use'], 0); ?>>사용안함</option>
|
||||
<option value="1" <?php echo get_selected($default['de_shop_layout_use'], 1); ?>>사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
|
||||
<section id="anc_scf_skin">
|
||||
<h2 class="h2_frm">스킨설정</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
@ -283,29 +197,13 @@ if(!isset($default['de_mobile_search_list_row'])) {
|
||||
<tr>
|
||||
<th scope="row"><label for="de_shop_skin">PC용 스킨</label></th>
|
||||
<td colspan="3">
|
||||
<select name="de_shop_skin" id="de_shop_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('shop');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($default['de_shop_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_skin_select('shop', 'de_shop_skin', 'de_shop_skin', $default['de_shop_skin'], 'required'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_shop_mobile_skin">모바일용 스킨</label></th>
|
||||
<td colspan="3">
|
||||
<select name="de_shop_mobile_skin" id="de_shop_mobile_skin" required class="required">
|
||||
<?php
|
||||
$arr = get_skin_dir('shop', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($default['de_shop_mobile_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_mobile_skin_select('shop', 'de_shop_mobile_skin', 'de_shop_mobile_skin', $default['de_shop_mobile_skin'], 'required'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -313,7 +211,7 @@ if(!isset($default['de_mobile_search_list_row'])) {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
<?php echo preg_replace('#</div>$#i', '<button type="button" class="get_shop_skin">테마 스킨설정 가져오기</button></div>', $frm_submit); ?>
|
||||
|
||||
<section id="anc_scf_index">
|
||||
<h2 class="h2_frm">쇼핑몰 초기화면</h2>
|
||||
@ -433,7 +331,7 @@ if(!isset($default['de_mobile_search_list_row'])) {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
<?php echo preg_replace('#</div>$#i', '<button type="button" class="shop_pc_index">테마설정 가져오기</button></div>', $frm_submit); ?>
|
||||
|
||||
<section id="anc_mscf_index">
|
||||
<h2 class="h2_frm">모바일 쇼핑몰 초기화면 설정</h2>
|
||||
@ -552,7 +450,7 @@ if(!isset($default['de_mobile_search_list_row'])) {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
<?php echo preg_replace('#</div>$#i', '<button type="button" class="shop_mobile_index">테마설정 가져오기</button></div>', $frm_submit); ?>
|
||||
|
||||
<section id ="anc_scf_payment">
|
||||
<h2 class="h2_frm">결제설정</h2>
|
||||
@ -1203,7 +1101,7 @@ if(!isset($default['de_mobile_search_list_row'])) {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
<?php echo preg_replace('#</div>$#i', '<button type="button" class="shop_etc">테마설정 가져오기</button></div>', $frm_submit); ?>
|
||||
|
||||
<?php if (file_exists($logo_img) || file_exists($logo_img2) || file_exists($mobile_logo_img) || file_exists($mobile_logo_img2)) { ?>
|
||||
<script>
|
||||
@ -1469,7 +1367,74 @@ $(function() {
|
||||
} else {
|
||||
$cf_cardtest_btn.text("테스트결제 팁 더보기");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$(".get_shop_skin").on("click", function() {
|
||||
if(!confirm("현재 테마의 쇼핑몰 스킨 설정을 적용하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "../theme_config_load.php",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: { type: "shop_skin" },
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
var field = Array('de_shop_skin', 'de_shop_mobile_skin');
|
||||
var count = field.length;
|
||||
var key;
|
||||
|
||||
for(i=0; i<count; i++) {
|
||||
key = field[i];
|
||||
|
||||
if(data[key] != undefined && data[key] != "")
|
||||
$("select[name="+key+"]").val(data[key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".shop_pc_index, .shop_mobile_index, .shop_etc").on("click", function() {
|
||||
if(!confirm("현재 테마의 스킨, 이미지 사이즈 등의 설정을 적용하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
var type = $(this).attr("class");
|
||||
var $el;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "../theme_config_load.php",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: { type: type },
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
$.each(data, function(key, val) {
|
||||
if(key == "error")
|
||||
return true;
|
||||
|
||||
$el = $("#"+key);
|
||||
|
||||
if($el[0].type == "checkbox") {
|
||||
$el.attr("checked", parseInt(val) ? true : false);
|
||||
return true;
|
||||
}
|
||||
$el.val(val);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -41,11 +41,6 @@ $sql = " update {$g5['g5_shop_default_table']}
|
||||
de_admin_company_addr = '{$_POST['de_admin_company_addr']}',
|
||||
de_admin_info_name = '{$_POST['de_admin_info_name']}',
|
||||
de_admin_info_email = '{$_POST['de_admin_info_email']}',
|
||||
de_include_index = '{$_POST['de_include_index']}',
|
||||
de_include_head = '{$_POST['de_include_head']}',
|
||||
de_include_tail = '{$_POST['de_include_tail']}',
|
||||
de_root_index_use = '{$_POST['de_root_index_use']}',
|
||||
de_shop_layout_use = '{$_POST['de_shop_layout_use']}',
|
||||
de_shop_skin = '{$_POST['de_shop_skin']}',
|
||||
de_shop_mobile_skin = '{$_POST['de_shop_mobile_skin']}',
|
||||
de_type1_list_use = '{$_POST['de_type1_list_use']}',
|
||||
|
||||
@ -280,7 +280,7 @@ function get_max_value($arr)
|
||||
$option_noti = (int)$row['cnt'];
|
||||
|
||||
// SMS 정보
|
||||
if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
|
||||
}
|
||||
?>
|
||||
|
||||
@ -31,10 +31,6 @@ else
|
||||
$ev['ev_mobile_skin'] = 'list.10.skin.php';
|
||||
$ev['ev_use'] = 1;
|
||||
|
||||
// 1.03.00
|
||||
// 입력일 경우 기본값으로 대체
|
||||
//$ev['ev_img_width'] = $default['de_simg_width'];
|
||||
//$ev['ev_img_height'] = $default['de_simg_height'];
|
||||
$ev['ev_img_width'] = 230;
|
||||
$ev['ev_img_height'] = 230;
|
||||
$ev['ev_list_mod'] = 3;
|
||||
@ -42,6 +38,7 @@ else
|
||||
$ev['ev_mobile_img_width'] = 230;
|
||||
$ev['ev_mobile_img_height'] = 230;
|
||||
$ev['ev_mobile_list_mod'] = 3;
|
||||
$ev['ev_mobile_list_row'] = 5;
|
||||
}
|
||||
|
||||
// 분류리스트
|
||||
@ -62,6 +59,12 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
$category_select .= "<option value=\"{$row['ca_id']}\">$nbsp{$row['ca_name']}</option>\n";
|
||||
}
|
||||
|
||||
// 모바일 1줄당 이미지수 필드 추가
|
||||
if(!sql_query(" select ev_mobile_list_row from {$g5['g5_shop_event_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_event_table']}`
|
||||
ADD `ev_mobile_list_row` int(11) NOT NULL DEFAULT '0' AFTER `ev_mobile_list_mod` ", true);
|
||||
}
|
||||
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
?>
|
||||
|
||||
@ -84,6 +87,7 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
<td>
|
||||
<span class="frm_ev_id"><?php echo $ev_id; ?></span>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/event.php?ev_id=<?php echo $ev['ev_id']; ?>" class="btn_frmline">이벤트바로가기</a>
|
||||
<button type="button" class="btn_frmline shop_event">테마설정 가져오기</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -120,7 +124,7 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_list_mod">1줄당 이미지 수</label></th>
|
||||
<td>
|
||||
<?php echo help("1행에 설정한 값만큼의 상품을 출력합니다. 스킨 설정에 따라 1행에 하나의 상품만 출력할 수도 있습니다.", 50); ?>
|
||||
<?php echo help("1행에 설정한 값만큼의 상품을 출력합니다. 스킨 설정에 따라 1행에 하나의 상품만 출력할 수도 있습니다."); ?>
|
||||
<input type="text" name="ev_list_mod" value="<?php echo $ev['ev_list_mod']; ?>" id="ev_list_mod" required class="required frm_input" size="3"> 개
|
||||
</td>
|
||||
</tr>
|
||||
@ -144,12 +148,19 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_mobile_list_mod">모바일 이미지 수</label></th>
|
||||
<th scope="row"><label for="ev_mobile_list_mod">모바일 1줄당 이미지 수</label></th>
|
||||
<td>
|
||||
<?php echo help("한 페이지에 출력할 이미지 수를 설정합니다."); ?>
|
||||
<?php echo help("1행에 설정한 값만큼의 상품을 출력합니다. 스킨 설정에 따라 1행에 하나의 상품만 출력할 수도 있습니다."); ?>
|
||||
<input type="text" name="ev_mobile_list_mod" value="<?php echo $ev['ev_mobile_list_mod']; ?>" id="ev_mobile_list_mod" required class="required frm_input" size="3"> 개
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_mobile_list_row">모바일 이미지 줄 수</label></th>
|
||||
<td>
|
||||
<?php echo help("한 페이지에 출력할 이미지 줄 수를 설정합니다.\n한 페이지에 표시되는 상품수는 (1줄당 이미지 수 x 줄 수) 입니다."); ?>
|
||||
<input type="text" name="ev_mobile_list_row" value="<?php echo $ev['ev_mobile_list_row']; ?>" id="ev_mobile_list_row" required class="required frm_input" size="3"> 개
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_use">사용</label></th>
|
||||
<td>
|
||||
@ -317,6 +328,33 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$(".shop_event").on("click", function() {
|
||||
if(!confirm("현재 테마의 스킨, 이미지 사이즈 등의 설정을 적용하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "../theme_config_load.php",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: { type: 'shop_event' },
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
$.each(data, function(key, val) {
|
||||
if(key == "error")
|
||||
return true;
|
||||
|
||||
$("#"+key).val(val);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_search_item").click(function() {
|
||||
var ca_id = $("#sch_ca_id").val();
|
||||
var it_name = $.trim($("#sch_name").val());
|
||||
@ -332,7 +370,7 @@ $(function() {
|
||||
);
|
||||
});
|
||||
|
||||
$("#sch_item_list .add_item").live("click", function() {
|
||||
$(document).on("click", "#sch_item_list .add_item", function() {
|
||||
// 이미 등록된 상품인지 체크
|
||||
var $li = $(this).closest("li");
|
||||
var it_id = $li.find("input:hidden").val();
|
||||
@ -363,7 +401,7 @@ $(function() {
|
||||
$li.remove();
|
||||
});
|
||||
|
||||
$("#reg_item_list .del_item").live("click", function() {
|
||||
$(document).on("click", "#reg_item_list .del_item", function() {
|
||||
if(!confirm("상품을 삭제하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ $sql_common = " set ev_skin = '$ev_skin',
|
||||
ev_mobile_img_width = '$ev_mobile_img_width',
|
||||
ev_mobile_img_height= '$ev_mobile_img_height',
|
||||
ev_mobile_list_mod = '$ev_mobile_list_mod',
|
||||
ev_mobile_list_row = '$ev_mobile_list_row',
|
||||
ev_subject = '$ev_subject',
|
||||
ev_head_html = '$ev_head_html',
|
||||
ev_tail_html = '$ev_tail_html',
|
||||
|
||||
@ -231,15 +231,7 @@ if(!sql_query(" select it_skin from {$g5['g5_shop_item_table']} limit 1", false)
|
||||
<tr>
|
||||
<th scope="row"><label for="it_skin">PC용 스킨</label></th>
|
||||
<td colspan="3">
|
||||
<select name="it_skin" id="it_skin">
|
||||
<?php
|
||||
$arr = get_skin_dir('shop');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($it['it_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_skin_select('shop', 'it_skin', 'it_skin', $it['it_skin']); ?>
|
||||
</td>
|
||||
<td class="td_grpset">
|
||||
<input type="checkbox" name="chk_ca_it_skin" value="1" id="chk_ca_it_skin">
|
||||
@ -251,15 +243,7 @@ if(!sql_query(" select it_skin from {$g5['g5_shop_item_table']} limit 1", false)
|
||||
<tr>
|
||||
<th scope="row"><label for="it_mobile_skin">모바일용 스킨</label></th>
|
||||
<td colspan="3">
|
||||
<select name="it_mobile_skin" id="it_mobile_skin">
|
||||
<?php
|
||||
$arr = get_skin_dir('shop', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
if ($i == 0) echo "<option value=\"\">선택</option>";
|
||||
echo "<option value=\"".$arr[$i]."\"".get_selected($it['it_mobile_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php echo get_mobile_skin_select('shop', 'it_mobile_skin', 'it_mobile_skin', $it['it_mobile_skin']); ?>
|
||||
</td>
|
||||
<td class="td_grpset">
|
||||
<input type="checkbox" name="chk_ca_it_mobile_skin" value="1" id="chk_ca_it_mobile_skin">
|
||||
@ -517,7 +501,7 @@ if(!sql_query(" select it_skin from {$g5['g5_shop_item_table']} limit 1", false)
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#it_info_gubun").live("change", function() {
|
||||
$(document).on("change", "#it_info_gubun", function() {
|
||||
var gubun = $(this).val();
|
||||
$.post(
|
||||
"<?php echo G5_ADMIN_URL; ?>/shop_admin/iteminfo.php",
|
||||
@ -819,7 +803,7 @@ $(function(){
|
||||
});
|
||||
|
||||
// 모두선택
|
||||
$("input[name=opt_chk_all]").live("click", function() {
|
||||
$(document).on("click", "input[name=opt_chk_all]", function() {
|
||||
if($(this).is(":checked")) {
|
||||
$("input[name='opt_chk[]']").attr("checked", true);
|
||||
} else {
|
||||
@ -828,7 +812,7 @@ $(function(){
|
||||
});
|
||||
|
||||
// 선택삭제
|
||||
$("#sel_option_delete").live("click", function() {
|
||||
$(document).on("click", "#sel_option_delete", function() {
|
||||
var $el = $("input[name='opt_chk[]']:checked");
|
||||
if($el.size() < 1) {
|
||||
alert("삭제하려는 옵션을 하나 이상 선택해 주십시오.");
|
||||
@ -839,7 +823,7 @@ $(function(){
|
||||
});
|
||||
|
||||
// 일괄적용
|
||||
$("#opt_value_apply").live("click", function() {
|
||||
$(document).on("click", "#opt_value_apply", function() {
|
||||
if($(".opt_com_chk:checked").size() < 1) {
|
||||
alert("일괄 수정할 항목을 하나이상 체크해 주십시오.");
|
||||
return false;
|
||||
@ -982,7 +966,7 @@ $(function(){
|
||||
});
|
||||
|
||||
// 입력필드삭제
|
||||
$("#del_supply_row").live("click", function() {
|
||||
$(document).on("click", "#del_supply_row", function() {
|
||||
$(this).closest("tr").remove();
|
||||
|
||||
supply_sequence();
|
||||
@ -1025,7 +1009,7 @@ $(function(){
|
||||
});
|
||||
|
||||
// 모두선택
|
||||
$("input[name=spl_chk_all]").live("click", function() {
|
||||
$(document).on("click", "input[name=spl_chk_all]", function() {
|
||||
if($(this).is(":checked")) {
|
||||
$("input[name='spl_chk[]']").attr("checked", true);
|
||||
} else {
|
||||
@ -1034,7 +1018,7 @@ $(function(){
|
||||
});
|
||||
|
||||
// 선택삭제
|
||||
$("#sel_supply_delete").live("click", function() {
|
||||
$(document).on("click", "#sel_supply_delete", function() {
|
||||
var $el = $("input[name='spl_chk[]']:checked");
|
||||
if($el.size() < 1) {
|
||||
alert("삭제하려는 옵션을 하나 이상 선택해 주십시오.");
|
||||
@ -1045,7 +1029,7 @@ $(function(){
|
||||
});
|
||||
|
||||
// 일괄적용
|
||||
$("#spl_value_apply").live("click", function() {
|
||||
$(document).on("click", "#spl_value_apply", function() {
|
||||
if($(".spl_com_chk:checked").size() < 1) {
|
||||
alert("일괄 수정할 항목을 하나이상 체크해 주십시오.");
|
||||
return false;
|
||||
@ -1379,7 +1363,7 @@ $(function(){
|
||||
);
|
||||
});
|
||||
|
||||
$("#relation .add_item").live("click", function() {
|
||||
$(document).on("click", "#relation .add_item", function() {
|
||||
// 이미 등록된 상품인지 체크
|
||||
var $li = $(this).closest("li");
|
||||
var it_id = $li.find("input:hidden").val();
|
||||
@ -1410,7 +1394,7 @@ $(function(){
|
||||
$li.remove();
|
||||
});
|
||||
|
||||
$("#reg_relation .del_item").live("click", function() {
|
||||
$(document).on("click", "#reg_relation .del_item", function() {
|
||||
if(!confirm("상품을 삭제하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
@ -1499,7 +1483,7 @@ $(function(){
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#event_list .add_event").live("click", function() {
|
||||
$(document).on("click", "#event_list .add_event", function() {
|
||||
// 이미 등록된 이벤트인지 체크
|
||||
var $li = $(this).closest("li");
|
||||
var ev_id = $li.find("input:hidden").val();
|
||||
@ -1528,7 +1512,7 @@ $(function(){
|
||||
}
|
||||
});
|
||||
|
||||
$("#reg_event_list .del_event").live("click", function() {
|
||||
$(document).on("click", "#reg_event_list .del_event", function() {
|
||||
if(!confirm("상품을 삭제하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ $g5['title'] = "SMS 기본설정";
|
||||
if (!$config['cf_icode_server_ip']) $config['cf_icode_server_ip'] = '211.172.232.124';
|
||||
if (!$config['cf_icode_server_port']) $config['cf_icode_server_port'] = '7295';
|
||||
|
||||
if ($config['cf_icode_id'] && $config['cf_icode_pw'])
|
||||
if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw'])
|
||||
{
|
||||
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
|
||||
}
|
||||
|
||||
80
adm/theme.js
Normal file
80
adm/theme.js
Normal file
@ -0,0 +1,80 @@
|
||||
$(function() {
|
||||
$(".theme_active").on("click", function() {
|
||||
var theme = $(this).data("theme");
|
||||
var name = $(this).data("name");
|
||||
|
||||
if(!confirm(name+" 테마를 적용하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
var set_default_skin = 0;
|
||||
if($(this).data("set_default_skin") == true) {
|
||||
if(confirm("기본환경설정, 1:1문의, 쇼핑몰 스킨을 테마에서 설정된 스킨으로 변경하시겠습니까?\n\n변경을 선택하시면 테마에서 지정된 스킨으로 회원스킨 등이 변경됩니다."))
|
||||
set_default_skin = 1;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./theme_update.php",
|
||||
data: {
|
||||
"theme": theme,
|
||||
"set_default_skin": set_default_skin
|
||||
},
|
||||
cache: false,
|
||||
async: false,
|
||||
success: function(data) {
|
||||
if(data) {
|
||||
alert(data);
|
||||
return false;
|
||||
}
|
||||
|
||||
document.location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".theme_deactive").on("click", function() {
|
||||
var theme = $(this).data("theme");
|
||||
var name = $(this).data("name");
|
||||
|
||||
if(!confirm(name+" 테마 사용설정을 해제하시겠습니까?\n\n테마 설정을 해제하셔도 게시판 등의 스킨은 변경되지 않으므로 개별 변경작업이 필요합니다."))
|
||||
return false;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./theme_update.php",
|
||||
data: {
|
||||
"theme": theme,
|
||||
"type": "reset"
|
||||
},
|
||||
cache: false,
|
||||
async: false,
|
||||
success: function(data) {
|
||||
if(data) {
|
||||
alert(data);
|
||||
return false;
|
||||
}
|
||||
|
||||
document.location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".theme_preview").on("click", function() {
|
||||
var theme = $(this).data("theme");
|
||||
|
||||
$("#theme_detail").remove();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./theme_detail.php",
|
||||
data: {
|
||||
"theme": theme
|
||||
},
|
||||
cache: false,
|
||||
async: false,
|
||||
success: function(data) {
|
||||
$("#theme_list").after(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
77
adm/theme.php
Normal file
77
adm/theme.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
$sub_menu = "100280";
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($is_admin != 'super')
|
||||
alert('최고관리자만 접근 가능합니다.');
|
||||
|
||||
// 테마 필드 추가
|
||||
if(!isset($config['cf_theme'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_theme` varchar(255) NOT NULL DEFAULT '' AFTER `cf_title` ", true);
|
||||
}
|
||||
|
||||
$theme = get_theme_dir();
|
||||
if($config['cf_theme'] && in_array($config['cf_theme'], $theme))
|
||||
array_unshift($theme, $config['cf_theme']);
|
||||
$theme = array_values(array_unique($theme));
|
||||
$total_count = count($theme);
|
||||
|
||||
// 설정된 테마가 존재하지 않는다면 cf_theme 초기화
|
||||
if($config['cf_theme'] && !in_array($config['cf_theme'], $theme))
|
||||
sql_query(" update {$g5['config_table']} set cf_theme = '' ");
|
||||
|
||||
$g5['title'] = "테마설정";
|
||||
include_once('./admin.head.php');
|
||||
?>
|
||||
|
||||
<script src="<?php echo G5_ADMIN_URL; ?>/theme.js"></script>
|
||||
|
||||
<p class="theme_p">설치된 테마 : <?php echo number_format($total_count); ?></p>
|
||||
|
||||
<?php if($total_count > 0) { ?>
|
||||
<ul id="theme_list">
|
||||
<?php
|
||||
for($i=0; $i<$total_count; $i++) {
|
||||
$info = get_theme_info($theme[$i]);
|
||||
|
||||
$name = get_text($info['theme_name']);
|
||||
if($info['screenshot'])
|
||||
$screenshot = '<img src="'.$info['screenshot'].'" alt="'.$name.'">';
|
||||
else
|
||||
$screenshot = '<img src="'.G5_ADMIN_URL.'/img/theme_img.jpg" alt="">';
|
||||
|
||||
if($config['cf_theme'] == $theme[$i]) {
|
||||
$btn_active = '<span class="theme_sl theme_sl_use">사용중</span><button type="button" class="theme_sl theme_deactive" data-theme="'.$theme[$i].'" '.'data-name="'.$name.'">사용안함</button>';
|
||||
} else {
|
||||
$tconfig = get_theme_config_value($theme[$i], 'set_default_skin');
|
||||
if($tconfig['set_default_skin'])
|
||||
$set_default_skin = 'true';
|
||||
else
|
||||
$set_default_skin = 'false';
|
||||
|
||||
$btn_active = '<button type="button" class="theme_sl theme_active" data-theme="'.$theme[$i].'" '.'data-name="'.$name.'" data-set_default_skin="'.$set_default_skin.'">테마적용</button>';
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<div class="tmli_if">
|
||||
<?php echo $screenshot; ?>
|
||||
<div class="tmli_tit">
|
||||
<p><?php echo get_text($info['theme_name']); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo $btn_active; ?>
|
||||
<a href="./theme_preview.php?theme=<?php echo $theme[$i]; ?>" class="theme_pr" target="theme_preview">미리보기</a>
|
||||
<button type="button" class="tmli_dt theme_preview" data-theme="<?php echo $theme[$i]; ?>">상세보기</button>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php } else { ?>
|
||||
<p class="no_theme">설치된 테마가 없습니다.</p>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
include_once ('./admin.tail.php');
|
||||
?>
|
||||
184
adm/theme_config_load.php
Normal file
184
adm/theme_config_load.php
Normal file
@ -0,0 +1,184 @@
|
||||
<?php
|
||||
$sub_menu = "300100";
|
||||
include_once('./_common.php');
|
||||
include_once(G5_LIB_PATH.'/json.lib.php');
|
||||
|
||||
$data = array();
|
||||
$data['error'] = '';
|
||||
|
||||
$data['error'] = auth_check($auth[$sub_menu], 'w', true);
|
||||
if($data['error'])
|
||||
die(json_encode($data));
|
||||
|
||||
if(!$config['cf_theme']) {
|
||||
$data['error'] = '사용 중인 테마가 없습니다.';
|
||||
die(json_encode($data));
|
||||
}
|
||||
|
||||
$theme_dir = get_theme_dir();
|
||||
if(!in_array($config['cf_theme'], $theme_dir)) {
|
||||
$data['error'] = $config['cf_theme'].' 테마는 설치된 테마가 아닙니다.';
|
||||
die(json_encode($data));
|
||||
}
|
||||
|
||||
$type = $_POST['type'];
|
||||
$arr_type = array('board', 'conf_skin', 'conf_member', 'shop_skin', 'shop_pc_index', 'shop_mobile_index', 'shop_etc', 'shop_event', 'shop_category');
|
||||
if(!in_array($type, $arr_type)) {
|
||||
$data['error'] = '올바른 방법으로 이용해 주십시오.';
|
||||
die(json_encode($data));
|
||||
}
|
||||
|
||||
if($type == 'board') {
|
||||
$keys = array('bo_gallery_cols', 'bo_gallery_width', 'bo_gallery_height', 'bo_mobile_gallery_width', 'bo_mobile_gallery_height', 'bo_image_width');
|
||||
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
|
||||
|
||||
$i = 0;
|
||||
foreach($keys as $val) {
|
||||
if($tconfig[$val]) {
|
||||
$data[$val] = (int)preg_replace('#[^0-9]#', '', $tconfig[$val]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
$data['error'] = '적용할 게시판 이미지 설정이 없습니다.';
|
||||
} else if($type == 'conf_skin') {
|
||||
$keys = array('cf_new_skin', 'cf_mobile_new_skin', 'cf_search_skin', 'cf_mobile_search_skin', 'cf_connect_skin', 'cf_mobile_connect_skin', 'cf_faq_skin', 'cf_mobile_faq_skin');
|
||||
|
||||
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
|
||||
|
||||
$i = 0;
|
||||
foreach($keys as $val) {
|
||||
if($tconfig[$val]) {
|
||||
$data[$val] = preg_match('#^theme/.+$#', $tconfig[$val]) ? $tconfig[$val] : 'theme/'.$tconfig[$val];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
$data['error'] = '적용할 기본환경 스킨 설정이 없습니다.';
|
||||
} else if($type == 'conf_member') {
|
||||
$keys = array('cf_member_skin', 'cf_mobile_member_skin');
|
||||
|
||||
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
|
||||
|
||||
$i = 0;
|
||||
foreach($keys as $val) {
|
||||
if($tconfig[$val]) {
|
||||
$data[$val] = preg_match('#^theme/.+$#', $tconfig[$val]) ? $tconfig[$val] : 'theme/'.$tconfig[$val];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
$data['error'] = '적용할 기본환경 회원스킨 설정이 없습니다.';
|
||||
} else if($type == 'shop_skin') {
|
||||
$keys = array('de_shop_skin', 'de_shop_mobile_skin');
|
||||
|
||||
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
|
||||
|
||||
$i = 0;
|
||||
foreach($keys as $val) {
|
||||
if($tconfig[$val]) {
|
||||
$data[$val] = preg_match('#^theme/.+$#', $tconfig[$val]) ? $tconfig[$val] : 'theme/'.$tconfig[$val];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
$data['error'] = '적용할 쇼핑몰 스킨 설정이 없습니다.';
|
||||
} else if($type == 'shop_pc_index') {
|
||||
$keys = array();
|
||||
for($i=1; $i<=5; $i++) {
|
||||
$keys[] = 'de_type'.$i.'_list_use';
|
||||
$keys[] = 'de_type'.$i.'_list_skin';
|
||||
$keys[] = 'de_type'.$i.'_list_mod';
|
||||
$keys[] = 'de_type'.$i.'_list_row';
|
||||
$keys[] = 'de_type'.$i.'_img_width';
|
||||
$keys[] = 'de_type'.$i.'_img_height';
|
||||
}
|
||||
|
||||
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
|
||||
|
||||
$i = 0;
|
||||
foreach($keys as $val) {
|
||||
if(strlen($tconfig[$val])) {
|
||||
$data[$val] = trim($tconfig[$val]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
$data['error'] = '적용할 테마 설정이 없습니다.';
|
||||
} else if($type == 'shop_mobile_index') {
|
||||
$keys = array();
|
||||
for($i=1; $i<=5; $i++) {
|
||||
$keys[] = 'de_mobile_type'.$i.'_list_use';
|
||||
$keys[] = 'de_mobile_type'.$i.'_list_skin';
|
||||
$keys[] = 'de_mobile_type'.$i.'_list_mod';
|
||||
$keys[] = 'de_mobile_type'.$i.'_list_row';
|
||||
$keys[] = 'de_mobile_type'.$i.'_img_width';
|
||||
$keys[] = 'de_mobile_type'.$i.'_img_height';
|
||||
}
|
||||
|
||||
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
|
||||
|
||||
$i = 0;
|
||||
foreach($keys as $val) {
|
||||
if(strlen($tconfig[$val])) {
|
||||
$data[$val] = trim($tconfig[$val]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
$data['error'] = '적용할 테마 설정이 없습니다.';
|
||||
} else if($type == 'shop_etc') {
|
||||
$keys = array('de_rel_list_use', 'de_rel_list_skin', 'de_rel_list_mod', 'de_rel_img_width', 'de_rel_img_height', 'de_mobile_rel_list_use', 'de_mobile_rel_list_skin', 'de_mobile_rel_list_mod', 'de_mobile_rel_img_width', 'de_mobile_rel_img_height', 'de_search_list_skin', 'de_search_list_mod', 'de_search_list_row', 'de_search_img_width', 'de_search_img_height', 'de_mobile_search_list_skin', 'de_mobile_search_list_mod', 'de_mobile_search_list_row', 'de_mobile_search_img_width', 'de_mobile_search_img_height', 'de_mimg_width', 'de_mimg_height');
|
||||
|
||||
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
|
||||
|
||||
$i = 0;
|
||||
foreach($keys as $val) {
|
||||
if(strlen($tconfig[$val])) {
|
||||
$data[$val] = trim($tconfig[$val]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
$data['error'] = '적용할 테마 설정이 없습니다.';
|
||||
} else if($type == 'shop_event') {
|
||||
$keys = array('ev_skin', 'ev_img_width', 'ev_img_height', 'ev_list_mod', 'ev_list_row', 'ev_mobile_skin', 'ev_mobile_img_width', 'ev_mobile_img_height', 'ev_mobile_list_mod', 'ev_mobile_list_row');
|
||||
|
||||
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
|
||||
|
||||
$i = 0;
|
||||
foreach($keys as $val) {
|
||||
if(strlen($tconfig[$val])) {
|
||||
$data[$val] = trim($tconfig[$val]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
$data['error'] = '적용할 테마 설정이 없습니다.';
|
||||
} else if($type == 'shop_category') {
|
||||
$keys = array('ca_skin', 'ca_img_width', 'ca_img_height', 'ca_list_mod', 'ca_list_row', 'ca_mobile_skin', 'ca_mobile_img_width', 'ca_mobile_img_height', 'ca_mobile_list_mod', 'ca_mobile_list_row');
|
||||
|
||||
$tconfig = get_theme_config_value($config['cf_theme'], implode(',', $keys));
|
||||
|
||||
$i = 0;
|
||||
foreach($keys as $val) {
|
||||
if(strlen($tconfig[$val])) {
|
||||
$data[$val] = trim($tconfig[$val]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 0)
|
||||
$data['error'] = '적용할 테마 설정이 없습니다.';
|
||||
}
|
||||
|
||||
die(json_encode($data));
|
||||
?>
|
||||
64
adm/theme_detail.php
Normal file
64
adm/theme_detail.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
$sub_menu = "100280";
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($is_admin != 'super')
|
||||
die('최고관리자만 접근 가능합니다.');
|
||||
|
||||
$theme = trim($_POST['theme']);
|
||||
$theme_dir = get_theme_dir();
|
||||
|
||||
if(!in_array($theme, $theme_dir))
|
||||
die('선택하신 테마가 설치되어 있지 않습니다.');
|
||||
|
||||
$info = get_theme_info($theme);
|
||||
|
||||
if($info['screenshot'])
|
||||
$screenshot = '<img src="'.$info['screenshot'].'" alt="'.$name.'">';
|
||||
else
|
||||
$screenshot = '<img src="'.G5_ADMIN_URL.'/img/theme_img.jpg" alt="">';
|
||||
|
||||
$name = get_text($info['theme_name']);
|
||||
if($info['theme_uri']) {
|
||||
$name = '<a href="'.set_http($info['theme_uri']).'" target="_blank" class="thdt_home">'.$name.'</a>';
|
||||
}
|
||||
|
||||
$maker = get_text($info['maker']);
|
||||
if($info['maker_uri']) {
|
||||
$maker = '<a href="'.set_http($info['maker_uri']).'" target="_blank" class="thdt_home">'.$maker.'</a>';
|
||||
}
|
||||
|
||||
$license = get_text($info['license']);
|
||||
if($info['license_uri']) {
|
||||
$license = '<a href="'.set_http($info['license_uri']).'" target="_blank" class="thdt_home">'.$license.'</a>';
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="theme_detail">
|
||||
<div class="thdt_img"><?php echo $screenshot; ?></div>
|
||||
<div class="thdt_if">
|
||||
<h2><?php echo $name; ?></h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th scope="row">Version</th>
|
||||
<td><?php echo get_text($info['version']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Maker</th>
|
||||
<td><?php echo $maker; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">License</th>
|
||||
<td><?php echo $license; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><?php echo get_text($info['detail']); ?></p>
|
||||
<button type="button" class="close_btn">닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(".close_btn").on("click", function() {
|
||||
$("#theme_detail").remove();
|
||||
});
|
||||
</script>
|
||||
178
adm/theme_preview.php
Normal file
178
adm/theme_preview.php
Normal file
@ -0,0 +1,178 @@
|
||||
<?php
|
||||
$sub_menu = "100280";
|
||||
define('_THEME_PREVIEW_', true);
|
||||
include_once('./_common.php');
|
||||
|
||||
$theme_dir = get_theme_dir();
|
||||
|
||||
if(!$theme || !in_array($theme, $theme_dir))
|
||||
alert_close('테마가 존재하지 않거나 올바르지 않습니다.');
|
||||
|
||||
$info = get_theme_info($theme);
|
||||
|
||||
$arr_mode = array('index', 'list', 'view', 'shop', 'ca_list', 'item');
|
||||
$mode = substr(strip_tags($_GET['mode']), 0, 20);
|
||||
if(!in_array($mode, $arr_mode))
|
||||
$mode = 'index';
|
||||
|
||||
if(G5_COMMUNITY_USE === false || $mode == 'shop' || $mode == 'ca_list' || $mode == 'item')
|
||||
define('_SHOP_', true);
|
||||
|
||||
$qstr_index = '&mode=index';
|
||||
$qstr_list = '&mode=list';
|
||||
$qstr_view = '&mode=view';
|
||||
$qstr_shop = '&mode=shop';
|
||||
$qstr_ca_list = '&mode=ca_list';
|
||||
$qstr_item = '&mode=item';
|
||||
$qstr_device = '&mode='.$mode.'&device='.(G5_IS_MOBILE ? 'pc' : 'mobile');
|
||||
|
||||
$sql = " select bo_table, wr_parent from {$g5['board_new_table']} order by bn_id desc limit 1 ";
|
||||
$row = sql_fetch($sql);
|
||||
$bo_table = $row['bo_table'];
|
||||
$board = sql_fetch(" select * from {$g5['board_table']} where bo_table = '$bo_table' ");
|
||||
$write_table = $g5['write_prefix'] . $bo_table;
|
||||
|
||||
// theme.config.php 미리보기 게시판 스킨이 설정돼 있다면
|
||||
$tconfig = get_theme_config_value($theme, 'set_default_skin, preview_board_skin, preview_mobile_board_skin, de_shop_skin, de_shop_mobile_skin');
|
||||
if($mode == 'list' || $mode == 'view') {
|
||||
if($tconfig['preview_board_skin'])
|
||||
$board['bo_skin'] = preg_match('#^theme/.+$#', $tconfig['preview_board_skin']) ? $tconfig['preview_board_skin'] : 'theme/'.$tconfig['preview_board_skin'];
|
||||
|
||||
if($tconfig['preview_mobile_board_skin'])
|
||||
$board['bo_mobile_skin'] = preg_match('#^theme/.+$#', $tconfig['preview_mobile_board_skin']) ? $tconfig['preview_mobile_board_skin'] : 'theme/'.$tconfig['preview_mobile_board_skin'];
|
||||
}
|
||||
|
||||
// 스킨경로
|
||||
if (G5_IS_MOBILE) {
|
||||
$board_skin_path = get_skin_path('board', $board['bo_mobile_skin']);
|
||||
$board_skin_url = get_skin_url('board', $board['bo_mobile_skin']);
|
||||
$member_skin_path = get_skin_path('member', $config['cf_mobile_member_skin']);
|
||||
$member_skin_url = get_skin_url('member', $config['cf_mobile_member_skin']);
|
||||
$new_skin_path = get_skin_path('new', $config['cf_mobile_new_skin']);
|
||||
$new_skin_url = get_skin_url('new', $config['cf_mobile_new_skin']);
|
||||
$search_skin_path = get_skin_path('search', $config['cf_mobile_search_skin']);
|
||||
$search_skin_url = get_skin_url('search', $config['cf_mobile_search_skin']);
|
||||
$connect_skin_path = get_skin_path('connect', $config['cf_mobile_connect_skin']);
|
||||
$connect_skin_url = get_skin_url('connect', $config['cf_mobile_connect_skin']);
|
||||
$faq_skin_path = get_skin_path('faq', $config['cf_mobile_faq_skin']);
|
||||
$faq_skin_url = get_skin_url('faq', $config['cf_mobile_faq_skin']);
|
||||
} else {
|
||||
$board_skin_path = get_skin_path('board', $board['bo_skin']);
|
||||
$board_skin_url = get_skin_url('board', $board['bo_skin']);
|
||||
$member_skin_path = get_skin_path('member', $config['cf_member_skin']);
|
||||
$member_skin_url = get_skin_url('member', $config['cf_member_skin']);
|
||||
$new_skin_path = get_skin_path('new', $config['cf_new_skin']);
|
||||
$new_skin_url = get_skin_url('new', $config['cf_new_skin']);
|
||||
$search_skin_path = get_skin_path('search', $config['cf_search_skin']);
|
||||
$search_skin_url = get_skin_url('search', $config['cf_search_skin']);
|
||||
$connect_skin_path = get_skin_path('connect', $config['cf_connect_skin']);
|
||||
$connect_skin_url = get_skin_url('connect', $config['cf_connect_skin']);
|
||||
$faq_skin_path = get_skin_path('faq', $config['cf_faq_skin']);
|
||||
$faq_skin_url = get_skin_url('faq', $config['cf_faq_skin']);
|
||||
}
|
||||
|
||||
// 쇼핑몰 스킨 재설정
|
||||
if($tconfig['de_shop_skin'])
|
||||
$default['de_shop_skin'] = preg_match('#^theme/.+$#', $tconfig['de_shop_skin']) ? $tconfig['de_shop_skin'] : 'theme/'.$tconfig['de_shop_skin'];
|
||||
|
||||
if($tconfig['de_shop_mobile_skin'])
|
||||
$default['de_shop_mobile_skin'] = preg_match('#^theme/.+$#', $tconfig['de_shop_mobile_skin']) ? $tconfig['de_shop_mobile_skin'] : 'theme/'.$tconfig['de_shop_mobile_skin'];
|
||||
|
||||
// 테마 경로 설정
|
||||
if(defined('G5_THEME_PATH')) {
|
||||
define('G5_THEME_SHOP_PATH', G5_THEME_PATH.'/'.G5_SHOP_DIR);
|
||||
define('G5_THEME_SHOP_URL', G5_THEME_URL.'/'.G5_SHOP_DIR);
|
||||
define('G5_THEME_MSHOP_PATH', G5_THEME_PATH.'/'.G5_MOBILE_DIR.'/'.G5_SHOP_DIR);
|
||||
define('G5_THEME_MSHOP_URL', G5_THEME_URL.'/'.G5_MOBILE_DIR.'/'.G5_SHOP_DIR);
|
||||
}
|
||||
|
||||
// 스킨 경로 설정
|
||||
if(preg_match('#^theme/(.+)$#', $default['de_shop_skin'], $match)) {
|
||||
define('G5_SHOP_SKIN_PATH', G5_THEME_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1]);
|
||||
define('G5_SHOP_SKIN_URL', G5_THEME_URL .'/'.G5_SKIN_DIR.'/shop/'.$match[1]);
|
||||
} else {
|
||||
define('G5_SHOP_SKIN_PATH', G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$default['de_shop_skin']);
|
||||
define('G5_SHOP_SKIN_URL', G5_URL .'/'.G5_SKIN_DIR.'/shop/'.$default['de_shop_skin']);
|
||||
}
|
||||
|
||||
if(preg_match('#^theme/(.+)$#', $default['de_shop_mobile_skin'], $match)) {
|
||||
define('G5_MSHOP_SKIN_PATH', G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1]);
|
||||
define('G5_MSHOP_SKIN_URL', G5_THEME_URL .'/'.G5_MOBILE_DIR.'/'.G5_SKIN_DIR.'/shop/'.$match[1]);
|
||||
} else {
|
||||
define('G5_MSHOP_SKIN_PATH', G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']);
|
||||
define('G5_MSHOP_SKIN_URL', G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']);
|
||||
}
|
||||
|
||||
$conf = sql_fetch(" select cf_theme from {$g5['config_table']} ");
|
||||
$name = get_text($info['theme_name']);
|
||||
if($conf['cf_theme'] != $theme) {
|
||||
if($tconfig['set_default_skin'])
|
||||
$set_default_skin = 'true';
|
||||
else
|
||||
$set_default_skin = 'false';
|
||||
|
||||
$btn_active = '<li><button type="button" class="theme_sl theme_active" data-theme="'.$theme.'" '.'data-name="'.$name.'" data-set_default_skin="'.$set_default_skin.'">테마적용</button></li>';
|
||||
} else {
|
||||
$btn_active = '';
|
||||
}
|
||||
|
||||
$g5['title'] = get_text($info['theme_name']).' 테마 미리보기';
|
||||
require_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo G5_ADMIN_URL; ?>/css/theme.css">
|
||||
<script src="<?php echo G5_ADMIN_URL; ?>/theme.js"></script>
|
||||
|
||||
<section id="preview_item">
|
||||
<ul>
|
||||
<li><a href="./theme_preview.php?theme=<?php echo $theme.$qstr_index; ?>">인덱스 화면</a></li>
|
||||
<li><a href="./theme_preview.php?theme=<?php echo $theme.$qstr_list; ?>">게시글 리스트</a></li>
|
||||
<li><a href="./theme_preview.php?theme=<?php echo $theme.$qstr_view; ?>">게시글 보기</a></li>
|
||||
<?php if(defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
|
||||
<?php if(G5_COMMUNITY_USE) { ?>
|
||||
<li><a href="./theme_preview.php?theme=<?php echo $theme.$qstr_shop; ?>">쇼핑몰</a></li>
|
||||
<?php } ?>
|
||||
<li><a href="./theme_preview.php?theme=<?php echo $theme.$qstr_ca_list; ?>">상품리스트</a></li>
|
||||
<li><a href="./theme_preview.php?theme=<?php echo $theme.$qstr_item; ?>">상품상세</a></li>
|
||||
<?php } ?>
|
||||
<li><a href="./theme_preview.php?theme=<?php echo $theme.$qstr_device; ?>"><?php echo (G5_IS_MOBILE ? 'PC 버전' : '모바일 버전'); ?></a></li>
|
||||
<?php echo $btn_active; ?>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section id="preview_content">
|
||||
<?php
|
||||
switch($mode) {
|
||||
case 'list':
|
||||
include(G5_BBS_PATH.'/board.php');
|
||||
break;
|
||||
case 'view':
|
||||
$wr_id = $row['wr_parent'];
|
||||
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
|
||||
include(G5_BBS_PATH.'/board.php');
|
||||
break;
|
||||
case 'shop':
|
||||
include(G5_SHOP_PATH.'/index.php');
|
||||
break;
|
||||
case 'ca_list':
|
||||
$sql = " select ca_id from {$g5['g5_shop_category_table']} where ca_use = '1' order by ca_id limit 1 ";
|
||||
$tmp = sql_fetch($sql);
|
||||
$ca_id = $tmp['ca_id'];
|
||||
include(G5_SHOP_PATH.'/list.php');
|
||||
break;
|
||||
case 'item':
|
||||
$sql = " select it_id from {$g5['g5_shop_item_table']} where it_use = '1' order by it_id desc limit 1 ";
|
||||
$tmp = sql_fetch($sql);
|
||||
$_GET['it_id'] = $tmp['it_id'];
|
||||
include(G5_SHOP_PATH.'/item.php');
|
||||
break;
|
||||
default:
|
||||
include(G5_PATH.'/index.php');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</section>
|
||||
|
||||
<?php
|
||||
require_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
90
adm/theme_update.php
Normal file
90
adm/theme_update.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
$sub_menu = "100280";
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($is_admin != 'super')
|
||||
die('최고관리자만 접근 가능합니다.');
|
||||
|
||||
$theme = trim($_POST['theme']);
|
||||
$theme_dir = get_theme_dir();
|
||||
|
||||
if($_POST['type'] == 'reset') {
|
||||
$sql = " update {$g5['config_table']} set cf_theme = '' ";
|
||||
sql_query($sql);
|
||||
die('');
|
||||
}
|
||||
|
||||
if(!in_array($theme, $theme_dir))
|
||||
die('선택하신 테마가 설치되어 있지 않습니다.');
|
||||
|
||||
// 테마적용
|
||||
$sql = " update {$g5['config_table']} set cf_theme = '$theme' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 테마 설정 스킨 적용
|
||||
if($_POST['set_default_skin'] == 1) {
|
||||
$keys = 'set_default_skin, cf_member_skin, cf_mobile_member_skin, cf_new_skin, cf_mobile_new_skin, cf_search_skin, cf_mobile_search_skin, cf_connect_skin, cf_mobile_connect_skin, cf_faq_skin, cf_mobile_faq_skin, qa_skin, qa_mobile_skin, de_shop_skin, de_shop_mobile_skin';
|
||||
|
||||
$tconfig = get_theme_config_value($theme, $keys);
|
||||
|
||||
if($tconfig['set_default_skin']) {
|
||||
$sql_common = array();
|
||||
$qa_sql_common = array();
|
||||
$de_sql_common = array();
|
||||
|
||||
foreach($tconfig as $key => $val) {
|
||||
if(preg_match('#^qa_.+$#', $key)) {
|
||||
if($val) {
|
||||
if(!preg_match('#^theme/.+$#', $val))
|
||||
$val = 'theme/'.$val;
|
||||
|
||||
$qa_sql_common[] = " $key = '$val' ";
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if(preg_match('#^de_.+$#', $key)) {
|
||||
if(!isset($default[$key]))
|
||||
continue;
|
||||
|
||||
if($val) {
|
||||
if(!preg_match('#^theme/.+$#', $val))
|
||||
$val = 'theme/'.$val;
|
||||
|
||||
$de_sql_common[] = " $key = '$val' ";
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!isset($config[$key]))
|
||||
continue;
|
||||
|
||||
if($val) {
|
||||
if(!preg_match('#^theme/.+$#', $val))
|
||||
$val = 'theme/'.$val;
|
||||
|
||||
$sql_common[] = " $key = '$val' ";
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($sql_common)) {
|
||||
$sql = " update {$g5['config_table']} set " . implode(', ', $sql_common);
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if(!empty($qa_sql_common)) {
|
||||
$sql = " update {$g5['qa_config_table']} set " . implode(', ', $qa_sql_common);
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if(!empty($de_sql_common)) {
|
||||
$sql = " update {$g5['g5_shop_default_table']} set " . implode(', ', $de_sql_common);
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
die('');
|
||||
?>
|
||||
210
adm/write_count.php
Normal file
210
adm/write_count.php
Normal file
@ -0,0 +1,210 @@
|
||||
<?php
|
||||
$sub_menu = '300820';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], 'r');
|
||||
|
||||
// http://www.jqplot.com/
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_PLUGIN_URL.'/jqplot/jquery.jqplot.css">', 0);
|
||||
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/jquery.jqplot.js"></script>', 0);
|
||||
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/plugins/jqplot.canvasTextRenderer.min.js"></script>', 0);
|
||||
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/plugins/jqplot.categoryAxisRenderer.min.js"></script>', 0);
|
||||
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/plugins/jqplot.pointLabels.min.js"></script>', 0);
|
||||
add_javascript('<!--[if lt IE 9]><script src="'.G5_PLUGIN_URL.'/jqplot/excanvas.js"></script><![endif]-->', 0);
|
||||
|
||||
if (!($graph == 'line' || $graph == 'bar'))
|
||||
$graph = 'line';
|
||||
|
||||
if ($graph == 'bar') {
|
||||
// 바 타입으로 사용하는 코드입니다.
|
||||
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/jqplot.barRenderer.min.js"></script>', 0);
|
||||
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/jqplot.categoryAxisRenderer.min.js"></script>', 0);
|
||||
add_javascript('<script src="'.G5_PLUGIN_URL.'/jqplot/jqplot.pointLabels.min.js"></script>', 0);
|
||||
}
|
||||
|
||||
$g5['title'] = '글,댓글 현황';
|
||||
include_once ('./admin.head.php');
|
||||
|
||||
$period_array = array(
|
||||
'오늘'=>array('시간', 0),
|
||||
'어제'=>array('시간', 0),
|
||||
'7일전'=>array('일', 7),
|
||||
'14일전'=>array('일', 14),
|
||||
'30일전'=>array('일', 30),
|
||||
'3개월전'=>array('주', 90),
|
||||
'6개월전'=>array('주', 180),
|
||||
'1년전'=>array('월', 365),
|
||||
'2년전'=>array('월', 365*2),
|
||||
'3년전'=>array('월', 365*3),
|
||||
'5년전'=>array('년', 365*5),
|
||||
'10년전'=>array('년', 365*10),
|
||||
);
|
||||
|
||||
$is_period = false;
|
||||
foreach($period_array as $key=>$value) {
|
||||
if ($key == $period) {
|
||||
$is_period = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$is_period)
|
||||
$period = '오늘';
|
||||
|
||||
$day = $period_array[$period][0];
|
||||
|
||||
$today = date('Y-m-d', G5_SERVER_TIME);
|
||||
$yesterday = date('Y-m-d', G5_SERVER_TIME - 86400);
|
||||
|
||||
if ($period == '오늘') {
|
||||
$from = $today;
|
||||
$to = $from;
|
||||
} else if ($period == '어제') {
|
||||
$from = $yesterday;
|
||||
$to = $from;
|
||||
} else if ($period == '내일') {
|
||||
$from = date('Y-m-d', G5_SERVER_TIME + (86400 * 2));
|
||||
$to = $from;
|
||||
} else {
|
||||
$from = date('Y-m-d', G5_SERVER_TIME - (86400 * $period_array[$period][1]));
|
||||
$to = $yesterday;
|
||||
}
|
||||
|
||||
$sql_bo_table = '';
|
||||
if ($bo_table)
|
||||
$sql_bo_table = "and bo_table = '$bo_table'";
|
||||
|
||||
switch ($day) {
|
||||
case '시간' :
|
||||
$sql = " select substr(bn_datetime,6,8) as hours, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by hours order by bn_datetime ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
// 월-일 시간
|
||||
$line1[] = "['".substr($row['hours'],0,8)."',".$row['wcount'].']';
|
||||
$line2[] = "['".substr($row['hours'],0,8)."',".$row['ccount'].']';
|
||||
}
|
||||
break;
|
||||
case '일' :
|
||||
$sql = " select substr(bn_datetime,1,10) as days, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by days order by bn_datetime ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
// 월-일
|
||||
$line1[] = "['".substr($row['days'],5,5)."',".$row['wcount'].']';
|
||||
$line2[] = "['".substr($row['days'],5,5)."',".$row['ccount'].']';
|
||||
}
|
||||
break;
|
||||
case '주' :
|
||||
$sql = " select concat(substr(bn_datetime,1,4), '-', weekofyear(bn_datetime)) as weeks, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by weeks order by bn_datetime ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
// 올해의 몇주로 보여주면 바로 확인이 안되므로 주를 날짜로 바꾼다.
|
||||
// 년-월-일
|
||||
list($lyear, $lweek) = explode('-', $row['weeks']);
|
||||
$date = date('y-m-d', strtotime($lyear.'W'.str_pad($lweek, 2, '0', STR_PAD_LEFT)));
|
||||
$line1[] = "['".$date."',".$row['wcount'].']';
|
||||
$line2[] = "['".$date."',".$row['ccount'].']';
|
||||
}
|
||||
break;
|
||||
case '월' :
|
||||
$sql = " select substr(bn_datetime,1,7) as months, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by months order by bn_datetime ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
// 년-월
|
||||
$line1[] = "['".substr($row['months'],2,5)."',".$row['wcount'].']';
|
||||
$line2[] = "['".substr($row['months'],2,5)."',".$row['ccount'].']';
|
||||
}
|
||||
break;
|
||||
case '년' :
|
||||
$sql = " select substr(bn_datetime,1,4) as years, sum(if(wr_id=wr_parent,1,0)) as wcount, sum(if(wr_id=wr_parent,0,1)) as ccount from {$g5['board_new_table']} where substr(bn_datetime,1,10) between '$from' and '$to' {$sql_bo_table} group by years order by bn_datetime ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
// 년(4자리)
|
||||
$line1[] = "['".substr($row['years'],0,4)."',".$row['wcount'].']';
|
||||
$line2[] = "['".substr($row['years'],0,4)."',".$row['ccount'].']';
|
||||
}
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div id="wr_cont">
|
||||
<form>
|
||||
<select name="bo_table">
|
||||
<option value="">전체게시판</a>
|
||||
<?php
|
||||
$sql = " select bo_table, bo_subject from {$g5['board_table']} order by bo_count_write desc ";
|
||||
$result = sql_query($sql);
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
echo "<option value=\"{$row['bo_table']}\"";
|
||||
if ($bo_table == $row['bo_table'])
|
||||
echo ' selected="selected"';
|
||||
echo ">{$row['bo_subject']}</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<select name="period">
|
||||
<?php
|
||||
foreach($period_array as $key=>$value) {
|
||||
echo "<option value=\"{$key}\"";
|
||||
if ($key == $period)
|
||||
echo " selected=\"selected\"";
|
||||
echo ">{$key}</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<select name="graph">
|
||||
<option value="line" <?php echo ($graph == 'line' ? 'selected="selected"' : ''); ?>>선그래프</option>
|
||||
<option value="bar" <?php echo ($graph == 'bar' ? 'selected="selected"' : ''); ?>>막대그래프</option>
|
||||
</select>
|
||||
|
||||
<input type="submit" class="btn_submit" value="확인">
|
||||
</form>
|
||||
<ul id="grp_color">
|
||||
<li><span></span>글 수</li>
|
||||
<li class="color2"><span></span>댓글 수</li>
|
||||
</ul>
|
||||
</div>
|
||||
<br>
|
||||
<div id="chart_wr">
|
||||
<?php
|
||||
if (empty($line1) || empty($line2)) {
|
||||
echo "<h5>그래프를 만들 데이터가 없습니다.</h5>\n";
|
||||
} else {
|
||||
?>
|
||||
<div id="chart1" style="height:500px; width:100%;"></div>
|
||||
<div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var line1 = [<?php echo implode($line1, ','); ?>];
|
||||
var line2 = [<?php echo implode($line2, ','); ?>];
|
||||
var plot1 = $.jqplot ('chart1', [line1, line2], {
|
||||
seriesDefaults: {
|
||||
<?php if ($graph == 'bar') { ?>
|
||||
renderer:$.jqplot.BarRenderer,
|
||||
<?php } ?>
|
||||
pointLabels: { show: true }
|
||||
},
|
||||
axes:{
|
||||
xaxis: {
|
||||
renderer: $.jqplot.CategoryAxisRenderer,
|
||||
label: '<?php echo $day; ?>',
|
||||
pad:0,
|
||||
max:23
|
||||
},
|
||||
yaxis: {
|
||||
label: '글수',
|
||||
min: 0
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?
|
||||
include_once ('./admin.tail.php');
|
||||
?>
|
||||
Reference in New Issue
Block a user