스킨 제작 프로젝트 - Step3. 스킨 제작
글쓰기 폼에 기본 글꼴폰트를 설정하는 방법입니다.
조금 응용하면 사용자별로 기본 글꼴폰트로써 나올 수 있게 가능 하겠습니다.(?)
수정파일경로 : XE설치폴더/modules/editor/tpl/js/editor.js
var contentHtml = ''+
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'+
'<html lang="ko" xmlns="http://www.w3.org/1999/xhtml><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/>'+
//'<base href="'+request_uri+'" />'+
'<link rel="stylesheet" href="'+request_uri+'common/css/default.css" type="text/css" />'+
'<link rel="stylesheet" href="'+request_uri+editor_path+'css/editor.css" type="text/css" />'+
'<style style="text/css">'+
'body {font-size:9pt;'+fontfamily+'margin:0px; height:'+editor_height+'px; background-color:transparent;}'+
'blockquote, ol, ul { margin-left:40px; }'+
'</style>'+
'</head><body editor_sequence="'+editor_sequence+'">'+
content+
'</body></html>'+
'';
125 body {font-size:9pt;'+fontfamily+'margin:0px;
밑줄 부분과 같이 script 변수를 추가 해주세요.(변수명은 원하시는데로...)
그 후 아래의 경로에 변수에 대한 값을 추가해 주세요
수정파일경로 : XE설치폴더/common/tpl/common_layout.html
<!--@end--><script type="text/javascript">//<![CDATA[
var fontfamily = "font-family:맑은 고딕;";
var current_url = "{$current_url}";
var request_uri = "{$request_uri}";
var current_mid = "{$mid}";
var wating_message = "{$lang->msg_call_server}";
//]]></script>
17 var fontfamily = "font-family:맑은 고딕;";
밑줄 부분과 같이 script 변수 선언해주세요.
여기서 {$current_url}와 같이 회원의 추가정보로써 입력받은 폰트명을 임의로 생성하여 변수를 선언해주시면
사용자별로도 글쓸때 기본폰트로 보이게 됩니다.
그리고 보이게 되는 폰트를 마지막으로 글 등록 후에도 모든사람에게 보이게 할려면 아래를 추가해주세요.
수정파일경로 : XE/설치폴더/modules/board/skins/스킨폴더/view_document.html
<div class="readBody">
<div class="contentBody">
<!--@if($oDocument->isSecret() && !$oDocument->isGranted())-->
<!--%import("filter/input_password.xml")-->
<strong>{$lang->msg_is_secret}</strong>
<form action="./" method="get" onsubmit="return procFilter(this, input_password)">
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="document_srl" value="{$oDocument->document_srl}" />
<div class="inputPassword">
<input type="password" name="password" id="cpw" class="inputTypeText" /><span class="button"><input type="submit" value="{$lang->cmd_input}" accesskey="s" /></span>
</div>
</form>
<!--@else-->
<font face="굴림">
{$oDocument->getContent()}
</font>
<!--@end-->
</div>
</div>
93 <font face="굴림">
95 </font>
수정파일경로 : XE/설치폴더/modules/board/skins/스킨폴더/comment.html
<div class="replyContent">
<!--@if(!$comment->isAccessible())-->
<!--%import("filter/input_password.xml")-->
<strong>{$lang->msg_is_secret}</strong>
<form action="./" method="get" onsubmit="return procFilter(this, input_password)">
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="document_srl" value="{$comment->get('document_srl')}" />
<input type="hidden" name="comment_srl" value="{$comment->get('comment_srl')}" />
<div class="inputPassword">
<input type="password" name="password" class="inputTypeText" /><span class="button"><input type="submit" value="{$lang->cmd_input}" accesskey="s" /></span>
</div>
</form>
<!--@else-->
<font face="굴림">
{$comment->getContent(true)}
</font>
<!--@end-->
</div>
66 <font face="굴림">
68 </font>
조금 이상해보일 수 있는데 밑줄 부분과 같이 태그 입력해서 "굴림" 여기를 바로 위의 {$current_url} 형식으로 회원 추가 옵션 변수를 넣어주시면 모든사람에게도 회원 기본 폰트로 보이겠죠...
그리고 혹시나 해서 적는데 위 처럼 수정 했는데 적용 안되시는 분은
저장하실때 꼭 UTF-8로 저장하셔야 적용 됩니다.(한글폰트명일 경우 필시!)





이거 때문에 얼마나 고생했는지......
덕분에 해결했습니다. 감사합니다^^