[G5] 기본형 그누보드를 반응형으로 만들기 > 기술자료 | 해피정닷컴

[G5] 기본형 그누보드를 반응형으로 만들기 > 기술자료

본문 바로가기

사이트 내 전체검색

[G5] 기본형 그누보드를 반응형으로 만들기 > 기술자료

그누보드 [G5] 기본형 그누보드를 반응형으로 만들기

페이지 정보


본문

여러 테마를 사용할 기회가 있기 때문에 무조건 테마사용으로 합니다. 
그누보드5 / plugin / bootstrap / 3.3.6
그누보드5 / config.php 
그누보드5 / theme / basic / head.sub.php 
그누보드5 / theme / basic / tail.sub.php 
그누보드5 / skin / 반응형 스킨


1. 그누보드5 / config.php 
define('G5_USE_MOBILE', false); 


2. 부트스트랩을 사용하기 위해 추가해 줍니다. 
http://getbootstrap.com/getting-started/#download 에서 Source code 를 다운받아 아래 위치에 업로드
그누보드5 / plugin / bootstrap / 3.3.6


3-1. 그누보드5 / theme / basic / head.sub.php 
<?php
if (G5_IS_MOBILE) {
    echo '<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10,user-scalable=yes">'.PHP_EOL;
    echo '<meta name="HandheldFriendly" content="true">'.PHP_EOL;
    echo '<meta name="format-detection" content="telephone=no">'.PHP_EOL;
} else {
    echo '<meta http-equiv="imagetoolbar" content="no">'.PHP_EOL;
    echo '<meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">'.PHP_EOL;
}

를 다음과 같이 변경
if (G5_IS_MOBILE) {
    echo '<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10,user-scalable=yes">'.PHP_EOL;
    echo '<meta name="HandheldFriendly" content="true">'.PHP_EOL;
    echo '<meta name="format-detection" content="telephone=no">'.PHP_EOL;
} else {
    echo '<meta name="viewport" content="width=device-width, initial-scale=1">'.PHP_EOL;
    echo '<meta http-equiv="imagetoolbar" content="no">'.PHP_EOL;
    echo '<meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">'.PHP_EOL;
}


3-2. 그누보드5 / theme / basic / head.sub.php 
웹폰트 아이콘을 사용하기 위해 추가

<link rel="stylesheet" href="<?php echo G5_THEME_CSS_URL; ?>/<?php echo G5_IS_MOBILE ? 'mobile' : 'default'; ?>.css">

를 다음과 같이 변경
<?php 
if (defined('G5_IS_ADMIN')) { 
    if(!defined('_THEME_PREVIEW_')) 
        echo '<link rel="stylesheet" href="'.G5_ADMIN_URL.'/css/admin.css">'.PHP_EOL; 
} else { 
    //echo '<link rel="stylesheet" href="'.G5_THEME_CSS_URL.'/'.(G5_IS_MOBILE?'mobile':'default').'.css">'.PHP_EOL; 
    echo '<link rel="stylesheet" href="'.G5_THEME_CSS_URL.'/default.css">'.PHP_EOL; 

echo '<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">'.PHP_EOL; 
?> 


3-3. 그누보드5 / theme / basic / head.sub.php 
<!--[if lte IE 8]>
<script src="<?php echo G5_JS_URL ?>/html5.js"></script>
<![endif]-->

를 다음과 같이 변경
<!--[if lte IE 8]> 
<script src="<?php echo G5_JS_URL ?>/html5.js"></script> 
<![endif]--> 
<?php if(!defined('G5_IS_ADMIN')) { ?> 
<!-- Bootstrap core CSS --> 
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> 
<!-- Bootstrap theme --> 
<link href="<?php echo G5_PLUGIN_URL?>/bootstrap/3.3.6/dist/css/bootstrap-theme.css" rel="stylesheet"> 

<!-- Custom styles for this template -->

<!-- Just for debugging purposes. Don't actually copy these 2 lines! --> 
<!--[if lt IE 9]><script src="<?php echo G5_THEME_URL?>/assets/js/ie8-responsive-file-warning.js"></script><![endif]--> 
<script src="<?php echo G5_URL?>/bootstrap/3.3.6/assets/js/ie-emulation-modes-warning.js"></script> 

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> 
<!--[if lt IE 9]> 
  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> 
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> 
<![endif]--> 
<?php } ?> 


4. 그누보드5 / theme / basic / tail.sub.php 
관리자페이지는 부트스트랩을 사용하지 않기위해 추가
<?php if ($is_admin == 'super') {  ?><!-- <div style='float:left; text-align:center;'>RUN TIME : <?php echo get_microtime()-$begin_time; ?><br></div> --><?php }  ?>

를 다음과 같이 변경
<?php if(!defined('G5_IS_ADMIN')) { ?> 
    <!-- Bootstrap core JavaScript 
    ================================================== --> 
    <!-- Placed at the end of the document so the pages load faster --> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 
    <script src="<?php echo G5_PLUGIN_URL?>/bootstrap/3.3.6/assets/js/docs.min.js"></script> 
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> 
    <script src="<?php echo G5_PLUGIN_URL?>/bootstrap/3.3.6/assets/js/ie10-viewport-bug-workaround.js"></script> 
<?php } ?>
<?php if ($is_admin == 'super') {  ?><!-- <div style='float:left; text-align:center;'>RUN TIME : <?php echo get_microtime()-$begin_time; ?><br></div> --><?php }  ?>


5. 반응형으로 코딩 다시 하기



자료출처
http://sir.kr/g5_tip/3910

댓글목록

등록된 댓글이 없습니다.


Total 2,643건 43 페이지
  • RSS
기술자료 목록
1803
영카트   12300  2016-06-27 13:48  
1802
MySQL   21601  2016-06-25 01:57  
1801
Adobe   27096  2016-06-23 14:18  
1800
영카트   21184  2016-06-20 18:57 ~ 2024-12-02 23:38  
1799
호스팅   11133  2016-06-08 12:41  
1798
ClassicASP   17803  2016-05-28 00:20  
1797
PHP   20116  2016-05-25 11:50 ~ 2022-05-13 11:34  
1796
그누보드   15078  2016-05-25 04:14 ~ 2018-11-18 09:29  
1795
호스팅   17202  2016-05-24 18:52 ~ 2025-02-12 23:40  
1794
일반   13695  2016-05-11 17:30  
1793
일반   18379  2016-05-11 17:17  
열람
그누보드   27195  2016-05-04 17:04 ~ 2016-05-04 00:00  
1791
그누보드   15757  2016-05-04 11:04 ~ 2017-06-16 00:00  
1790
그누보드   17016  2016-04-21 03:56 ~ 2018-04-27 10:35  
1789
호스팅   27109  2016-04-19 22:32 ~ 2019-01-03 01:48  
1788
일반   13116  2016-04-17 16:44  
1787
MySQL   14911  2016-04-13 23:21  
1786
.NET   14543  2016-04-07 20:30  
1785
Secure   13010  2016-03-29 05:21  
1784
그누보드   11941  2016-03-29 02:37 ~ 2020-03-13 11:28  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2025 해피정닷컴. All Rights Reserved.