#336 에 따른 스킨의 css 파일 로드 기능 추가
This commit is contained in:
14
head.sub.php
14
head.sub.php
@ -40,6 +40,20 @@ header("Pragma: no-cache"); // HTTP/1.0
|
|||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<link rel="stylesheet" href="<?=G4_CSS_URL?>/<?=(G4_IS_MOBILE?'mobile':'default')?>.css?=<?=date("md")?>">
|
<link rel="stylesheet" href="<?=G4_CSS_URL?>/<?=(G4_IS_MOBILE?'mobile':'default')?>.css?=<?=date("md")?>">
|
||||||
<?}?>
|
<?}?>
|
||||||
|
<? // 스킨의 style sheet 불러옴
|
||||||
|
if(isset($board_skin_path))
|
||||||
|
echo get_skin_stylesheet($board_skin_path);
|
||||||
|
if(isset($member_skin_path))
|
||||||
|
echo get_skin_stylesheet($member_skin_path);
|
||||||
|
if(isset($new_skin_path))
|
||||||
|
echo get_skin_stylesheet($new_skin_path);
|
||||||
|
if(isset($search_skin_path))
|
||||||
|
echo get_skin_stylesheet($search_skin_path);
|
||||||
|
if(isset($connect_skin_path))
|
||||||
|
echo get_skin_stylesheet($connect_skin_path);
|
||||||
|
if(isset($poll_skin_path))
|
||||||
|
echo get_skin_stylesheet($poll_skin_path);
|
||||||
|
?>
|
||||||
<!--[if lte IE 8]>
|
<!--[if lte IE 8]>
|
||||||
<script src="<?=G4_JS_URL?>/html5.js"></script>
|
<script src="<?=G4_JS_URL?>/html5.js"></script>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
|||||||
@ -1785,4 +1785,36 @@ function delete_editor_thumbnail($contents)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 스킨 style sheet 파일 얻기
|
||||||
|
function get_skin_stylesheet($skin_path)
|
||||||
|
{
|
||||||
|
if(!$skin_path)
|
||||||
|
return "";
|
||||||
|
|
||||||
|
$str = "";
|
||||||
|
|
||||||
|
$p = parse_url(G4_URL);
|
||||||
|
$skin_url = $p['scheme'].'://'.$p['host'];
|
||||||
|
if(isset($p['port']))
|
||||||
|
$skin_url .= ':'.$p['port'];
|
||||||
|
$skin_url .= str_replace($_SERVER['DOCUMENT_ROOT'], "", $skin_path);
|
||||||
|
|
||||||
|
if(is_dir($skin_path)) {
|
||||||
|
if($dh = opendir($skin_path)) {
|
||||||
|
while(($file = readdir($dh)) !== false) {
|
||||||
|
if($file == "." || $file == "..")
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(is_dir($skin_path.'/'.$file))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(preg_match("/\.(css)$/i", $file))
|
||||||
|
$str .= '<link rel="stylesheet" href="'.$skin_url.'/'.$file.'?='.date("md").'">'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user