Compare commits

...
9 Commits
Author SHA1 Message Date
chicpro 1fe4684537 MySQLi 지원 추가 및 SMS5 수정 2015-10-16 10:12:06 +09:00
chicpro 0803de998b 반응형 대비 캡챠 코드 수정 2015-10-06 09:49:15 +09:00
chicpro 273983c87c 따옴표 관련 오류 수정 2015-10-02 17:57:46 +09:00
chicpro 94cc7639a9 XSS 취약점 수정 및 LMS 모듈 추가 2015-10-01 13:46:46 +09:00
chicpro 84009dc16c 관리자 글현황 추가 및 기타 오류 수정 2015-08-28 11:42:25 +09:00
chicpro 82c12f6d98 투표 결과 테마스킨 적용 오류 수정 2015-08-04 09:05:41 +09:00
chicpro 6beff3a333 그누보드 5.1.0 테마 지원버전 2015-08-03 15:44:15 +09:00
chicpro d49200c99e XSS 취약점 및 기타 오류 수정 2015-07-27 14:08:23 +09:00
sungkyuchunandchicpro faed6ac09a empty_mb_name checks mb_id, not mb_name
empty_mb_name is a function checking name from user input form. But it
was not checked by empty_mb_name function. So I fix it.
2015-07-21 09:48:45 +09:00
432 changed files with 45848 additions and 2209 deletions
+173 -15
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);
}
}
}
+1
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'),
+1
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'),
);
?>
-1
View File
@@ -6,7 +6,6 @@ $menu["menu900"] = array (
array('900300', '문자 보내기', ''.G5_SMS5_ADMIN_URL.'/sms_write.php', 'sms_write'),
array('900400', '전송내역-건별', ''.G5_SMS5_ADMIN_URL.'/history_list.php', 'sms_history' , 1),
array('900410', '전송내역-번호별', ''.G5_SMS5_ADMIN_URL.'/history_num.php', 'sms_history_num' , 1),
array('900450', '전송내역-회원', ''.G5_SMS5_ADMIN_URL.'/history_member.php', 'sms_history_mb' , 1),
array('900500', '이모티콘 그룹', ''.G5_SMS5_ADMIN_URL.'/form_group.php' , 'emoticon_group'),
array('900600', '이모티콘 관리', ''.G5_SMS5_ADMIN_URL.'/form_list.php', 'emoticon_list'),
array('900700', '휴대폰번호 그룹', ''.G5_SMS5_ADMIN_URL.'/num_group.php' , 'hp_group', 1),
+34 -4
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) {
+9
View File
@@ -12,16 +12,25 @@ if (!$bo_table) { alert('게시판 TABLE명은 반드시 입력하세요.'); }
if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) { alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)'); }
if (!$_POST['bo_subject']) { alert('게시판 제목을 입력하세요.'); }
$_POST['bo_include_head'] = preg_replace("#[\\\]+$#", "", substr($_POST['bo_include_head'], 0, 255));
$_POST['bo_include_tail'] = preg_replace("#[\\\]+$#", "", substr($_POST['bo_include_tail'], 0, 255));
if ($file = $_POST['bo_include_head']) {
$purl = parse_url($file);
$file = $purl['path'];
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
alert('상단 파일 경로가 php, html 파일이 아닙니다.');
}
$_POST['bo_include_head'] = $file;
}
if ($file = $_POST['bo_include_tail']) {
$purl = parse_url($file);
$file = $purl['path'];
if (!preg_match("/\.(php|htm['l']?)$/i", $file)) {
alert('하단 파일 경로가 php, html 파일이 아닙니다.');
}
$_POST['bo_include_tail'] = $file;
}
$board_path = G5_DATA_PATH.'/file/'.$bo_table;
+67 -126
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'])) {
@@ -183,6 +180,12 @@ if(!isset($config['cf_kakao_js_apikey'])) {
ADD `cf_kakao_js_apikey` varchar(255) NOT NULL DEFAULT '' AFTER `cf_googl_shorturl_apikey` ", true);
}
// SMS 전송유형 필드 추가
if(!isset($config['cf_sms_type'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}`
ADD `cf_sms_type` varchar(10) NOT NULL DEFAULT '' AFTER `cf_sms_use` ", true);
}
if(!$config['cf_faq_skin']) $config['cf_faq_skin'] = "basic";
if(!$config['cf_mobile_faq_skin']) $config['cf_mobile_faq_skin'] = "basic";
@@ -212,7 +215,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 +344,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 +471,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 +575,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 +684,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 +1005,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>
@@ -1138,6 +1040,16 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_sms_type">SMS 전송유형</label></th>
<td>
<?php echo help("전송유형을 SMS로 선택하시면 최대 80바이트까지 전송하실 수 있으며<br>LMS로 선택하시면 90바이트 이하는 SMS로, 그 이상은 1500바이트까지 LMS로 전송됩니다.<br>요금은 건당 SMS는 16원, LMS는 48원입니다."); ?>
<select id="cf_sms_type" name="cf_sms_type">
<option value="" <?php echo get_selected($config['cf_sms_type'], ''); ?>>SMS</option>
<option value="LMS" <?php echo get_selected($config['cf_sms_type'], 'LMS'); ?>>LMS</option>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_icode_id">아이코드 회원아이디</label></th>
<td>
@@ -1173,7 +1085,6 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
<tr>
<th scope="row">아이코드 SMS 신청<br>회원가입</th>
<td>
<?php echo help("아래 링크에서 회원가입 하시면 문자 건당 16원에 제공 받을 수 있습니다."); ?>
<a href="http://icodekorea.com/res/join_company_fix_a.php?sellid=sir2" target="_blank" class="btn_frmline">아이코드 회원가입</a>
</td>
</tr>
@@ -1185,12 +1096,6 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
<a href="http://www.icodekorea.com/smsbiz/credit_card_amt.php?icode_id=<?php echo $config['cf_icode_id']; ?>&amp;icode_passwd=<?php echo $config['cf_icode_pw']; ?>" target="_blank" class="btn_frmline" onclick="window.open(this.href,'icode_payment', 'scrollbars=1,resizable=1'); return false;">충전하기</a>
</td>
</tr>
<tr>
<th scope="row">건수별 금액</th>
<td colspan="3">
<?php echo number_format($userinfo['gpay']); ?> 원.
</td>
</tr>
<?php } ?>
</tbody>
</table>
@@ -1250,6 +1155,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)
+1 -3
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']}',
@@ -127,6 +124,7 @@ $sql = " update {$g5['config_table']}
cf_cert_limit = '{$_POST['cf_cert_limit']}',
cf_cert_req = '{$_POST['cf_cert_req']}',
cf_sms_use = '{$_POST['cf_sms_use']}',
cf_sms_type = '{$_POST['cf_sms_type']}',
cf_icode_id = '{$_POST['cf_icode_id']}',
cf_icode_pw = '{$_POST['cf_icode_pw']}',
cf_icode_server_ip = '{$_POST['cf_icode_server_ip']}',
+1 -1
View File
@@ -69,7 +69,7 @@ $result = sql_query($sql);
</tr>
</thead>
<tbody>
<?php for ($i=0; $row=mysql_fetch_array($result); $i++) {
<?php for ($i=0; $row=sql_fetch_array($result); $i++) {
$bg = 'bg'.($i%2);
?>
<tr class="<?php echo $bg; ?>">
+50
View File
@@ -714,3 +714,53 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
.sevice_2 .svc_sms .svc_btn a{display:inline-block; background:#f8f8f8;width:100%;text-align:center;margin:0;padding:10px 0 0 }
.sevice_2 .svc_design{overflow:hidden;height:210px;position:relative}
.sevice_2 .svc_design .svc_btn a{margin:0 0 20px}
/*테마*/
.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 }
/*전송실패 문자 재전송 내역*/
.sms_table{padding:0 20px 40px;}
.sms_table table th{border:1px solid #ddd;padding:9px 0}
.sms_table table td{border:1px solid #ddd;text-align:center;width:16%;padding:9px 0}
+8
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;}
+1 -1
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")
{
+1 -1
View File
@@ -21,7 +21,7 @@ if ($w == "")
$sql_common ";
sql_query($sql);
$fa_id = mysql_insert_id();
$fa_id = sql_insert_id();
}
else if ($w == "u")
{
+1 -1
View File
@@ -31,7 +31,7 @@ if ($w == "")
$sql = " insert {$g5['faq_master_table']} $sql_common ";
sql_query($sql);
$fm_id = mysql_insert_id();
$fm_id = sql_insert_id();
}
else if ($w == "u")
{
+1 -1
View File
@@ -93,7 +93,7 @@ $result = sql_query($sql);
</tr>
</thead>
<tbody>
<?php for ($i=0; $row=mysql_fetch_array($result); $i++) {
<?php for ($i=0; $row=sql_fetch_array($result); $i++) {
$sql1 = " select COUNT(*) as cnt from {$g5['faq_table']} where fm_id = '{$row['fm_id']}' ";
$row1 = sql_fetch($sql1);
$cnt = $row1['cnt'];
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

+1 -1
View File
@@ -91,7 +91,7 @@ $colspan = 12;
$leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date("Ymd", G5_SERVER_TIME);
$intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date("Ymd", G5_SERVER_TIME);
$mb_nick = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);
$mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']);
$mb_id = $row['mb_id'];
if ($row['mb_leave_date'])
+1 -1
View File
@@ -51,7 +51,7 @@ $colspan = 7;
</thead>
<tbody>
<?php
for ($i=0; $row=mysql_fetch_array($result); $i++) {
for ($i=0; $row=sql_fetch_array($result); $i++) {
$s_vie = '<a href="./mail_preview.php?ma_id='.$row['ma_id'].'" target="_blank">미리보기</a>';
$num = number_format($total_count - ($page - 1) * $config['cf_page_rows'] - $i);
+3
View File
@@ -31,6 +31,8 @@ else if ($w == 'u')
$required_mb_password = '';
$html_title = '수정';
$mb['mb_name'] = get_text($mb['mb_name']);
$mb['mb_nick'] = get_text($mb['mb_nick']);
$mb['mb_email'] = get_text($mb['mb_email']);
$mb['mb_homepage'] = get_text($mb['mb_homepage']);
$mb['mb_birth'] = get_text($mb['mb_birth']);
@@ -38,6 +40,7 @@ else if ($w == 'u')
$mb['mb_hp'] = get_text($mb['mb_hp']);
$mb['mb_addr1'] = get_text($mb['mb_addr1']);
$mb['mb_addr2'] = get_text($mb['mb_addr2']);
$mb['mb_addr3'] = get_text($mb['mb_addr3']);
$mb['mb_signature'] = get_text($mb['mb_signature']);
$mb['mb_recommend'] = get_text($mb['mb_recommend']);
$mb['mb_profile'] = get_text($mb['mb_profile']);
+2 -2
View File
@@ -166,7 +166,7 @@ $colspan = 16;
$leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date('Ymd', G5_SERVER_TIME);
$intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date('Ymd', G5_SERVER_TIME);
$mb_nick = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);
$mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']);
$mb_id = $row['mb_id'];
$leave_msg = '';
@@ -211,7 +211,7 @@ $colspan = 16;
<tr class="<?php echo $bg; ?>">
<td headers="mb_list_chk" class="td_chk" rowspan="2">
<input type="hidden" name="mb_id[<?php echo $i ?>]" value="<?php echo $row['mb_id'] ?>" id="mb_id_<?php echo $i ?>">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['mb_name']); ?> <?php echo $row['mb_nick']; ?>님</label>
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['mb_name']); ?> <?php echo get_text($row['mb_nick']); ?>님</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td headers="mb_list_id" rowspan="2" class="td_name sv_use"><?php echo $mb_id ?></td>
+2 -2
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());
+3 -3
View File
@@ -73,7 +73,7 @@ $colspan = 7;
}
$search = array('"', "'");
$replace = array('&#34;', '&#39;');
$replace = array('&#034;', '&#039;');
$me_name = str_replace($search, $replace, $row['me_name']);
?>
<tr class="<?php echo $bg; ?> menu_list menu_group_<?php echo substr($row['me_code'], 0, 2); ?>">
@@ -136,12 +136,12 @@ $colspan = 7;
<script>
$(function() {
$(".btn_add_submenu").live("click", function() {
$(document).on("click", ".btn_add_submenu", function() {
var code = $(this).closest("tr").find("input[name='code[]']").val().substr(0, 2);
add_submenu(code);
});
$(".btn_del_menu").live("click", function() {
$(document).on("click", ".btn_del_menu", function() {
if(!confirm("메뉴를 삭제하시겠습니까?"))
return false;
+1 -1
View File
@@ -27,7 +27,7 @@ if($w == "")
$sql = " insert {$g5['new_win_table']} set $sql_common ";
sql_query($sql);
$nw_id = mysql_insert_id();
$nw_id = sql_insert_id();
}
else if ($w == "u")
{
+1 -1
View File
@@ -70,7 +70,7 @@ $result = sql_query($sql);
</thead>
<tbody>
<?php
for ($i=0; $row=mysql_fetch_array($result); $i++) {
for ($i=0; $row=sql_fetch_array($result); $i++) {
$bg = 'bg'.($i%2);
switch($row['nw_device']) {
+1 -1
View File
@@ -17,7 +17,7 @@ if ($w == '')
values ( '{$_POST['po_subject']}', '{$_POST['po_poll1']}', '{$_POST['po_poll2']}', '{$_POST['po_poll3']}', '{$_POST['po_poll4']}', '{$_POST['po_poll5']}', '{$_POST['po_poll6']}', '{$_POST['po_poll7']}', '{$_POST['po_poll8']}', '{$_POST['po_poll9']}', '{$_POST['po_cnt1']}', '{$_POST['po_cnt2']}', '{$_POST['po_cnt3']}', '{$_POST['po_cnt4']}', '{$_POST['po_cnt5']}', '{$_POST['po_cnt6']}', '{$_POST['po_cnt7']}', '{$_POST['po_cnt8']}', '{$_POST['po_cnt9']}', '{$_POST['po_etc']}', '{$_POST['po_level']}', '{$_POST['po_point']}', '".G5_TIME_YMD."' ) ";
sql_query($sql);
$po_id = mysql_insert_id();
$po_id = sql_insert_id();
}
else if ($w == 'u')
{
+1 -1
View File
@@ -16,7 +16,7 @@ $sql_order = " order by cnt desc ";
$sql = " select pp_word {$sql_common} {$sql_search} {$sql_group} ";
$result = sql_query($sql);
$total_count = mysql_num_rows($result);
$total_count = sql_num_rows($result);
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
+2 -1
View File
@@ -2,9 +2,10 @@
define('G5_IS_ADMIN', true);
include_once ('../../common.php');
include_once(G5_ADMIN_PATH.'/admin.lib.php');
include_once(G5_SMS5_PATH.'/sms5.lib.php');
if (!strstr($_SERVER['SCRIPT_NAME'], 'install.php')) {
if(!mysql_num_rows(mysql_query(" show tables like '{$g5['sms5_config_table']}' ")))
if(!sql_num_rows(sql_query(" show tables like '{$g5['sms5_config_table']}' ")))
goto_url('install.php');
// SMS 설정값 배열변수
+2 -45
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']);
}
@@ -86,57 +86,14 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
<input type="button" value="충전하기" class="btn_frmline" onclick="window.open('http://icodekorea.com/company/credit_card_input.php?icode_id=<?php echo $config['cf_icode_id']?>&icode_passwd=<?php echo $config['cf_icode_pw']?>','icode_payment','width=650,height=500')">
</td>
</tr>
<tr>
<th scope="row">건별 금액</th>
<td><?php echo number_format($userinfo['gpay'])?> 원</td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="cf_phone">회신번호<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("회신받을 휴대폰 번호를 입력하세요. '-' 를 꼭 입력하세요.<br>예) 010-123-4567"); ?>
<?php echo help("회신받을 휴대폰 번호를 입력하세요. 회신번호는 발신번호로 사전등록된 번호와 동일해야 합니다.<br>예) 010-123-4567"); ?>
<input type="text" name="cf_phone" value="<?php echo $sms5['cf_phone']; ?>" id="cf_phone" required class="frm_input required" size="12">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_member">회원간 문자전송</label></th>
<td>
<?php echo help("허용에 체크하면 회원끼리 문자전송이 가능합니다.");?>
<input type="checkbox" name="cf_member" value="1" id="cf_member" <?php echo get_checked(1, $sms5['cf_member']); ?>> <label for="cf_member">허용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_level">문자전송가능 레벨</label></th>
<td>
<?php echo help("문자전송을 허용할 회원레벨을 선택해주세요.");?>
<select name="cf_level" id="cf_level">
<?php for ($i=1; $i<=10; $i++) { ?>
<option value="<?php echo $i?>"<?php echo get_selected($i, $sms5['cf_level']);?>> <?php echo $i?> </option>
<?php } ?>
</select>
레벨 이상
</td>
</tr>
<tr>
<th scope="row"><label for="cf_point">문자전송 차감 포인트<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("회원이 문자를 전송할시에 차감할 포인트를 입력해주세요. 0이면 포인트를 차감하지 않습니다.");?>
<input type="text" name="cf_point" value="<?php echo $sms5['cf_point']; ?>" id="cf_point" required class="frm_input required" size="5">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_day_count">문자전송 하루제한 갯수<strong class="sound_only"> 필수</strong></label></th>
<td>
<?php echo help("회원이 하루에 보낼수 있는 문자 갯수를 입력해주세요. 0이면 제한하지 않습니다.");?>
<input type="text" name="cf_day_count" value="<?php echo $sms5['cf_day_count']; ?>" id="cf_day_count" required class="frm_input required" size="5">
</td>
</tr>
<tr>
<th scope="row"><label for="cf_skin">스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
<td>
<?php echo get_sms5_skin_select('skin', 'cf_skin', 'cf_skin', $sms5['cf_skin'], 'required'); ?>
</td>
</tr>
</tbody>
</table>
</div>
+5 -6
View File
@@ -8,16 +8,15 @@ check_demo();
$g5['title'] = "SMS 기본설정";
// 회신번호 체크
if(!check_vaild_callback($cf_phone))
alert('회신번호가 올바르지 않습니다.');
$userinfo = get_icode_userinfo($cf_icode_id, $cf_icode_pw);
if ($userinfo['code'] == '202')
alert('아이코드 아이디와 패스워드가 맞지 않습니다.');
if ($cf_member == '1')
$cf_member = 1;
else
$cf_member = 0;
$res = sql_fetch("select * from ".$g5['sms5_config_table']." limit 1");
if (!$res)
@@ -25,7 +24,7 @@ if (!$res)
else
$sql = "update ";
$sql .= $g5['sms5_config_table']." set cf_phone='$cf_phone', cf_member='$cf_member', cf_level='$cf_level', cf_point='$cf_point', cf_day_count='$cf_day_count', cf_skin = '$cf_skin' ";
$sql .= $g5['sms5_config_table']." set cf_phone='$cf_phone' ";
sql_query($sql);
-90
View File
@@ -1,90 +0,0 @@
<?php
$sub_menu = "900410";
include_once("./_common.php");
$page_size = 20;
$colspan = 7;
auth_check($auth[$sub_menu], "r");
$g5['title'] = "문자전송 내역 (회원)";
if ($page < 1) $page = 1;
if ($st && trim($sv))
$sql_search = " and $st like '%$sv%' ";
else
$sql_search = "";
$total_res = sql_fetch("select count(*) as cnt from {$g5['sms5_member_history_table']} where 1 $sql_search");
$total_count = $total_res['cnt'];
$total_page = (int)($total_count/$page_size) + ($total_count%$page_size==0 ? 0 : 1);
$page_start = $page_size * ( $page - 1 );
$vnum = $total_count - (($page-1) * $page_size);
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="search_form" method="get" action="<?php echo $_SEVER['SCRIPT_NAME']?>" class="local_sch01 local_sch">
<label for="st" class="sound_only">검색대상</label>
<select name="st" id="st">
<option value="mb_id"<?php echo get_selected('mh_name', $st); ?>>아이디</option>
<option value="mh_hp"<?php echo get_selected('mh_hp', $st); ?>>받는번호</option>
<option value="mh_reply"<?php echo get_selected('mh_reply', $st); ?>>보내는번호</option>
</select>
<label for="sv" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="sv" value="<?php echo $sv ?>" id="sv" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">번호</th>
<th scope="col">회원</th>
<th scope="col">보내는번호</th>
<th scope="col">받는번호</th>
<th scope="col">전송일시</th>
<th scope="col">예약</th>
<th scope="col">Log</th>
</tr>
</thead>
<tbody>
<?php if (!$total_count) { ?>
<tr>
<td colspan="<?php echo $colspan?>" class="empty_table" >
데이터가 없습니다.
</td>
</tr>
<?php
}
$qry = sql_query("select * from {$g5['sms5_member_history_table']} where 1 $sql_search order by mh_no desc limit $page_start, $page_size");
while($row = sql_fetch_array($qry)) {
$bg = 'bg'.($line++%2);
$mb = get_member($row['mb_id']);
$mb_id = get_sideview($row['mb_id'], $mb['mb_nick']);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_num"><?php echo $vnum--?></td>
<td class="td_mbid"><?php echo $mb_id?></td>
<td class="td_numbig"><?php echo $row['mh_reply']?></td>
<td class="td_numbig"><?php echo $row['mh_hp']?></td>
<td class="td_datetime"><?php echo $row['mh_datetime']?></td>
<td class="td_boolean"><?php echo $row['mh_booking']!='0000-00-00 00:00:00'?"<span title='{$row['mh_booking']}'>예약</span>":'';?></td>
<td><?php echo $row['mh_log']?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME']."?st=$st&amp;sv=$sv&amp;page="); ?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>
+151 -58
View File
@@ -39,7 +39,8 @@ if (!$res['cnt']) {
$sql = sql_query("select * from {$g5['sms5_history_table']} where wr_no='$wr_no' $sql_renum $sql_flag");
while ($res = sql_fetch_array($sql))
{
$res['bk_hp'] = get_hp($res['bk_hp'], 0);
$res['bk_hp'] = get_hp($res['hs_hp'], 0);
$res['bk_name'] = $res['hs_name'];
if ($g5['sms5_demo'])
$res['bk_hp'] = '0100000000';
@@ -48,6 +49,7 @@ while ($res = sql_fetch_array($sql))
}
$wr_total = count($list);
$reply = str_replace('-', '', trim($write['wr_reply']));
if ($config['cf_sms_use'] != 'icode') {
alert('기본환경설정에서 icode sms 사용이 비활성화 되어 있습니다.');
@@ -55,79 +57,170 @@ if ($config['cf_sms_use'] != 'icode') {
include_once(G5_ADMIN_PATH.'/admin.head.php');
$SMS = new SMS5;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$reply = str_replace('-', '', trim($write['wr_reply']));
if($config['cf_sms_type'] == 'LMS') {
$port_setting = get_icode_port_type($config['cf_icode_id'], $config['cf_icode_pw']);
$result = $SMS->Add($list, $reply, '', '', $write['wr_message'], '', $wr_total);
if ($result)
{
$result = $SMS->Send();
if ($result) //SMS 서버에 접속했습니다.
{
sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', wr_reply='".addslashes($write['wr_reply'])."', wr_message='".addslashes($write['wr_message'])."', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
if($port_setting !== false) {
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting);
$wr_success = 0;
$wr_failure = 0;
$count = 0;
foreach ($SMS->Result as $result)
{
list($phone, $code) = explode(":", $result);
for($i=0; $i<$wr_total; $i++) {
$strDest = array();
$strDest[] = $list[$i]['bk_hp'];
$strCallBack = $reply;
$strCaller = $config['cf_title'];
$strSubject = '';
$strURL = '';
$strData = $write['wr_message'];
if( !empty($list[$i]['bk_name']) ){
$strData = str_replace("{이름}", $list[$i]['bk_name'], $strData);
}
$strDate = $booking;
$nCount = 1;
if (substr($code,0,5) == "Error")
{
$hs_code = substr($code,6,2);
$result = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount);
switch ($hs_code) {
case '02': // "02:형식오류"
$hs_memo = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$hs_memo = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$hs_memo = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$hs_memo = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$hs_memo = "알 수 없는 오류로 전송이 실패하었습니다.";
break;
if($result) {
$result = $SMS->Send();
if ($result) //SMS 서버에 접속했습니다.
{
foreach ($SMS->Result as $result)
{
list($phone, $code) = explode(":", $result);
if (substr($code,0,5) == "Error")
{
$hs_code = substr($code,6,2);
switch ($hs_code) {
case '02': // "02:형식오류"
$hs_memo = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$hs_memo = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$hs_memo = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$hs_memo = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$hs_memo = "알 수 없는 오류로 전송이 실패하였습니다.";
break;
}
$wr_failure++;
$hs_flag = 0;
}
else
{
$hs_code = $code;
$hs_memo = get_hp($phone, 1)."로 전송했습니다.";
$wr_success++;
$hs_flag = 1;
}
$row = $list[$i];
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
$log = array_shift($SMS->Log);
$log = @iconv('euc-kr', 'utf-8', $log);
sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='".addslashes($row['bk_name'])."', hs_hp='{$row['bk_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'", false);
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
}
$wr_failure++;
$hs_flag = 0;
}
else
{
$hs_code = $code;
$hs_memo = get_hp($phone, 1)."로 전송했습니다.";
$wr_success++;
$hs_flag = 1;
}
$row = array_shift($list);
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
$log = array_shift($SMS->Log);
$log = @iconv('UTF-8', 'UTF-8//IGNORE', $log);
sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='{$row['hs_name']}', hs_hp='{$row['hs_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'", false);
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
sql_query("update {$g5['sms5_write_table']} set wr_success='$wr_success', wr_failure='$wr_failure' where wr_no='$wr_no' and wr_renum='$new_wr_renum'");
sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', wr_reply='".addslashes($write['wr_reply'])."', wr_message='".addslashes($write['wr_message'])."', wr_success='$wr_success', wr_failure='$wr_failure', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
sql_query("update {$g5['sms5_write_table']} set wr_re_total=wr_re_total+1 where wr_no='$wr_no' and wr_renum=0");
}
else alert("에러: SMS 서버와 통신이 불안정합니다.");
} else {
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$reply = str_replace('-', '', trim($write['wr_reply']));
$result = $SMS->Add($list, $reply, '', '', $write['wr_message'], '', $wr_total);
if ($result)
{
$result = $SMS->Send();
if ($result) //SMS 서버에 접속했습니다.
{
sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', wr_reply='".addslashes($write['wr_reply'])."', wr_message='".addslashes($write['wr_message'])."', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
$wr_success = 0;
$wr_failure = 0;
$count = 0;
foreach ($SMS->Result as $result)
{
list($phone, $code) = explode(":", $result);
if (substr($code,0,5) == "Error")
{
$hs_code = substr($code,6,2);
switch ($hs_code) {
case '02': // "02:형식오류"
$hs_memo = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$hs_memo = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$hs_memo = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$hs_memo = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$hs_memo = "알 수 없는 오류로 전송이 실패하었습니다.";
break;
}
$wr_failure++;
$hs_flag = 0;
}
else
{
$hs_code = $code;
$hs_memo = get_hp($phone, 1)."로 전송했습니다.";
$wr_success++;
$hs_flag = 1;
}
$row = array_shift($list);
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
$log = array_shift($SMS->Log);
$log = @iconv('euc-kr', 'utf-8', $log);
sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum='$new_wr_renum', bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='{$row['hs_name']}', hs_hp='{$row['hs_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'", false);
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
sql_query("update {$g5['sms5_write_table']} set wr_success='$wr_success', wr_failure='$wr_failure' where wr_no='$wr_no' and wr_renum='$new_wr_renum'");
sql_query("update {$g5['sms5_write_table']} set wr_re_total=wr_re_total+1 where wr_no='$wr_no' and wr_renum=0");
}
else alert("에러: SMS 서버와 통신이 불안정합니다.");
}
else alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
}
else alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
?>
<script>
+2
View File
@@ -98,6 +98,7 @@ function all_send()
<?php if ($write['wr_re_total'] && !$wr_renum) { ?>
<h2>전송실패 문자 재전송 내역</h2>
<div class="sms_table">
<table>
<thead>
<tr>
@@ -138,6 +139,7 @@ function all_send()
</tbody>
</table>
<?php } ?>
</div>
<?php
if( $write['wr_memo'] ){
+2 -2
View File
@@ -53,7 +53,7 @@ eval("\$file = \"$file\";");
$f = explode(";", $file);
for ($i=0; $i<count($f); $i++) {
if (trim($f[$i]) == "") continue;
mysql_query($f[$i]) or die(mysql_error());
sql_query($f[$i]) or die(mysqli_error());
}
// 테이블 생성 ------------------------------------
@@ -68,7 +68,7 @@ $download_point = -20;
//-------------------------------------------------------------------------------------------------
// config 테이블 설정
$sql = " insert into {$g5['sms5_book_group_table']} set bg_name='미분류'";
mysql_query($sql) or die(mysql_error() . "<p>" . $sql);
sql_query($sql) or die(mysqli_error() . "<p>" . $sql);
echo "<script>document.getElementById('sms5_job_02').innerHTML='DB설정 완료';</script>";
flush(); usleep(50000);
+1 -28
View File
@@ -65,12 +65,7 @@ DROP TABLE IF EXISTS `{$g5['sms5_config_table']}`;
CREATE TABLE `{$g5['sms5_config_table']}` (
`cf_phone` varchar(255) NOT NULL default '',
`cf_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`cf_member` tinyint(4) NOT NULL default '1',
`cf_level` tinyint(4) NOT NULL default '2',
`cf_point` int(11) NOT NULL default '0',
`cf_day_count` int(11) NOT NULL default '0',
`cf_skin` varchar(100) NOT NULL DEFAULT ''
`cf_datetime` datetime NOT NULL default '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -164,25 +159,3 @@ CREATE TABLE `{$g5['sms5_write_table']}` (
`wr_memo` text NOT NULL,
KEY `wr_no` (`wr_no`,`wr_renum`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
##
## Table structure for table `{$g5['sms5_member_history_table']}`
##
DROP TABLE IF EXISTS `{$g5['sms5_member_history_table']}`;
CREATE TABLE `{$g5['sms5_member_history_table']}` (
`mh_no` int(11) NOT NULL auto_increment,
`mb_id` varchar(30) NOT NULL,
`mh_reply` varchar(30) NOT NULL,
`mh_hp` varchar(30) NOT NULL,
`mh_datetime` datetime NOT NULL,
`mh_booking` datetime NOT NULL,
`mh_log` varchar(255) NOT NULL,
`mh_ip` varchar(15) NOT NULL,
PRIMARY KEY (`mh_no`),
KEY `mb_id` (`mb_id`,`mh_datetime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+40 -4
View File
@@ -33,7 +33,7 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
<label for="wr_message" id="wr_message_lbl">내용</label>
<textarea name="wr_message" id="wr_message" class="box_txt box_square" onkeyup="byte_check('wr_message', 'sms_bytes');" accesskey="m"></textarea>
<div id="sms_byte"><span id="sms_bytes">0</span> / 80 byte</div>
<div id="sms_byte"><span id="sms_bytes">0</span> / <span id="sms_max_bytes"><?php echo ($config['cf_sms_type'] == 'LMS' ? 90 : 80); ?></span> byte</div>
<button type="button" id="write_sc_btn" class="write_scemo_btn">특수<br>기호</button>
<div id="write_sc" class="write_scemo">
@@ -114,7 +114,7 @@ if ($config['cf_sms_use'] == 'icode') { // 아이코드 사용
<div id="write_reply">
<label for="wr_reply">회신<strong class="sound_only"> 필수</strong></label>
<input type="text" name="wr_reply" value="<?php echo $sms5['cf_phone']?>" id="wr_reply" required class="frm_input required" size="17" maxlength="20">
<input type="text" name="wr_reply" value="<?php echo $sms5['cf_phone']?>" id="wr_reply" required class="frm_input required" size="17" maxlength="20" readonly="readonly">
</div>
<div id="write_recv" class="write_inner">
@@ -406,6 +406,7 @@ function byte_check(wr_message, sms_bytes)
{
var conts = document.getElementById(wr_message);
var bytes = document.getElementById(sms_bytes);
var max_bytes = document.getElementById("sms_max_bytes");
var i = 0;
var cnt = 0;
@@ -424,6 +425,40 @@ function byte_check(wr_message, sms_bytes)
bytes.innerHTML = cnt;
<?php if($config['cf_sms_type'] == 'LMS') { ?>
if(cnt > 90)
max_bytes.innerHTML = 1500;
else
max_bytes.innerHTML = 90;
if (cnt > 1500)
{
exceed = cnt - 1500;
alert('메시지 내용은 1500바이트를 넘을수 없습니다.\n\n작성하신 메세지 내용은 '+ exceed +'byte가 초과되었습니다.\n\n초과된 부분은 자동으로 삭제됩니다.');
var tcnt = 0;
var xcnt = 0;
var tmp = conts.value;
for (i=0; i<tmp.length; i++)
{
ch = tmp.charAt(i);
if (escape(ch).length > 4) {
tcnt += 2;
} else {
tcnt += 1;
}
if (tcnt > 1500) {
tmp = tmp.substring(0,i);
break;
} else {
xcnt = tcnt;
}
}
conts.value = tmp;
bytes.innerHTML = xcnt;
return;
}
<?php } else { ?>
if (cnt > 80)
{
exceed = cnt - 80;
@@ -451,6 +486,7 @@ function byte_check(wr_message, sms_bytes)
bytes.innerHTML = xcnt;
return;
}
<?php } ?>
}
<?php
@@ -496,7 +532,7 @@ if ($wr_no)
// 회원목록
$sql = " select * from {$g5['sms5_history_table']} where wr_no = '$wr_no' and bk_no > 0 ";
$qry = sql_query($sql);
$tot = mysql_num_rows($qry);
$tot = sql_num_rows($qry);
if ($tot > 0) {
@@ -514,7 +550,7 @@ if ($wr_no)
// 비회원 목록
$sql = " select * from {$g5['sms5_history_table']} where wr_no = '$wr_no' and bk_no = 0 ";
$qry = sql_query($sql);
$tot = mysql_num_rows($qry);
$tot = sql_num_rows($qry);
if ($tot > 0)
{
+168 -62
View File
@@ -12,6 +12,9 @@ $wr_message = clean_xss_tags(trim($wr_message));
if (!$wr_reply)
win_close_alert('회신 번호를 숫자, - 로 입력해주세요.');
if(!check_vaild_callback($wr_reply))
win_close_alert('회신 번호를 올바르게 입력해 주십시오.');
if (!$wr_message)
win_close_alert('메세지를 입력해주세요.');
@@ -42,6 +45,9 @@ while ($row = array_shift($send_list))
while ($row = sql_fetch_array($qry))
{
$row['bk_hp'] = get_hp($row['bk_hp'], 0);
if(!$row['bk_hp']) continue;
if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
@@ -63,6 +69,8 @@ while ($row = array_shift($send_list))
$hp = get_hp($row['mb_hp'], 0);
$mb_id = $row['mb_id'];
if(!$hp) continue;
if ($wr_overlap && array_overlap($hps, $hp)) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
@@ -84,6 +92,8 @@ while ($row = array_shift($send_list))
$hp = get_hp($item[$i][1], 0);
$name = $item[$i][0];
if(!$hp) continue;
if ($wr_overlap && array_overlap($hps, $hp)) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
@@ -99,6 +109,8 @@ while ($row = array_shift($send_list))
$row = sql_fetch("select * from {$g5['sms5_book_table']} where bk_no='$item[$i]'");
$row['bk_hp'] = get_hp($row['bk_hp'], 0);
if(!$row['bk_hp']) continue;
if ($wr_overlap && array_overlap($hps, $row['bk_hp'])) {
$overlap++;
array_push( $duplicate_data['hp'], $row['bk_hp'] );
@@ -133,86 +145,180 @@ if ($config['cf_sms_use'] != 'icode') {
include_once(G5_ADMIN_PATH.'/admin.head.php');
$SMS = new SMS5;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$reply = str_replace('-', '', trim($wr_reply));
$wr_message = conv_unescape_nl($wr_message);
$result = $SMS->Add($list, $reply, '', '', $wr_message, $booking, $wr_total);
$SMS = new SMS5;
if ($result)
{
$result = $SMS->Send();
if($config['cf_sms_type'] == 'LMS') {
$port_setting = get_icode_port_type($config['cf_icode_id'], $config['cf_icode_pw']);
if ($result) //SMS 서버에 접속했습니다.
{
$row = sql_fetch("select max(wr_no) as wr_no from {$g5['sms5_write_table']}");
if ($row)
$wr_no = $row['wr_no'] + 1;
else
$wr_no = 1;
sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum=0, wr_reply='$wr_reply', wr_message='$wr_message', wr_booking='$wr_booking', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
if($port_setting !== false) {
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting);
$wr_success = 0;
$wr_failure = 0;
$count = 0;
foreach ($SMS->Result as $result)
{
list($phone, $code) = explode(":", $result);
$row2 = sql_fetch("select max(wr_no) as wr_no from {$g5['sms5_write_table']}");
if ($row2)
$wr_no = $row2['wr_no'] + 1;
else
$wr_no = 1;
if (substr($code,0,5) == "Error")
{
$hs_code = substr($code,6,2);
for($i=0; $i<$wr_total; $i++) {
$strDest = array();
$strDest[] = $list[$i]['bk_hp'];
$strCallBack = $reply;
$strCaller = $config['cf_title'];
$strSubject = '';
$strURL = '';
$strData = $wr_message;
if( !empty($list[$i]['bk_name']) ){
$strData = str_replace("{이름}", $list[$i]['bk_name'], $strData);
}
$strDate = $booking;
$nCount = 1;
switch ($hs_code) {
case '02': // "02:형식오류"
$hs_memo = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$hs_memo = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$hs_memo = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$hs_memo = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$hs_memo = "알 수 없는 오류로 전송이 실패하였습니다.";
break;
$result = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount);
if($result) {
$result = $SMS->Send();
if ($result) //SMS 서버에 접속했습니다.
{
foreach ($SMS->Result as $result)
{
list($phone, $code) = explode(":", $result);
if (substr($code,0,5) == "Error")
{
$hs_code = substr($code,6,2);
switch ($hs_code) {
case '02': // "02:형식오류"
$hs_memo = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$hs_memo = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$hs_memo = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$hs_memo = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$hs_memo = "알 수 없는 오류로 전송이 실패하였습니다.";
break;
}
$wr_failure++;
$hs_flag = 0;
}
else
{
$hs_code = $code;
$hs_memo = get_hp($phone, 1)."로 전송했습니다.";
$wr_success++;
$hs_flag = 1;
}
$row = $list[$i];
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
$log = array_shift($SMS->Log);
$log = @iconv('euc-kr', 'utf-8', $log);
sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum=0, bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='".addslashes($row['bk_name'])."', hs_hp='{$row['bk_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'", false);
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
}
$wr_failure++;
$hs_flag = 0;
}
else
{
$hs_code = $code;
$hs_memo = get_hp($phone, 1)."로 전송했습니다.";
$wr_success++;
$hs_flag = 1;
}
$row = array_shift($list);
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
$log = array_shift($SMS->Log);
$log = @iconv('UTF-8', 'UTF-8//IGNORE', $log);
sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum=0, bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='".addslashes($row['bk_name'])."', hs_hp='{$row['bk_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'", false);
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
sql_query("update {$g5['sms5_write_table']} set wr_success='$wr_success', wr_failure='$wr_failure', wr_memo='$str_serialize' where wr_no='$wr_no' and wr_renum=0");
sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum=0, wr_reply='$wr_reply', wr_message='$wr_message', wr_success='$wr_success', wr_failure='$wr_failure', wr_memo='$str_serialize', wr_booking='$wr_booking', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
}
else win_close_alert("에러: SMS 서버와 통신이 불안정합니다.");
} else {
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$result = $SMS->Add($list, $reply, '', '', $wr_message, $booking, $wr_total);
if ($result)
{
$result = $SMS->Send();
if ($result) //SMS 서버에 접속했습니다.
{
$row = sql_fetch("select max(wr_no) as wr_no from {$g5['sms5_write_table']}");
if ($row)
$wr_no = $row['wr_no'] + 1;
else
$wr_no = 1;
sql_query("insert into {$g5['sms5_write_table']} set wr_no='$wr_no', wr_renum=0, wr_reply='$wr_reply', wr_message='$wr_message', wr_booking='$wr_booking', wr_total='$wr_total', wr_datetime='".G5_TIME_YMDHIS."'");
$wr_success = 0;
$wr_failure = 0;
$count = 0;
foreach ($SMS->Result as $result)
{
list($phone, $code) = explode(":", $result);
if (substr($code,0,5) == "Error")
{
$hs_code = substr($code,6,2);
switch ($hs_code) {
case '02': // "02:형식오류"
$hs_memo = "형식이 잘못되어 전송이 실패하였습니다.";
break;
case '23': // "23:인증실패,데이터오류,전송날짜오류"
$hs_memo = "데이터를 다시 확인해 주시기바랍니다.";
break;
case '97': // "97:잔여코인부족"
$hs_memo = "잔여코인이 부족합니다.";
break;
case '98': // "98:사용기간만료"
$hs_memo = "사용기간이 만료되었습니다.";
break;
case '99': // "99:인증실패"
$hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요.";
break;
default: // "미 확인 오류"
$hs_memo = "알 수 없는 오류로 전송이 실패하였습니다.";
break;
}
$wr_failure++;
$hs_flag = 0;
}
else
{
$hs_code = $code;
$hs_memo = get_hp($phone, 1)."로 전송했습니다.";
$wr_success++;
$hs_flag = 1;
}
$row = array_shift($list);
$row['bk_hp'] = get_hp($row['bk_hp'], 1);
$log = array_shift($SMS->Log);
$log = @iconv('euc-kr', 'utf-8', $log);
sql_query("insert into {$g5['sms5_history_table']} set wr_no='$wr_no', wr_renum=0, bg_no='{$row['bg_no']}', mb_id='{$row['mb_id']}', bk_no='{$row['bk_no']}', hs_name='".addslashes($row['bk_name'])."', hs_hp='{$row['bk_hp']}', hs_datetime='".G5_TIME_YMDHIS."', hs_flag='$hs_flag', hs_code='$hs_code', hs_memo='".addslashes($hs_memo)."', hs_log='".addslashes($log)."'", false);
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
sql_query("update {$g5['sms5_write_table']} set wr_success='$wr_success', wr_failure='$wr_failure', wr_memo='$str_serialize' where wr_no='$wr_no' and wr_renum=0");
}
else win_close_alert("에러: SMS 서버와 통신이 불안정합니다.");
}
else win_close_alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
}
else win_close_alert("에러: SMS 데이터 입력도중 에러가 발생하였습니다.");
function win_close_alert($msg) {
+80
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
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');
?>
+78
View File
@@ -0,0 +1,78 @@
<?php
$sub_menu = "100280";
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');
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'] = '적용할 기본환경 회원스킨 설정이 없습니다.';
}
die(json_encode($data));
?>
+64
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>
+118
View File
@@ -0,0 +1,118 @@
<?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');
$mode = substr(strip_tags($_GET['mode']), 0, 20);
if(!in_array($mode, $arr_mode))
$mode = 'index';
$qstr_index = '&amp;mode=index';
$qstr_list = '&amp;mode=list';
$qstr_view = '&amp;mode=view';
$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');
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']);
}
$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>
<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;
default:
include(G5_PATH.'/index.php');
break;
}
?>
</section>
<?php
require_once(G5_PATH.'/tail.sub.php');
?>
+70
View File
@@ -0,0 +1,70 @@
<?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';
$tconfig = get_theme_config_value($theme, $keys);
if($tconfig['set_default_skin']) {
$sql_common = array();
$qa_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(!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);
}
}
}
die('');
?>
+210
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');
?>
+4 -4
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";
+1 -1
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']);
+1 -1
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']);
+2 -2
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)
+9 -3
View File
@@ -1,5 +1,8 @@
<?php
include_once('./_common.php');
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(!$is_admin)
alert('접근 권한이 없습니다.', G5_URL);
// 4.11
@include_once($board_skin_path.'/delete_all.head.skin.php');
@@ -13,13 +16,16 @@ if ($wr_id) // 건별삭제
else // 일괄삭제
$tmp_array = $_POST['chk_wr_id'];
$chk_count = count($tmp_array);
if($chk_count > (G5_IS_MOBILE ? $board['bo_mobile_page_rows'] : $board['bo_page_rows']))
alert('올바른 방법으로 이용해 주십시오.');
// 사용자 코드 실행
@include_once($board_skin_path.'/delete_all.skin.php');
// 거꾸로 읽는 이유는 답변글부터 삭제가 되어야 하기 때문임
for ($i=count($tmp_array)-1; $i>=0; $i--)
for ($i=$chk_count-1; $i>=0; $i--)
{
$write = sql_fetch(" select * from $write_table where wr_id = '$tmp_array[$i]' ");
+2 -1
View File
@@ -76,7 +76,8 @@ if (!get_session($ss_name))
$g5['title'] = '다운로드 &gt; '.conv_subject($write['wr_subject'], 255);
$original = urlencode($file['bf_source']);
//$original = urlencode($file['bf_source']);
$original = iconv('utf-8', 'euc-kr', $file['bf_source']); // SIR 잉끼님 제안코드
@include_once($board_skin_path.'/download.tail.skin.php');
+2
View File
@@ -30,6 +30,8 @@ include_once(G5_PATH.'/head.sub.php');
if (!$name)
$name = base64_decode($email);
else
$name = get_text(stripslashes($name), true);
if (!isset($type))
$type = 0;
+11 -2
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');
?>
+1 -1
View File
@@ -53,7 +53,7 @@ if ($sca || $stx) {
/*
$sql = " select distinct wr_parent from {$write_table} where {$sql_search} ";
$result = sql_query($sql);
$total_count = mysql_num_rows($result);
$total_count = sql_num_rows($result);
*/
} else {
$sql_search = "";
+3 -3
View File
@@ -2,8 +2,8 @@
include_once('./_common.php');
// 이호경님 제안 코드
session_unset(); // 모든 세션변수를 언레지스터 시켜줌
session_destroy(); // 세션해제함
session_unset(); // 모든 세션변수를 언레지스터 시켜줌
session_destroy(); // 세션해제함
// 자동로그인 해제 --------------------------------
set_cookie('ck_mb_id', '', 0);
@@ -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에 도메인을 지정할 수 없습니다.');
}
+1 -1
View File
@@ -55,7 +55,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="act" value="<?php echo $act ?>">
<input type="hidden" name="url" value="<?php echo clean_xss_tags($_SERVER['HTTP_REFERER']); ?>">
<input type="hidden" name="url" value="<?php echo get_text(clean_xss_tags($_SERVER['HTTP_REFERER'])); ?>">
<div class="tbl_head01 tbl_wrap">
<table>
+1 -1
View File
@@ -99,7 +99,7 @@ while ($row = sql_fetch_array($result))
wr_10 = '".addslashes($row2['wr_10'])."' ";
sql_query($sql);
$insert_id = mysql_insert_id();
$insert_id = sql_insert_id();
// 코멘트가 아니라면
if (!$row2['wr_is_comment'])
+1 -1
View File
@@ -51,7 +51,7 @@ $sql = " select wr_subject from {$write_table}
and wr_is_comment = 0 ";
$row = sql_fetch($sql);
$g5['title'] = $row['wr_subject'];
$g5['title'] = get_text($row['wr_subject']);
include_once($member_skin_path.'/password.skin.php');
+1 -1
View File
@@ -4,7 +4,7 @@ include_once('./_common.php');
if ($is_guest)
alert_close('회원만 조회하실 수 있습니다.');
$g5['title'] = $member['mb_nick'].' 님의 포인트 내역';
$g5['title'] = get_text($member['mb_nick']).' 님의 포인트 내역';
include_once(G5_PATH.'/head.sub.php');
$list = array();
+18 -5
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');
+2 -2
View File
@@ -17,14 +17,14 @@ if (!$mb['mb_open'] && $is_admin != 'super' && $member['mb_id'] != $mb_id)
$g5['title'] = $mb['mb_nick'].'님의 자기소개';
include_once(G5_PATH.'/head.sub.php');
$mb_nick = get_sideview($mb['mb_id'], $mb['mb_nick'], $mb['mb_email'], $mb['mb_homepage'], $mb['mb_open']);
$mb_nick = get_sideview($mb['mb_id'], get_text($mb['mb_nick']), $mb['mb_email'], $mb['mb_homepage'], $mb['mb_open']);
// 회원가입후 몇일째인지? + 1 은 당일을 포함한다는 뜻
$sql = " select (TO_DAYS('".G5_TIME_YMDHIS."') - TO_DAYS('{$mb['mb_datetime']}') + 1) as days ";
$row = sql_fetch($sql);
$mb_reg_after = $row['days'];
$mb_homepage = set_http(clean_xss_tags($mb['mb_homepage']));
$mb_homepage = set_http(get_text(clean_xss_tags($mb['mb_homepage'])));
$mb_profile = $mb['mb_profile'] ? conv_content($mb['mb_profile'],0) : '소개 내용이 없습니다.';
include_once($member_skin_path.'/profile.skin.php');
+2 -2
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) {
// 모바일의 경우 설정을 따르지 않는다.
+1 -2
View File
@@ -57,8 +57,7 @@ if(is_file($skin_file)) {
}
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && $qaconfig['qa_use_editor'] && !G5_IS_MOBILE) {
if ($config['cf_editor'] && $qaconfig['qa_use_editor'] && (!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE)) {
$is_dhtml_editor = true;
}
+91 -24
View File
@@ -217,7 +217,7 @@ if($w == '' || $w == 'a' || $w == 'r') {
$sql = " insert into {$g5['qa_content_table']}
set qa_num = '$qa_num',
mb_id = '{$member['mb_id']}',
qa_name = '{$member['mb_nick']}',
qa_name = '".addslashes($member['mb_nick'])."',
qa_email = '$qa_email',
qa_hp = '$qa_hp',
qa_type = '$qa_type',
@@ -244,7 +244,7 @@ if($w == '' || $w == 'a' || $w == 'r') {
sql_query($sql);
if($w == '' || $w == 'r') {
$qa_id = mysql_insert_id();
$qa_id = sql_insert_id();
if($w == 'r' && $write['qa_related']) {
$qa_related = $write['qa_related'];
@@ -300,33 +300,100 @@ if($w == '' || $w == 'a' || $w == 'r') {
// SMS 알림
if($config['cf_sms_use'] == 'icode' && $qaconfig['qa_use_sms']) {
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
if($config['cf_sms_type'] == 'LMS') {
include_once(G5_LIB_PATH.'/icode.lms.lib.php');
// 답변글은 질문 등록자에게 전송
if($w == 'a' && $write['qa_sms_recv'] && trim($write['qa_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 답변이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_send_number']);
$recv_number = preg_replace('/[^0-9]/', '', $write['qa_hp']);
$port_setting = get_icode_port_type($config['cf_icode_id'], $config['cf_icode_pw']);
if($recv_number) {
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$SMS->Send();
// SMS 모듈 클래스 생성
if($port_setting !== false) {
// 답변글은 질문 등록자에게 전송
if($w == 'a' && $write['qa_sms_recv'] && trim($write['qa_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 답변이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_send_number']);
$recv_number = preg_replace('/[^0-9]/', '', $write['qa_hp']);
if($recv_number) {
$strDest = array();
$strDest[] = $recv_number;
$strCallBack = $send_number;
$strCaller = iconv_euckr(trim($config['cf_title']));
$strSubject = '';
$strURL = '';
$strData = iconv_euckr($sms_content);
$strDate = '';
$nCount = count($strDest);
$SMS = new LMS;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting);
$res = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount);
if($res) {
$SMS->Send();
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
}
}
// 문의글 등록시 관리자에게 전송
if(($w == '' || $w == 'r') && trim($qaconfig['qa_admin_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 문의글이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qa_hp);
$recv_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_admin_hp']);
if($recv_number) {
$strDest = array();
$strDest[] = $recv_number;
$strCallBack = $send_number;
$strCaller = iconv_euckr(trim($config['cf_title']));;
$strSubject = '';
$strURL = '';
$strData = iconv_euckr($sms_content);
$strDate = '';
$nCount = count($strDest);
$SMS = new LMS;
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting);
$res = $SMS->Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate, $nCount);
if($res) {
$SMS->Send();
}
$SMS->Init(); // 보관하고 있던 결과값을 지웁니다.
}
}
}
}
} else {
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
// 문의글 등록시 관리자에게 전송
if(($w == '' || $w == 'r') && trim($qaconfig['qa_admin_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 문의글이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qa_hp);
$recv_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_admin_hp']);
// 답변글은 질문 등록자에게 전송
if($w == 'a' && $write['qa_sms_recv'] && trim($write['qa_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 답변이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_send_number']);
$recv_number = preg_replace('/[^0-9]/', '', $write['qa_hp']);
if($recv_number) {
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$SMS->Send();
if($recv_number) {
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$SMS->Send();
}
}
// 문의글 등록시 관리자에게 전송
if(($w == '' || $w == 'r') && trim($qaconfig['qa_admin_hp'])) {
$sms_content = $config['cf_title'].' '.$qaconfig['qa_title'].'에 문의글이 등록되었습니다.';
$send_number = preg_replace('/[^0-9]/', '', $qa_hp);
$recv_number = preg_replace('/[^0-9]/', '', $qaconfig['qa_admin_hp']);
if($recv_number) {
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$SMS->Send();
}
}
}
}
+3
View File
@@ -30,6 +30,9 @@ if ($w == "") {
alert('개인정보처리방침안내의 내용에 동의하셔야 회원가입 하실 수 있습니다.', G5_BBS_URL.'/register.php');
}
$agree = preg_replace('#[^0-9]#', '', $_POST['agree']);
$agree2 = preg_replace('#[^0-9]#', '', $_POST['agree2']);
$member['mb_birth'] = '';
$member['mb_sex'] = '';
$member['mb_name'] = '';
+1 -1
View File
@@ -73,7 +73,7 @@ if ($w == '' || $w == 'u') {
if($w == '' && $mb_password != $mb_password_re)
alert('비밀번호가 일치하지 않습니다.');
if ($msg = empty_mb_name($mb_id)) alert($msg, "", true, true);
if ($msg = empty_mb_name($mb_name)) alert($msg, "", true, true);
if ($msg = empty_mb_nick($mb_nick)) alert($msg, "", true, true);
if ($msg = empty_mb_email($mb_email)) alert($msg, "", true, true);
if ($msg = reserve_mb_id($mb_id)) alert($msg, "", true, true);
+1 -1
View File
@@ -4,7 +4,7 @@ include_once('./_common.php');
if (!$is_member)
alert_close('회원만 조회하실 수 있습니다.');
$g5['title'] = $member['mb_nick'].'님의 스크랩';
$g5['title'] = get_text($member['mb_nick']).'님의 스크랩';
include_once(G5_PATH.'/head.sub.php');
$sql_common = " from {$g5['scrap_table']} where mb_id = '{$member['mb_id']}' ";
+1 -1
View File
@@ -70,7 +70,7 @@ if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level']))
wr_ip = '{$_SERVER['REMOTE_ADDR']}' ";
sql_query($sql);
$comment_id = mysql_insert_id();
$comment_id = sql_insert_id();
// 원글에 코멘트수 증가
sql_query(" update $write_table set wr_comment = wr_comment + 1 where wr_id = '$wr_id' ");
+1 -1
View File
@@ -120,7 +120,7 @@ if ($stx) {
$sql = " select wr_id from {$tmp_write_table} where {$sql_search} ";
$result = sql_query($sql, false);
$row['cnt'] = @mysql_num_rows($result);
$row['cnt'] = @sql_num_rows($result);
$total_count += $row['cnt'];
if ($row['cnt']) {
+1 -1
View File
@@ -12,7 +12,7 @@ switch($_REQUEST['sns']) {
header("Location:http://www.facebook.com/sharer/sharer.php?s=100&u=".$short_url."&p=".$title);
break;
case 'twitter' :
header("Location:http://twitter.com/home?status=".$title_url);
header("Location:https://twitter.com/intent/tweet?text=".$title_url);
break;
case 'gplus' :
header("Location:https://plus.google.com/share?url=".$short_url);
+10 -2
View File
@@ -390,9 +390,17 @@ if ($is_guest) {
}
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && !G5_IS_MOBILE && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) {
$is_dhtml_editor_use = false;
$editor_content_js = '';
if(!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE)
$is_dhtml_editor_use = true;
// 모바일에서는 G5_IS_MOBILE_DHTML_USE 설정에 따라 DHTML 에디터 적용
if ($config['cf_editor'] && $is_dhtml_editor_use && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) {
$is_dhtml_editor = true;
if(is_file(G5_EDITOR_PATH.'/'.$config['cf_editor'].'/autosave.editor.js'))
$editor_content_js = '<script src="'.G5_EDITOR_URL.'/'.$config['cf_editor'].'/autosave.editor.js"></script>'.PHP_EOL;
}
$editor_html = editor_html('wr_content', $content, $is_dhtml_editor);
$editor_js = '';
+1 -1
View File
@@ -167,7 +167,7 @@ if ($w == 'c') // 댓글 입력
wr_10 = '$wr_10' ";
sql_query($sql);
$comment_id = mysql_insert_id();
$comment_id = sql_insert_id();
// 원글에 댓글수 증가 & 마지막 시간 반영
sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_last = '".G5_TIME_YMDHIS."' where wr_id = '$wr_id' ");
+1 -1
View File
@@ -244,7 +244,7 @@ if ($w == '' || $w == 'r') {
wr_10 = '$wr_10' ";
sql_query($sql);
$wr_id = mysql_insert_id();
$wr_id = sql_insert_id();
// 부모 아이디에 UPDATE
sql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' ");
+119 -78
View File
@@ -135,7 +135,7 @@ if (file_exists($dbconfig_file)) {
// mysql connect resource $g5 배열에 저장 - 명랑폐인님 제안
$g5['connect_db'] = $connect_db;
sql_query(" set names utf8 ");
sql_set_charset('utf8', $connect_db);
if(defined('G5_MYSQL_SET_MODE') && G5_MYSQL_SET_MODE) sql_query("SET SESSION sql_mode = ''");
if (defined(G5_TIMEZONE)) sql_query(" set time_zone = '".G5_TIMEZONE."'");
} else {
@@ -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,128 @@ 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');
//=====================================================================================
// 사용기기 설정
// 테마의 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']);
}
//==============================================================================
+8 -1
View File
@@ -5,7 +5,7 @@
********************/
define('G5_VERSION', '그누보드5');
define('G5_GNUBOARD_VER', '5.0.41');
define('G5_GNUBOARD_VER', '5.1.3');
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
define('_GNUBOARD_', true);
@@ -59,6 +59,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) {
@@ -191,6 +192,12 @@ define('G5_THUMB_JPG_QUALITY', 90);
// 썸네일 png Compress 설정
define('G5_THUMB_PNG_COMPRESS', 5);
// 모바일 기기에서 DHTML 에디터 사용여부를 설정합니다.
define('G5_IS_MOBILE_DHTML_USE', false);
// MySQLi 사용여부를 설정합니다.
define('G5_MYSQLI_USE', true);
// ip 숨김방법 설정
/* 123.456.789.012 ip의 숨김 방법을 변경하는 방법은
\\1 은 123, \\2는 456, \\3은 789, \\4는 012에 각각 대응되므로
+7 -1
View File
@@ -283,4 +283,10 @@ a.btn_admin:focus, a.btn_admin:hover {text-decoration:none}
/*메일인증*/
.rg_em{margin-top:5px}
.rg_em caption{padding:0;font-size:0;line-height:0;overflow:hidden}
.rg_em caption{padding:0;font-size:0;line-height:0;overflow:hidden}
/*캡챠 모바일에서 피시버젼*/
#captcha.m_captcha audio{display:block;margin:5px 0 10px;}
#captcha.m_captcha #captcha_key{margin-left:3px }
#captcha.m_captcha #captcha_reload span{background:none;display:inline}
#captcha.m_captcha #captcha_reload {position:relative ;width:auto;top:0;left:0;margin:0;padding:0 10px;height:43px;border:0;background:#e4eaec;vertical-align:middle;overflow:hidden;cursor:pointer}
+12
View File
@@ -102,6 +102,7 @@ a:hover, a:focus, a:active {color:#000;text-decoration:underline}
/* 화면낭독기 사용자용 */
#hd_login_msg {position:absolute;top:0;left:0;width:0;height:0;overflow:hidden}
.msg_sound_only, .sound_only {display:inline-block;position:absolute;top:0;left:0;margin:0 !important;padding:0 !important;width:1px !important;height:1px !important;font-size:0 !important;line-height:0 !important;overflow:hidden}
/* 본문 바로가기 */
.to_content a {z-index:100000;position:absolute;top:0;left:0;width:0;height:0;font-size:0;line-height:0;overflow:hidden}
@@ -116,6 +117,17 @@ a:hover, a:focus, a:active {color:#000;text-decoration:underline}
#captcha #captcha_reload {margin:0;padding:0 5px;height:32px;border:0;background:#e4eaec;vertical-align:middle;overflow:hidden;cursor:pointer}
#captcha #captcha_key {margin:0 0 0 4px;padding:0 5px;width:50px;height:30px;border:1px solid #b8c9c2;background:#f7f7f7;font-size:1.333em;font-weight:bold;text-align:center;line-height:2em}
#captcha #captcha_info {display:block;margin:5px 0 0;font-size:0.95em;letter-spacing:-0.1em}
#captcha #captcha_mp3{margin:0;padding:0 5px;height:32px;border:0;background:#e4eaec;vertical-align:middle;overflow:hidden;cursor:pointer}
/*단축키일람 */
.btn_cke_sc{background:#333;color:#fff;padding:5px;border:none;margin-bottom:5px}
.cke_sc_def {margin:0 0 5px;padding:10px;border:1px solid #ccc;background:#f7f7f7;text-align:center}
.cke_sc_def dl{margin:0 0 5px;text-align:left;zoom:1}
.cke_sc_def dl:after {display:block;visibility:hidden;clear:both;content:""}
.cke_sc_def dt, .cke_sc_def dd {float:left;margin:0;padding:5px 0;border-bottom:1px solid #e9e9e9}
.cke_sc_def dt {width:50%;font-weight:bold}
.cke_sc_def dd {width:50%}
.btn_cke_sc_close{background:#333;padding:5px;border:none;color:#fff}
/* 버튼 */
a.btn01 {display:inline-block;padding:8px 7px 7px;border:1px solid #ccc;background:#fafafa;color:#000;text-decoration:none;vertical-align:middle}
-17
View File
@@ -22,23 +22,10 @@ $g5['sms5_book_table'] = $g5['sms5_prefix'] . 'book';
$g5['sms5_book_group_table'] = $g5['sms5_prefix'] . 'book_group';
$g5['sms5_form_table'] = $g5['sms5_prefix'] . 'form';
$g5['sms5_form_group_table'] = $g5['sms5_prefix'] . 'form_group';
$g5['sms5_member_history_table'] = $g5['sms5_prefix'] . 'member_history';
if (!empty($config['cf_sms_use'])) {
$sms5 = sql_fetch("select * from {$g5['sms5_config_table']} ", false);
if( $sms5['cf_member'] && trim($member['mb_hp']) ) {
$g5['sms5_use_sideview'] = true; //회원 사이드뷰 레이어에 추가
} else {
$g5['sms5_use_sideview'] = false;
}
//==============================================================================
// 스킨경로
//------------------------------------------------------------------------------
$sms5_skin_path = G5_SMS5_PATH.'/skin/'.$sms5['cf_skin']; //sms5 스킨 path
$sms5_skin_url = G5_SMS5_URL .'/skin/'.$sms5['cf_skin']; //sms5 스킨 url
// Demo 설정
if (file_exists(G5_PATH.'/DEMO'))
@@ -49,9 +36,5 @@ if (!empty($config['cf_sms_use'])) {
// 아이코드에 실제로 보내지 않고 가상(Random)으로 전송결과를 저장합니다.
$g5['sms5_demo_send'] = true;
}
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
include_once(G5_SMS5_PATH.'/sms5.lib.php');
}
?>
-5
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');
?>
+2 -2
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');
?>
+7 -37
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">';
@@ -169,13 +169,7 @@ document.onkeydown = noRefresh ;
$is_euckr = true;
// member table 복사
$columns = array();
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['member_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$columns = sql_field_names($g5['member_table']);
$sql = " select * from {$g4['member_table']} ";
$result = sql_query($sql);
@@ -325,13 +319,7 @@ document.onkeydown = noRefresh ;
echo '<li>visit sum table 복사</li>'.PHP_EOL;
// group table 복사
$columns = array();
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['group_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$columns = sql_field_names($g5['group_table']);
$sql = " select * from {$g4['group_table']} ";
$result = sql_query($sql);
@@ -365,13 +353,7 @@ document.onkeydown = noRefresh ;
unset($fiels);
// board 복사
$columns = array();
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['board_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$columns = sql_field_names($g5['board_table']);
$sql = " select * from {$g4['board_table']} ";
$result = sql_query($sql);
@@ -413,13 +395,7 @@ document.onkeydown = noRefresh ;
// 게시글 복사
if(sql_query($sql, FALSE)) {
$write_table = $g4['write_prefix'].$bo_table;
$columns2 = array();
$fields2 = mysql_list_fields(G5_MYSQL_DB, $create_table);
$count2 = mysql_num_fields($fields2);
for ($j = 0; $j < $count2; $j++) {
$fld = mysql_field_name($fields2, $j);
$columns2[] = $fld;
}
$columns2 = sql_field_names($create_table);
$sql3 = " select * from $write_table ";
$result3 = sql_query($sql3);
@@ -461,13 +437,7 @@ document.onkeydown = noRefresh ;
$tables = array('board_file', 'board_new', 'board_good', 'mail', 'memo', 'group_member', 'auth', 'popular', 'poll', 'poll_etc', 'scrap');
foreach($tables as $table) {
$columns = array();
$fields = mysql_list_fields(G5_MYSQL_DB, $g5[$table.'_table']);
$count = mysql_num_fields($fields);
for ($i = 0; $i < $count; $i++) {
$fld = mysql_field_name($fields, $i);
$columns[] = $fld;
}
$columns = sql_field_names($g5[$table.'_table']);
$src_table = $g4[$table.'_table'];
$dst_table = $g5[$table.'_table'];
@@ -536,5 +506,5 @@ $(function() {
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
include_once(G5_PATH.'/'.G5_THEME_DIR.'/basic/tail.sub.php');
?>
+12 -13
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;
}
?>
<!-- 상단 시작 { -->
@@ -98,7 +97,7 @@ if (G5_IS_MOBILE) {
<?php } ?>
<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>
</ul>
</div>
@@ -158,8 +157,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 } ?>
+8 -7
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 {
echo '<link rel="stylesheet" href="'.G5_CSS_URL.'/'.(G5_IS_MOBILE?'mobile':'default').'.css">'.PHP_EOL;
}
@@ -99,7 +100,7 @@ if ($is_member) { // 회원이라면 로그인 중이라는 메세지를 출력
else if ($is_admin == 'group') $sr_admin_msg = "그룹관리자 ";
else if ($is_admin == 'board') $sr_admin_msg = "게시판관리자 ";
echo '<div id="hd_login_msg">'.$sr_admin_msg.$member['mb_nick'].'님 로그인 중 ';
echo '<div id="hd_login_msg">'.$sr_admin_msg.get_text($member['mb_nick']).'님 로그인 중 ';
echo '<a href="'.G5_BBS_URL.'/logout.php">로그아웃</a></div>';
}
?>
+10 -8
View File
@@ -1,11 +1,12 @@
<?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; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_PATH.'/index.php');
return;
}
if (G5_IS_MOBILE) {
@@ -13,7 +14,7 @@ if (G5_IS_MOBILE) {
return;
}
include_once('./_head.php');
include_once(G5_PATH.'/head.php');
?>
<h2 class="sound_only">최신글</h2>
@@ -35,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>
@@ -44,5 +46,5 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
<!-- } 최신글 끝 -->
<?php
include_once('./_tail.php');
?>
include_once(G5_PATH.'/tail.php');
?>
+3 -4
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',
@@ -287,8 +285,9 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_cert_limit` int(11) NOT NULL DEFAULT '0',
`cf_cert_req` tinyint(4) NOT NULL DEFAULT '0',
`cf_sms_use` varchar(255) NOT NULL DEFAULT '',
`cf_sms_type` varchar(10) NOT NULL DEFAULT '',
`cf_icode_id` varchar(255) NOT NULL DEFAULT '',
`cf_icode_pw` varchar(255) NOT NULL DEFAULT '',
`cf_icode_pw` varchar(255) NOT NULL DEFAULT '',
`cf_icode_server_ip` varchar(255) NOT NULL DEFAULT '',
`cf_icode_server_port` varchar(255) NOT NULL DEFAULT '',
`cf_googl_shorturl_apikey` varchar(255) NOT NULL DEFAULT '',
+20 -13
View File
@@ -8,6 +8,8 @@ header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
include_once ('../config.php');
include_once ('../lib/common.lib.php');
$title = G5_VERSION." 설치 완료 3/3";
include_once ('./install.inc.php');
@@ -23,7 +25,7 @@ $admin_pass = $_POST['admin_pass'];
$admin_name = $_POST['admin_name'];
$admin_email = $_POST['admin_email'];
$dblink = @mysql_connect($mysql_host, $mysql_user, $mysql_pass);
$dblink = sql_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_db);
if (!$dblink) {
?>
@@ -37,7 +39,7 @@ if (!$dblink) {
exit;
}
$select_db = @mysql_select_db($mysql_db, $dblink);
$select_db = sql_select_db($mysql_db, $dblink);
if (!$select_db) {
?>
@@ -52,11 +54,15 @@ if (!$select_db) {
}
$mysql_set_mode = 'false';
@mysql_query('set names utf8');
if(version_compare(mysql_get_server_info(), '5.6.6', '>=') == 1) {
@mysql_query("SET SESSION sql_mode = ''");
sql_set_charset('utf8', $dblink);
$result = sql_query(" SELECT @@sql_mode as mode ", true, $dblink);
$row = sql_fetch_array($result);
if($row['mode']) {
sql_query("SET SESSION sql_mode = ''", true, $dblink);
$mysql_set_mode = 'true';
}
unset($result);
unset($row);
?>
<div class="ins_inner">
@@ -73,7 +79,7 @@ $file = preg_replace('/`g5_([^`]+`)/', '`'.$table_prefix.'$1', $file);
$f = explode(';', $file);
for ($i=0; $i<count($f); $i++) {
if (trim($f[$i]) == '') continue;
mysql_query($f[$i]) or die(mysql_error());
sql_query($f[$i], true, $dblink);
}
// 테이블 생성 ------------------------------------
?>
@@ -90,6 +96,7 @@ $download_point = 0;
// config 테이블 설정
$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."',
@@ -151,14 +158,14 @@ $sql = " insert into `{$table_prefix}config`
cf_stipulation = '해당 홈페이지에 맞는 회원가입약관을 입력합니다.',
cf_privacy = '해당 홈페이지에 맞는 개인정보처리방침을 입력합니다.'
";
mysql_query($sql) or die(mysql_error() . "<p>" . $sql);
sql_query($sql, true, $dblink);
// 1:1문의 설정
$sql = " insert into `{$table_prefix}qa_config`
( qa_title, qa_category, qa_skin, qa_mobile_skin, qa_use_email, qa_req_email, qa_use_hp, qa_req_hp, qa_use_editor, qa_subject_len, qa_mobile_subject_len, qa_page_rows, qa_mobile_page_rows, qa_image_width, qa_upload_size, qa_insert_content )
values
( '1:1문의', '회원|포인트', 'basic', 'basic', '1', '0', '1', '0', '1', '60', '30', '15', '15', '600', '1048576', '' ) ";
mysql_query($sql);
sql_query($sql, true, $dblink);
// 관리자 회원가입
$sql = " insert into `{$table_prefix}member`
@@ -174,15 +181,15 @@ $sql = " insert into `{$table_prefix}member`
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$_SERVER['REMOTE_ADDR']}'
";
@mysql_query($sql);
sql_query($sql, true, $dblink);
// 내용관리 생성
@mysql_query(" insert into `{$table_prefix}content` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ") or die(mysql_error() . "<p>" . $sql);
@mysql_query(" insert into `{$table_prefix}content` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>' ") or die(mysql_error() . "<p>" . $sql);
@mysql_query(" insert into `{$table_prefix}content` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>' ") or die(mysql_error() . "<p>" . $sql);
sql_query(" insert into `{$table_prefix}content` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ", true, $dblink);
sql_query(" insert into `{$table_prefix}content` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>' ", true, $dblink);
sql_query(" insert into `{$table_prefix}content` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>' ", true, $dblink);
// FAQ Master
@mysql_query(" insert into `{$table_prefix}faq_master` set fm_id = '1', fm_subject = '자주하시는 질문' ") or die(mysql_error() . "<p>" . $sql);
sql_query(" insert into `{$table_prefix}faq_master` set fm_id = '1', fm_subject = '자주하시는 질문' ", true, $dblink);
?>
<li>DB설정 완료</li>
+23 -16
View File
@@ -7,13 +7,18 @@ var save_wr_content = null;
function autosave() {
$("form#fwrite").each(function() {
if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") {
this.wr_content.value = CKEDITOR.instances.wr_content.getData();
} else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") {
this.wr_content.value = ed_wr_content.outputBodyHTML();
} else if (g5_editor.indexOf("smarteditor2") != -1 && typeof(oEditors)!="undefined" && typeof(oEditors.getById['wr_content'])!="undefined" ) {
this.wr_content.value = oEditors.getById['wr_content'].getIR();
if(g5_editor != "") {
if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") {
this.wr_content.value = CKEDITOR.instances.wr_content.getData();
} else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") {
this.wr_content.value = ed_wr_content.outputBodyHTML();
} else {
if(typeof get_editor_wr_content == "function") {
this.wr_content.value = get_editor_wr_content();
}
}
}
// 변수에 저장해 놓은 값과 다를 경우에만 임시 저장함
if (save_wr_subject != this.wr_subject.value || save_wr_content != this.wr_content.value) {
$.ajax({
@@ -69,7 +74,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");
@@ -78,14 +83,16 @@ $(function(){
var subject = $(data).find("item").find("subject").text();
var content = $(data).find("item").find("content").text();
$("#wr_subject").val(subject);
if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") {
CKEDITOR.instances.wr_content.setData(content);
} else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") {
ed_wr_content.putContents(content);
} else if (g5_editor.indexOf("smarteditor2") != -1 && typeof(oEditors)!="undefined" && typeof(oEditors.getById['wr_content'])!="undefined" ) {
oEditors.getById["wr_content"].exec("SET_CONTENTS", [""]);
//oEditors.getById["wr_content"].exec("SET_IR", [""]);
oEditors.getById["wr_content"].exec("PASTE_HTML", [content]);
if(g5_editor != "") {
if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") {
CKEDITOR.instances.wr_content.setData(content);
} else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") {
ed_wr_content.putContents(content);
} else {
if(typeof put_editor_wr_content == "function") {
put_editor_wr_content(content);
}
}
} else {
$("#fwrite #wr_content").val(content);
}
@@ -93,7 +100,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){
+1 -14
View File
@@ -503,14 +503,6 @@ var win_zip = function(frm_name, frm_zip, frm_addr1, frm_addr2, frm_addr3, frm_j
}
}
/**
* sms5 창
**/
var win_sms5 = function(href) {
var new_win = window.open(href, 'win_sms5', 'width=474, height=560, scrollbars=1');
new_win.focus();
}
/**
* 새로운 비밀번호 분실 창 : 101123
**/
@@ -590,11 +582,6 @@ $(function(){
return false;
});
$(".win_sms5").click(function() {
win_sms5(this.href);
return false;
});
/*
$(".win_poll").click(function() {
win_poll(this.href);
@@ -674,7 +661,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) {
+227 -59
View File
@@ -380,11 +380,12 @@ function get_list($write_row, $board, $skin_url, $subject_len=40)
else
$list['last2'] = substr($list['last2'],5,5);
$list['wr_homepage'] = get_text(addslashes($list['wr_homepage']));
$list['wr_homepage'] = get_text($list['wr_homepage']);
$tmp_name = get_text(cut_str($list['wr_name'], $config['cf_cut_name'])); // 설정된 자리수 만큼만 이름 출력
$tmp_name2 = cut_str($list['wr_name'], $config['cf_cut_name']); // 설정된 자리수 만큼만 이름 출력
if ($board['bo_use_sideview'])
$list['name'] = get_sideview($list['mb_id'], $tmp_name, $list['wr_email'], $list['wr_homepage']);
$list['name'] = get_sideview($list['mb_id'], $tmp_name2, $list['wr_email'], $list['wr_homepage']);
else
$list['name'] = '<span class="'.($list['mb_id']?'sv_member':'sv_guest').'">'.$tmp_name.'</span>';
@@ -1201,10 +1202,9 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
$email = base64_encode($email);
$homepage = set_http(clean_xss_tags($homepage));
$name = preg_replace("/\&#039;/", "", $name);
$name = preg_replace("/\'/", "", $name);
$name = preg_replace("/\"/", "&#034;", $name);
$title_name = $name;
$name = get_text($name, 0, true);
$email = get_text($email);
$homepage = get_text($homepage);
$tmp_name = "";
if ($mb_id) {
@@ -1240,10 +1240,6 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
$title_mb_id = '[비회원]';
}
$name = get_text($name);
$email = get_text($email);
$homepage = get_text($homepage);
$str = "<span class=\"sv_wrap\">\n";
$str .= $tmp_name."\n";
@@ -1264,10 +1260,6 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
}
if($mb_id)
$str2 .= "<a href=\"".G5_BBS_URL."/new.php?mb_id=".$mb_id."\">전체게시물</a>\n";
if($g5['sms5_use_sideview']){
$mb = get_member($mb_id, " mb_open, mb_sms , mb_hp ");
if( $mb['mb_open'] && $mb['mb_sms'] && $mb['mb_hp'] ) $str2 .= "<a href=\"".G5_SMS5_URL."/?mb_id=".$mb_id."\" class=\"win_sms5\" target=\"_blank\">문자보내기</a>\n";
}
if($is_admin == "super" && $mb_id) {
$str2 .= "<a href=\"".G5_ADMIN_URL."/member_form.php?w=u&amp;mb_id=".$mb_id."\" target=\"_blank\">회원정보변경</a>\n";
$str2 .= "<a href=\"".G5_ADMIN_URL."/point_list.php?sfl=mb_id&amp;stx=".$mb_id."\" target=\"_blank\">포인트내역</a>\n";
@@ -1365,12 +1357,19 @@ function cut_str($str, $len, $suffix="…")
// TEXT 형식으로 변환
function get_text($str, $html=0)
function get_text($str, $html=0, $restore=false)
{
/* 3.22 막음 (HTML 체크 줄바꿈시 출력 오류때문)
$source[] = "/ /";
$target[] = " &nbsp;";
*/
$source[] = "<";
$target[] = "&lt;";
$source[] = ">";
$target[] = "&gt;";
$source[] = "\"";
$target[] = "&#034;";
$source[] = "\'";
$target[] = "&#039;";
if($restore)
$str = str_replace($target, $source, $str);
// 3.31
// TEXT 출력일 경우 &amp; &nbsp; 등의 코드를 정상으로 출력해 주기 위함
@@ -1378,21 +1377,12 @@ function get_text($str, $html=0)
$str = html_symbol($str);
}
$source[] = "/</";
$target[] = "&lt;";
$source[] = "/>/";
$target[] = "&gt;";
//$source[] = "/\"/";
//$target[] = "&#034;";
$source[] = "/\'/";
$target[] = "&#039;";
//$source[] = "/}/"; $target[] = "&#125;";
if ($html) {
$source[] = "/\n/";
$source[] = "\n";
$target[] = "<br/>";
}
return preg_replace($source, $target, $str);
return str_replace($source, $target, $str);
}
@@ -1422,11 +1412,22 @@ function html_symbol($str)
*************************************************************************/
// DB 연결
function sql_connect($host, $user, $pass)
function sql_connect($host, $user, $pass, $db=G5_MYSQL_DB)
{
global $g5;
return @mysql_connect($host, $user, $pass);
if(function_exists('mysqli_connect') && G5_MYSQLI_USE) {
$link = mysqli_connect($host, $user, $pass, $db);
// 연결 오류 발생 시 스크립트 종료
if (mysqli_connect_errno()) {
die('Connect Error: '.mysqli_connect_error());
}
} else {
$link = mysql_connect($host, $user, $pass);
}
return $link;
}
@@ -1435,16 +1436,36 @@ function sql_select_db($db, $connect)
{
global $g5;
return @mysql_select_db($db, $connect);
if(function_exists('mysqli_select_db') && G5_MYSQLI_USE)
return @mysqli_select_db($connect, $db);
else
return @mysql_select_db($db, $connect);
}
// mysql_query 와 mysql_error 를 한꺼번에 처리
// mysql connect resource 지정 - 명랑폐인님 제안
function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR)
function sql_set_charset($charset, $link=null)
{
global $g5;
if(!$link)
$link = $g5['connect_db'];
if(function_exists('mysqli_set_charset') && G5_MYSQLI_USE)
mysqli_set_charset($link, $charset);
else
sql_query(" set names {$charset} ");
}
// mysqli_query 와 mysqli_error 를 한꺼번에 처리
// mysql connect resource 지정 - 명랑폐인님 제안
function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null)
{
global $g5;
if(!$link)
$link = $g5['connect_db'];
// Blind SQL Injection 취약점 해결
$sql = trim($sql);
// union의 사용을 허락하지 않습니다.
@@ -1453,20 +1474,34 @@ function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR)
// `information_schema` DB로의 접근을 허락하지 않습니다.
$sql = preg_replace("#^select.*from.*where.*`?information_schema`?.*#i", "select 1", $sql);
if ($error)
$result = @mysql_query($sql, $g5['connect_db']) or die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
else
$result = @mysql_query($sql, $g5['connect_db']);
if(function_exists('mysqli_query') && G5_MYSQLI_USE) {
if ($error) {
$result = @mysqli_query($link, $sql) or die("<p>$sql<p>" . mysqli_errno($link) . " : " . mysqli_error($link) . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
} else {
$result = @mysqli_query($link, $sql);
}
} else {
if ($error) {
$result = @mysql_query($sql, $link) or die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
} else {
$result = @mysql_query($sql, $link);
}
}
return $result;
}
// 쿼리를 실행한 후 결과값에서 한행을 얻는다.
function sql_fetch($sql, $error=G5_DISPLAY_SQL_ERROR)
function sql_fetch($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null)
{
$result = sql_query($sql, $error);
//$row = @sql_fetch_array($result) or die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : $_SERVER['SCRIPT_NAME']");
global $g5;
if(!$link)
$link = $g5['connect_db'];
$result = sql_query($sql, $error, $link);
//$row = @sql_fetch_array($result) or die("<p>$sql<p>" . mysqli_errno() . " : " . mysqli_error() . "<p>error file : $_SERVER['SCRIPT_NAME']");
$row = sql_fetch_array($result);
return $row;
}
@@ -1475,7 +1510,11 @@ function sql_fetch($sql, $error=G5_DISPLAY_SQL_ERROR)
// 결과값에서 한행 연관배열(이름으로)로 얻는다.
function sql_fetch_array($result)
{
$row = @mysql_fetch_assoc($result);
if(function_exists('mysqli_fetch_assoc') && G5_MYSQLI_USE)
$row = @mysqli_fetch_assoc($result);
else
$row = @mysql_fetch_assoc($result);
return $row;
}
@@ -1485,7 +1524,10 @@ function sql_fetch_array($result)
// 단, 결과 값은 스크립트(script) 실행부가 종료되면서 메모리에서 자동적으로 지워진다.
function sql_free_result($result)
{
return mysql_free_result($result);
if(function_exists('mysqli_free_result') && G5_MYSQLI_USE)
return mysqli_free_result($result);
else
return mysql_free_result($result);
}
@@ -1499,6 +1541,74 @@ function sql_password($value)
}
function sql_insert_id($link=null)
{
global $g5;
if(!$link)
$link = $g5['connect_db'];
if(function_exists('mysqli_insert_id') && G5_MYSQLI_USE)
return mysqli_insert_id($link);
else
return mysql_insert_id($link);
}
function sql_num_rows($result)
{
if(function_exists('mysqli_num_rows') && G5_MYSQLI_USE)
return mysqli_num_rows($result);
else
return mysql_num_rows($result);
}
function sql_field_names($table, $link=null)
{
global $g5;
if(!$link)
$link = $g5['connect_db'];
$columns = array();
$sql = " select * from `$table` limit 1 ";
$result = sql_query($sql, $link);
if(function_exists('mysqli_fetch_field') && G5_MYSQLI_USE) {
while($field = mysqli_fetch_field($result)) {
$columns[] = $field->name;
}
} else {
$i = 0;
$cnt = mysql_num_fields($result);
while($i < $cnt) {
$field = mysql_fetch_field($result, $i);
$columns[] = $field->name;
$i++;
}
}
return $columns;
}
function sql_error_info($link=null)
{
global $g5;
if(!$link)
$link = $g5['connect_db'];
if(function_exists('mysqli_error') && G5_MYSQLI_USE) {
return mysqli_errno($link) . ' : ' . mysqli_error($link);
} else {
return mysql_errno($link) . ' : ' . mysql_error($link);
}
}
// PHPMyAdmin 참고
function get_table_define($table, $crlf="\n")
{
@@ -1899,12 +2009,15 @@ function convert_charset($from_charset, $to_charset, $str)
}
// mysql_real_escape_string 의 alias 기능을 한다.
function sql_real_escape_string($field)
// mysqli_real_escape_string 의 alias 기능을 한다.
function sql_real_escape_string($str, $link=null)
{
global $g5;
return mysql_real_escape_string($field, $g5['connect_db']);
if(!$link)
$link = $g5['connect_db'];
return mysqli_real_escape_string($link, $str);
}
function escape_trim($field)
@@ -2066,7 +2179,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));
@@ -2643,9 +2756,9 @@ function module_exec_check($exe, $type)
// 주소출력
function print_address($addr1, $addr2, $addr3, $addr4)
{
$address = trim($addr1);
$addr2 = trim($addr2);
$addr3 = trim($addr3);
$address = get_text(trim($addr1));
$addr2 = get_text(trim($addr2));
$addr3 = get_text(trim($addr3));
if($addr4 == 'N') {
if($addr2)
@@ -2723,11 +2836,6 @@ function clean_xss_tags($str)
{
$str = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $str);
$search = array('"', "'");
$replace = array('&#34;', '&#39;');
$str = str_replace($search, $replace, $str);
return $str;
}
@@ -2857,7 +2965,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'])) {
@@ -2962,7 +3070,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'];
@@ -2993,4 +3101,64 @@ 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);
}
// 발신번호 유효성 체크
function check_vaild_callback($callback){
$_callback = preg_replace('/[^0-9]/','', $callback);
/**
* 1588 로시작하면 총8자리인데 7자리라 차단
* 02 로시작하면 총9자리 또는 10자리인데 11자리라차단
* 1366은 그자체가 원번호이기에 다른게 붙으면 차단
* 030으로 시작하면 총10자리 또는 11자리인데 9자리라차단
*/
if( substr($_callback,0,4) == '1588') if( strlen($_callback) != 8) return false;
if( substr($_callback,0,2) == '02') if( strlen($_callback) != 9 && strlen($_callback) != 10 ) return false;
if( substr($_callback,0,3) == '030') if( strlen($_callback) != 10 && strlen($_callback) != 11 ) return false;
if( !preg_match("/^(02|0[3-6]\d|01(0|1|3|5|6|7|8|9)|070|080|007)\-?\d{3,4}\-?\d{4,5}$/",$_callback) &&
!preg_match("/^(15|16|18)\d{2}\-?\d{4,5}$/",$_callback) ){
return false;
} else if( preg_match("/^(02|0[3-6]\d|01(0|1|3|5|6|7|8|9)|070|080)\-?0{3,4}\-?\d{4}$/",$_callback )) {
return false;
} else {
return true;
}
}
?>
+18 -5
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();
+249
View File
@@ -0,0 +1,249 @@
<?php
if (!defined('_GNUBOARD_')) exit;
// 요금제에 따른 port 구분
function get_icode_port_type($id, $pw)
{
$userinfo = get_icode_userinfo($id, $pw);
if($userinfo['payment'] == 'A') { // 충전제
return 1;
} else if($userinfo['payment'] == 'C') { // 정액제
return 1;
} else {
return false;
}
}
/**
* SMS 발송을 관장하는 메인 클래스이다.
*
* 접속, 발송, URL발송, 결과등의 실질적으로 쓰이는 모든 부분이 포함되어 있다.
*/
class LMS {
var $icode_id;
var $icode_pw;
var $socket_host;
var $socket_port;
var $socket_portcode;
var $Data = array();
var $Result = array();
// SMS 서버 접속
function SMS_con($host, $id, $pw, $portcode) {
$this->socket_host = $host;
$this->socket_portcode = $portcode;
$this->icode_id = FillSpace($id, 10);
$this->icode_pw = FillSpace($pw, 10);
}
function Init() {
$this->Data = ""; // 발송하기 위한 패킷내용이 배열로 들어간다.
$this->Result = ""; // 발송결과값이 배열로 들어간다.
}
function Add($strDest, $strCallBack, $strCaller, $strSubject, $strURL, $strData, $strDate="", $nCount) {
// 문자 타입별 Port 설정.
$sendType = strlen($strData) > 90 ? 1 : 0; // 0: SMS / 1: LMS
/* 개발 완료 후 아래 포트를 rand 함수를 이용하는 라인으로 변경 바랍니다.*/
// 충전식
if ($this->socket_portcode == 1) {
if($sendType && $sendType == 1) {
//$this->socket_port = 8200; // LMS
$this->socket_port=(int)rand(8200,8201); // LMS
} else {
//$this->socket_port = 6295; // SMS
$this->socket_port=(int)rand(6295,6297); // SMS
}
}
// 정액제
else {
if($sendType && $sendType == 1) {
//$this->socket_port = 8300; // LMS
$this->socket_port=(int)rand(8300,8301); // LMS
} else {
//$this->socket_port = 6291; // SMS
$this->socket_port=(int)rand(6291,6293); // SMS
}
}
$strCallBack = FillSpace($strCallBack, 11); // 회신번호
$strDate = FillSpace($strDate, 12); // 즉시(12byte 공백), 예약전송(YmdHi)
if ($sendType && $sendType == 1) {
/** LMS 제목 **/
/*
제목필드의 값이 없을 경우 단말기 기종및 설정에 따라 표기 방법이 다름
1.설정에서 제목필드보기 설정 Disable -> 제목필드값을 넣어도 미표기
2.설정에서 제목필드보기 설정 Enable -> 제목을 넣지 않을 경우 제목없음으로 자동표시
제목의 첫글자에 "<",">", 개행문자가 있을경우 단말기종류 및 통신사에 따라 메세지 전송실패 -> 글자를 체크하거나 취환처리요망
*/
$strSubject = str_replace("\r\n", " ", $strSubject);
$strSubject = str_replace("<", "[", $strSubject);
$strSubject = str_replace(">", "]", $strSubject);
$strSubject = FillSpace($strSubject,30);
$strData = FillSpace(CutChar($strData,1500),1500);
} else if (!$strURL) {
$strData = FillSpace(CutChar($strData,90),90);
$strCaller = FillSpace($strCaller,10);
} else {
$strURL = FillSpace($strURL,50);
}
$Error = CheckCommonTypeDest($strDest, $nCount);
$Error = is_vaild_callback($strCallBack);
$Error = CheckCommonTypeDate($strDate);
for ($i=0; $i<$nCount; $i++) {
$strDest[$i] = FillSpace($strDest[$i],11);
if ($sendType && $sendType == 1) {
$this->Data[$i] = '01144 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strSubject.$strDate.$strData;
} else if (!$strURL) {
$this->Data[$i] = '01144 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strCaller.$strDate.$strData;
} else {
$strData = FillSpace(CheckCallCenter($strURL, $strDest[$i], $strData),80);
$this->Data[$i] = '05173 '.$this->icode_id.$this->icode_pw.$strDest[$i].$strCallBack.$strURL.$strDate.$strData;
}
}
return true;
}
function Send() {
$fsocket = fsockopen($this->socket_host,$this->socket_port, $errno, $errstr, 2);
if (!$fsocket) return false;
set_time_limit(300);
foreach($this->Data as $puts) {
fputs($fsocket, $puts);
while(!$gets) { $gets = fgets($fsocket,30); }
$dest = substr($puts,26,11);
if (substr($gets,0,19) == "0223 00".$dest) {
$this->Result[] = $dest.":".substr($gets,19,10);
} else {
$this->Result[$dest] = $dest.":Error(".substr($gets,6,2).")";
}
$gets = "";
}
fclose($fsocket);
$this->Data = "";
return true;
}
}
/**
* 원하는 문자열의 길이를 원하는 길이만큼 공백을 넣어 맞추도록 합니다.
*
* @param text 원하는 문자열입니다.
* size 원하는 길이입니다.
* @return 변경된 문자열을 넘깁니다.
*/
function FillSpace($text,$size) {
for ($i=0; $i<$size; $i++) $text.= " ";
$text = substr($text,0,$size);
return $text;
}
/**
* 원하는 문자열을 원하는 길에 맞는지 확인해서 조정하는 기능을 합니다.
*
* @param word 원하는 문자열입니다.
* cut 원하는 길이입니다.
* @return 변경된 문자열입니다.
*/
function CutChar($word, $cut) {
$word=substr($word,0,$cut); // 필요한 길이만큼 취함.
for ($k = $cut-1; $k > 1; $k--) {
if (ord(substr($word,$k,1))<128) break; // 한글값은 160 이상.
}
$word = substr($word, 0, $cut-($cut-$k+1)%2);
return $word;
}
/**
* 수신번호의 값이 정확한 값인지 확인합니다.
*
* @param strDest 발송번호 배열입니다.
* nCount 배열의 크기입니다.
* @return 처리결과입니다.
*/
function CheckCommonTypeDest($strDest, $nCount) {
for ($i=0; $i<$nCount; $i++) {
$strDest[$i] = preg_replace("/[^0-9]/","",$strDest[$i]);
if(!preg_match("/^01[0-9]{8,9}$/", $strDest[$i]))
return "수신번호오류";
}
}
/**
* 회신번호 유효성 여부조회 *
* @param string callback 회신번호
* @return 처리결과입니다
* 한국인터넷진흥원 권고
*/
function is_vaild_callback($callback){
$_callback = preg_replace('/[^0-9]/', '', $callback);
if (!preg_match("/^(02|0[3-6]\d|01(0|1|3|5|6|7|8|9)|070|080|007)\-?\d{3,4}\-?\d{4,5}$/", $_callback) &&
!preg_match("/^(15|16|18)\d{2}\-?\d{4,5}$/", $_callback)){
return "회신번호오류";
}
if (preg_match("/^(02|0[3-6]\d|01(0|1|3|5|6|7|8|9)|070|080)\-?0{3,4}\-?\d{4}$/", $_callback)){
return "회신번호오류";
}
}
/**
* 예약날짜의 값이 정확한 값인지 확인합니다.
*
* @param string strDate (예약시간)
* @return 처리결과입니다
*/
function CheckCommonTypeDate($strDate) {
$strDate = preg_replace("/[^0-9]/", "", $strDate);
if ($strDate){
if (!checkdate(substr($strDate,4,2),substr($strDate,6,2),substr($rsvTime,0,4)))
return "예약날짜오류";
if (substr($strDate,8,2)>23 || substr($strDate,10,2)>59) return false;
return "예약날짜오류";
}
}
/**
* URL콜백용으로 메세지 크기를 수정합니다.
*
* @param url URL 내용입니다.
* msg 결과메시지입니다.
* desk 문자내용입니다.
*/
function CheckCallCenter($url, $dest, $data) {
switch (substr($dest,0,3)) {
case '010': //20바이트
return CutChar($data,20); break;
case '011': //80바이트
return CutChar($data,80); break;
case '016': // 80바이트
return CutChar($data,80); break;
case '017': // URL 포함 80바이트
return CutChar($data,80 - strlen($url)); break;
case '018': // 20바이트
return CutChar($data,20); break;
case '019': // 20바이트
return CutChar($data,20); break;
default:
return CutChar($data,80); break;
}
}
?>
+79
View File
@@ -0,0 +1,79 @@
<?php
if (!defined('_GNUBOARD_')) exit;
// http://tinsology.net/2011/04/php-json_encode-and-json_decode-alternatives/
if(!function_exists('json_encode'))
{
function json_encode($a=false)
{
// Some basic debugging to ensure we have something returned
if (is_null($a)) return 'null';
if ($a === false) return 'false';
if ($a === true) return 'true';
if (is_scalar($a))
{
if (is_float($a))
{
// Always use '.' for floats.
return floatval(str_replace(',', '.', strval($a)));
}
if (is_string($a))
{
static $jsonReplaces = array(array('\\', '/', "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
}
else
return $a;
}
$isList = true;
for ($i = 0, reset($a); true; $i++) {
if (key($a) !== $i)
{
$isList = false;
break;
}
}
$result = array();
if ($isList)
{
foreach ($a as $v) $result[] = json_encode($v);
return '[' . join(',', $result) . ']';
}
else
{
foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);
return '{' . join(',', $result) . '}';
}
}
}
if(!function_exists('json_decode'))
{
function json_decode($json)
{
$comment = false;
$out = '$x=';
for ($i=0; $i<strlen($json); $i++)
{
if (!$comment)
{
if (($json[$i] == '{') || ($json[$i] == '['))
$out .= ' array(';
else if (($json[$i] == '}') || ($json[$i] == ']'))
$out .= ')';
else if ($json[$i] == ':')
$out .= '=>';
else
$out .= $json[$i];
}
else
$out .= $json[$i];
if ($json[$i] == '"' && $json[($i-1)]!="\\")
$comment = !$comment;
}
eval($out . ';');
return $x;
}
}
?>
+18 -14
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();
+19 -6
View File
@@ -7,18 +7,31 @@ function outlogin($skin_dir='basic')
global $config, $member, $g5, $urlencode, $is_admin, $is_member;
if (array_key_exists('mb_nick', $member)) {
$nick = cut_str($member['mb_nick'], $config['cf_cut_name']);
$nick = get_text(cut_str($member['mb_nick'], $config['cf_cut_name']));
}
if (array_key_exists('mb_point', $member)) {
$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;
}
}
// 읽지 않은 쪽지가 있다면
+21 -7
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();
+22 -8
View File
@@ -17,17 +17,31 @@ function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3)
for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i] = $row;
// 스크립트등의 실행금지
$list[$i]['pp_word'] = get_text($list[$i]['pp_word']);
//$list[$i]['pp_word'] = get_text($list[$i]['pp_word']);
}
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 {
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();
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;
}
include_once ($popular_skin_path.'/popular.skin.php');
$content = ob_get_contents();
ob_end_clean();
+6 -2
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;
}
@@ -470,7 +474,7 @@ and the roundoff errors in the Gaussian blur process, are welcome.
$radius = abs(round($radius)); // Only integers make sense.
if ($radius == 0) {
return $img; imagedestroy($img); break; }
return $img; imagedestroy($img); }
$w = imagesx($img); $h = imagesy($img);
$imgCanvas = imagecreatetruecolor($w, $h);
$imgBlur = imagecreatetruecolor($w, $h);
+20 -6
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();
+2 -2
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)) {
+5
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');

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