Mediawiki

From 탱이의 잡동사니
Jump to navigation Jump to search

Overview

Mediawiki 사용법 정리

Configuration

Sidebar

왼쪽 사이드 바 수정 옵션.

Upload file size

/etc/php.ini 혹은 /etc/php5/apache2/php.ini 파일에서 다음의 항목을 수정한다<ref>https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads#Set_maximum_size_for_file_uploads</ref>.

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 8M

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

Upload file types

LocalSettings.php 파일에 다음과 같은 항목을 추가해주면 된다. 별도로 더 추가하고자 하는 확장자가 있다면 추가해주면된다.

$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc',
    'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'bmp', 'docx', 'xlsx',
    'pptx', 'ps', 'odt', 'ods', 'odp', 'odg'
);

Extension

SyntaxHighligh

Maps

Mediawiki Map extension.

어떤 이유에서인지 구글 지도를 사용하려고 하면 브라우저 호환성 문제가 발생한다. 아쉽지만 차선책으로 openlayers 를 사용하면 문제가 해결된다. 옵션으로는 layers=osm-mapquest zoom=15 가 제일 무난하다.

<display_map width=600px height=300px service=openlayers layers=osm-mapquest zoom=15>
Copenhagen, Denmark
</display_map>

아래 링크에 상세 사용 설명이 나와있다.

RSS Reader

Mediawiki RSS reader extension. Mediawiki RSS Reader 가 필요할 때 사용할 수 있는 extension 이다. 종류가 많이 있지만 이게 젤 괜찮은 듯 싶다.

RSS 내용을 가져올 때, 특수문자들이 정상적으로 표시가 안되는 문제가 있었다. RSSReader.php 파일에서 다음의 내용을 수정해주면 된다. <source lang=php>

         //$item_title=preg_replace("|\[rsslist:.+?\]|", "",
           //htmlspecialchars(html_entity_decode(html_entity_decode(html_entity_decode($item['title'],
           //ENT_QUOTES, "UTF-8"), ENT_QUOTES, "UTF-8"), ENT_QUOTES, "UTF-8"), ENT_QUOTES, "UTF-8"));
         $item_title=
           htmlspecialchars_decode(html_entity_decode(html_entity_decode(html_entity_decode($item['title'],
           ENT_QUOTES, "UTF-8"), ENT_QUOTES, "UTF-8"), ENT_QUOTES, "UTF-8"));

</source>

References

<references />