테마기능 추가

This commit is contained in:
chicpro
2015-08-31 14:22:30 +09:00
parent bc74dad81b
commit a2f2e19c95
542 changed files with 54577 additions and 779 deletions

View File

@ -1,7 +1,8 @@
<?php
include_once('./common.php');
if((isset($default['de_root_index_use']) && $default['de_root_index_use']) || (isset($default['de_shop_layout_use']) && $default['de_shop_layout_use'])) {
// 커뮤니티 사용여부
if(G5_COMMUNITY_USE === false) {
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');

View File

@ -1,8 +1,5 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(isset($default['de_shop_layout_use']) && $default['de_shop_layout_use'])
include_once(G5_SHOP_PATH.'/_head.php');
else
include_once(G5_PATH.'/head.php');
include_once(G5_PATH.'/head.php');
?>

View File

@ -1,8 +1,5 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(isset($default['de_shop_layout_use']) && $default['de_shop_layout_use'])
include_once(G5_SHOP_PATH.'/_tail.php');
else
include_once(G5_PATH.'/tail.php');
include_once(G5_PATH.'/tail.php');
?>

View File

@ -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);
}
}
}

View File

@ -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'),

View File

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

View File

@ -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'].'&amp;'.$qstr.'" onclick="return delete_confirm2(\'게시판 썸네일 파일을 삭제하시겠습니까?\');">게시판 썸네일 삭제</a>
'.PHP_EOL;
<a href="./board_thumbnail_delete.php?bo_table='.$board['bo_table'].'&amp;'.$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) {

View File

@ -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)

View File

@ -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']}',

View File

@ -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
View 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;}

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -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());

View File

@ -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;

View File

@ -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);
?>

View File

@ -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>

View File

@ -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']); ?>

View File

@ -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>

View File

@ -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']}',

View File

@ -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']);
}
?>

View File

@ -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;

View File

@ -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',

View File

@ -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;

View File

@ -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
View 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
View 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
View 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
View 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
View 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 = '&amp;mode=index';
$qstr_list = '&amp;mode=list';
$qstr_view = '&amp;mode=view';
$qstr_shop = '&amp;mode=shop';
$qstr_ca_list = '&amp;mode=ca_list';
$qstr_item = '&amp;mode=item';
$qstr_device = '&amp;mode='.$mode.'&amp;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
View 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
View 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');
?>

View File

