"미디어위키 모바일웹 적용 (WPTouch)"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 2명의 중간 판 16개는 보이지 않습니다)
1번째 줄: 1번째 줄:
;미디어위키 모바일웹 스킨 적용하기
==개요==
;미디어위키 모바일 스킨
;미디어위키 모바일웹 설정
;미디어위키 스마트폰 스킨
;미디어위키 모바일웹 스킨 적용
;미디어위키 스마트폰 스킨  
;미디어위키 WPTouch 스킨 설치
* 공식 모바일 스킨이 나오기 전에 사용하던 스킨
* 현재는 [[미디어위키 MobileFrontend]](공식 스킨) 사용이 권장됨


==스킨 설치==
==스킨 설치==
10번째 줄: 14번째 줄:
*모두<ref>wptouch 폴더, WPtouch.deps.php, WPtouch.php</ref>를 웹서버 [[미디어위키 폴더]] 아래의 skins 폴더에 업로드
*모두<ref>wptouch 폴더, WPtouch.deps.php, WPtouch.php</ref>를 웹서버 [[미디어위키 폴더]] 아래의 skins 폴더에 업로드


==LocalSettings.php 수정==
==모바일 분기==
기본 스킨인 vector는 그대로 사용하되, 모바일기기의 브라우저를 감지하여 모바일스킨(wptouch)을 분기하도록 하자.
*[[LocalSettings.php]]를 수정해서 기기에 맞는 스킨이 적용되도록 분기시키면 된다.
*PC이면 기존 스킨 'vector'로<ref>일반PC용 스킨 vector. 기본값.</ref>, 모바일 기기라면 'wptouch' 스킨으로 분기시키자.
*기기를 판단하는 방법은 확장기능을 이용하는 방법과, [[HTTP_USER_AGENT]] 값을 직접 확인하고 분기시키는 하드코딩 방법이 있다.


;변경 전
===방법1: 하드코딩 (직접 처리)===
<source lang='php'>
;LocalSettings.php 변경 전
<syntaxhighlight lang='php'>
## Default skin: you can change the default skin. Use the internal symbolic
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
$wgDefaultSkin = 'vector';
$wgDefaultSkin = 'vector';
</source>
</syntaxhighlight>


;변경 후
;LocalSettings.php 변경 후
<source lang='php'>
<syntaxhighlight lang='php'>
## Default skin: you can change the default skin. Use the internal symbolic
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
if (preg_match("/(mobile|webos|opera mini)/i", $_SERVER['HTTP_USER_AGENT'])) $wgDefaultSkin = 'wptouch';
if (preg_match("/(mobile|webos|opera mini)/i", $_SERVER['HTTP_USER_AGENT'])) $wgDefaultSkin = 'wptouch';
else $wgDefaultSkin = 'vector';
else $wgDefaultSkin = 'vector';
</source>
</syntaxhighlight>
 
===방법2: 확장기능 설치/활용===
*[[확장기능 폴더]] 아래에 MobileDetect 폴더 생성
*MobileDetect 폴더에 MobileDetect.php 파일 생성
*MobileDetect.php 파일의 내용을 [http://www.mediawiki.org/wiki/Extension:MobileDetect 여기]의 Code 문단 내용으로 교체
 
;LocalSettings.php 변경 전
<syntaxhighlight lang='php'>
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
$wgDefaultSkin = 'vector';
</syntaxhighlight>
 
;LocalSettings.php 변경 후
<syntaxhighlight lang='php'>
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
$wgDefaultSkin = "vector"
require_once("$IP/extensions/MobileDetect/MobileDetect.php");
if( mobiledetect() ) $wgDefaultSkin = "wptouch";
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[모바일웹 스마트폰 기종 확인]]
*[[모바일웹 스마트폰 기종 확인]]
*[[미디어위키 MobileFrontend 설치]] ★


==주석==
==주석==
<references/>
<references/>
==참고==
*http://www.mediawiki.org/wiki/Extension:MobileDetect
*http://smartcloud.pe.kr/wp/?p=178


[[분류: 미디어위키]]
[[분류: 미디어위키]]
[[분류:모바일 웹]]
[[분류:모바일 웹]]

2020년 11월 2일 (월) 02:59 기준 최신판

1 개요[ | ]

미디어위키 모바일웹 설정
미디어위키 모바일웹 스킨 적용
미디어위키 스마트폰 스킨
미디어위키 WPTouch 스킨 설치

2 스킨 설치[ | ]

3 모바일 분기[ | ]

  • LocalSettings.php를 수정해서 기기에 맞는 스킨이 적용되도록 분기시키면 된다.
  • PC이면 기존 스킨 'vector'로[3], 모바일 기기라면 'wptouch' 스킨으로 분기시키자.
  • 기기를 판단하는 방법은 확장기능을 이용하는 방법과, HTTP_USER_AGENT 값을 직접 확인하고 분기시키는 하드코딩 방법이 있다.

3.1 방법1: 하드코딩 (직접 처리)[ | ]

LocalSettings.php 변경 전
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
$wgDefaultSkin = 'vector';
LocalSettings.php 변경 후
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
if (preg_match("/(mobile|webos|opera mini)/i", $_SERVER['HTTP_USER_AGENT'])) $wgDefaultSkin = 'wptouch';
else $wgDefaultSkin = 'vector';

3.2 방법2: 확장기능 설치/활용[ | ]

  • 확장기능 폴더 아래에 MobileDetect 폴더 생성
  • MobileDetect 폴더에 MobileDetect.php 파일 생성
  • MobileDetect.php 파일의 내용을 여기의 Code 문단 내용으로 교체
LocalSettings.php 변경 전
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
$wgDefaultSkin = 'vector';
LocalSettings.php 변경 후
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
$wgDefaultSkin = "vector"
require_once("$IP/extensions/MobileDetect/MobileDetect.php");
if( mobiledetect() ) $wgDefaultSkin = "wptouch";

4 같이 보기[ | ]

5 주석[ | ]

  1. wptouch 폴더, WPtouch.deps.php, WPtouch.php 가 남아 있게 된다.
  2. wptouch 폴더, WPtouch.deps.php, WPtouch.php
  3. 일반PC용 스킨 vector. 기본값.

6 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}