Merge branch 'master' of github.com:gnuboard/g4s
This commit is contained in:
57
common.php
57
common.php
@ -3,30 +3,19 @@
|
|||||||
** 공통 변수, 상수, 코드
|
** 공통 변수, 상수, 코드
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
//error_reporting(E_ALL ^ E_NOTICE);
|
//error_reporting(E_ALL ^ E_NOTICE);
|
||||||
|
//error_reporting(E_ALL & ~E_NOTICE);
|
||||||
|
//error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
|
||||||
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
|
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
|
||||||
|
|
||||||
// 보안설정이나 프레임이 달라도 쿠키가 통하도록 설정
|
// 보안설정이나 프레임이 달라도 쿠키가 통하도록 설정
|
||||||
header('P3P: CP="ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC"');
|
header('P3P: CP="ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC"');
|
||||||
|
|
||||||
if (!isset($set_time_limit)) $set_time_limit = 0;
|
if (!defined('G4_SET_TIME_LIMIT')) define('G4_SET_TIME_LIMIT', 0);
|
||||||
@set_time_limit($set_time_limit);
|
@set_time_limit(G4_SET_TIME_LIMIT);
|
||||||
|
|
||||||
// 짧은 환경변수를 지원하지 않는다면
|
|
||||||
if (isset($HTTP_POST_VARS) && !isset($_POST)) {
|
|
||||||
$_POST = &$HTTP_POST_VARS;
|
|
||||||
$_GET = &$HTTP_GET_VARS;
|
|
||||||
$_SERVER = &$HTTP_SERVER_VARS;
|
|
||||||
$_COOKIE = &$HTTP_COOKIE_VARS;
|
|
||||||
$_ENV = &$HTTP_ENV_VARS;
|
|
||||||
$_FILES = &$HTTP_POST_FILES;
|
|
||||||
|
|
||||||
if (!isset($_SESSION))
|
|
||||||
$_SESSION = &$HTTP_SESSION_VARS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
// php.ini 의 magic_quotes_gpc 값이 FALSE 인 경우 addslashes() 적용
|
// php.ini 의 magic_quotes_gpc 값이 Off 인 경우 addslashes() 적용
|
||||||
// SQL Injection 등으로 부터 보호
|
// SQL Injection 등으로 부터 보호
|
||||||
// http://kr.php.net/manual/en/function.get-magic-quotes-gpc.php#97783
|
// http://kr.php.net/manual/en/function.get-magic-quotes-gpc.php#97783
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -78,21 +67,45 @@ $group = array();
|
|||||||
$g4 = array();
|
$g4 = array();
|
||||||
|
|
||||||
|
|
||||||
|
function g4_path()
|
||||||
|
{
|
||||||
|
$path = dirname(__FILE__); // 예) /home/sir/www/g4s
|
||||||
|
$linux_dir = str_replace("\\", "/", $path); // 예) /home/sir/www/g4s
|
||||||
|
$document_root = str_replace("\\", "/", $_SERVER['DOCUMENT_ROOT']); // 예) /home/sir/www
|
||||||
|
$base_dir = preg_replace('#^'.$document_root.'#i', '', $linux_dir); // 예) /g4s
|
||||||
|
$port = $_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : '';
|
||||||
|
$http = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 's' : '') . '://';
|
||||||
|
|
||||||
|
$result = array();
|
||||||
|
$result['path'] = $path;
|
||||||
|
$result['url'] = $http.$_SERVER['SERVER_NAME'].$port.$base_dir;
|
||||||
|
$result['curr_url'] = $http.$_SERVER['SERVER_NAME'].$port.$_SERVER['PHP_SELF'];
|
||||||
|
$result['curr_uri'] = $result['curr_url'] . ($_SERVER['QUERY_STRING'] ? '?'.$_SERVER['QUERY_STRING'] : '');
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
$g4_path = g4_path();
|
||||||
|
|
||||||
|
include_once($g4_path['path'].'/config.php'); // 설정 파일
|
||||||
|
|
||||||
|
unset($g4_path);
|
||||||
|
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
// 공통
|
// 공통
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
$config_user_file = dirname(__FILE__).'/config.user.php';
|
$dbconfig_file = G4_DATA_PATH.'/dbconfig.php';
|
||||||
if (file_exists($config_user_file)) {
|
if (file_exists($dbconfig_file)) {
|
||||||
include_once($config_user_file);
|
include_once($dbconfig_file);
|
||||||
include_once(dirname(__FILE__).'/config.php'); // 설정 파일
|
|
||||||
include_once(G4_LIB_PATH.'/common.lib.php'); // 공통 라이브러리
|
include_once(G4_LIB_PATH.'/common.lib.php'); // 공통 라이브러리
|
||||||
|
|
||||||
$connect_db = sql_connect(G4_MYSQL_HOST, G4_MYSQL_USER, G4_MYSQL_PASSWORD) or die('MySQL Connect Error!!!');
|
$connect_db = sql_connect(G4_MYSQL_HOST, G4_MYSQL_USER, G4_MYSQL_PASSWORD) or die('MySQL Connect Error!!!');
|
||||||
$select_db = sql_select_db(G4_MYSQL_DB, $connect_db) or die('MySQL DB Error!!!');
|
$select_db = sql_select_db(G4_MYSQL_DB, $connect_db) or die('MySQL DB Error!!!');
|
||||||
} else {
|
} else {
|
||||||
echo "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";
|
echo "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";
|
||||||
echo "<h3>$config_user_file 파일을 찾을 수 없습니다.<br>프로그램 설치 후 실행하시기 바랍니다.</h3>";
|
echo "<h3>$dbconfig_file 파일을 찾을 수 없습니다.<br>프로그램 설치 후 실행하시기 바랍니다.</h3>";
|
||||||
echo '<a href="'.G4_PATH.'/install/">설치하기</a>';
|
echo '<a href="'.G4_URL.'/install/">설치하기</a>';
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|||||||
143
config.php
143
config.php
@ -2,39 +2,54 @@
|
|||||||
|
|
||||||
// 절실함
|
// 절실함
|
||||||
|
|
||||||
if (function_exists("date_default_timezone_set"))
|
|
||||||
date_default_timezone_set("Asia/Seoul");
|
|
||||||
|
|
||||||
function g4_path()
|
|
||||||
{
|
|
||||||
$path = dirname(__FILE__); // 예) /home/sir/www/g4s
|
|
||||||
$linux_dir = str_replace("\\", "/", $path); // 예) /home/sir/www/g4s
|
|
||||||
$document_root = str_replace("\\", "/", $_SERVER['DOCUMENT_ROOT']); // 예) /home/sir/www
|
|
||||||
$base_dir = preg_replace('#^'.$document_root.'#i', '', $linux_dir); // 예) /g4s
|
|
||||||
$port = $_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : '';
|
|
||||||
$http = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 's' : '') . '://';
|
|
||||||
|
|
||||||
$result = array();
|
|
||||||
$result['path'] = $path;
|
|
||||||
$result['url'] = $http.$_SERVER['SERVER_NAME'].$port.$base_dir;
|
|
||||||
$result['curr_url'] = $http.$_SERVER['SERVER_NAME'].$port.$_SERVER['PHP_SELF'];
|
|
||||||
$result['curr_uri'] = $result['curr_url'] . ($_SERVER['QUERY_STRING'] ? '?'.$_SERVER['QUERY_STRING'] : '');
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
// 상수 선언
|
// 상수 선언
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
|
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
|
||||||
define('_GNUBOARD_', true);
|
define('_GNUBOARD_', true);
|
||||||
|
|
||||||
$g4_path = g4_path();
|
if (PHP_VERSION >= '5.3.0') {
|
||||||
|
//if (function_exists("date_default_timezone_set")) date_default_timezone_set("Asia/Seoul");
|
||||||
|
date_default_timezone_set("Asia/Seoul");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
// 경로 상수
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/*
|
||||||
|
보안서버 도메인
|
||||||
|
회원가입, 글쓰기에 사용되는 https 로 시작되는 주소를 말합니다.
|
||||||
|
포트가 있다면 도메인 뒤에 :443 과 같이 입력하세요.
|
||||||
|
보안서버주소가 없다면 공란으로 두시면 되며 보안서버주소 뒤에 / 는 붙이지 않습니다.
|
||||||
|
입력예) https://www.domain.com:443/gnuboard4s
|
||||||
|
*/
|
||||||
|
define('G4_DOMAIN', 'http://tmp.sir.co.kr/g4s');
|
||||||
|
define('G4_HTTPS_DOMAIN', 'http://https-gnuboard4s-tmp.sir.co.kr/g4s'); // http://https-gnuboard4s-tmp.sir.co.kr
|
||||||
|
|
||||||
|
/*
|
||||||
|
www.sir.co.kr 과 sir.co.kr 도메인은 서로 다른 도메인으로 인식합니다. 쿠키를 공유하려면 .sir.co.kr 과 같이 입력하세요.
|
||||||
|
이곳에 입력이 없다면 www 붙은 도메인과 그렇지 않은 도메인은 쿠키를 공유하지 않으므로 로그인이 풀릴 수 있습니다.
|
||||||
|
*/
|
||||||
|
define('G4_COOKIE_DOMAIN', '.sir.co.kr');
|
||||||
|
|
||||||
// URL 은 브라우저상에서의 경로 (도메인으로 부터의)
|
|
||||||
define('G4_ADMIN_DIR', 'adm');
|
define('G4_ADMIN_DIR', 'adm');
|
||||||
define('G4_BBS_DIR', 'bbs');
|
define('G4_BBS_DIR', 'bbs');
|
||||||
|
define('G4_CSS_DIR', 'css');
|
||||||
|
define('G4_DATA_DIR', 'data');
|
||||||
|
define('G4_EXTEND_DIR', 'extend');
|
||||||
|
define('G4_IMG_DIR', 'img');
|
||||||
|
define('G4_JS_DIR', 'js');
|
||||||
|
define('G4_LIB_DIR', 'lib');
|
||||||
|
define('G4_SKIN_DIR', 'skin');
|
||||||
|
define('G4_GCAPTCHA_DIR', 'gcaptcha');
|
||||||
|
define('G4_CKEDITOR_DIR', 'ckeditor');
|
||||||
|
define('G4_EDITOR_DIR', 'editor');
|
||||||
|
define('G4_CACHE_DIR', 'cache');
|
||||||
|
define('G4_FILE_DIR', 'file');
|
||||||
|
|
||||||
|
// URL 은 브라우저상에서의 경로 (도메인으로 부터의)
|
||||||
if (G4_DOMAIN) {
|
if (G4_DOMAIN) {
|
||||||
define('G4_URL', G4_DOMAIN);
|
define('G4_URL', G4_DOMAIN);
|
||||||
} else {
|
} else {
|
||||||
@ -42,30 +57,38 @@ if (G4_DOMAIN) {
|
|||||||
}
|
}
|
||||||
define('G4_ADMIN_URL', G4_URL.'/'.G4_ADMIN_DIR);
|
define('G4_ADMIN_URL', G4_URL.'/'.G4_ADMIN_DIR);
|
||||||
define('G4_BBS_URL', G4_URL.'/'.G4_BBS_DIR);
|
define('G4_BBS_URL', G4_URL.'/'.G4_BBS_DIR);
|
||||||
define('G4_CSS_URL', G4_URL.'/css');
|
define('G4_CSS_URL', G4_URL.'/'.G4_CSS_DIR);
|
||||||
define('G4_DATA_URL', G4_URL.'/data');
|
define('G4_DATA_URL', G4_URL.'/'.G4_DATA_DIR);
|
||||||
define('G4_IMG_URL', G4_URL.'/img');
|
define('G4_IMG_URL', G4_URL.'/'.G4_IMG_DIR);
|
||||||
define('G4_JS_URL', G4_URL.'/js');
|
define('G4_JS_URL', G4_URL.'/'.G4_JS_DIR);
|
||||||
define('G4_SKIN_URL', G4_URL.'/skin');
|
define('G4_SKIN_URL', G4_URL.'/'.G4_SKIN_DIR);
|
||||||
define('G4_GCAPTCHA_URL', G4_BBS_URL.'/gcaptcha');
|
define('G4_GCAPTCHA_URL', G4_BBS_URL.'/'.G4_GCAPTCHA_DIR);
|
||||||
define('G4_CKEDITOR_URL', G4_BBS_URL.'/ckeditor'); // CKEDITOR 의 라이브러리 경로
|
define('G4_CKEDITOR_URL', G4_BBS_URL.'/'.G4_CKEDITOR_DIR); // CKEDITOR 의 라이브러리 경로
|
||||||
define('G4_EDITOR_URL', G4_DATA_URL.'/editor'); // CKEDITOR 에서 업로드한 파일이 저장되는 경로
|
define('G4_EDITOR_URL', G4_DATA_URL.'/'.G4_EDITOR_DIR); // CKEDITOR 에서 업로드한 파일이 저장되는 경로
|
||||||
define('G4_CACHE_URL', G4_DATA_URL.'/cache');
|
define('G4_CACHE_URL', G4_DATA_URL.'/'.G4_CACHE_DIR);
|
||||||
|
define('G4_FILE_URL', G4_DATA_URL.'/'.G4_FILE_DIR);
|
||||||
|
|
||||||
// PATH 는 서버상에서의 절대경로
|
// PATH 는 서버상에서의 절대경로
|
||||||
define('G4_PATH', $g4_path['path']);
|
define('G4_PATH', $g4_path['path']);
|
||||||
define('G4_ADMIN_PATH', G4_PATH.'/'.G4_ADMIN_DIR);
|
define('G4_ADMIN_PATH', G4_PATH.'/'.G4_ADMIN_DIR);
|
||||||
define('G4_BBS_PATH', G4_PATH.'/'.G4_BBS_DIR);
|
define('G4_BBS_PATH', G4_PATH.'/'.G4_BBS_DIR);
|
||||||
define('G4_DATA_PATH', G4_PATH.'/data');
|
define('G4_DATA_PATH', G4_PATH.'/'.G4_DATA_DIR);
|
||||||
define('G4_EXTEND_PATH', G4_PATH.'/extend');
|
define('G4_EXTEND_PATH', G4_PATH.'/'.G4_EXTEND_DIR);
|
||||||
define('G4_LIB_PATH', G4_PATH.'/lib');
|
define('G4_LIB_PATH', G4_PATH.'/'.G4_LIB_DIR);
|
||||||
define('G4_SKIN_PATH', G4_PATH.'/skin');
|
define('G4_SKIN_PATH', G4_PATH.'/'.G4_SKIN_DIR);
|
||||||
define('G4_GCAPTCHA_PATH', G4_BBS_PATH.'/gcaptcha');
|
define('G4_GCAPTCHA_PATH', G4_BBS_PATH.'/'.G4_GCAPTCHA_DIR);
|
||||||
define('G4_CKEDITOR_PATH', G4_BBS_PATH.'/ckeditor');
|
define('G4_CKEDITOR_PATH', G4_BBS_PATH.'/'.G4_CKEDITOR_DIR);
|
||||||
define('G4_CACHE_PATH', G4_DATA_PATH.'/cache');
|
define('G4_CACHE_PATH', G4_DATA_PATH.'/'.G4_CACHE_DIR);
|
||||||
define('G4_EDITOR_PATH', G4_DATA_PATH.'/editor');
|
define('G4_EDITOR_PATH', G4_DATA_PATH.'/'.G4_EDITOR_DIR);
|
||||||
|
define('G4_FILE_PATH', G4_DATA_PATH.'/'.G4_FILE_DIR);
|
||||||
|
//==============================================================================
|
||||||
|
|
||||||
unset($g4_path);
|
|
||||||
|
// 시간 상수
|
||||||
|
define('G4_SERVER_TIME', time());
|
||||||
|
define('G4_TIME_YMDHIS', date("Y-m-d H:i:s", G4_SERVER_TIME));
|
||||||
|
define('G4_TIME_YMD', substr(G4_TIME_YMDHIS, 0, 10));
|
||||||
|
define('G4_TIME_HIS', substr(G4_TIME_YMDHIS, 11, 8));
|
||||||
|
|
||||||
|
|
||||||
// 입력값 검사 상수 (숫자를 변경하시면 안됩니다.)
|
// 입력값 검사 상수 (숫자를 변경하시면 안됩니다.)
|
||||||
@ -77,52 +100,22 @@ define('G4_HANGUL', 16); // 한글
|
|||||||
define('G4_SPACE', 32); // 공백
|
define('G4_SPACE', 32); // 공백
|
||||||
define('G4_SPECIAL', 64); // 특수문자
|
define('G4_SPECIAL', 64); // 특수문자
|
||||||
|
|
||||||
|
|
||||||
// 모바일 인지 결정 $_SERVER['HTTP_USER_AGENT']
|
// 모바일 인지 결정 $_SERVER['HTTP_USER_AGENT']
|
||||||
define('G4_MOBILE_AGENT', 'phone|samsung|lgtel|mobile|skt|nokia|blackberry|android|sony');
|
define('G4_MOBILE_AGENT', 'phone|samsung|lgtel|mobile|skt|nokia|blackberry|android|sony');
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
// 자주 사용하는 값
|
// 자주 사용하는 값
|
||||||
// 서버의 시간과 실제 사용하는 시간이 틀린 경우 수정하세요.
|
// 서버의 시간과 실제 사용하는 시간이 틀린 경우 수정하세요.
|
||||||
// 하루는 86400 초입니다. 1시간은 3600초
|
// 하루는 86400 초입니다. 1시간은 3600초
|
||||||
// 6시간이 빠른 경우 time() + (3600 * 6);
|
// 6시간이 빠른 경우 time() + (3600 * 6);
|
||||||
// 6시간이 느린 경우 time() - (3600 * 6);
|
// 6시간이 느린 경우 time() - (3600 * 6);
|
||||||
|
/*
|
||||||
$g4['server_time'] = time();
|
$g4['server_time'] = time();
|
||||||
$g4['time_ymd'] = date("Y-m-d", $g4['server_time']);
|
$g4['time_ymd'] = date("Y-m-d", $g4['server_time']);
|
||||||
$g4['time_his'] = date("H:i:s", $g4['server_time']);
|
$g4['time_his'] = date("H:i:s", $g4['server_time']);
|
||||||
$g4['time_ymdhis'] = date("Y-m-d H:i:s", $g4['server_time']);
|
$g4['time_ymdhis'] = date("Y-m-d H:i:s", $g4['server_time']);
|
||||||
define('G4_SERVER_TIME', time());
|
*/
|
||||||
define('G4_TIME_YMDHIS', date("Y-m-d H:i:s", G4_SERVER_TIME));
|
|
||||||
define('G4_TIME_YMD', substr(G4_TIME_YMDHIS, 0, 10));
|
|
||||||
define('G4_TIME_HIS', substr(G4_TIME_YMDHIS, 11, 8));
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// 테이블 명
|
|
||||||
// (상수로 선언한것은 함수에서 global 선언을 하지 않아도 바로 사용할 수 있기 때문)
|
|
||||||
//
|
|
||||||
$g4['table_prefix'] = G4_TABLE_PREFIX; // 테이블명 접두사
|
|
||||||
$g4['write_prefix'] = $g4['table_prefix'] . 'write_'; // 게시판 테이블명 접두사
|
|
||||||
|
|
||||||
$g4['auth_table'] = $g4['table_prefix'] . 'auth'; // 관리권한 설정 테이블
|
|
||||||
$g4['config_table'] = $g4['table_prefix'] . 'config'; // 기본환경 설정 테이블
|
|
||||||
$g4['group_table'] = $g4['table_prefix'] . 'group'; // 게시판 그룹 테이블
|
|
||||||
$g4['group_member_table'] = $g4['table_prefix'] . 'group_member'; // 게시판 그룹+회원 테이블
|
|
||||||
$g4['board_table'] = $g4['table_prefix'] . 'board'; // 게시판 설정 테이블
|
|
||||||
$g4['board_file_table'] = $g4['table_prefix'] . 'board_file'; // 게시판 첨부파일 테이블
|
|
||||||
$g4['board_good_table'] = $g4['table_prefix'] . 'board_good'; // 게시물 추천,비추천 테이블
|
|
||||||
$g4['board_new_table'] = $g4['table_prefix'] . 'board_new'; // 게시판 새글 테이블
|
|
||||||
$g4['login_table'] = $g4['table_prefix'] . 'login'; // 로그인 테이블 (접속자수)
|
|
||||||
$g4['mail_table'] = $g4['table_prefix'] . 'mail'; // 회원메일 테이블
|
|
||||||
$g4['member_table'] = $g4['table_prefix'] . 'member'; // 회원 테이블
|
|
||||||
$g4['memo_table'] = $g4['table_prefix'] . 'memo'; // 메모 테이블
|
|
||||||
$g4['poll_table'] = $g4['table_prefix'] . 'poll'; // 투표 테이블
|
|
||||||
$g4['poll_etc_table'] = $g4['table_prefix'] . 'poll_etc'; // 투표 기타의견 테이블
|
|
||||||
$g4['point_table'] = $g4['table_prefix'] . 'point'; // 포인트 테이블
|
|
||||||
$g4['popular_table'] = $g4['table_prefix'] . 'popular'; // 인기검색어 테이블
|
|
||||||
$g4['scrap_table'] = $g4['table_prefix'] . 'scrap'; // 게시글 스크랩 테이블
|
|
||||||
$g4['visit_table'] = $g4['table_prefix'] . 'visit'; // 방문자 테이블
|
|
||||||
$g4['visit_sum_table'] = $g4['table_prefix'] . 'visit_sum'; // 방문자 합계 테이블
|
|
||||||
$g4['token_table'] = $g4['table_prefix'] . 'token'; // 토큰 테이블
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// 기타
|
// 기타
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
<?
|
<?
|
||||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||||
|
|
||||||
|
define('G4_USE_SHOP', false);
|
||||||
|
|
||||||
if (!defined('G4_USE_SHOP') || !G4_USE_SHOP) return;
|
if (!defined('G4_USE_SHOP') || !G4_USE_SHOP) return;
|
||||||
|
|
||||||
include_once(G4_LIB_PATH.'/shop.lib.php');
|
include_once(G4_LIB_PATH.'/shop.lib.php');
|
||||||
@ -10,21 +13,22 @@ include_once(G4_LIB_PATH.'/shop.lib.php');
|
|||||||
// 미수금에 대한 QUERY 문
|
// 미수금에 대한 QUERY 문
|
||||||
// 테이블 a 는 장바구니 ($g4[yc4_cart_table])
|
// 테이블 a 는 장바구니 ($g4[yc4_cart_table])
|
||||||
// 테이블 b 는 주문서 ($g4[yc4_order_table])
|
// 테이블 b 는 주문서 ($g4[yc4_order_table])
|
||||||
|
/*
|
||||||
define(_MISU_QUERY_, "
|
define(_MISU_QUERY_, "
|
||||||
count(distinct b.od_id) as ordercount, /* 주문서건수 */
|
count(distinct b.od_id) as ordercount, -- 주문서건수
|
||||||
count(a.ct_id) as itemcount, /* 상품건수 */
|
count(a.ct_id) as itemcount, -- 상품건수
|
||||||
(SUM((a.ct_amount + a.it_amount - a.cp_amount) * a.ct_qty) + b.od_send_cost + b.od_send_cost_area - b.od_coupon_amount - b.od_send_coupon) as orderamount , /* 주문합계 */
|
(SUM((a.ct_amount + a.it_amount - a.cp_amount) * a.ct_qty) + b.od_send_cost + b.od_send_cost_area - b.od_coupon_amount - b.od_send_coupon) as orderamount , -- 주문합계
|
||||||
(SUM(IF(a.ct_status = '취소' OR a.ct_status = '반품' OR a.ct_status = '품절', (a.ct_amount + a.it_amount) * a.ct_qty, 0))) as ordercancel, /* 주문취소 */
|
(SUM(IF(a.ct_status = '취소' OR a.ct_status = '반품' OR a.ct_status = '품절', (a.ct_amount + a.it_amount) * a.ct_qty, 0))) as ordercancel, -- 주문취소
|
||||||
(b.od_receipt_amount + b.od_receipt_point) as receiptamount, /* 입금합계 */
|
(b.od_receipt_amount + b.od_receipt_point) as receiptamount, -- 입금합계
|
||||||
(b.od_refund_amount) as receiptcancel, /* 입금취소 */
|
(b.od_refund_amount) as receiptcancel, -- 입금취소
|
||||||
(
|
(
|
||||||
(SUM((a.ct_amount + a.it_amount - a.cp_amount) * a.ct_qty) + b.od_send_cost + b.od_send_cost_area - b.od_coupon_amount - b.od_send_coupon) -
|
(SUM((a.ct_amount + a.it_amount - a.cp_amount) * a.ct_qty) + b.od_send_cost + b.od_send_cost_area - b.od_coupon_amount - b.od_send_coupon) -
|
||||||
(SUM(IF(a.ct_status = '취소' OR a.ct_status = '반품' OR a.ct_status = '품절', (a.ct_amount + a.it_amount) * a.ct_qty, 0))) -
|
(SUM(IF(a.ct_status = '취소' OR a.ct_status = '반품' OR a.ct_status = '품절', (a.ct_amount + a.it_amount) * a.ct_qty, 0))) -
|
||||||
b.od_dc_amount -
|
b.od_dc_amount -
|
||||||
(b.od_receipt_amount + b.od_receipt_point) +
|
(b.od_receipt_amount + b.od_receipt_point) +
|
||||||
(b.od_refund_amount)
|
(b.od_refund_amount)
|
||||||
) as misu /* 미수금 = 주문합계 - 주문취소 - DC - 입금합계 + 입금취소 */");
|
) as misu -- 미수금 = 주문합계 - 주문취소 - DC - 입금합계 + 입금취소");
|
||||||
|
*/
|
||||||
|
|
||||||
// 쇼핑몰 디렉토리
|
// 쇼핑몰 디렉토리
|
||||||
define('G4_SHOP_DIR', 'shop');
|
define('G4_SHOP_DIR', 'shop');
|
||||||
|
|||||||
@ -4,13 +4,14 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
|||||||
|
|
||||||
$begin_time = get_microtime();
|
$begin_time = get_microtime();
|
||||||
|
|
||||||
$g4_head_title = $g4['title']; // 상태바에 표시될 제목
|
|
||||||
if (!isset($g4['title'])) {
|
if (!isset($g4['title'])) {
|
||||||
$g4['title'] = $config['cf_title'];
|
$g4['title'] = $config['cf_title'];
|
||||||
$g4_head_title = $g4['title'];
|
$g4_head_title = $g4['title'];
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
|
$g4_head_title = $g4['title']; // 상태바에 표시될 제목
|
||||||
$g4_head_title .= " : ".$config['cf_title'];
|
$g4_head_title .= " : ".$config['cf_title'];
|
||||||
|
}
|
||||||
|
|
||||||
// 현재 접속자
|
// 현재 접속자
|
||||||
// 게시판 제목에 ' 포함되면 오류 발생
|
// 게시판 제목에 ' 포함되면 오류 발생
|
||||||
|
|||||||
@ -1191,8 +1191,7 @@ function sql_select_db($db, $connect)
|
|||||||
{
|
{
|
||||||
global $g4;
|
global $g4;
|
||||||
|
|
||||||
if (strtolower($g4['charset']) == 'utf-8') @mysql_query(" set names utf8 ");
|
@mysql_query(" set names utf8 ");
|
||||||
else if (strtolower($g4['charset']) == 'euc-kr') @mysql_query(" set names euckr ");
|
|
||||||
return @mysql_select_db($db, $connect);
|
return @mysql_select_db($db, $connect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?
|
<?php
|
||||||
if (!defined('_GNUBOARD_')) exit;
|
if (!defined('_GNUBOARD_')) exit;
|
||||||
|
|
||||||
// 최신글 추출
|
// 최신글 추출
|
||||||
|
|||||||
Reference in New Issue
Block a user