@ -1,7 +1,8 @@
<?php
include_once('../common.php');
if(isset($default['de_shop_layout_use']) && $default['de_shop_layout_use']) {
// 커뮤니티 사용여부
if(G5_COMMUNITY_USE === false) {
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');

View File

@ -222,19 +222,19 @@ $admin_href = "";
if ($member['mb_id'] && ($is_admin == 'super' || $group['gr_admin'] == $member['mb_id']))
$admin_href = G5_ADMIN_URL.'/board_form.php?w=u&amp;bo_table='.$bo_table;
include_once('./board_head.php');
include_once(G5_BBS_PATH.'/board_head.php');
// 게시물 아이디가 있다면 게시물 보기를 INCLUDE
if (isset($wr_id) && $wr_id) {
include_once('./view.php');
include_once(G5_BBS_PATH.'/view.php');
}
// 전체목록보이기 사용이 "예" 또는 wr_id 값이 없다면 목록을 보임
//if ($board['bo_use_list_view'] || empty($wr_id))
if ($member['mb_level'] >= $board['bo_list_level'] && $board['bo_use_list_view'] || empty($wr_id))
include_once ('./list.php');
include_once (G5_BBS_PATH.'/list.php');
include_once('./board_tail.php');
include_once(G5_BBS_PATH.'/board_tail.php');
echo "\n<!-- 사용스킨 : ".(G5_IS_MOBILE ? $board['bo_mobile_skin'] : $board['bo_skin'])." -->\n";

View File

@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 게시판 관리의 상단 내용
if (G5_IS_MOBILE) {
// 모바일의 경우 설정을 따르지 않는다.
include_once('./_head.php');
include_once(G5_BBS_PATH.'/_head.php');
echo stripslashes($board['bo_mobile_content_head']);
} else {
@include ($board['bo_include_head']);

View File

@ -5,7 +5,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (G5_IS_MOBILE) {
echo stripslashes($board['bo_mobile_content_tail']);
// 모바일의 경우 설정을 따르지 않는다.
include_once('./_tail.php');
include_once(G5_BBS_PATH.'/_tail.php');
} else {
echo stripslashes($board['bo_content_tail']);
@include ($board['bo_include_tail']);

View File

@ -62,8 +62,8 @@ $str = preg_replace($src, $dst, $str);
if(trim($co['co_skin']) == '')
$co['co_skin'] = 'basic';
$content_skin_path = G5_SKIN_PATH.'/content/'.$co['co_skin'];
$content_skin_url = G5_SKIN_URL.'/content/'.$co['co_skin'];
$content_skin_path = get_skin_path('content', $co['co_skin']);
$content_skin_url = get_skin_url('content', $co['co_skin']);
$skin_file = $content_skin_path.'/content.skin.php';
if ($is_admin)

View File

@ -1,7 +1,14 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/latest.lib.php');
$g5['title'] = $group['gr_subject'];
if(defined('G5_THEME_PATH')) {
$group_file = G5_THEME_PATH.'/group.php';
if(is_file($group_file)) {
require_once($group_file);
return;
}
unset($group_file);
}
if (G5_IS_MOBILE) {
include_once(G5_MOBILE_PATH.'/group.php');
@ -11,7 +18,9 @@ if (G5_IS_MOBILE) {
if(!$is_admin && $group['gr_device'] == 'mobile')
alert($group['gr_subject'].' 그룹은 모바일에서만 접근할 수 있습니다.');
$g5['title'] = $group['gr_subject'];
include_once('./_head.php');
include_once(G5_LIB_PATH.'/latest.lib.php');
?>

View File

@ -11,7 +11,7 @@ set_cookie('ck_auto', '', 0);
// 자동로그인 해제 end --------------------------------
if ($url) {
$p = parse_url($url);
$p = @parse_url($url);
if ($p['scheme'] || $p['host']) {
alert('url에 도메인을 지정할 수 없습니다.');
}

View File

@ -85,12 +85,25 @@ for ($i=0; $row2=sql_fetch_array($result); $i++) {
$list3[$i]['subject'] = cut_str($row2['po_subject'],60,"");
}
if (G5_IS_MOBILE) {
$poll_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
$poll_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
if (G5_IS_MOBILE) {
$poll_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
if(!is_dir($poll_skin_path))
$poll_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
$poll_skin_url = str_replace(G5_PATH, G5_URL, $poll_skin_path);
} else {
$poll_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
$poll_skin_url = str_replace(G5_PATH, G5_URL, $poll_skin_path);
}
//$skin_dir = $match[1];
} else {
$poll_skin_path = G5_SKIN_PATH.'/poll/'.$skin_dir;
$poll_skin_url = G5_SKIN_URL.'/poll/'.$skin_dir;
if (G5_IS_MOBILE) {
$poll_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
$poll_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
} else {
$poll_skin_path = G5_SKIN_PATH.'/poll/'.$skin_dir;
$poll_skin_url = G5_SKIN_URL.'/poll/'.$skin_dir;
}
}
include_once(G5_PATH.'/head.sub.php');

View File

@ -1,8 +1,8 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$qa_skin_path = (G5_IS_MOBILE ? G5_MOBILE_PATH : G5_PATH).'/'.G5_SKIN_DIR.'/qa/'.(G5_IS_MOBILE ? $qaconfig['qa_mobile_skin'] : $qaconfig['qa_skin']);
$qa_skin_url = (G5_IS_MOBILE ? G5_MOBILE_URL : G5_URL).'/'.G5_SKIN_DIR.'/qa/'.(G5_IS_MOBILE ? $qaconfig['qa_mobile_skin'] : $qaconfig['qa_skin']);
$qa_skin_path = get_skin_path('qa', (G5_IS_MOBILE ? $qaconfig['qa_mobile_skin'] : $qaconfig['qa_skin']));
$qa_skin_url = get_skin_url('qa', (G5_IS_MOBILE ? $qaconfig['qa_mobile_skin'] : $qaconfig['qa_skin']));
if (G5_IS_MOBILE) {
// 모바일의 경우 설정을 따르지 않는다.

View File

@ -218,58 +218,6 @@ if ($config['cf_editor'])
else
define('G5_EDITOR_LIB', G5_LIB_PATH."/editor.lib.php");
//==============================================================================
// 사용기기 설정
// config.php G5_SET_DEVICE 설정에 따라 사용자 화면 제한됨
// pc 설정 시 모바일 기기에서도 PC화면 보여짐
// mobile 설정 시 PC에서도 모바일화면 보여짐
// both 설정 시 접속 기기에 따른 화면 보여짐
//------------------------------------------------------------------------------
$is_mobile = false;
$set_device = true;
if(defined('G5_SET_DEVICE')) {
switch(G5_SET_DEVICE) {
case 'pc':
$is_mobile = false;
$set_device = false;
break;
case 'mobile':
$is_mobile = true;
$set_device = false;
break;
default:
break;
}
}
//==============================================================================
//==============================================================================
// Mobile 모바일 설정
// 쿠키에 저장된 값이 모바일이라면 브라우저 상관없이 모바일로 실행
// 그렇지 않다면 브라우저의 HTTP_USER_AGENT 에 따라 모바일 결정
// G5_MOBILE_AGENT : config.php 에서 선언
//------------------------------------------------------------------------------
if (G5_USE_MOBILE && $set_device) {
if ($_REQUEST['device']=='pc')
$is_mobile = false;
else if ($_REQUEST['device']=='mobile')
$is_mobile = true;
else if (isset($_SESSION['ss_is_mobile']))
$is_mobile = $_SESSION['ss_is_mobile'];
else if (is_mobile())
$is_mobile = true;
} else {
$set_device = false;
}
$_SESSION['ss_is_mobile'] = $is_mobile;
define('G5_IS_MOBILE', $is_mobile);
define('G5_DEVICE_BUTTON_DISPLAY', $set_device);
if (G5_IS_MOBILE) {
$g5['mobile_path'] = G5_PATH.'/'.$g5['mobile_dir'];
}
//==============================================================================
// 4.00.03 : [보안관련] PHPSESSID 가 틀리면 로그아웃한다.
if (isset($_REQUEST['PHPSESSID']) && $_REQUEST['PHPSESSID'] != session_id())
goto_url(G5_BBS_URL.'/logout.php');
@ -371,7 +319,7 @@ if (isset($_REQUEST['url'])) {
$url = '';
$urlencode = urlencode($_SERVER['REQUEST_URI']);
if (G5_DOMAIN) {
$p = parse_url(G5_DOMAIN);
$p = @parse_url(G5_DOMAIN);
$urlencode = G5_DOMAIN.urldecode(preg_replace("/^".urlencode($p['path'])."/", "", $urlencode));
}
}
@ -513,35 +461,133 @@ if ($is_admin != 'super') {
}
// 테마경로
if(defined('_THEME_PREVIEW_') && _THEME_PREVIEW_ === true)
$config['cf_theme'] = trim($_GET['theme']);
if(isset($config['cf_theme']) && trim($config['cf_theme'])) {
$theme_path = G5_PATH.'/'.G5_THEME_DIR.'/'.$config['cf_theme'];
if(is_dir($theme_path)) {
define('G5_THEME_PATH', $theme_path);
define('G5_THEME_URL', G5_URL.'/'.G5_THEME_DIR.'/'.$config['cf_theme']);
define('G5_THEME_MOBILE_PATH', $theme_path.'/'.G5_MOBILE_DIR);
define('G5_THEME_LIB_PATH', $theme_path.'/'.G5_LIB_DIR);
define('G5_THEME_CSS_URL', G5_THEME_URL.'/'.G5_CSS_DIR);
define('G5_THEME_IMG_URL', G5_THEME_URL.'/'.G5_IMG_DIR);
define('G5_THEME_JS_URL', G5_THEME_URL.'/'.G5_JS_DIR);
}
unset($theme_path);
}
// 테마 설정 로드
if(is_file(G5_THEME_PATH.'/theme.config.php'))
include_once(G5_THEME_PATH.'/theme.config.php');
// 쇼핑몰 설정
if (defined('G5_USE_SHOP') && G5_USE_SHOP)
include_once(G5_PATH.'/shop.config.php');
//=====================================================================================
// 사용기기 설정
// 테마의 G5_THEME_DEVICE 설정에 따라 사용자 화면 제한됨
// 테마에 별도 설정이 없는 경우 config.php G5_SET_DEVICE 설정에 따라 사용자 화면 제한됨
// pc 설정 시 모바일 기기에서도 PC화면 보여짐
// mobile 설정 시 PC에서도 모바일화면 보여짐
// both 설정 시 접속 기기에 따른 화면 보여짐
//-------------------------------------------------------------------------------------
$is_mobile = false;
$set_device = true;
if(defined('G5_THEME_DEVICE') && G5_THEME_DEVICE != '') {
switch(G5_THEME_DEVICE) {
case 'pc':
$is_mobile = false;
$set_device = false;
break;
case 'mobile':
$is_mobile = true;
$set_device = false;
break;
default:
break;
}
}
if(defined('G5_SET_DEVICE') && $set_device) {
switch(G5_SET_DEVICE) {
case 'pc':
$is_mobile = false;
$set_device = false;
break;
case 'mobile':
$is_mobile = true;
$set_device = false;
break;
default:
break;
}
}
//==============================================================================
//==============================================================================
// Mobile 모바일 설정
// 쿠키에 저장된 값이 모바일이라면 브라우저 상관없이 모바일로 실행
// 그렇지 않다면 브라우저의 HTTP_USER_AGENT 에 따라 모바일 결정
// G5_MOBILE_AGENT : config.php 에서 선언
//------------------------------------------------------------------------------
if (G5_USE_MOBILE && $set_device) {
if ($_REQUEST['device']=='pc')
$is_mobile = false;
else if ($_REQUEST['device']=='mobile')
$is_mobile = true;
else if (isset($_SESSION['ss_is_mobile']))
$is_mobile = $_SESSION['ss_is_mobile'];
else if (is_mobile())
$is_mobile = true;
} else {
$set_device = false;
}
$_SESSION['ss_is_mobile'] = $is_mobile;
define('G5_IS_MOBILE', $is_mobile);
define('G5_DEVICE_BUTTON_DISPLAY', $set_device);
if (G5_IS_MOBILE) {
$g5['mobile_path'] = G5_PATH.'/'.$g5['mobile_dir'];
}
//==============================================================================
//==============================================================================
// 스킨경로
//------------------------------------------------------------------------------
if (G5_IS_MOBILE) {
$board_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/board/'.$board['bo_mobile_skin'];
$board_skin_url = G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/board/'.$board['bo_mobile_skin'];
$member_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/member/'.$config['cf_mobile_member_skin'];
$member_skin_url = G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/member/'.$config['cf_mobile_member_skin'];
$new_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/new/'.$config['cf_mobile_new_skin'];
$new_skin_url = G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/new/'.$config['cf_mobile_new_skin'];
$search_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/search/'.$config['cf_mobile_search_skin'];
$search_skin_url = G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/search/'.$config['cf_mobile_search_skin'];
$connect_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/connect/'.$config['cf_mobile_connect_skin'];
$connect_skin_url = G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/connect/'.$config['cf_mobile_connect_skin'];
$faq_skin_path = G5_MOBILE_PATH .'/'.G5_SKIN_DIR.'/faq/'.$config['cf_mobile_faq_skin'];
$faq_skin_url = G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/faq/'.$config['cf_mobile_faq_skin'];
$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 = G5_SKIN_PATH.'/board/'.$board['bo_skin'];
$board_skin_url = G5_SKIN_URL .'/board/'.$board['bo_skin'];
$member_skin_path = G5_SKIN_PATH.'/member/'.$config['cf_member_skin'];
$member_skin_url = G5_SKIN_URL .'/member/'.$config['cf_member_skin'];
$new_skin_path = G5_SKIN_PATH.'/new/'.$config['cf_new_skin'];
$new_skin_url = G5_SKIN_URL .'/new/'.$config['cf_new_skin'];
$search_skin_path = G5_SKIN_PATH.'/search/'.$config['cf_search_skin'];
$search_skin_url = G5_SKIN_URL .'/search/'.$config['cf_search_skin'];
$connect_skin_path = G5_SKIN_PATH.'/connect/'.$config['cf_connect_skin'];
$connect_skin_url = G5_SKIN_URL .'/connect/'.$config['cf_connect_skin'];
$faq_skin_path = G5_SKIN_PATH.'/faq/'.$config['cf_faq_skin'];
$faq_skin_url = G5_SKIN_URL.'/faq/'.$config['cf_faq_skin'];
$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']);
}
//==============================================================================

View File

@ -7,7 +7,8 @@
define('G5_VERSION', '그누보드5');
define('G5_GNUBOARD_VER', '5.0.42');
define('G5_GNUBOARD_VER', '5.1.1');
define('G5_YOUNGCART_VER', '5.0.44');
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
@ -62,6 +63,7 @@ define('G5_SNS_DIR', 'sns');
define('G5_SYNDI_DIR', 'syndi');
define('G5_PHPMAILER_DIR', 'PHPMailer_v2.0.4');
define('G5_SESSION_DIR', 'session');
define('G5_THEME_DIR', 'theme');
// URL 은 브라우저상에서의 경로 (도메인으로 부터의)
if (G5_DOMAIN) {

View File

@ -3,29 +3,6 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) return;
//------------------------------------------------------------------------------
// 쇼핑몰 상수 모음 시작
//------------------------------------------------------------------------------
define('G5_SHOP_DIR', 'shop');
define('G5_SHOP_PATH', G5_PATH.'/'.G5_SHOP_DIR);
define('G5_SHOP_URL', G5_URL.'/'.G5_SHOP_DIR);
define('G5_MSHOP_PATH', G5_MOBILE_PATH.'/'.G5_SHOP_DIR);
define('G5_MSHOP_URL', G5_MOBILE_URL.'/'.G5_SHOP_DIR);
define('G5_SHOP_IMG_URL', G5_SHOP_URL.'/'.G5_IMG_DIR);
define('G5_MSHOP_IMG_URL', G5_MSHOP_URL.'/'.G5_IMG_DIR);
// 보안서버주소 설정
if (G5_HTTPS_DOMAIN) {
define('G5_HTTPS_SHOP_URL', G5_HTTPS_DOMAIN.'/'.G5_SHOP_DIR);
define('G5_HTTPS_MSHOP_URL', G5_HTTPS_DOMAIN.'/'.G5_MOBILE_DIR.'/'.G5_SHOP_DIR);
} else {
define('G5_HTTPS_SHOP_URL', G5_SHOP_URL);
define('G5_HTTPS_MSHOP_URL', G5_MSHOP_URL);
}
/*
배송업체에 데이터를 추가하는 경우 아래 형식으로 추가하세요.
.'(배송업체명^택배조회URL^연락처)'
@ -45,62 +22,6 @@ define('G5_DELIVERY_COMPANY',
.'(KGB택배^http://www.kgbls.co.kr/sub5/trace.asp?f_slipno=^1577-4577)'
.'(KG로지스^http://www.kglogis.co.kr/contents/waybill.jsp?item_no=^1588-8848)'
);
//------------------------------------------------------------------------------
// 쇼핑몰 상수 모음 끝
//------------------------------------------------------------------------------
//==============================================================================
// 쇼핑몰 필수 실행코드 모음 시작
//==============================================================================
// 쇼핑몰 설정값 배열변수
$default = sql_fetch(" select * from {$g5['g5_shop_default_table']} ");
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']);
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']);
/*
// 주문상태 상수
define('G5_OD_STATUS_ORDER' , '입금확인중');
define('G5_OD_STATUS_SETTLE' , '결제완료');
define('G5_OD_STATUS_READY' , '배송준비중');
define('G5_OD_STATUS_DELIVERY' , '배송중');
define('G5_OD_STATUS_FINISH' , '배송완료');
*/
/*
# 주문상태는 상수로 처리하지 않고 실제 문자열 값을 처리한다.
'쇼핑' : 고객이 장바구니에 상품을 담고 있는 경우 입니다.
'입금확인중' : 무통장, 가상계좌의 경우 결제하기 전을 말합니다.
'결제완료' : 결제가 완료된 상태를 말합니다.
'배송준비중' : 배송준비중이 되면 취소가 불가합니다.
'배송중' : 배송중이면 반품이 불가합니다.
'배송완료' : 배송이 완료된 상태에서만 포인트적립이 가능합니다.
'취소' : 입금확인중이나 결제완료후 취소가 가능합니다.
'반품' : 배송완료 후에만 반품처리가 가능합니다.
'품절' :
# 13.10.04
'쇼핑' : 고객이 장바구니에 상품을 담고 있는 경우 입니다.
'주문' : 무통장, 가상계좌의 경우 결제하기 전을 말합니다.
'입금' : 신용카드, 계좌이체, 휴대폰결제가 된 상태, 무통장, 가상계좌는 주문후 입금한 상태를 말합니다.
'배송' : 배송이 되면 취소가 불가합니다.
'완료' : 배송이 완료된 상태에서만 포인트적립이 가능합니다.
'취소' : 입금이후로는 고객의 취소가 불가합니다.
'반품' : 배송완료 후에만 반품처리가 가능합니다.
'품절' : 주문이나 입금후 상품의 품절된 상태를 나타냅니다.
*/
//==============================================================================
// 쇼핑몰 필수 실행코드 모음 끝
//==============================================================================
include_once(G5_LIB_PATH.'/shop.lib.php');
include_once(G5_LIB_PATH.'/thumbnail.lib.php');

View File

@ -1,8 +1,3 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// head.sub.php, tail.sub.php 파일의 이름을 지정할 수 있습니다.
// 지정된 파일은 head.sub.php, tail.sub.php 파일과 동일한 위치에 존재해야 합니다.
//define('G5_HEAD_SUB_FILE', 'user.head.sub.php');
//define('G5_TAIL_SUB_FILE', 'user.tail.sub.php');
?>

View File

@ -4,7 +4,7 @@ include_once(G5_LIB_PATH.'/connect.lib.php');
include_once(G5_LIB_PATH.'/outlogin.lib.php');
$g5['title'] = '그누보드4 DB 데이터 이전';
include_once(G5_PATH.'/head.sub.php');
include_once(G5_PATH.'/'.G5_THEME_DIR.'/basic/head.sub.php');
if(get_session('tables_copied') == 'done')
alert('DB 데이터 변환을 이미 실행하였습니다. 중복 실행시 오류가 발생할 수 있습니다.', G5_URL);
@ -172,5 +172,5 @@ $(function() {
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
include_once(G5_PATH.'/'.G5_THEME_DIR.'/basic/tail.sub.php');
?>

View File

@ -10,7 +10,7 @@ set_time_limit ( 0 );
ini_set('memory_limit', '50M');
$g5['title'] = '그누보드4 DB 데이터 이전';
include_once(G5_PATH.'/head.sub.php');
include_once(G5_PATH.'/'.G5_THEME_DIR.'/basic/head.sub.php');
echo '<link rel="stylesheet" href="'.G5_URL.'/g4_import.css">';
@ -536,5 +536,5 @@ $(function() {
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
include_once(G5_PATH.'/'.G5_THEME_DIR.'/basic/tail.sub.php');
?>

View File

@ -1,10 +1,14 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 상단 파일 경로 지정 : 이 코드는 가능한 삭제하지 마십시오.
if ($config['cf_include_head'] && is_file(G5_PATH.'/'.$config['cf_include_head'])) {
include_once(G5_PATH.'/'.$config['cf_include_head']);
return; // 이 코드의 아래는 실행을 하지 않습니다.
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_PATH.'/head.php');
return;
}
if (G5_IS_MOBILE) {
include_once(G5_MOBILE_PATH.'/head.php');
return;
}
include_once(G5_PATH.'/head.sub.php');
@ -14,11 +18,6 @@ include_once(G5_LIB_PATH.'/poll.lib.php');
include_once(G5_LIB_PATH.'/visit.lib.php');
include_once(G5_LIB_PATH.'/connect.lib.php');
include_once(G5_LIB_PATH.'/popular.lib.php');
if (G5_IS_MOBILE) {
include_once(G5_MOBILE_PATH.'/head.php');
return;
}
?>
<!-- 상단 시작 { -->
@ -100,7 +99,7 @@ if (G5_IS_MOBILE) {
<li><a href="<?php echo G5_BBS_URL ?>/faq.php">FAQ</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/qalist.php">1:1문의</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/current_connect.php">접속자 <?php echo connect(); // 현재 접속자수 ?></a></li>
<li><a href="<?php echo G5_BBS_URL ?>/current_connect.php">접속자 <?php echo connect(); // 현재 접속자수, 테마의 스킨을 사용하려면 스킨을 theme/basic 과 같이 지정 ?></a></li>
<li><a href="<?php echo G5_BBS_URL ?>/new.php">새글</a></li>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<li><a href="<?php echo G5_SHOP_URL ?>/">쇼핑몰</a></li>
@ -163,8 +162,8 @@ if (G5_IS_MOBILE) {
<!-- 콘텐츠 시작 { -->
<div id="wrapper">
<div id="aside">
<?php echo outlogin('basic'); // 외부 로그인 ?>
<?php echo poll('basic'); // 설문조사 ?>
<?php echo outlogin('basic'); // 외부 로그인, 테마의 스킨을 사용하려면 스킨을 theme/basic 과 같이 지정 ?>
<?php echo poll('basic'); // 설문조사, 테마의 스킨을 사용하려면 스킨을 theme/basic 과 같이 지정 ?>
</div>
<div id="container">
<?php if ((!$bo_table || $w == 's' ) && !defined("_INDEX_")) { ?><div id="container_title"><?php echo $g5['title'] ?></div><?php } ?>
<?php if ((!$bo_table || $w == 's' ) && !defined("_INDEX_")) { ?><div id="container_title"><?php echo $g5['title'] ?></div><?php } ?>

View File

@ -2,14 +2,14 @@
// 이 파일은 새로운 파일 생성시 반드시 포함되어야 함
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$begin_time = get_microtime();
// 사용자가 지정한 head.sub.php 파일이 있다면 include
if(defined('G5_HEAD_SUB_FILE') && is_file(G5_PATH.'/'.G5_HEAD_SUB_FILE)) {
include_once(G5_PATH.'/'.G5_HEAD_SUB_FILE);
// 테마 head.sub.php 파일
if(!defined('G5_IS_ADMIN') && defined('G5_THEME_PATH') && is_file(G5_THEME_PATH.'/head.sub.php')) {
require_once(G5_THEME_PATH.'/head.sub.php');
return;
}
$begin_time = get_microtime();
if (!isset($g5['title'])) {
$g5['title'] = $config['cf_title'];
$g5_head_title = $g5['title'];
@ -54,7 +54,8 @@ if($config['cf_add_meta'])
<title><?php echo $g5_head_title; ?></title>
<?php
if (defined('G5_IS_ADMIN')) {
echo '<link rel="stylesheet" href="'.G5_ADMIN_URL.'/css/admin.css">'.PHP_EOL;
if(!defined('_THEME_PREVIEW_'))
echo '<link rel="stylesheet" href="'.G5_ADMIN_URL.'/css/admin.css">'.PHP_EOL;
} else {
$shop_css = '';
if (defined('_SHOP_')) $shop_css = '_shop';

View File

@ -1,16 +1,11 @@
<?php
define('_INDEX_', true);
include_once('./_common.php');
// 초기화면 파일 경로 지정 : 이 코드는 가능한 삭제하지 마십시오.
if ($config['cf_include_index'] && is_file(G5_PATH.'/'.$config['cf_include_index'])) {
include_once(G5_PATH.'/'.$config['cf_include_index']);
return; // 이 코드의 아래는 실행을 하지 않습니다.
}
define('_INDEX_', true);
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 루트 index를 쇼핑몰 index 설정했을 때
if(isset($default['de_root_index_use']) && $default['de_root_index_use']) {
require_once(G5_SHOP_PATH.'/index.php');
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_PATH.'/index.php');
return;
}
@ -19,7 +14,7 @@ if (G5_IS_MOBILE) {
return;
}
include_once('./_head.php');
include_once(G5_PATH.'/head.php');
?>
<h2 class="sound_only">최신글</h2>
@ -41,6 +36,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
<?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
// 테마의 스킨을 사용하려면 theme/basic 과 같이 지정
echo latest("basic", $row['bo_table'], 5, 25);
?>
</div>
@ -50,5 +46,5 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
<!-- } 최신글 끝 -->
<?php
include_once('./_tail.php');
include_once(G5_PATH.'/tail.php');
?>

View File

@ -185,12 +185,10 @@ CREATE TABLE IF NOT EXISTS `g5_board_new` (
DROP TABLE IF EXISTS `g5_config`;
CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_title` varchar(255) NOT NULL DEFAULT '',
`cf_theme` varchar(255) NOT NULL DEFAULT '',
`cf_admin` varchar(255) NOT NULL DEFAULT '',
`cf_admin_email` varchar(255) NOT NULL DEFAULT '',
`cf_admin_email_name` varchar(255) NOT NULL DEFAULT '',
`cf_include_index` varchar(255) NOT NULL DEFAULT '',
`cf_include_head` varchar(255) NOT NULL DEFAULT '',
`cf_include_tail` varchar(255) NOT NULL DEFAULT '',
`cf_add_script` text NOT NULL,
`cf_use_point` tinyint(4) NOT NULL DEFAULT '0',
`cf_point_term` int(11) NOT NULL DEFAULT '0',

View File

@ -190,11 +190,6 @@ CREATE TABLE IF NOT EXISTS `g5_shop_default` (
`de_admin_company_addr` varchar(255) NOT NULL DEFAULT '',
`de_admin_info_name` varchar(255) NOT NULL DEFAULT '',
`de_admin_info_email` varchar(255) NOT NULL DEFAULT '',
`de_include_index` varchar(255) NOT NULL DEFAULT '',
`de_include_head` varchar(255) NOT NULL DEFAULT '',
`de_include_tail` varchar(255) NOT NULL DEFAULT '',
`de_root_index_use` tinyint(4) NOT NULL DEFAULT '0',
`de_shop_layout_use` tinyint(4) NOT NULL DEFAULT '0',
`de_shop_skin` varchar(255) NOT NULL DEFAULT '',
`de_shop_mobile_skin` varchar(255) NOT NULL DEFAULT '',
`de_type1_list_use` tinyint(4) NOT NULL DEFAULT '0',
@ -353,6 +348,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_event` (
`ev_mobile_img_width` int(11) NOT NULL DEFAULT '0',
`ev_mobile_img_height` int(11) NOT NULL DEFAULT '0',
`ev_mobile_list_mod` int(11) NOT NULL DEFAULT '0',
`ev_mobile_list_row` int(11) NOT NULL DEFAULT '0',
`ev_subject` varchar(255) NOT NULL DEFAULT '',
`ev_subject_strong` tinyint(4) NOT NULL DEFAULT '0',
`ev_head_html` text NOT NULL,

View File

@ -58,10 +58,12 @@ if (!$select_db) {
$mysql_set_mode = 'false';
@mysql_query('set names utf8');
if(version_compare(mysql_get_server_info(), '5.6.6', '>=') == 1) {
$row = mysql_fetch_assoc(mysql_query(" SELECT @@sql_mode as mode "));
if($row['mode']) {
@mysql_query("SET SESSION sql_mode = ''");
$mysql_set_mode = 'true';
}
unset($row);
?>
<div class="ins_inner">
@ -115,6 +117,7 @@ $download_point = 0;
if($g5_install || !$result) {
$sql = " insert into `{$table_prefix}config`
set cf_title = '".G5_VERSION."',
cf_theme = 'basic',
cf_admin = '$admin_id',
cf_admin_email = '$admin_email',
cf_admin_email_name = '".G5_VERSION."',
@ -229,7 +232,6 @@ if($g5_shop_install) {
de_admin_company_addr = 'OO도 OO시 OO구 OO동 123-45',
de_admin_info_name = '정보책임자명',
de_admin_info_email = '정보책임자 E-mail',
de_root_index_use = '0',
de_shop_skin = 'basic',
de_shop_mobile_skin = 'basic',
de_type1_list_use = '1',

View File

@ -69,7 +69,7 @@ $(function(){
});
// 임시저장된 글 제목과 내용을 가져와서 제목과 내용 입력박스에 노출해 줌
$(".autosave_load").live("click", function(){
$(document).on( "click", ".autosave_load", function(){
var $li = $(this).parents("li");
var as_id = $li.data("as_id");
var as_uid = $li.data("uid");
@ -93,7 +93,7 @@ $(function(){
$("#autosave_pop").hide();
});
$(".autosave_del").live("click", function(){
$(document).on( "click", ".autosave_del", function(){
var $li = $(this).parents("li");
var as_id = $li.data("as_id");
$.get(g5_bbs_url+"/ajax.autosavedel.php", {"as_id":as_id}, function(data){

View File

@ -674,7 +674,7 @@ $(function(){
}
});
$("textarea#wr_content[maxlength]").live("keyup change", function() {
$(document).on( "keyup change", "textarea#wr_content[maxlength]", function(){
var str = $(this).val();
var mx = parseInt($(this).attr("maxlength"));
if (str.length > mx) {

View File

@ -21,7 +21,7 @@ function fancyalert(msg)
}
$(function() {
$("#fancyalert_close, #fancyalert_inner").live("click", function() {
$(document).on("click", "#fancyalert_close, #fancyalert_inner", function() {
$("#fancyalert").fadeOut().remove();
$("html, body").off("touchmove", blockScroll);
});

View File

@ -6,7 +6,7 @@ $(function() {
// 선택옵션
/* 가상커서 ctrl keyup 이베트 대응 */
/*
$("select.it_option").live("keyup", function(e) {
$(document).on("keyup", "select.it_option", function(e) {
var sel_count = $("select.it_option").size();
var idx = $("select.it_option").index($(this));
var code = e.keyCode;
@ -23,7 +23,7 @@ $(function() {
*/
/* 키보드 접근 후 옵션 선택 Enter keydown 이벤트 대응 */
$("select.it_option").live("keydown", function(e) {
$(document).on("keydown", "select.it_option", function(e) {
var sel_count = $("select.it_option").size();
var idx = $("select.it_option").index($(this));
var code = e.keyCode;
@ -39,16 +39,16 @@ $(function() {
});
if(isAndroid) {
$("select.it_option").live("touchend", function() {
$(document).on("touchend", "select.it_option", function() {
option_add = true;
});
} else {
$("select.it_option").live("mouseup", function() {
$(document).on("mouseup", "select.it_option", function() {
option_add = true;
});
}
$("select.it_option").live("change", function() {
$(document).on("change", "select.it_option", function() {
var sel_count = $("select.it_option").size();
var idx = $("select.it_option").index($(this));
var val = $(this).val();
@ -110,7 +110,7 @@ $(function() {
// 추가옵션
/* 가상커서 ctrl keyup 이베트 대응 */
/*
$("select.it_supply").live("keyup", function(e) {
$(document).on("keyup", "select.it_supply", function(e) {
var $el = $(this);
var code = e.keyCode;
var val = $(this).val();
@ -126,7 +126,7 @@ $(function() {
*/
/* 키보드 접근 후 옵션 선택 Enter keydown 이벤트 대응 */
$("select.it_supply").live("keydown", function(e) {
$(document).on("keydown", "select.it_supply", function(e) {
var $el = $(this);
var code = e.keyCode;
var val = $(this).val();
@ -141,16 +141,16 @@ $(function() {
});
if(isAndroid) {
$("select.it_supply").live("touchend", function() {
$(document).on("touchend", "select.it_supply", function() {
supply_add = true;
});
} else {
$("select.it_supply").live("mouseup", function() {
$(document).on("mouseup", "select.it_supply", function() {
supply_add = true;
});
}
$("select.it_supply").live("change", function() {
$(document).on("change", "select.it_supply", function() {
var $el = $(this);
var val = $(this).val();
@ -162,7 +162,7 @@ $(function() {
});
// 수량변경 및 삭제
$("#sit_sel_option li button").live("click", function() {
$(document).on("click", "#sit_sel_option li button", function() {
var mode = $(this).text();
var this_qty, max_qty = 9999, min_qty = 1;
var $el_qty = $(this).closest("li").find("input[name^=ct_qty]");
@ -225,7 +225,7 @@ $(function() {
});
// 수량직접입력
$("input[name^=ct_qty]").live("keyup", function() {
$(document).on("keyup", "input[name^=ct_qty]", function() {
var val= $(this).val();
if(val != "") {

View File

@ -2066,7 +2066,7 @@ function delete_editor_thumbnail($contents)
for($i=0; $i<count($matchs[1]); $i++) {
// 이미지 path 구함
$imgurl = parse_url($matchs[1][$i]);
$imgurl = @parse_url($matchs[1][$i]);
$srcfile = $_SERVER['DOCUMENT_ROOT'].$imgurl['path'];
$filename = preg_replace("/\.[^\.]+$/i", "", basename($srcfile));
@ -2872,7 +2872,7 @@ function check_url_host($url, $msg='', $return_url=G5_URL)
if(!$msg)
$msg = 'url에 타 도메인을 지정할 수 없습니다.';
$p = parse_url($url);
$p = @parse_url($url);
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
if ((isset($p['scheme']) && $p['scheme']) || (isset($p['host']) && $p['host'])) {
@ -2977,7 +2977,7 @@ function clean_query_string($query, $amp=true)
function get_device_change_url()
{
$p = parse_url(G5_URL);
$p = @parse_url(G5_URL);
$href = $p['scheme'].'://'.$p['host'];
if(isset($p['port']) && $p['port'])
$href .= ':'.$p['port'];
@ -3008,4 +3008,39 @@ function get_device_change_url()
return $href;
}
// 스킨 path
function get_skin_path($dir, $skin)
{
global $config;
if(preg_match('#^theme/(.+)$#', $skin, $match)) { // 테마에 포함된 스킨이라면
$theme_path = '';
$cf_theme = trim($config['cf_theme']);
$theme_path = G5_PATH.'/'.G5_THEME_DIR.'/'.$cf_theme;
if(G5_IS_MOBILE) {
$skin_path = $theme_path.'/'.G5_MOBILE_DIR.'/'.G5_SKIN_DIR.'/'.$dir.'/'.$match[1];
if(!is_dir($skin_path))
$skin_path = $theme_path.'/'.G5_SKIN_DIR.'/'.$dir.'/'.$match[1];
} else {
$skin_path = $theme_path.'/'.G5_SKIN_DIR.'/'.$dir.'/'.$match[1];
}
} else {
if(G5_IS_MOBILE)
$skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/'.$dir.'/'.$skin;
else
$skin_path = G5_SKIN_PATH.'/'.$dir.'/'.$skin;
}
return $skin_path;
}
// 스킨 url
function get_skin_url($dir, $skin)
{
$skin_path = get_skin_path($dir, $skin);
return str_replace(G5_PATH, G5_URL, $skin_path);
}
?>

View File

@ -10,12 +10,25 @@ function connect($skin_dir='basic')
$sql = " select sum(IF(mb_id<>'',1,0)) as mb_cnt, count(*) as total_cnt from {$g5['login_table']} where mb_id <> '{$config['cf_admin']}' ";
$row = sql_fetch($sql);
if(G5_IS_MOBILE) {
$connect_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/connect/'.$skin_dir;
$connect_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/connect/'.$skin_dir;
if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
if (G5_IS_MOBILE) {
$connect_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/connect/'.$match[1];
if(!is_dir($connect_skin_path))
$connect_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/connect/'.$match[1];
$connect_skin_url = str_replace(G5_PATH, G5_URL, $connect_skin_path);
} else {
$connect_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/connect/'.$match[1];
$connect_skin_url = str_replace(G5_PATH, G5_URL, $connect_skin_path);
}
$skin_dir = $match[1];
} else {
$connect_skin_path = G5_SKIN_PATH.'/connect/'.$skin_dir;
$connect_skin_url = G5_SKIN_URL.'/connect/'.$skin_dir;
if(G5_IS_MOBILE) {
$connect_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/connect/'.$skin_dir;
$connect_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/connect/'.$skin_dir;
} else {
$connect_skin_path = G5_SKIN_PATH.'/connect/'.$skin_dir;
$connect_skin_url = G5_SKIN_URL.'/connect/'.$skin_dir;
}
}
ob_start();

View File

@ -6,16 +6,28 @@ if (!defined('_GNUBOARD_')) exit;
function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=1, $options='')
{
global $g5;
//static $css = array();
if (!$skin_dir) $skin_dir = 'basic';
if(G5_IS_MOBILE) {
$latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
$latest_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
if (G5_IS_MOBILE) {
$latest_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];
if(!is_dir($latest_skin_path))
$latest_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];
$latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
} else {
$latest_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];
$latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
}
$skin_dir = $match[1];
} else {
$latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir;
$latest_skin_url = G5_SKIN_URL.'/latest/'.$skin_dir;
if(G5_IS_MOBILE) {
$latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
$latest_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
} else {
$latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir;
$latest_skin_url = G5_SKIN_URL.'/latest/'.$skin_dir;
}
}
$cache_fwrite = false;
@ -60,14 +72,6 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=
}
}
/*
// 같은 스킨은 .css 를 한번만 호출한다.
if (!in_array($skin_dir, $css) && is_file($latest_skin_path.'/style.css')) {
echo '<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">';
$css[] = $skin_dir;
}
*/
ob_start();
include $latest_skin_path.'/latest.skin.php';
$content = ob_get_contents();

View File

@ -13,12 +13,25 @@ function outlogin($skin_dir='basic')
$point = number_format($member['mb_point']);
}
if (G5_IS_MOBILE) {
$outlogin_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/outlogin/'.$skin_dir;
$outlogin_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/outlogin/'.$skin_dir;
if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
if (G5_IS_MOBILE) {
$outlogin_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/outlogin/'.$match[1];
if(!is_dir($outlogin_skin_path))
$outlogin_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/outlogin/'.$match[1];
$outlogin_skin_url = str_replace(G5_PATH, G5_URL, $outlogin_skin_path);
} else {
$outlogin_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/outlogin/'.$match[1];
$outlogin_skin_url = str_replace(G5_PATH, G5_URL, $outlogin_skin_path);
}
$skin_dir = $match[1];
} else {
$outlogin_skin_path = G5_SKIN_PATH.'/outlogin/'.$skin_dir;
$outlogin_skin_url = G5_SKIN_URL.'/outlogin/'.$skin_dir;
if (G5_IS_MOBILE) {
$outlogin_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/outlogin/'.$skin_dir;
$outlogin_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/outlogin/'.$skin_dir;
} else {
$outlogin_skin_path = G5_SKIN_PATH.'/outlogin/'.$skin_dir;
$outlogin_skin_url = G5_SKIN_URL.'/outlogin/'.$skin_dir;
}
}
// 읽지 않은 쪽지가 있다면

View File

@ -15,16 +15,30 @@ function poll($skin_dir='basic', $po_id=false)
if(!$po_id)
return;
if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
if (G5_IS_MOBILE) {
$poll_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
if(!is_dir($poll_skin_path))
$poll_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
$poll_skin_url = str_replace(G5_PATH, G5_URL, $poll_skin_path);
} else {
$poll_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
$poll_skin_url = str_replace(G5_PATH, G5_URL, $poll_skin_path);
}
//$skin_dir = $match[1];
} else {
if (G5_IS_MOBILE) {
$poll_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
$poll_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
} else {
$poll_skin_path = G5_SKIN_PATH.'/poll/'.$skin_dir;
$poll_skin_url = G5_SKIN_URL.'/poll/'.$skin_dir;
}
}
$po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '$po_id' ");
ob_start();
if (G5_IS_MOBILE) {
$poll_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
$poll_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
} else {
$poll_skin_path = G5_SKIN_PATH.'/poll/'.$skin_dir;
$poll_skin_url = G5_SKIN_URL.'/poll/'.$skin_dir;
}
include_once ($poll_skin_path.'/poll.skin.php');
$content = ob_get_contents();
ob_end_clean();

View File

@ -20,14 +20,28 @@ function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3)
$list[$i]['pp_word'] = get_text($list[$i]['pp_word']);
}
ob_start();
if(G5_IS_MOBILE) {
$popular_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/popular/'.$skin_dir;
$popular_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/popular/'.$skin_dir;
if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
if (G5_IS_MOBILE) {
$popular_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/popular/'.$match[1];
if(!is_dir($popular_skin_path))
$popular_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/popular/'.$match[1];
$popular_skin_url = str_replace(G5_PATH, G5_URL, $popular_skin_path);
} else {
$popular_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/popular/'.$match[1];
$popular_skin_url = str_replace(G5_PATH, G5_URL,$popular_skin_path);
}
$skin_dir = $match[1];
} else {
$popular_skin_path = G5_SKIN_PATH.'/popular/'.$skin_dir;
$popular_skin_url = G5_SKIN_URL.'/popular/'.$skin_dir;
if(G5_IS_MOBILE) {
$popular_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/popular/'.$skin_dir;
$popular_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/popular/'.$skin_dir;
} else {
$popular_skin_path = G5_SKIN_PATH.'/popular/'.$skin_dir;
$popular_skin_url = G5_SKIN_URL.'/popular/'.$skin_dir;
}
}
ob_start();
include_once ($popular_skin_path.'/popular.skin.php');
$content = ob_get_contents();
ob_end_clean();

View File

@ -417,7 +417,7 @@ function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='', $img
if($filename) {
//thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop=false, $crop_mode='center', $is_sharpen=true, $um_value='80/0.5/3')
$thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, false, 'center', true, $um_value='80/0.5/3');
$thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, true, 'center', false, $um_value='80/0.5/3');
}
if($thumb) {
@ -462,7 +462,7 @@ function get_it_thumbnail($img, $width, $height=0, $id='')
$height = round(($width * $img_height) / $img_width);
}
$thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, false, 'center', true, $um_value='80/0.5/3');
$thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, true, 'center', false, $um_value='80/0.5/3');
if($thumb) {
$file_url = str_replace(G5_PATH, G5_URL, $filepath.'/'.$thumb);
@ -645,6 +645,23 @@ function it_img_upload($srcfile, $filename, $dir)
$filename);
$filename = preg_replace( $pattern, "", $filename);
$prepend = '';
// 동일한 이름의 파일이 있으면 파일명 변경
if(is_file($dir.'/'.$filename)) {
for($i=0; $i<20; $i++) {
$prepend = str_replace('.', '_', microtime(true)).'_';
if(is_file($dir.'/'.$prepend.$filename)) {
usleep(mt_rand(100, 10000));
continue;
} else {
break;
}
}
}
$filename = $prepend.$filename;
upload_file($srcfile, $filename, $dir);

View File

@ -59,15 +59,19 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
if($tname) {
if($edt) {
// 오리지날 이미지
$ori = G5_URL.$data_path;
// 썸네일 이미지
$src = G5_URL.str_replace($filename, $tname, $data_path);
} else {
$ori = G5_DATA_URL.'/file/'.$bo_table.'/'.$filename;
$src = G5_DATA_URL.'/file/'.$bo_table.'/'.$tname;
}
} else {
return false;
}
$thumb = array("src"=>$src, "alt"=>$alt);
$thumb = array("src"=>$src, "ori"=>$ori, "alt"=>$alt);
return $thumb;
}

View File

@ -18,14 +18,28 @@ function visit($skin_dir='basic')
settype($visit[3], "integer");
settype($visit[4], "integer");
ob_start();
if(G5_IS_MOBILE) {
$visit_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/visit/'.$skin_dir;
$visit_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/visit/'.$skin_dir;
if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
if (G5_IS_MOBILE) {
$visit_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/visit/'.$match[1];
if(!is_dir($visit_skin_path))
$visit_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/visit/'.$match[1];
$visit_skin_url = str_replace(G5_PATH, G5_URL, $visit_skin_path);
} else {
$visit_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/visit/'.$match[1];
$visit_skin_url = str_replace(G5_PATH, G5_URL, $visit_skin_path);
}
$skin_dir = $match[1];
} else {
$visit_skin_path = G5_SKIN_PATH.'/visit/'.$skin_dir;
$visit_skin_url = G5_SKIN_URL.'/visit/'.$skin_dir;
if(G5_IS_MOBILE) {
$visit_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/visit/'.$skin_dir;
$visit_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/visit/'.$skin_dir;
} else {
$visit_skin_path = G5_SKIN_PATH.'/visit/'.$skin_dir;
$visit_skin_url = G5_SKIN_URL.'/visit/'.$skin_dir;
}
}
ob_start();
include_once ($visit_skin_path.'/visit.skin.php');
$content = ob_get_contents();
ob_end_clean();

View File

@ -1,8 +1,5 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(isset($default['de_shop_layout_use']) && $default['de_shop_layout_use'])
include_once(G5_SHOP_PATH.'/_head.php');
else
include_once(G5_MOBILE_PATH.'/head.php');
include_once(G5_MOBILE_PATH.'/head.php');
?>

View File

@ -1,8 +1,5 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(isset($default['de_shop_layout_use']) && $default['de_shop_layout_use'])
include_once(G5_SHOP_PATH.'/_tail.php');
else
include_once(G5_MOBILE_PATH.'/tail.php');
include_once(G5_MOBILE_PATH.'/tail.php');
?>

View File

@ -49,8 +49,8 @@ $str = preg_replace($src, $dst, $str);
if(trim($co['co_mobile_skin']) == '')
$co['co_mobile_skin'] = 'basic';
$content_skin_path = G5_MOBILE_PATH .'/'.G5_SKIN_DIR.'/content/'.$co['co_mobile_skin'];
$content_skin_url = G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/content/'.$co['co_mobile_skin'];
$content_skin_path = get_skin_path('content', $co['co_mobile_skin']);
$content_skin_url = get_skin_url('content', $co['co_mobile_skin']);
$skin_file = $content_skin_path.'/content.skin.php';
if(is_file($skin_file)) {

View File

@ -1,6 +1,11 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_PATH.'/head.php');
return;
}
include_once(G5_PATH.'/head.sub.php');
include_once(G5_LIB_PATH.'/latest.lib.php');
include_once(G5_LIB_PATH.'/outlogin.lib.php');

View File

@ -1,7 +1,12 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_MOBILE_PATH.'/_head.php');
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_PATH.'/index.php');
return;
}
include_once(G5_MOBILE_PATH.'/head.php');
?>
<!-- 메인화면 최신글 시작 -->
@ -26,5 +31,5 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
<!-- 메인화면 최신글 끝 -->
<?php
include_once(G5_MOBILE_PATH.'/_tail.php');
include_once(G5_MOBILE_PATH.'/tail.php');
?>

View File

@ -119,7 +119,7 @@ $cart_count = mysql_num_rows($result);
<span class="total_price total_span"><span>소계 </span><strong><?php echo number_format($sell_price); ?></strong></span>
<span class="total_point total_span"><span>적립포인트 </span><strong><?php echo number_format($sum['point']); ?></strong></span>
</div>
</li>
<?php
@ -204,7 +204,7 @@ $(function() {
});
// 옵션수정 닫기
$("#mod_option_close").live("click", function() {
$(document).on("click", "#mod_option_close", function() {
$("#mod_option_frm").remove();
$("#win_mask, .window").hide();
$(".mod_options").eq(close_btn_idx).focus();

View File

@ -38,13 +38,13 @@ if (file_exists($list_file))
include G5_MSHOP_SKIN_PATH.'/list.sort.skin.php';
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $ev['ev_mobile_list_mod'];
$items = $ev['ev_mobile_list_mod'] * $ev['ev_mobile_list_row'];
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$list = new item_list(G5_MSHOP_SKIN_PATH.'/'.$ev['ev_mobile_skin'], $ev['ev_mobile_list_mod'], 1, $ev['ev_mobile_img_width'], $ev['ev_mobile_img_height']);
$list = new item_list(G5_MSHOP_SKIN_PATH.'/'.$ev['ev_mobile_skin'], $ev['ev_mobile_list_mod'], $ev['ev_mobile_list_row'], $ev['ev_mobile_img_width'], $ev['ev_mobile_img_height']);
$list->set_event($ev['ev_id']);
$list->set_is_page(true);
$list->set_mobile(true);

View File

@ -151,7 +151,10 @@ $skin_dir = G5_MSHOP_SKIN_PATH;
$ca_dir_check = true;
if($it['it_mobile_skin']) {
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$it['it_mobile_skin'];
if(preg_match('#^theme/(.+)$#', $it['it_mobile_skin'], $match))
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$it['it_skin'];
if(is_dir($skin_dir)) {
$form_skin_file = $skin_dir.'/item.form.skin.php';
@ -163,7 +166,10 @@ if($it['it_mobile_skin']) {
if($ca_dir_check) {
if($ca['ca_mobile_skin_dir']) {
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
if(preg_match('#^theme/(.+)$#', $ca['ca_mobile_skin_dir'], $match))
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
if(is_dir($skin_dir)) {
$form_skin_file = $skin_dir.'/item.form.skin.php';

View File

@ -24,7 +24,10 @@ include_once(G5_MSHOP_PATH.'/_head.php');
$skin_dir = G5_MSHOP_SKIN_PATH;
if($ca['ca_mobile_skin_dir']) {
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
if(preg_match('#^theme/(.+)$#', $ca['ca_mobile_skin_dir'], $match))
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
if(is_dir($skin_dir)) {
$skin_file = $skin_dir.'/'.$ca['ca_mobile_skin'];
@ -56,8 +59,8 @@ var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
include $cate_skin;
// 분류 Best Item
$list_mod = 3;
$list_row = 3;
$list_mod = (isset($theme_config['ca_mobile_list_best_mod']) && $theme_config['ca_mobile_list_best_mod']) ? (int)$theme_config['ca_mobile_list_best_mod'] : $ca['ca_mobile_list_mod'];
$list_row = (isset($theme_config['ca_mobile_list_best_row']) && $theme_config['ca_mobile_list_best_row']) ? (int)$theme_config['ca_mobile_list_best_row'] : $ca['ca_mobile_list_row'];
$limit = $list_mod * $list_row;
$best_skin = G5_MSHOP_SKIN_PATH.'/list.best.10.skin.php';

View File

@ -696,7 +696,7 @@ $(function() {
);
});
$(".cp_apply").live("click", function() {
$(document).on("click", ".cp_apply", function() {
var $el = $(this).closest("tr");
var cp_id = $el.find("input[name='f_cp_id[]']").val();
var price = $el.find("input[name='f_cp_prc[]']").val();
@ -755,12 +755,12 @@ $(function() {
$cp_btn_el.after("<button type=\"button\" class=\"cp_cancel\">쿠폰취소</button>");
});
$("#cp_close").live("click", function() {
$(document).on("click", "#cp_close", function() {
$("#cp_frm").remove();
$cp_btn_el.focus();
});
$(".cp_cancel").live("click", function() {
$(document).on("click", ".cp_cancel", function() {
coupon_cancel($(this).closest("li"));
calculate_total_price();
$("#cp_frm").remove();
@ -785,7 +785,7 @@ $(function() {
);
});
$(".od_cp_apply").live("click", function() {
$(document).on("click", ".od_cp_apply", function() {
var $el = $(this).closest("tr");
var cp_id = $el.find("input[name='o_cp_id[]']").val();
var price = parseInt($el.find("input[name='o_cp_prc[]']").val());
@ -822,12 +822,12 @@ $(function() {
$("#od_coupon_btn").after("<button type=\"button\" id=\"od_coupon_cancel\" class=\"btn_frmline\">쿠폰취소</button>");
});
$("#od_coupon_close").live("click", function() {
$(document).on("click", "#od_coupon_close", function() {
$("#od_coupon_frm").remove();
$("#od_coupon_btn").focus();
});
$("#od_coupon_cancel").live("click", function() {
$(document).on("click", "#od_coupon_cancel", function() {
var org_price = $("input[name=org_od_price]").val();
var item_coupon = parseInt($("input[name=item_coupon]").val());
$("input[name=od_price]").val(org_price - item_coupon);
@ -858,7 +858,7 @@ $(function() {
);
});
$(".sc_cp_apply").live("click", function() {
$(document).on("click", ".sc_cp_apply", function() {
var $el = $(this).closest("tr");
var cp_id = $el.find("input[name='s_cp_id[]']").val();
var price = parseInt($el.find("input[name='s_cp_prc[]']").val());
@ -881,12 +881,12 @@ $(function() {
$("#sc_coupon_btn").after("<button type=\"button\" id=\"sc_coupon_cancel\" class=\"btn_frmline\">쿠폰취소</button>");
});
$("#sc_coupon_close").live("click", function() {
$(document).on("click", "#sc_coupon_close", function() {
$("#sc_coupon_frm").remove();
$("#sc_coupon_btn").focus();
});
$("#sc_coupon_cancel").live("click", function() {
$(document).on("click", "#sc_coupon_cancel", function() {
$("input[name=od_send_coupon]").val(0);
$("#sc_cp_price").text(0);
calculate_order_price();

View File

@ -1,6 +1,11 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_MSHOP_PATH.'/shop.head.php');
return;
}
include_once(G5_PATH.'/head.sub.php');
include_once(G5_LIB_PATH.'/outlogin.lib.php');
include_once(G5_LIB_PATH.'/visit.lib.php');
@ -35,7 +40,7 @@ include_once(G5_LIB_PATH.'/latest.lib.php');
</ul>
<div id="logo"><a href="<?php echo $default['de_root_index_use'] ? G5_URL : G5_SHOP_URL; ?>/"><img src="<?php echo G5_DATA_URL; ?>/common/mobile_logo_img" alt="<?php echo $config['cf_title']; ?> 메인"></a></div>
<div id="logo"><a href="<?php echo G5_SHOP_URL; ?>/"><img src="<?php echo G5_DATA_URL; ?>/common/mobile_logo_img" alt="<?php echo $config['cf_title']; ?> 메인"></a></div>
<?php include_once(G5_MSHOP_PATH.'/category.php'); // 분류 ?>
@ -79,28 +84,8 @@ include_once(G5_LIB_PATH.'/latest.lib.php');
<ul id="hd_mb">
<li><a href="<?php echo G5_BBS_URL; ?>/faq.php">FAQ</a></li>
<li><a href="<?php echo G5_BBS_URL; ?>/qalist.php">1:1문의</a></li>
<?php
if(!$default['de_root_index_use']) {
$com_href = G5_URL;
$com_name = '커뮤니티';
if($default['de_shop_layout_use']) {
if(!preg_match('#'.G5_SHOP_DIR.'/#', $_SERVER['SCRIPT_NAME'])) {
$com_href = G5_SHOP_URL;
$com_name = '쇼핑몰';
}
}
?>
<li><a href="<?php echo $com_href; ?>/"><?php echo $com_name; ?></a></li>
<?php
unset($com_href);
unset($com_name);
}
?>
<li><a href="<?php echo G5_URL; ?>/">커뮤니티</a></li>
<li><a href="<?php echo G5_SHOP_URL; ?>/personalpay.php">개인결제</a></li>
<?php if($default['de_root_index_use']) { ?>
<li><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=5">세일상품</a></li>
<?php } ?>
</ul>
</header>

View File

@ -1,6 +1,11 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_MSHOP_PATH.'/shop.tail.php');
return;
}
$admin = get_admin("super");
// 사용자 화면 우측과 하단을 담당하는 페이지입니다.

View File

@ -179,7 +179,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php
// 코멘트 입출력
include_once('./view_comment.php');
include_once(G5_BBS_PATH.'/view_comment.php');
?>
<div id="bo_v_bot">

View File

@ -179,7 +179,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
<?php
// 코멘트 입출력
include_once('./view_comment.php');
include_once(G5_BBS_PATH.'/view_comment.php');
?>
<div id="bo_v_bot">

View File

@ -21,7 +21,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<ul id="memo_list_ul">
<?php for ($i=0; $i<count($list); $i++) { ?>
<li>
<a href="<?php echo $list[$i]['view_href'] ?>" class="memo_link"><?php echo $list[$i]['send_datetime'] ?> 에 받은 쪽지</a>
<a href="<?php echo $list[$i]['view_href'] ?>" class="memo_link"><?php echo $list[$i]['send_datetime'] ?> 에 <?php echo ($kind == "recv") ? "받은" : "보낸"; ?> 쪽지</a>
<span class="memo_read"><?php echo $list[$i]['read_datetime'] ?></span>
<span class="memo_send"><?php echo $list[$i]['name'] ?></span>
<a href="<?php echo $list[$i]['del_href'] ?>" onclick="del(this.href); return false;" class="memo_del">삭제</a>

View File

@ -1,5 +1,10 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_PATH.'/tail.php');
return;
}
?>
</div>
</div>

View File

@ -29,7 +29,7 @@ function editor_html($id, $content, $is_dhtml_editor=true)
$(this).text("단축키 일람 닫기");
}
});
$(".btn_cke_sc_close").live("click",function(){
$(document).on("click", ".btn_cke_sc_close", function(){
$(this).parent("div.cke_sc_def").remove();
});
});';

View File

@ -0,0 +1,21 @@
Title: MIT License
Copyright (c) 2009-2013 Chris Leonello
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

1438
plugin/jqplot/excanvas.js Normal file

File diff suppressed because it is too large Load Diff

3
plugin/jqplot/excanvas.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
jsDate | (c) 2010-2013 Chris Leonello
*/(function(c){c.jqplot.PointLabels=function(e){this.show=c.jqplot.config.enablePlugins;this.location="n";this.labelsFromSeries=false;this.seriesLabelIndex=null;this.labels=[];this._labels=[];this.stackedValue=false;this.ypadding=6;this.xpadding=6;this.escapeHTML=true;this.edgeTolerance=-5;this.formatter=c.jqplot.DefaultTickFormatter;this.formatString="";this.hideZeros=false;this._elems=[];c.extend(true,this,e)};var a=["nw","n","ne","e","se","s","sw","w"];var d={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7};var b=["se","s","sw","w","nw","n","ne","e"];c.jqplot.PointLabels.init=function(j,h,f,g,i){var e=c.extend(true,{},f,g);e.pointLabels=e.pointLabels||{};if(this.renderer.constructor===c.jqplot.BarRenderer&&this.barDirection==="horizontal"&&!e.pointLabels.location){e.pointLabels.location="e"}this.plugins.pointLabels=new c.jqplot.PointLabels(e.pointLabels);this.plugins.pointLabels.setLabels.call(this)};c.jqplot.PointLabels.prototype.setLabels=function(){var f=this.plugins.pointLabels;var h;if(f.seriesLabelIndex!=null){h=f.seriesLabelIndex}else{if(this.renderer.constructor===c.jqplot.BarRenderer&&this.barDirection==="horizontal"){h=(this._plotData[0].length<3)?0:this._plotData[0].length-1}else{h=(this._plotData.length===0)?0:this._plotData[0].length-1}}f._labels=[];if(f.labels.length===0||f.labelsFromSeries){if(f.stackedValue){if(this._plotData.length&&this._plotData[0].length){for(var e=0;e<this._plotData.length;e++){f._labels.push(this._plotData[e][h])}}}else{var g=this.data;if(this.renderer.constructor===c.jqplot.BarRenderer&&this.waterfall){g=this._data}if(g.length&&g[0].length){for(var e=0;e<g.length;e++){f._labels.push(g[e][h])}}g=null}}else{if(f.labels.length){f._labels=f.labels}}};c.jqplot.PointLabels.prototype.xOffset=function(f,e,g){e=e||this.location;g=g||this.xpadding;var h;switch(e){case"nw":h=-f.outerWidth(true)-this.xpadding;break;case"n":h=-f.outerWidth(true)/2;break;case"ne":h=this.xpadding;break;case"e":h=this.xpadding;break;case"se":h=this.xpadding;break;case"s":h=-f.outerWidth(true)/2;break;case"sw":h=-f.outerWidth(true)-this.xpadding;break;case"w":h=-f.outerWidth(true)-this.xpadding;break;default:h=-f.outerWidth(true)-this.xpadding;break}return h};c.jqplot.PointLabels.prototype.yOffset=function(f,e,g){e=e||this.location;g=g||this.xpadding;var h;switch(e){case"nw":h=-f.outerHeight(true)-this.ypadding;break;case"n":h=-f.outerHeight(true)-this.ypadding;break;case"ne":h=-f.outerHeight(true)-this.ypadding;break;case"e":h=-f.outerHeight(true)/2;break;case"se":h=this.ypadding;break;case"s":h=this.ypadding;break;case"sw":h=this.ypadding;break;case"w":h=-f.outerHeight(true)/2;break;default:h=-f.outerHeight(true)-this.ypadding;break}return h};c.jqplot.PointLabels.draw=function(x,j,v){var t=this.plugins.pointLabels;t.setLabels.call(this);for(var w=0;w<t._elems.length;w++){t._elems[w].emptyForce()}t._elems.splice(0,t._elems.length);if(t.show){var r="_"+this._stackAxis+"axis";if(!t.formatString){t.formatString=this[r]._ticks[0].formatString;t.formatter=this[r]._ticks[0].formatter}var E=this._plotData;var D=this._prevPlotData;var A=this._xaxis;var q=this._yaxis;var z,f;for(var w=0,u=t._labels.length;w<u;w++){var o=t._labels[w];if(o==null||(t.hideZeros&&parseInt(o,10)==0)){continue}o=t.formatter(t.formatString,o);f=document.createElement("div");t._elems[w]=c(f);z=t._elems[w];z.addClass("jqplot-point-label jqplot-series-"+this.index+" jqplot-point-"+w);z.css("position","absolute");z.insertAfter(x.canvas);if(t.escapeHTML){z.text(o)}else{z.html(o)}var g=t.location;if((this.fillToZero&&E[w][1]<0)||(this.fillToZero&&this._type==="bar"&&this.barDirection==="horizontal"&&E[w][0]<0)||(this.waterfall&&parseInt(o,10))<0){g=b[d[g]]}var n=A.u2p(E[w][0])+t.xOffset(z,g);var h=q.u2p(E[w][1])+t.yOffset(z,g);if(this._stack&&!t.stackedValue){if(this.barDirection==="vertical"){h=(this._barPoints[w][0][1]+this._barPoints[w][1][1])/2+v._gridPadding.top-0.5*z.outerHeight(true)}else{n=(this._barPoints[w][2][0]+this._barPoints[w][0][0])/2+v._gridPadding.left-0.5*z.outerWidth(true)}}if(this.renderer.constructor==c.jqplot.BarRenderer){if(this.barDirection=="vertical"){n+=this._barNudge}else{h-=this._barNudge}}z.css("left",n);z.css("top",h);var k=n+z.width();var s=h+z.height();var C=t.edgeTolerance;var e=c(x.canvas).position().left;var y=c(x.canvas).position().top;var B=x.canvas.width+e;var m=x.canvas.height+y;if(n-C<e||h-C<y||k+C>B||s+C>m){z.remove()}z=null;f=null}}};c.jqplot.postSeriesInitHooks.push(c.jqplot.PointLabels.init);c.jqplot.postDrawSeriesHooks.push(c.jqplot.PointLabels.draw)})(jQuery);

View File

@ -0,0 +1,261 @@
/*rules for the plot target div. These will be cascaded down to all plot elements according to css rules*/
.jqplot-target {
position: relative;
color: #666666;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 1em;
/* height: 300px;
width: 400px;*/
}
/*rules applied to all axes*/
.jqplot-axis {
font-size: 0.9em;
}
.jqplot-xaxis {
margin-top: 10px;
}
.jqplot-x2axis {
margin-bottom: 10px;
}
.jqplot-yaxis {
margin-right: 10px;
}
.jqplot-y2axis, .jqplot-y3axis, .jqplot-y4axis, .jqplot-y5axis, .jqplot-y6axis, .jqplot-y7axis, .jqplot-y8axis, .jqplot-y9axis, .jqplot-yMidAxis {
margin-left: 10px;
margin-right: 10px;
}
/*rules applied to all axis tick divs*/
.jqplot-axis-tick, .jqplot-xaxis-tick, .jqplot-yaxis-tick, .jqplot-x2axis-tick, .jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick, .jqplot-yMidAxis-tick {
position: absolute;
white-space: pre;
}
.jqplot-xaxis-tick {
top: 0px;
/* initial position untill tick is drawn in proper place */
left: 15px;
/* padding-top: 10px;*/
vertical-align: top;
}
.jqplot-x2axis-tick {
bottom: 0px;
/* initial position untill tick is drawn in proper place */
left: 15px;
/* padding-bottom: 10px;*/
vertical-align: bottom;
}
.jqplot-yaxis-tick {
right: 0px;
/* initial position untill tick is drawn in proper place */
top: 15px;
/* padding-right: 10px;*/
text-align: right;
}
.jqplot-yaxis-tick.jqplot-breakTick {
right: -20px;
margin-right: 0px;
padding:1px 5px 1px 5px;
/*background-color: white;*/
z-index: 2;
font-size: 1.5em;
}
.jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick {
left: 0px;
/* initial position untill tick is drawn in proper place */
top: 15px;
/* padding-left: 10px;*/
/* padding-right: 15px;*/
text-align: left;
}
.jqplot-yMidAxis-tick {
text-align: center;
white-space: nowrap;
}
.jqplot-xaxis-label {
margin-top: 10px;
font-size: 11pt;
position: absolute;
}
.jqplot-x2axis-label {
margin-bottom: 10px;
font-size: 11pt;
position: absolute;
}
.jqplot-yaxis-label {
margin-right: 10px;
/* text-align: center;*/
font-size: 11pt;
position: absolute;
}
.jqplot-yMidAxis-label {
font-size: 11pt;
position: absolute;
}
.jqplot-y2axis-label, .jqplot-y3axis-label, .jqplot-y4axis-label, .jqplot-y5axis-label, .jqplot-y6axis-label, .jqplot-y7axis-label, .jqplot-y8axis-label, .jqplot-y9axis-label {
/* text-align: center;*/
font-size: 11pt;
margin-left: 10px;
position: absolute;
}
.jqplot-meterGauge-tick {
font-size: 0.75em;
color: #999999;
}
.jqplot-meterGauge-label {
font-size: 1em;
color: #999999;
}
table.jqplot-table-legend {
margin-top: 12px;
margin-bottom: 12px;
margin-left: 12px;
margin-right: 12px;
}
table.jqplot-table-legend, table.jqplot-cursor-legend {
background-color: rgba(255,255,255,0.6);
border: 1px solid #cccccc;
position: absolute;
font-size: 0.75em;
}
td.jqplot-table-legend {
vertical-align:middle;
}
/*
These rules could be used instead of assigning
element styles and relying on js object properties.
*/
/*
td.jqplot-table-legend-swatch {
padding-top: 0.5em;
text-align: center;
}
tr.jqplot-table-legend:first td.jqplot-table-legend-swatch {
padding-top: 0px;
}
*/
td.jqplot-seriesToggle:hover, td.jqplot-seriesToggle:active {
cursor: pointer;
}
.jqplot-table-legend .jqplot-series-hidden {
text-decoration: line-through;
}
div.jqplot-table-legend-swatch-outline {
border: 1px solid #cccccc;
padding:1px;
}
div.jqplot-table-legend-swatch {
width:0px;
height:0px;
border-top-width: 5px;
border-bottom-width: 5px;
border-left-width: 6px;
border-right-width: 6px;
border-top-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-right-style: solid;
}
.jqplot-title {
top: 0px;
left: 0px;
padding-bottom: 0.5em;
font-size: 1.2em;
}
table.jqplot-cursor-tooltip {
border: 1px solid #cccccc;
font-size: 0.75em;
}
.jqplot-cursor-tooltip {
border: 1px solid #cccccc;
font-size: 0.75em;
white-space: nowrap;
background: rgba(208,208,208,0.5);
padding: 1px;
}
.jqplot-highlighter-tooltip, .jqplot-canvasOverlay-tooltip {
border: 1px solid #cccccc;
font-size: 0.75em;
white-space: nowrap;
background: rgba(208,208,208,0.5);
padding: 1px;
}
.jqplot-point-label {
font-size: 1em;
z-index: 2;
font-weight:bold;
color:#ff670f;
}
td.jqplot-cursor-legend-swatch {
vertical-align: middle;
text-align: center;
}
div.jqplot-cursor-legend-swatch {
width: 1.2em;
height: 0.7em;
}
.jqplot-error {
/* Styles added to the plot target container when there is an error go here.*/
text-align: center;
}
.jqplot-error-message {
/* Styling of the custom error message div goes here.*/
position: relative;
top: 46%;
display: inline-block;
}
div.jqplot-bubble-label {
font-size: 0.8em;
/* background: rgba(90%, 90%, 90%, 0.15);*/
padding-left: 2px;
padding-right: 2px;
color: rgb(20%, 20%, 20%);
}
div.jqplot-bubble-label.jqplot-bubble-label-highlight {
background: rgba(90%, 90%, 90%, 0.7);
}
div.jqplot-noData-container {
text-align: center;
background-color: rgba(96%, 96%, 96%, 0.3);
}

11411
plugin/jqplot/jquery.jqplot.js Normal file

File diff suppressed because it is too large Load Diff

1
plugin/jqplot/jquery.jqplot.min.css vendored Normal file
View File

@ -0,0 +1 @@
.jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em}.jqplot-axis{font-size:.75em}.jqplot-xaxis{margin-top:10px}.jqplot-x2axis{margin-bottom:10px}.jqplot-yaxis{margin-right:10px}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis,.jqplot-yMidAxis{margin-left:10px;margin-right:10px}.jqplot-axis-tick,.jqplot-xaxis-tick,.jqplot-yaxis-tick,.jqplot-x2axis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick,.jqplot-yMidAxis-tick{position:absolute;white-space:pre}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom}.jqplot-yaxis-tick{right:0;top:15px;text-align:right}.jqplot-yaxis-tick.jqplot-breakTick{right:-20px;margin-right:0;padding:1px 5px 1px 5px;z-index:2;font-size:1.5em}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left}.jqplot-yMidAxis-tick{text-align:center;white-space:nowrap}.jqplot-xaxis-label{margin-top:10px;font-size:11pt;position:absolute}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute}.jqplot-yMidAxis-label{font-size:11pt;position:absolute}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;margin-left:10px;position:absolute}.jqplot-meterGauge-tick{font-size:.75em;color:#999}.jqplot-meterGauge-label{font-size:1em;color:#999}table.jqplot-table-legend{margin-top:12px;margin-bottom:12px;margin-left:12px;margin-right:12px}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em}td.jqplot-table-legend{vertical-align:middle}td.jqplot-seriesToggle:hover,td.jqplot-seriesToggle:active{cursor:pointer}.jqplot-table-legend .jqplot-series-hidden{text-decoration:line-through}div.jqplot-table-legend-swatch-outline{border:1px solid #ccc;padding:1px}div.jqplot-table-legend-swatch{width:0;height:0;border-top-width:5px;border-bottom-width:5px;border-left-width:6px;border-right-width:6px;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-style:solid}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em}.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-highlighter-tooltip,.jqplot-canvasOverlay-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-point-label{font-size:.75em;z-index:2}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em}.jqplot-error{text-align:center}.jqplot-error-message{position:relative;top:46%;display:inline-block}div.jqplot-bubble-label{font-size:.8em;padding-left:2px;padding-right:2px;color:rgb(20%,20%,20%)}div.jqplot-bubble-label.jqplot-bubble-label-highlight{background:rgba(90%,90%,90%,0.7)}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,0.3)}

3
plugin/jqplot/jquery.jqplot.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,314 @@
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.8
* Revision: 1250
*
* Copyright (c) 2009-2013 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
*
* version 2007.04.27
* author Ash Searle
* http://hexmen.com/blog/2007/03/printf-sprintf/
* http://hexmen.com/js/sprintf.js
* The author (Ash Searle) has placed this code in the public domain:
* "This code is unrestricted: you are free to use it however you like."
*
*/
(function($) {
// Class: $.jqplot.BezierCurveRenderer.js
// Renderer which draws lines as stacked bezier curves.
// Data for the line will not be specified as an array of
// [x, y] data point values, but as a an array of [start piont, bezier curve]
// So, the line is specified as: [[xstart, ystart], [cp1x, cp1y, cp2x, cp2y, xend, yend]].
$.jqplot.BezierCurveRenderer = function(){
$.jqplot.LineRenderer.call(this);
};
$.jqplot.BezierCurveRenderer.prototype = new $.jqplot.LineRenderer();
$.jqplot.BezierCurveRenderer.prototype.constructor = $.jqplot.BezierCurveRenderer;
// Method: setGridData
// converts the user data values to grid coordinates and stores them
// in the gridData array.
// Called with scope of a series.
$.jqplot.BezierCurveRenderer.prototype.setGridData = function(plot) {
// recalculate the grid data
var xp = this._xaxis.series_u2p;
var yp = this._yaxis.series_u2p;
// this._plotData should be same as this.data
var data = this.data;
this.gridData = [];
this._prevGridData = [];
// if seriesIndex = 0, fill to x axis.
// if seriesIndex > 0, fill to previous series data.
var idx = this.index;
if (data.length == 2) {
if (idx == 0) {
this.gridData = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
[xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, this._yaxis.min)],
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
];
}
else {
var psd = plot.series[idx-1].data;
this.gridData = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
[xp.call(this._xaxis, psd[1][4]), yp.call(this._yaxis, psd[1][5])],
[xp.call(this._xaxis, psd[1][2]), yp.call(this._yaxis, psd[1][3]),
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
];
}
}
else {
if (idx == 0) {
this.gridData = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
[xp.call(this._xaxis, data[3][1]), yp.call(this._yaxis, this._yaxis.min)],
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
];
}
else {
var psd = plot.series[idx-1].data;
this.gridData = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
[xp.call(this._xaxis, psd[3][0]), yp.call(this._yaxis, psd[3][1])],
[xp.call(this._xaxis, psd[2][0]), yp.call(this._yaxis, psd[2][1]),
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
];
}
}
};
// Method: makeGridData
// converts any arbitrary data values to grid coordinates and
// returns them. This method exists so that plugins can use a series'
// linerenderer to generate grid data points without overwriting the
// grid data associated with that series.
// Called with scope of a series.
$.jqplot.BezierCurveRenderer.prototype.makeGridData = function(data, plot) {
// recalculate the grid data
var xp = this._xaxis.series_u2p;
var yp = this._yaxis.series_u2p;
var gd = [];
var pgd = [];
// if seriesIndex = 0, fill to x axis.
// if seriesIndex > 0, fill to previous series data.
var idx = this.index;
if (data.length == 2) {
if (idx == 0) {
gd = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
[xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, this._yaxis.min)],
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
];
}
else {
var psd = plot.series[idx-1].data;
gd = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
[xp.call(this._xaxis, psd[1][4]), yp.call(this._yaxis, psd[1][5])],
[xp.call(this._xaxis, psd[1][2]), yp.call(this._yaxis, psd[1][3]),
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
];
}
}
else {
if (idx == 0) {
gd = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
[xp.call(this._xaxis, data[3][1]), yp.call(this._yaxis, this._yaxis.min)],
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
];
}
else {
var psd = plot.series[idx-1].data;
gd = [
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
[xp.call(this._xaxis, psd[3][0]), yp.call(this._yaxis, psd[3][1])],
[xp.call(this._xaxis, psd[2][0]), yp.call(this._yaxis, psd[2][1]),
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
];
}
}
return gd;
};
// called within scope of series.
$.jqplot.BezierCurveRenderer.prototype.draw = function(ctx, gd, options) {
var i;
ctx.save();
if (gd.length) {
if (this.showLine) {
ctx.save();
var opts = (options != null) ? options : {};
ctx.fillStyle = opts.fillStyle || this.color;
ctx.beginPath();
ctx.moveTo(gd[0][0], gd[0][1]);
ctx.bezierCurveTo(gd[1][0], gd[1][1], gd[1][2], gd[1][3], gd[1][4], gd[1][5]);
ctx.lineTo(gd[2][0], gd[2][1]);
if (gd[3].length == 2) {
ctx.lineTo(gd[3][0], gd[3][1]);
}
else {
ctx.bezierCurveTo(gd[3][0], gd[3][1], gd[3][2], gd[3][3], gd[3][4], gd[3][5]);
}
ctx.closePath();
ctx.fill();
ctx.restore();
}
}
ctx.restore();
};
$.jqplot.BezierCurveRenderer.prototype.drawShadow = function(ctx, gd, options) {
// This is a no-op, shadows drawn with lines.
};
$.jqplot.BezierAxisRenderer = function() {
$.jqplot.LinearAxisRenderer.call(this);
};
$.jqplot.BezierAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
$.jqplot.BezierAxisRenderer.prototype.constructor = $.jqplot.BezierAxisRenderer;
// Axes on a plot with Bezier Curves
$.jqplot.BezierAxisRenderer.prototype.init = function(options){
$.extend(true, this, options);
var db = this._dataBounds;
// Go through all the series attached to this axis and find
// the min/max bounds for this axis.
for (var i=0; i<this._series.length; i++) {
var s = this._series[i];
var d = s.data;
if (d.length == 4) {
for (var j=0; j<d.length; j++) {
if (this.name == 'xaxis' || this.name == 'x2axis') {
if (d[j][0] < db.min || db.min == null) {
db.min = d[j][0];
}
if (d[j][0] > db.max || db.max == null) {
db.max = d[j][0];
}
}
else {
if (d[j][1] < db.min || db.min == null) {
db.min = d[j][1];
}
if (d[j][1] > db.max || db.max == null) {
db.max = d[j][1];
}
}
}
}
else {
if (this.name == 'xaxis' || this.name == 'x2axis') {
if (d[0][0] < db.min || db.min == null) {
db.min = d[0][0];
}
if (d[0][0] > db.max || db.max == null) {
db.max = d[0][0];
}
for (var j=0; j<5; j+=2) {
if (d[1][j] < db.min || db.min == null) {
db.min = d[1][j];
}
if (d[1][j] > db.max || db.max == null) {
db.max = d[1][j];
}
}
}
else {
if (d[0][1] < db.min || db.min == null) {
db.min = d[0][1];
}
if (d[0][1] > db.max || db.max == null) {
db.max = d[0][1];
}
for (var j=1; j<6; j+=2) {
if (d[1][j] < db.min || db.min == null) {
db.min = d[1][j];
}
if (d[1][j] > db.max || db.max == null) {
db.max = d[1][j];
}
}
}
}
}
};
// setup default renderers for axes and legend so user doesn't have to
// called with scope of plot
function preInit(target, data, options) {
options = options || {};
options.axesDefaults = $.extend(true, {pad:0}, options.axesDefaults);
options.seriesDefaults = options.seriesDefaults || {};
options.legend = $.extend(true, {placement:'outside'}, options.legend);
// only set these if there is a pie series
var setopts = false;
if (options.seriesDefaults.renderer == $.jqplot.BezierCurveRenderer) {
setopts = true;
}
else if (options.series) {
for (var i=0; i < options.series.length; i++) {
if (options.series[i].renderer == $.jqplot.BezierCurveRenderer) {
setopts = true;
}
}
}
if (setopts) {
options.axesDefaults.renderer = $.jqplot.BezierAxisRenderer;
}
}
$.jqplot.preInitHooks.push(preInit);
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,801 @@
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.8
* Revision: 1250
*
* Copyright (c) 2009-2013 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
*
* version 2007.04.27
* author Ash Searle
* http://hexmen.com/blog/2007/03/printf-sprintf/
* http://hexmen.com/js/sprintf.js
* The author (Ash Searle) has placed this code in the public domain:
* "This code is unrestricted: you are free to use it however you like."
*
*/
(function($) {
// Class: $.jqplot.BarRenderer
// A plugin renderer for jqPlot to draw a bar plot.
// Draws series as a line.
$.jqplot.BarRenderer = function(){
$.jqplot.LineRenderer.call(this);
};
$.jqplot.BarRenderer.prototype = new $.jqplot.LineRenderer();
$.jqplot.BarRenderer.prototype.constructor = $.jqplot.BarRenderer;
// called with scope of series.
$.jqplot.BarRenderer.prototype.init = function(options, plot) {
// Group: Properties
//
// prop: barPadding
// Number of pixels between adjacent bars at the same axis value.
this.barPadding = 8;
// prop: barMargin
// Number of pixels between groups of bars at adjacent axis values.
this.barMargin = 10;
// prop: barDirection
// 'vertical' = up and down bars, 'horizontal' = side to side bars
this.barDirection = 'vertical';
// prop: barWidth
// Width of the bar in pixels (auto by devaul). null = calculated automatically.
this.barWidth = null;
// prop: shadowOffset
// offset of the shadow from the slice and offset of
// each succesive stroke of the shadow from the last.
this.shadowOffset = 2;
// prop: shadowDepth
// number of strokes to apply to the shadow,
// each stroke offset shadowOffset from the last.
this.shadowDepth = 5;
// prop: shadowAlpha
// transparency of the shadow (0 = transparent, 1 = opaque)
this.shadowAlpha = 0.08;
// prop: waterfall
// true to enable waterfall plot.
this.waterfall = false;
// prop: groups
// group bars into this many groups
this.groups = 1;
// prop: varyBarColor
// true to color each bar of a series separately rather than
// have every bar of a given series the same color.
// If used for non-stacked multiple series bar plots, user should
// specify a separate 'seriesColors' array for each series.
// Otherwise, each series will set their bars to the same color array.
// This option has no Effect for stacked bar charts and is disabled.
this.varyBarColor = false;
// prop: highlightMouseOver
// True to highlight slice when moused over.
// This must be false to enable highlightMouseDown to highlight when clicking on a slice.
this.highlightMouseOver = true;
// prop: highlightMouseDown
// True to highlight when a mouse button is pressed over a slice.
// This will be disabled if highlightMouseOver is true.
this.highlightMouseDown = false;
// prop: highlightColors
// an array of colors to use when highlighting a bar.
this.highlightColors = [];
// prop: transposedData
// NOT IMPLEMENTED YET. True if this is a horizontal bar plot and
// x and y values are "transposed". Tranposed, or "swapped", data is
// required prior to rev. 894 builds of jqPlot with horizontal bars.
// Allows backward compatability of bar renderer horizontal bars with
// old style data sets.
this.transposedData = true;
this.renderer.animation = {
show: false,
direction: 'down',
speed: 3000,
_supported: true
};
this._type = 'bar';
// if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
if (options.highlightMouseDown && options.highlightMouseOver == null) {
options.highlightMouseOver = false;
}
//////
// This is probably wrong here.
// After going back and forth on whether renderer should be the thing
// or extend the thing, it seems that it it best if it is a property
// on the thing. This should be something that is commonized
// among series renderers in the future.
//////
$.extend(true, this, options);
// really should probably do this
$.extend(true, this.renderer, options);
// fill is still needed to properly draw the legend.
// bars have to be filled.
this.fill = true;
// if horizontal bar and animating, reset the default direction
if (this.barDirection === 'horizontal' && this.rendererOptions.animation && this.rendererOptions.animation.direction == null) {
this.renderer.animation.direction = 'left';
}
if (this.waterfall) {
this.fillToZero = false;
this.disableStack = true;
}
if (this.barDirection == 'vertical' ) {
this._primaryAxis = '_xaxis';
this._stackAxis = 'y';
this.fillAxis = 'y';
}
else {
this._primaryAxis = '_yaxis';
this._stackAxis = 'x';
this.fillAxis = 'x';
}
// index of the currenty highlighted point, if any
this._highlightedPoint = null;
// total number of values for all bar series, total number of bar series, and position of this series
this._plotSeriesInfo = null;
// Array of actual data colors used for each data point.
this._dataColors = [];
this._barPoints = [];
// set the shape renderer options
var opts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, strokeStyle:this.color, fillStyle:this.color, closePath:this.fill};
this.renderer.shapeRenderer.init(opts);
// set the shadow renderer options
var sopts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, closePath:this.fill};
this.renderer.shadowRenderer.init(sopts);
plot.postInitHooks.addOnce(postInit);
plot.postDrawHooks.addOnce(postPlotDraw);
plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
};
// called with scope of series
function barPreInit(target, data, seriesDefaults, options) {
if (this.rendererOptions.barDirection == 'horizontal') {
this._stackAxis = 'x';
this._primaryAxis = '_yaxis';
}
if (this.rendererOptions.waterfall == true) {
this._data = $.extend(true, [], this.data);
var sum = 0;
var pos = (!this.rendererOptions.barDirection || this.rendererOptions.barDirection === 'vertical' || this.transposedData === false) ? 1 : 0;
for(var i=0; i<this.data.length; i++) {
sum += this.data[i][pos];
if (i>0) {
this.data[i][pos] += this.data[i-1][pos];
}
}
this.data[this.data.length] = (pos == 1) ? [this.data.length+1, sum] : [sum, this.data.length+1];
this._data[this._data.length] = (pos == 1) ? [this._data.length+1, sum] : [sum, this._data.length+1];
}
if (this.rendererOptions.groups > 1) {
this.breakOnNull = true;
var l = this.data.length;
var skip = parseInt(l/this.rendererOptions.groups, 10);
var count = 0;
for (var i=skip; i<l; i+=skip) {
this.data.splice(i+count, 0, [null, null]);
this._plotData.splice(i+count, 0, [null, null]);
this._stackData.splice(i+count, 0, [null, null]);
count++;
}
for (i=0; i<this.data.length; i++) {
if (this._primaryAxis == '_xaxis') {
this.data[i][0] = i+1;
this._plotData[i][0] = i+1;
this._stackData[i][0] = i+1;
}
else {
this.data[i][1] = i+1;
this._plotData[i][1] = i+1;
this._stackData[i][1] = i+1;
}
}
}
}
$.jqplot.preSeriesInitHooks.push(barPreInit);
// needs to be called with scope of series, not renderer.
$.jqplot.BarRenderer.prototype.calcSeriesNumbers = function() {
var nvals = 0;
var nseries = 0;
var paxis = this[this._primaryAxis];
var s, series, pos;
// loop through all series on this axis
for (var i=0; i < paxis._series.length; i++) {
series = paxis._series[i];
if (series === this) {
pos = i;
}
// is the series rendered as a bar?
if (series.renderer.constructor == $.jqplot.BarRenderer) {
// gridData may not be computed yet, use data length insted
nvals += series.data.length;
nseries += 1;
}
}
// return total number of values for all bar series, total number of bar series, and position of this series
return [nvals, nseries, pos];
};
$.jqplot.BarRenderer.prototype.setBarWidth = function() {
// need to know how many data values we have on the approprate axis and figure it out.
var i;
var nvals = 0;
var nseries = 0;
var paxis = this[this._primaryAxis];
var s, series, pos;
var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
nvals = temp[0];
nseries = temp[1];
var nticks = paxis.numberTicks;
var nbins = (nticks-1)/2;
// so, now we have total number of axis values.
if (paxis.name == 'xaxis' || paxis.name == 'x2axis') {
if (this._stack) {
this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals * nseries - this.barMargin;
}
else {
this.barWidth = ((paxis._offsets.max - paxis._offsets.min)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries;
// this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals - this.barPadding - this.barMargin/nseries;
}
}
else {
if (this._stack) {
this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals * nseries - this.barMargin;
}
else {
this.barWidth = ((paxis._offsets.min - paxis._offsets.max)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries;
// this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals - this.barPadding - this.barMargin/nseries;
}
}
return [nvals, nseries];
};
function computeHighlightColors (colors) {
var ret = [];
for (var i=0; i<colors.length; i++){
var rgba = $.jqplot.getColorComponents(colors[i]);
var newrgb = [rgba[0], rgba[1], rgba[2]];
var sum = newrgb[0] + newrgb[1] + newrgb[2];
for (var j=0; j<3; j++) {
// when darkening, lowest color component can be is 60.
newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
newrgb[j] = parseInt(newrgb[j], 10);
}
ret.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
}
return ret;
}
function getStart(sidx, didx, comp, plot, axis) {
// check if sign change
var seriesIndex = sidx,
prevSeriesIndex = sidx - 1,
start,
prevVal,
aidx = (axis === 'x') ? 0 : 1;
// is this not the first series?
if (seriesIndex > 0) {
prevVal = plot.series[prevSeriesIndex]._plotData[didx][aidx];
// is there a sign change
if ((comp * prevVal) < 0) {
start = getStart(prevSeriesIndex, didx, comp, plot, axis);
}
// no sign change.
else {
start = plot.series[prevSeriesIndex].gridData[didx][aidx];
}
}
// if first series, return value at 0
else {
start = (aidx === 0) ? plot.series[seriesIndex]._xaxis.series_u2p(0) : plot.series[seriesIndex]._yaxis.series_u2p(0);
}
return start;
}
$.jqplot.BarRenderer.prototype.draw = function(ctx, gridData, options, plot) {
var i;
// Ughhh, have to make a copy of options b/c it may be modified later.
var opts = $.extend({}, options);
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
var xaxis = this.xaxis;
var yaxis = this.yaxis;
var xp = this._xaxis.series_u2p;
var yp = this._yaxis.series_u2p;
var pointx, pointy;
// clear out data colors.
this._dataColors = [];
this._barPoints = [];
if (this.barWidth == null) {
this.renderer.setBarWidth.call(this);
}
var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
var nvals = temp[0];
var nseries = temp[1];
var pos = temp[2];
var points = [];
if (this._stack) {
this._barNudge = 0;
}
else {
this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding);
}
if (showLine) {
var negativeColors = new $.jqplot.ColorGenerator(this.negativeSeriesColors);
var positiveColors = new $.jqplot.ColorGenerator(this.seriesColors);
var negativeColor = negativeColors.get(this.index);
if (! this.useNegativeColors) {
negativeColor = opts.fillStyle;
}
var positiveColor = opts.fillStyle;
var base;
var xstart;
var ystart;
if (this.barDirection == 'vertical') {
for (var i=0; i<gridData.length; i++) {
if (!this._stack && this.data[i][1] == null) {
continue;
}
points = [];
base = gridData[i][0] + this._barNudge;
// stacked
if (this._stack && this._prevGridData.length) {
ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y');
}
// not stacked
else {
if (this.fillToZero) {
ystart = this._yaxis.series_u2p(0);
}
else if (this.waterfall && i > 0 && i < this.gridData.length-1) {
ystart = this.gridData[i-1][1];
}
else if (this.waterfall && i == 0 && i < this.gridData.length-1) {
if (this._yaxis.min <= 0 && this._yaxis.max >= 0) {
ystart = this._yaxis.series_u2p(0);
}
else if (this._yaxis.min > 0) {
ystart = ctx.canvas.height;
}
else {
ystart = 0;
}
}
else if (this.waterfall && i == this.gridData.length - 1) {
if (this._yaxis.min <= 0 && this._yaxis.max >= 0) {
ystart = this._yaxis.series_u2p(0);
}
else if (this._yaxis.min > 0) {
ystart = ctx.canvas.height;
}
else {
ystart = 0;
}
}
else {
ystart = ctx.canvas.height;
}
}
if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) {
if (this.varyBarColor && !this._stack) {
if (this.useNegativeColors) {
opts.fillStyle = negativeColors.next();
}
else {
opts.fillStyle = positiveColors.next();
}
}
else {
opts.fillStyle = negativeColor;
}
}
else {
if (this.varyBarColor && !this._stack) {
opts.fillStyle = positiveColors.next();
}
else {
opts.fillStyle = positiveColor;
}
}
if (!this.fillToZero || this._plotData[i][1] >= 0) {
points.push([base-this.barWidth/2, ystart]);
points.push([base-this.barWidth/2, gridData[i][1]]);
points.push([base+this.barWidth/2, gridData[i][1]]);
points.push([base+this.barWidth/2, ystart]);
}
// for negative bars make sure points are always ordered clockwise
else {
points.push([base-this.barWidth/2, gridData[i][1]]);
points.push([base-this.barWidth/2, ystart]);
points.push([base+this.barWidth/2, ystart]);
points.push([base+this.barWidth/2, gridData[i][1]]);
}
this._barPoints.push(points);
// now draw the shadows if not stacked.
// for stacked plots, they are predrawn by drawShadow
if (shadow && !this._stack) {
var sopts = $.extend(true, {}, opts);
// need to get rid of fillStyle on shadow.
delete sopts.fillStyle;
this.renderer.shadowRenderer.draw(ctx, points, sopts);
}
var clr = opts.fillStyle || this.color;
this._dataColors.push(clr);
this.renderer.shapeRenderer.draw(ctx, points, opts);
}
}
else if (this.barDirection == 'horizontal'){
for (var i=0; i<gridData.length; i++) {
if (!this._stack && this.data[i][0] == null) {
continue;
}
points = [];
base = gridData[i][1] - this._barNudge;
xstart;
if (this._stack && this._prevGridData.length) {
xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x');
}
// not stacked
else {
if (this.fillToZero) {
xstart = this._xaxis.series_u2p(0);
}
else if (this.waterfall && i > 0 && i < this.gridData.length-1) {
xstart = this.gridData[i-1][0];
}
else if (this.waterfall && i == 0 && i < this.gridData.length-1) {
if (this._xaxis.min <= 0 && this._xaxis.max >= 0) {
xstart = this._xaxis.series_u2p(0);
}
else if (this._xaxis.min > 0) {
xstart = 0;
}
else {
xstart = 0;
}
}
else if (this.waterfall && i == this.gridData.length - 1) {
if (this._xaxis.min <= 0 && this._xaxis.max >= 0) {
xstart = this._xaxis.series_u2p(0);
}
else if (this._xaxis.min > 0) {
xstart = 0;
}
else {
xstart = ctx.canvas.width;
}
}
else {
xstart = 0;
}
}
if ((this.fillToZero && this._plotData[i][0] < 0) || (this.waterfall && this._data[i][0] < 0)) {
if (this.varyBarColor && !this._stack) {
if (this.useNegativeColors) {
opts.fillStyle = negativeColors.next();
}
else {
opts.fillStyle = positiveColors.next();
}
}
else {
opts.fillStyle = negativeColor;
}
}
else {
if (this.varyBarColor && !this._stack) {
opts.fillStyle = positiveColors.next();
}
else {
opts.fillStyle = positiveColor;
}
}
if (!this.fillToZero || this._plotData[i][0] >= 0) {
points.push([xstart, base + this.barWidth / 2]);
points.push([xstart, base - this.barWidth / 2]);
points.push([gridData[i][0], base - this.barWidth / 2]);
points.push([gridData[i][0], base + this.barWidth / 2]);
}
else {
points.push([gridData[i][0], base + this.barWidth / 2]);
points.push([gridData[i][0], base - this.barWidth / 2]);
points.push([xstart, base - this.barWidth / 2]);
points.push([xstart, base + this.barWidth / 2]);
}
this._barPoints.push(points);
// now draw the shadows if not stacked.
// for stacked plots, they are predrawn by drawShadow
if (shadow && !this._stack) {
var sopts = $.extend(true, {}, opts);
delete sopts.fillStyle;
this.renderer.shadowRenderer.draw(ctx, points, sopts);
}
var clr = opts.fillStyle || this.color;
this._dataColors.push(clr);
this.renderer.shapeRenderer.draw(ctx, points, opts);
}
}
}
if (this.highlightColors.length == 0) {
this.highlightColors = $.jqplot.computeHighlightColors(this._dataColors);
}
else if (typeof(this.highlightColors) == 'string') {
var temp = this.highlightColors;
this.highlightColors = [];
for (var i=0; i<this._dataColors.length; i++) {
this.highlightColors.push(temp);
}
}
};
// for stacked plots, shadows will be pre drawn by drawShadow.
$.jqplot.BarRenderer.prototype.drawShadow = function(ctx, gridData, options, plot) {
var i;
var opts = (options != undefined) ? options : {};
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
var xaxis = this.xaxis;
var yaxis = this.yaxis;
var xp = this._xaxis.series_u2p;
var yp = this._yaxis.series_u2p;
var pointx, points, pointy, nvals, nseries, pos;
if (this._stack && this.shadow) {
if (this.barWidth == null) {
this.renderer.setBarWidth.call(this);
}
var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
nvals = temp[0];
nseries = temp[1];
pos = temp[2];
if (this._stack) {
this._barNudge = 0;
}
else {
this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding);
}
if (showLine) {
if (this.barDirection == 'vertical') {
for (var i=0; i<gridData.length; i++) {
if (this.data[i][1] == null) {
continue;
}
points = [];
var base = gridData[i][0] + this._barNudge;
var ystart;
if (this._stack && this._prevGridData.length) {
ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y');
}
else {
if (this.fillToZero) {
ystart = this._yaxis.series_u2p(0);
}
else {
ystart = ctx.canvas.height;
}
}
points.push([base-this.barWidth/2, ystart]);
points.push([base-this.barWidth/2, gridData[i][1]]);
points.push([base+this.barWidth/2, gridData[i][1]]);
points.push([base+this.barWidth/2, ystart]);
this.renderer.shadowRenderer.draw(ctx, points, opts);
}
}
else if (this.barDirection == 'horizontal'){
for (var i=0; i<gridData.length; i++) {
if (this.data[i][0] == null) {
continue;
}
points = [];
var base = gridData[i][1] - this._barNudge;
var xstart;
if (this._stack && this._prevGridData.length) {
xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x');
}
else {
if (this.fillToZero) {
xstart = this._xaxis.series_u2p(0);
}
else {
xstart = 0;
}
}
points.push([xstart, base+this.barWidth/2]);
points.push([gridData[i][0], base+this.barWidth/2]);
points.push([gridData[i][0], base-this.barWidth/2]);
points.push([xstart, base-this.barWidth/2]);
this.renderer.shadowRenderer.draw(ctx, points, opts);
}
}
}
}
};
function postInit(target, data, options) {
for (var i=0; i<this.series.length; i++) {
if (this.series[i].renderer.constructor == $.jqplot.BarRenderer) {
// don't allow mouseover and mousedown at same time.
if (this.series[i].highlightMouseOver) {
this.series[i].highlightMouseDown = false;
}
}
}
}
// called within context of plot
// create a canvas which we can draw on.
// insert it before the eventCanvas, so eventCanvas will still capture events.
function postPlotDraw() {
// Memory Leaks patch
if (this.plugins.barRenderer && this.plugins.barRenderer.highlightCanvas) {
this.plugins.barRenderer.highlightCanvas.resetCanvas();
this.plugins.barRenderer.highlightCanvas = null;
}
this.plugins.barRenderer = {highlightedSeriesIndex:null};
this.plugins.barRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-barRenderer-highlight-canvas', this._plotDimensions, this));
this.plugins.barRenderer.highlightCanvas.setContext();
this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
}
function highlight (plot, sidx, pidx, points) {
var s = plot.series[sidx];
var canvas = plot.plugins.barRenderer.highlightCanvas;
canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
s._highlightedPoint = pidx;
plot.plugins.barRenderer.highlightedSeriesIndex = sidx;
var opts = {fillStyle: s.highlightColors[pidx]};
s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
canvas = null;
}
function unhighlight (plot) {
var canvas = plot.plugins.barRenderer.highlightCanvas;
canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
for (var i=0; i<plot.series.length; i++) {
plot.series[i]._highlightedPoint = null;
}
plot.plugins.barRenderer.highlightedSeriesIndex = null;
plot.target.trigger('jqplotDataUnhighlight');
canvas = null;
}
function handleMove(ev, gridpos, datapos, neighbor, plot) {
if (neighbor) {
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
var evt1 = jQuery.Event('jqplotDataMouseOver');
evt1.pageX = ev.pageX;
evt1.pageY = ev.pageY;
plot.target.trigger(evt1, ins);
if (plot.series[ins[0]].show && plot.series[ins[0]].highlightMouseOver &&
!(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
var evt = jQuery.Event('jqplotDataHighlight');
evt.which = ev.which;
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
plot.target.trigger(evt, ins);
highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
}
}
else if (neighbor == null) {
unhighlight (plot);
}
}
function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
if (neighbor) {
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
var evt = jQuery.Event('jqplotDataHighlight');
evt.which = ev.which;
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
plot.target.trigger(evt, ins);
highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
}
}
else if (neighbor == null) {
unhighlight (plot);
}
}
function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
var idx = plot.plugins.barRenderer.highlightedSeriesIndex;
if (idx != null && plot.series[idx].highlightMouseDown) {
unhighlight(plot);
}
}
function handleClick(ev, gridpos, datapos, neighbor, plot) {
if (neighbor) {
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
var evt = jQuery.Event('jqplotDataClick');
evt.which = ev.which;
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
plot.target.trigger(evt, ins);
}
}
function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
if (neighbor) {
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
var idx = plot.plugins.barRenderer.highlightedSeriesIndex;
if (idx != null && plot.series[idx].highlightMouseDown) {
unhighlight(plot);
}
var evt = jQuery.Event('jqplotDataRightClick');
evt.which = ev.which;
evt.pageX = ev.pageX;
evt.pageY = ev.pageY;
plot.target.trigger(evt, ins);
}
}
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,235 @@
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.8
* Revision: 1250
*
* Copyright (c) 2009-2013 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
*
* version 2007.04.27
* author Ash Searle
* http://hexmen.com/blog/2007/03/printf-sprintf/
* http://hexmen.com/js/sprintf.js
* The author (Ash Searle) has placed this code in the public domain:
* "This code is unrestricted: you are free to use it however you like."
*
*/
(function($) {
/**
* Class: $.jqplot.BlockRenderer
* Plugin renderer to draw a x-y block chart. A Block chart has data points displayed as
* colored squares with a text label inside. Data must be supplied in the form:
*
* > [[x1, y1, "label 1", {css}], [x2, y2, "label 2", {css}], ...]
*
* The label and css object are optional. If the label is ommitted, the
* box will collapse unless a css height and/or width is specified.
*
* The css object is an object specifying css properties
* such as:
*
* > {background:'#4f98a5', border:'3px solid gray', padding:'1px'}
*
* Note that css properties specified with the data point override defaults
* specified with the series.
*
*/
$.jqplot.BlockRenderer = function(){
$.jqplot.LineRenderer.call(this);
};
$.jqplot.BlockRenderer.prototype = new $.jqplot.LineRenderer();
$.jqplot.BlockRenderer.prototype.constructor = $.jqplot.BlockRenderer;
// called with scope of a series
$.jqplot.BlockRenderer.prototype.init = function(options) {
// Group: Properties
//
// prop: css
// default css styles that will be applied to all data blocks.
// these values will be overridden by css styles supplied with the
// individulal data points.
this.css = {padding:'2px', border:'1px solid #999', textAlign:'center'};
// prop: escapeHtml
// true to escape html in the box label.
this.escapeHtml = false;
// prop: insertBreaks
// true to turn spaces in data block label into html breaks <br />.
this.insertBreaks = true;
// prop: varyBlockColors
// true to vary the color of each block in this series according to
// the seriesColors array. False to set each block to the color
// specified on this series. This has no effect if a css background color
// option is specified in the renderer css options.
this.varyBlockColors = false;
$.extend(true, this, options);
if (this.css.backgroundColor) {
this.color = this.css.backgroundColor;
}
else if (this.css.background) {
this.color = this.css.background;
}
else if (!this.varyBlockColors) {
this.css.background = this.color;
}
this.canvas = new $.jqplot.BlockCanvas();
this.shadowCanvas = new $.jqplot.BlockCanvas();
this.canvas._plotDimensions = this._plotDimensions;
this.shadowCanvas._plotDimensions = this._plotDimensions;
this._type = 'block';
// group: Methods
//
// Method: moveBlock
// Moves an individual block. More efficient than redrawing
// the whole series by calling plot.drawSeries().
// Properties:
// idx - the 0 based index of the block or point in this series.
// x - the x coordinate in data units (value on x axis) to move the block to.
// y - the y coordinate in data units (value on the y axis) to move the block to.
// duration - optional parameter to create an animated movement. Can be a
// number (higher is slower animation) or 'fast', 'normal' or 'slow'. If not
// provided, the element is moved without any animation.
this.moveBlock = function (idx, x, y, duration) {
// update plotData, stackData, data and gridData
// x and y are in data coordinates.
var el = this.canvas._elem.children(':eq('+idx+')');
this.data[idx][0] = x;
this.data[idx][1] = y;
this._plotData[idx][0] = x;
this._plotData[idx][1] = y;
this._stackData[idx][0] = x;
this._stackData[idx][1] = y;
this.gridData[idx][0] = this._xaxis.series_u2p(x);
this.gridData[idx][1] = this._yaxis.series_u2p(y);
var w = el.outerWidth();
var h = el.outerHeight();
var left = this.gridData[idx][0] - w/2 + 'px';
var top = this.gridData[idx][1] - h/2 + 'px';
if (duration) {
if (parseInt(duration, 10)) {
duration = parseInt(duration, 10);
}
el.animate({left:left, top:top}, duration);
}
else {
el.css({left:left, top:top});
}
el = null;
};
};
// called with scope of series
$.jqplot.BlockRenderer.prototype.draw = function (ctx, gd, options) {
if (this.plugins.pointLabels) {
this.plugins.pointLabels.show = false;
}
var i, el, d, gd, t, css, w, h, left, top;
var opts = (options != undefined) ? options : {};
var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
this.canvas._elem.empty();
for (i=0; i<this.gridData.length; i++) {
d = this.data[i];
gd = this.gridData[i];
t = '';
css = {};
if (typeof d[2] == 'string') {
t = d[2];
}
else if (typeof d[2] == 'object') {
css = d[2];
}
if (typeof d[3] == 'object') {
css = d[3];
}
if (this.insertBreaks){
t = t.replace(/ /g, '<br />');
}
css = $.extend(true, {}, this.css, css);
// create a div
el = $('<div style="position:absolute;margin-left:auto;margin-right:auto;"></div>');
this.canvas._elem.append(el);
// set text
this.escapeHtml ? el.text(t) : el.html(t);
// style it
// remove styles we don't want overridden.
delete css.position;
delete css.marginRight;
delete css.marginLeft;
if (!css.background && !css.backgroundColor && !css.backgroundImage){
css.background = colorGenerator.next();
}
el.css(css);
w = el.outerWidth();
h = el.outerHeight();
left = gd[0] - w/2 + 'px';
top = gd[1] - h/2 + 'px';
el.css({left:left, top:top});
el = null;
}
};
$.jqplot.BlockCanvas = function() {
$.jqplot.ElemContainer.call(this);
this._ctx;
};
$.jqplot.BlockCanvas.prototype = new $.jqplot.ElemContainer();
$.jqplot.BlockCanvas.prototype.constructor = $.jqplot.BlockCanvas;
$.jqplot.BlockCanvas.prototype.createElement = function(offsets, clss, plotDimensions) {
this._offsets = offsets;
var klass = 'jqplot-blockCanvas';
if (clss != undefined) {
klass = clss;
}
var elem;
// if this canvas already has a dom element, don't make a new one.
if (this._elem) {
elem = this._elem.get(0);
}
else {
elem = document.createElement('div');
}
// if new plotDimensions supplied, use them.
if (plotDimensions != undefined) {
this._plotDimensions = plotDimensions;
}
var w = this._plotDimensions.width - this._offsets.left - this._offsets.right + 'px';
var h = this._plotDimensions.height - this._offsets.top - this._offsets.bottom + 'px';
this._elem = $(elem);
this._elem.css({ position: 'absolute', width:w, height:h, left: this._offsets.left, top: this._offsets.top });
this._elem.addClass(klass);
return this._elem;
};
$.jqplot.BlockCanvas.prototype.setContext = function() {
this._ctx = {
canvas:{
width:0,
height:0
},
clearRect:function(){return null;}
};
return this._ctx;
};
})(jQuery);

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