나리야 사이트 설정 레이아웃[레이아웃, 폰트셋, 컬러셋]확인용[수정]
나리야 사이트설정시 레이아웃, 폰트셋, 컬러셋설정 확인용입니다.
수정파일 : /theme/BS4-Basic/adm/setup_form.php
레이아웃 : 셀렉트박스 theme_layout클래스명 추가
[code]
<tr>
<td class="text-center">
레이아웃
</td>
<td class="text-center">
<?php $pc['layout'] = isset($pc['layout']) ? $pc['layout'] : ''; ?>
<select name="pc[layout]" class="custom-select theme_layout">
<?php echo $sel_option ?>
<option value="w"<?php echo get_selected('w', $pc['layout']) ?>>와이드</option>
<option value="ac"<?php echo get_selected('ac', $pc['layout']) ?>>박스 A</option>
<option value="bc"<?php echo get_selected('bc', $pc['layout']) ?>>박스 B</option>
</select>
</td>
<td class="text-center">
<?php $mo['layout'] = isset($mo['layout']) ? $mo['layout'] : ''; ?>
<select name="mo[layout]" class="custom-select theme_layout">
<?php echo $sel_option ?>
<option value="w"<?php echo get_selected('w', $mo['layout']) ?>>와이드</option>
<option value="ac"<?php echo get_selected('ac', $mo['layout']) ?>>박스 A</option>
<option value="bc"<?php echo get_selected('bc', $mo['layout']) ?>>박스 B</option>
</select>
</td>
<td class="text-muted">
사이트 기본 스타일
</td>
</tr>
[/code]
폰트셋 : 셀렉트박스 font_scheme클래스명 추가
[code]
<tr>
<td class="text-center">
폰트셋
</td>
<td>
<select name="co[font]" class="custom-select font_scheme">
<?php echo $sel_option ?>
<?php
$pc['font'] = isset($pc['font']) ? $pc['font'] : '';
$skins = na_file_list(G5_THEME_PATH.'/css/font', 'css');
for ($i=0; $i<count($skins); $i++) {
?>
<option value="<?php echo $skins[$i] ?>"<?php echo get_selected($pc['font'], $skins[$i]) ?>><?php echo $skins[$i] ?></option>
<?php } ?>
</select>
</td>
<td>
<select name="co[font_mo]" class="custom-select font_scheme">
<?php echo $sel_option ?>
<?php
$pc['font_mo'] = isset($pc['font_mo']) ? $pc['font_mo'] : '';
$skins = na_file_list(G5_THEME_PATH.'/css/font/mobile', 'css');
for ($i=0; $i<count($skins); $i++) {
?>
<option value="<?php echo $skins[$i] ?>"<?php echo get_selected($pc['font_mo'], $skins[$i]) ?>><?php echo $skins[$i] ?></option>
<?php } ?>
</select>
</td>
<td class="text-muted">
테마 내 /css/font 폴더 내 CSS 파일
</td>
</tr>
[/code]
컬러셋 : 셀렉트박스 color_scheme클래스명 추가
[code]
<tr>
<td class="text-center">
컬러셋
</td>
<td>
<select name="pc[color]" class="custom-select color_scheme">
<?php echo $sel_option ?>
<?php
$pc['color'] = isset($pc['color']) ? $pc['color'] : '';
$skins = na_file_list(G5_THEME_PATH.'/css/color', 'css');
for ($i=0; $i<count($skins); $i++) {
?>
<option value="<?php echo $skins[$i] ?>"<?php echo get_selected($pc['color'], $skins[$i]) ?>><?php echo $skins[$i] ?></option>
<?php } ?>
</select>
</td>
<td>
<select name="mo[color]" class="custom-select color_scheme">
<?php echo $sel_option ?>
<?php
$mo['color'] = isset($mo['color']) ? $mo['color'] : '';
for ($i=0; $i<count($skins); $i++) { // $skins PC랑 같은 배열임
?>
<option value="<?php echo $skins[$i] ?>"<?php echo get_selected($mo['color'], $skins[$i]) ?>><?php echo $skins[$i] ?></option>
<?php } ?>
</select>
</td>
<td class="text-muted">
테마 내 /css/color 폴더 내 CSS 파일
</td>
</tr>
[/code]
스크립트 추가
[code]
<script>
$(document).ready(function() {
/* 레이아웃 */
$("select.theme_layout").on("change", function() {
var theme_layout = jQuery(this).val();
if(theme_layout == 'ac') {
$('.wrapper').removeClass('boxed boxed-a m-lg-auto');
$('.wrapper').addClass('boxed boxed-a m-lg-auto');
} else if(theme_layout == 'bc') {
$('.wrapper').removeClass('boxed boxed-b m-lg-auto');
$('.wrapper').addClass('boxed boxed-b m-lg-auto');
} else {
$('.wrapper').removeClass('boxed boxed-a m-lg-auto');
$('.wrapper').removeClass('boxed boxed-b m-lg-auto');
$('.wrapper').addClass('wided');
}
});
/* 폰트셋 */
$("select.font_scheme").on("change", function() {
var font_scheme = jQuery(this).val();
jQuery("#font_scheme").attr('href', '<?php echo G5_THEME_URL;?>/css/font/' + font_scheme + '.css');
});
/* 컬러셋 */
$("select.color_scheme").on("change", function() {
var color_scheme = jQuery(this).val();
jQuery("#color_scheme").attr('href', '<?php echo G5_THEME_URL;?>/css/color/' + color_scheme + '.css');
});
});
</script>
[/code]
폰트셋, 컬러셋 적용
/theme/BS4-Basic/head.sub.php 45line 수정
수정전
[code]
// CSS
add_stylesheet('<link rel="stylesheet" href="'.NA_URL.'/css/nariya.css" type="text/css">', -1);
$df_stylesheet = '<link rel="stylesheet" href="'.G5_THEME_URL.'/css/theme.css" type="text/css">'.PHP_EOL;
$df_stylesheet .= '<link rel="stylesheet" href="'.G5_THEME_URL.'/css/font/'.$tset['font'].'.css" type="text/css">'.PHP_EOL;;
$df_stylesheet .= '<link rel="stylesheet" href="'.G5_THEME_URL.'/css/color/'.$tset['color'].'.css" type="text/css">';
add_stylesheet($df_stylesheet, 0);
unset($df_stylesheet);
[/code]
수정후
[code]
// CSS
add_stylesheet('<link rel="stylesheet" href="'.NA_URL.'/css/nariya.css" type="text/css">', -1);
$df_stylesheet = '<link rel="stylesheet" href="'.G5_THEME_URL.'/css/theme.css" type="text/css">'.PHP_EOL;
$df_stylesheet .= '<link rel="stylesheet" href="'.G5_THEME_URL.'/css/font/'.$tset['font'].'.css" type="text/css" id="font_scheme">'.PHP_EOL;;
$df_stylesheet .= '<link rel="stylesheet" href="'.G5_THEME_URL.'/css/color/'.$tset['color'].'.css" type="text/css" id="color_scheme">';
add_stylesheet($df_stylesheet, 0);
unset($df_stylesheet);
[/code]
-- 2021.09.01 17:06 내용 수정 --
댓글 2개
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 2004 | 3년 전 | 2861 | ||
| 2003 |
JKWang
|
3년 전 | 3261 | |
| 2002 | 3년 전 | 4135 | ||
| 2001 | 3년 전 | 3163 | ||
| 2000 | 3년 전 | 3428 | ||
| 1999 |
돈도없어개발하기도시러
|
3년 전 | 2757 | |
| 1998 | 3년 전 | 3074 | ||
| 1997 | 3년 전 | 6781 | ||
| 1996 | 3년 전 | 2797 | ||
| 1995 | 3년 전 | 6473 | ||
| 1994 | 3년 전 | 8074 | ||
| 1993 | 3년 전 | 3684 | ||
| 1992 |
|
4년 전 | 4066 | |
| 1991 | 4년 전 | 2912 | ||
| 1990 | 4년 전 | 3516 | ||
| 1989 | 4년 전 | 2973 | ||
| 1988 | 4년 전 | 3433 | ||
| 1987 | 4년 전 | 3164 | ||
| 1986 | 4년 전 | 2666 | ||
| 1985 |
|
4년 전 | 3589 | |
| 1984 | 4년 전 | 3657 | ||
| 1983 | 4년 전 | 2784 | ||
| 1982 | 4년 전 | 4231 | ||
| 1981 | 4년 전 | 3213 | ||
| 1980 | 4년 전 | 2593 | ||
| 1979 | 4년 전 | 3371 | ||
| 1978 | 4년 전 | 3046 | ||
| 1977 | 4년 전 | 3523 | ||
| 1976 |
welcome
|
4년 전 | 3289 | |
| 1975 | 4년 전 | 3073 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기