미디어위키
지각생 연습장
(→extension) |
|||
1번째 줄: | 1번째 줄: | ||
− | = The MediaWiki codebase = | + | {{topmenu}} |
+ | = 사용 = | ||
+ | * [[미디어위키 설정]] - 설정 & 사용 팁들 | ||
+ | * http://www.mediawiki.org/wiki/MediaWiki 미디어위키 홈페이지 | ||
+ | * 사례: [http://sestory.tistory.com/9 MediaWiki 로 개인 홈페이지 만들기] | ||
+ | == 업그레이드 == | ||
+ | * 백업 : DB, 파일들 | ||
+ | * 새 버전 받아 압축 풀기 | ||
+ | * AdminSettings.php 생성 (AdminSettings.sample 파일 이용) | ||
+ | * 업데이트 | ||
+ | *# $ php maintenance/update.php (쉘에서) | ||
+ | *# 혹은 installer 사용 재설치 (LocalSettings.php 재생성) | ||
+ | |||
+ | == 스팸 방지 == | ||
+ | * [http://www.mediawiki.org/wiki/Spam Manual:Combating spam] | ||
+ | *# rel="nofollow" : 페이지 랭킹값이 부풀려지지 않도록? | ||
+ | *# Spam blacklist | ||
+ | *# Captcha : ConfirmEdit 확장기능 | ||
+ | *# Edit filtering | ||
+ | *#:$wgSpamRegex = "/online-casino|buy-viagra|adipex|phentermine|adult-website\.com|display:none|overflow:\s*auto;\s*height:\s*[0-4]px;/i"; | ||
+ | *# Restrict editing | ||
+ | * http://meta.wikimedia.org/wiki/Anti-spam_Features | ||
+ | * http://wiki.evernex.com/index.php?title=Blocking_Spam_in_Mediawiki | ||
+ | |||
+ | == extension == | ||
+ | * 한번에 다 다운받기 : svn | ||
+ | *: svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ | ||
+ | *: 이후 미디어위키 디렉토리 아래 extensions 디렉토리 아래에 링크 | ||
+ | * SpamBlacklist : 1.5.x 버전에서는 안되는듯. (이 위키와 미문동 위키에서 작동 안함) | ||
+ | * AccessControl : Group_Based_Access_Control. 특정페이지에 특정그룹에 대한 읽기/쓰기 권한을 달리 조정하는 기능. 숨김 페이지를 만들 수도 있다 | ||
+ | ** 설치 : http://www.mediawiki.org/wiki/Extension:Group_Based_Access_Control#Installation | ||
+ | ** 위키 버전을 1.11이라고 하니까 안되고 1.8이나 1.9 등으로 입력하니 된다. 왜? | ||
+ | ** 접근 권한 없을때 기대한 것과 다른 행동을 하긴 하는데 일단 로그인하고 그룹에 속했을때, 적어도 관리자일 때만 볼 수 있는 페이지를 만드는건 가능하다 | ||
+ | * [http://www.mediawiki.org/wiki/Extension:AuthDrupal AuthDrupal] : 드루팔과 미디어위키의 로그인 계정정보 공유 | ||
+ | * [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi SyntaxHighlight_GeSHi] : 코드문법 하이라이트 | ||
+ | * [http://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration 구글 Analytics] | ||
+ | ** [http://www.engagestory.com/tt/516 미디어 위키에 google analytics 코드 삽입하기] | ||
+ | === 관리 도구 === | ||
+ | * [http://www.mediawiki.org/wiki/Extension:SpecialDeleteOldRevisions SpecialDeleteOldRevisions - 페이지의 옛날 버전들 지우기] | ||
+ | === Semantic Mediawiki === | ||
+ | * SMW | ||
+ | * Semantic Form | ||
+ | * Semantic Drilldown | ||
+ | |||
+ | === anti-spam extensions === | ||
+ | *http://www.mediawiki.org/wiki/Extension:AntiSpoof | ||
+ | *http://meta.wikimedia.org/wiki/Newuserlog | ||
+ | *http://meta.wikimedia.org/wiki/SpamBlacklist_extension | ||
+ | *http://www.mediawiki.org/wiki/Extension:Username_Blacklist | ||
+ | *Evaluate continuation of the use of Bad Behavior extension | ||
+ | *:- we use it here currently http://e-democracy.org/wiki | ||
+ | *http://www.bad-behavior.ioerror.us/category/mediawiki/ | ||
+ | ==== 사용자 생성 제한 ==== | ||
+ | * [http://minimonk.tistory.com/2211 mediawiki 사용자 생성 막기 / 금지하기] | ||
+ | ** 가입할 사람만 가입시키고 가입을 막아 버린다던가, (그룹 퍼미션에서 createaacount를 끔) | ||
+ | ** 아니면 가입승인 기능을 추가 ([http://www.mediawiki.org/wiki/Extension:ConfirmAccount ConfirmAccount] 확장 추가) | ||
+ | * ConfirmAccount 확장기능은 biography 에서 한국어 단어 수를 제대로 세지 못한다. RequestAccount_body.php 파일을 아래와 같이 수정 | ||
+ | **290번째 줄 부근에서 아래와 같은 줄을 찾아 | ||
+ | **:if ( str_word_count( $this->mBio ) < $wgAccountRequestMinWords ) { | ||
+ | **이렇게 고쳐준다. | ||
+ | $wordcount = count(preg_split('~[^\p{L}\p{N}\']+~u',$this->mBio)); | ||
+ | if ( $wordcount < $wgAccountRequestMinWords ) { | ||
+ | |||
+ | ====Captcha: [[ConfirmEdit]]==== | ||
+ | *[http://www.mediawiki.org/wiki/Extension:ConfirmEdit ConfirmEdit - 작성시 captcha 확인 (스팸 방지)] | ||
+ | **1.6 이상 버전에서 작동. 최신 버전은 PHP5 필요, PHP4의 경우는 21970 이전의 revision을 다운받음(svn 명령어 사용)<br> | ||
+ | **일반적 설치<br> | ||
+ | *#ConfirmEdit.php 와 ConfirmEdit.i18n.php 두 파일을 다운로드 | ||
+ | *#위키 설치 디렉토리/extensions 아래 ConfirmEdit 디렉토리 만듬 | ||
+ | *#다운받은 두 파일을 위에 만든 디렉토리에 업로드 | ||
+ | *#위키의 LocalSettings.php 를 열어 다음 한 줄 포함 | ||
+ | *#:require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" ); | ||
+ | *#위의 파일(ConfirmEdit.php)을 열어 아래줄처럼 변경 (원래는 false) | ||
+ | *#:$wgCaptchaTriggers['edit'] = true; | ||
+ | *#:$wgCaptchaTriggers['create'] = true; | ||
+ | *#로그인한 모든 사용자에겐 안 물어보려면 | ||
+ | *#:$wgGroupPermissions['user']['skipcaptcha'] = true; | ||
+ | **php4 에서 설치 (옛날 버전으로 설치) | ||
+ | **#svn checkout --revision 21970 http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ConfirmEdit/ | ||
+ | **#이후 위와 같은 방법으로 설정 | ||
+ | ***빈집 홈페이지에 설치 (09/1/12), 메시지 파일(ConfirmEdit.i18n.php)에 한글이 없어서 $wgConfirmEditMessage['ko'] 변수에 최신 버전의 메시지 내용을 넣어줬다. | ||
+ | |||
+ | === 멀티미디어 === | ||
+ | |||
+ | *[http://www.mediawiki.org/wiki/Extension:VPIPPlugin VPIPPlugin] : vPIP 를 미디어위키에서 쓸 수 있게 하는 것. 좋다. | ||
+ | **플러그인과 vPIP 다운로드하고, | ||
+ | **플러그인의 vPIP.php 를 수정해서 PlayButton.gif 와 DownloadButton.gif 의 경로를 수정한다. | ||
+ | **vPIP를 위한 코드를 미디어위키 스킨 </head> 바로 앞에 넣고 <br> | ||
+ | **<pre><script src="http://[url where vPIP was uploaded to]/vpip.js" type="text/javascript"></script><style type="text/css" media="all">@import "http://[url where vPIP was uploaded to]/vPIPBox.css";</style><script src="http://[url where vPIP was uploaded to]/jquery.js" type="text/javascript"></script><script src="http://[url where vPIP was uploaded to]/vpipit.js" type="text/javascript"></script></pre> | ||
+ | **일반적 방법으로 플러그인(확장기능)을 활성화한다. <br> | ||
+ | |||
+ | <br> | ||
+ | |||
+ | *사용법은 <video>~</video> 태그 안에 url, image, width, caption 등의 인수를 지정해서 쓴다. | ||
+ | |||
+ | <video> | ||
+ | caption=test | ||
+ | image=http://kuchu-camp.net/images/way_to_camp.jpg | ||
+ | url=http://kuchu-camp.net/movie/way_to_camp.wmv | ||
+ | </video> | ||
+ | |||
+ | *[http://www.mediawiki.org/wiki/Extension:EmbedVideo EmbedVideo] - embedding video clips from popular video sharing services | ||
+ | **미문동 위키에서 사용중 (2007/10) | ||
+ | **설치방법은 같음 - extensions/ 아래에 파일 업로드. LocalSettings.php 에서 require_once 로 불러옴 | ||
+ | **사용법 | ||
+ | ***{{#ev:service|id}} -or- | ||
+ | ***{{#ev:service|id|width}} | ||
+ | *http://www.mediawiki.org/wiki/Extension:VideoFlash | ||
+ | *[http://www.mediawiki.org/wiki/Extension:FlashMP3 FlashMP3] embeds a simple Flash-player for playback of mp3-files. It is based on the great Audio Player Wordpress plugin by 1pixelout. | ||
+ | *[http://www.mediawiki.org/wiki/Extension:EmbeddedVideo#Code Embdedded Video] 확장기능. 알기 쉽게 임베드 시킬 수 있을 것 같긴 한데 아직 뭔가가 잘 안된다. 이미지도 잘 안뜨고. vPIP 를 쓰는 다른 방법 혹은 뭔가 해야할 작업이 있는건가. 어쨌든 이런 류의 확장기능을 더 자세히 살펴봐야겠다. 그리고 제길 이 페이지좀 정리하자 -_- | ||
+ | *[http://www.mediawiki.org/wiki/Extension:EmbedURL EmbedURL] | ||
+ | *#<pre><embedurl>http://www.my-url.com/</embedurl></pre> | ||
+ | *#<pre><embedurl>http://www.my-url.com/{width=640}{height=480}</embedurl></pre> | ||
+ | |||
+ | <br> | ||
+ | |||
+ | === Some fun extensions === | ||
+ | |||
+ | ==== FCKeditor ==== | ||
+ | |||
+ | *확장기능 : http://mediawiki.fckeditor.net/ | ||
+ | *FCKeditor : http://www.fckeditor.net/ | ||
+ | *설치 방법 | ||
+ | *#위 주소에서 FCKeditor 확장기능을 다운로드한다. | ||
+ | *#extensions 디렉토리 아래에 둔다 | ||
+ | *#FCKeditor 를 다운받는다. (확장기능 말고 에디터 자체) | ||
+ | *#다운받은 FCKeditor 를 "FCKeditor 확장기능" 디렉토리 아래에 있는 fckeditor 디렉토리에 압축을 푼다 | ||
+ | *#LocalSettings.php에 다음 한줄을 추가해 활성화 한다. 끝이다 :) | ||
+ | *#:require_once("$IP/extensions/FCKeditor/FCKeditor.php"); | ||
+ | *참고 : clean 스킨과 충돌함 | ||
+ | |||
+ | ==== inputbox : 간단한 입력 폼 만들기 ==== | ||
+ | |||
+ | *http://www.mediawiki.org/wiki/Extension:Inputbox : 설치/사용방법 - 디게 간단하다. | ||
+ | |||
+ | <inputbox> | ||
+ | type=create | ||
+ | width=15 | ||
+ | default=테스트 | ||
+ | break=no | ||
+ | </inputbox> | ||
+ | |||
+ | ==== 기타 (미확인) ==== | ||
+ | *[http://www.mediawiki.org/wiki/Extension:Restrict_access_by_category_and_group Restrict_access_by_category_and_group] | ||
+ | *http://www.mediawiki.org/wiki/Extension:AddHTML | ||
+ | *http://www.mediawiki.org/wiki/Extension:EmailObfuscator | ||
+ | *http://www.mediawiki.org/wiki/Extension:CharInsert | ||
+ | *http://www.mediawiki.org/wiki/Extension:BreadCrumbs | ||
+ | *http://www.mediawiki.org/wiki/Extension:SimpleFeed | ||
+ | *http://www.mediawiki.org/wiki/Extension:Spellcheck | ||
+ | *http://www.mediawiki.org/wiki/Extension:Simple_Forms | ||
+ | *http://www.mediawiki.org/wiki/Extension:FormMailer | ||
+ | *http://www.mediawiki.org/wiki/Extension:ShareThis | ||
+ | *YouTubeTag | ||
+ | *ArticleComments | ||
+ | *websiteFrame | ||
+ | |||
+ | = 관리 = | ||
+ | * 파일 업로드 확장자 설정 : LocalSettings.php 파일에 아래 줄 찾아 고침(없음 추가) | ||
+ | $wgFileExtensions = array('ppt', 'doc', 'pdf', 'jpg', 'odt' ...); | ||
+ | * 계정 암호 바꾸기 <pre>UPDATE user SET user_password = MD5(CONCAT(user_id, '-', MD5('somepass'))) WHERE user_name = 'someuser';</pre> | ||
+ | ** Where obviously "somepass" is changed to the password you want to set and "someuser" is changed to the user name as it is listed in the table "user". | ||
+ | ** Note: The user_id in the CONCAT string is a column name and is not meant to be replaced with 'someuser' | ||
+ | ** Note: If you obtain a 'dbname.user table does not exist' error, please check the LocalSettings.php file, and double-check the value for the $wgDBprefix variable. If that variable is not empty, try repeating the command, replacing $wgDBPrefix_user instead of user in the UPDATE clause of the SQL statement. | ||
+ | = 참고 = | ||
+ | 좋은 참고, 자료 사이트들 | ||
+ | * [http://ko.wikipedia.org/wiki/%EC%82%AC%EC%9A%A9%EC%9E%90:%EB%A9%80%EB%9A%B1%EC%9D%B4/%EB%AF%B8%EB%94%94%EC%96%B4%EC%9C%84%ED%82%A4 위키백과 - 사용자:WonRyong/MediaWiki] | ||
+ | * http://www.knowledgethoughts.com/wiki/Mediawiki_templates 미디어위키 템플릿 만들기 튜토리얼 | ||
+ | * [http://mediawiki2u.com/ Free Mediawiki Skins] 미디어위키 스킨 | ||
+ | * [http://www.ipbwiki.com/Ipb_Wiki:Integration_Of_Invision_Power_Board_with_MediaWiki Ipb Wiki:Integration Of Invision Power Board with MediaWiki] | ||
+ | * [http://openoffice.or.kr/blog/?p=242 오픈오피스 문서를 미디어위키 형식으로 변환하여 저장할 수 있는 도구인 Odt2Wiki] | ||
+ | |||
+ | = 해킹 = | ||
+ | 확장기능 만들어보는 중. 참가신청폼을 만들려고 inputbox 를 본따고 있다 | ||
+ | <entry> | ||
+ | 참가신청폼입니다. | ||
+ | |||
+ | to말고도 다른 옵션도 넣고 싶구나 | ||
+ | 자바스크립트를 적용중. 이번엔 다르게. 될때까지. 될것 같다 | ||
+ | </entry> | ||
+ | |||
+ | == [[미디어위키 스킨|스킨]] == | ||
+ | * Chick | ||
+ | * CologneBlue | ||
+ | * [[MonoBook]] | ||
+ | * MySkin | ||
+ | * Nostalgia | ||
+ | * Simple | ||
+ | * Standard | ||
+ | === clean === | ||
+ | |||
+ | 08년 7월부터 쓰기 시작한 clean 스킨관련 팁 | ||
+ | |||
+ | *링크걸린 이미지 주위의 파란 테두리 없애기 : skins/clean/main.css 파일을 열어 다음 줄 추가<pre>a img { border: none }</pre> | ||
+ | *왼쪽 위 "wiki"메뉴에 최근바뀜 표시하기 | ||
+ | **위키 디렉토리의 includes/SkinTemplate.php 에서 이런 줄을 찾아<pre> $nav_urls['specialpages'] = array( 'href' => self::makeSpecialUrl( 'Specialpages' ) );</pre> | ||
+ | **아래 내용을 추가해준다. (복사해서 붙인 후 수정)<pre> $nav_urls['recentchanges'] = array( 'href' => self::makeSpecialUrl( 'RecentChanges' ) ); | ||
+ | </pre> | ||
+ | |||
+ | *참고: clean 스킨은 FCKeditor 확장기능과 충돌한다. | ||
+ | |||
+ | == The MediaWiki codebase == | ||
The MediaWiki codebase is large and ugly. Don't be overwhelmed by it. When you're first starting off, aim to write features or fix bugs which are constrained to a small region of code. | The MediaWiki codebase is large and ugly. Don't be overwhelmed by it. When you're first starting off, aim to write features or fix bugs which are constrained to a small region of code. | ||
− | You can browse the generated documentation. | + | You can browse the [http://svn.wikimedia.org/doc/ generated documentation.] |
One of the best ways to learn about MediaWiki is to read the code. Here are some starting points: | One of the best ways to learn about MediaWiki is to read the code. Here are some starting points: | ||
− | * index.php is the main entry point, although where things go from there is not very obvious. | + | * [[index.php]] is the main entry point, although where things go from there is not very obvious. |
− | * Article.php contains code for page view, delete, rollback, watch and unwatch. It also contains some general utilities for dealing with articles, such as fetching a revision or saving a page. | + | * [[Article.php]] contains code for page view, delete, rollback, watch and unwatch. It also contains some general utilities for dealing with articles, such as fetching a revision or saving a page. |
− | * EditPage.php has about half of the code related to editing, the half that's close to the user interface. The rest is in Article.php and the various *Update.php files. | + | * [[EditPage.php]] has about half of the code related to editing, the half that's close to the user interface. The rest is in Article.php and the various *Update.php files. |
− | * Parser.php has most of the code that converts wikitext to HTML. A few bits and pieces are in Skin.php | + | * [[Parser.php]] has most of the code that converts wikitext to HTML. A few bits and pieces are in Skin.php |
− | * Linker.php has functions to generate the HTML for links and images | + | * [[Linker.php]] has functions to generate the HTML for links and images |
* Code for most special pages is in the Special*.php files. | * Code for most special pages is in the Special*.php files. | ||
− | * Database.php contains stacks of functions for accessing the database. | + | * [[Database.php]] contains stacks of functions for accessing the database. |
− | * OutputPage.php is the home of the OutputPage class, which is an output buffer. Send your text here and it will be sent to stdout just before the script exits. | + | * [[OutputPage.php]] is the home of the OutputPage class, which is an output buffer. Send your text here and it will be sent to stdout just before the script exits. |
− | * Title.php is all about titles -- and that includes interwiki titles and "#" fragments. There's some functions in here that will fetch information about an article from the database. | + | * [[Title.php]] is all about titles -- and that includes interwiki titles and "#" fragments. There's some functions in here that will fetch information about an article from the database. |
− | * User.php contains the User class, which represents user preferences and permissions. | + | * [[User.php]] contains the User class, which represents user preferences and permissions. |
− | * Setup.php does all sorts of initialisation, and seems to account for a large proportion of running time. Among other things, it initialises lots of global variables, mostly containing objects. | + | * [[Setup.php]] does all sorts of initialisation, and seems to account for a large proportion of running time. Among other things, it initialises lots of global variables, mostly containing objects. |
− | * DefaultSettings.php contains defaults for lots of global variables, which may or may not be overridden in LocalSettings.php. Don't use isset(), always add a default for any global variable you introduce. | + | * [http://www.mediawiki.org/wiki/Help:Configuration_settings DefaultSettings.php] contains defaults for lots of global variables, which may or may not be overridden in LocalSettings.php. Don't use isset(), always add a default for any global variable you introduce. |
For getting started with debugging, see How to debug MediaWiki. | For getting started with debugging, see How to debug MediaWiki. | ||
+ | [[category: 해킹]] | ||
+ | [[category: 위키]] | ||
+ | [[category: 기술]] | ||
+ | [[category: 미디어위키]] | ||
+ | [[category: 확장기능]] | ||
+ | [[category: 웹]] | ||
+ | [[category: CMS]] | ||
+ | [[category: FOSS]] |