diff --git a/common.php b/common.php index 9b1885d49..b9118e474 100644 --- a/common.php +++ b/common.php @@ -218,14 +218,38 @@ 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 에서 선언 //------------------------------------------------------------------------------ -$is_mobile = false; -if (G5_USE_MOBILE) { +if (G5_USE_MOBILE && $set_device) { if ($_REQUEST['device']=='pc') $is_mobile = false; else if ($_REQUEST['device']=='mobile') @@ -234,10 +258,13 @@ if (G5_USE_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) { include_once(G5_LIB_PATH.'/mobile.lib.php'); // 모바일 전용 라이브러리 $g5['mobile_path'] = G5_PATH.'/'.$g5['mobile_dir']; diff --git a/config.php b/config.php index 6df2c181b..6c2dfc6a1 100644 --- a/config.php +++ b/config.php @@ -115,6 +115,14 @@ define('G5_PHPMAILER_PATH', G5_PLUGIN_PATH.'/'.G5_PHPMAILER_DIR); //============================================================================== +//============================================================================== +// 사용기기 설정 +// pc 설정 시 모바일 기기에서도 PC화면 보여짐 +// mobile 설정 시 PC에서도 모바일화면 보여짐 +// both 설정 시 접속 기기에 따른 화면 보여짐 +//------------------------------------------------------------------------------ +define('G5_SET_DEVICE', 'both'); + define('G5_USE_MOBILE', true); // 모바일 홈페이지를 사용하지 않을 경우 false 로 설정 define('G5_USE_CACHE', true); // 최신글등에 cache 기능 사용 여부 diff --git a/mobile/tail.php b/mobile/tail.php index 913f5489d..faa5a9ddb 100644 --- a/mobile/tail.php +++ b/mobile/tail.php @@ -25,7 +25,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가