확장기능:댓글

From mediawiki.org
This page is a translated version of the page Extension:Comments and the translation is 77% complete.
Outdated translations are marked like this.
미디어위키 확장 기능 설명서
Comments
출시 상태: 안정
구현 파서 확장 기능 ,
설명 ‎<comments /> 파서 후크 태그를 문서 내에 추가하면, 문서 내에 댓글을 달 수 있는 기능을 사용할 수 있도록 합니다.
만든 이
최신 버전 5.0
MediaWiki 1.39+
데이터베이스 변경
테이블 Comments
Comments_Vote
Comments_block
라이선스 GNU General Public License 2.0 or later
다운로드
  • $wgCommentsDefaultAvatar
  • $wgCommentsInRecentChanges
  • $wgCommentsAbuseFilterGroup
  • $wgCommentsSortDescending
‎<comments />
  • comment
  • commentadmin
  • commentlinks
  • comment-delete-own
Quarterly downloads 75 (Ranked 77th)
Comments 확장 기능 번역 (translatewiki.net에서 가능한 경우)
이슈 미해결 작업 · 버그 보고

댓글 확장기능은 ‎<comments /> 파서 후크 태그를 추가해 해당 태그가 있는 문서에 댓글을 달 수 있도록 하는 기능입니다.

댓글을 다는 행동은 Special:Log/comments에 로깅되지만, 기본적으로는 숨겨져 있습니다. 마치 patrol 로그 항목 처럼 말입니다. 당신은 $wgCommentsInRecentChanges = true;를 설정하여 댓글을 보여줄 수 있고, Special:RecentChanges를 설정하여 댓글 기록까지 보여줄 수 있습니다. (2.8 버전 이상에서 가능합니다)

기본적으로 코드는 MiszaJack Phoenix로 결정됩니다.

설치

  • 파일을 다운로드하고 Comments 폴더를 extensions/ 디렉토리에 넣어 주세요.
    개발자와 코딩 기여자는 Git을 이용해 확장기능을 다운받는 것이 좋습니다.cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Comments
  • 아래의 코드를 LocalSettings.php 코드의 마지막에 추가합니다.
    wfLoadExtension( 'Comments' );
    
  • 갱신 스크립트를 실행합니다. 이 스크립트는 이 확장기능을 필요로 하는 데이터 베이스 테이블을 자동적으로 작성합니다.
  • Yes 완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.
You will need to download the master version in order for the extension to work properly, as there is an issue with the branched versions.

사용

  • ‎<comments /> — 기본적인 댓글 형태입니다. 대부분의 경우에 적합합니다.
  • <comments allow="Derfel,Jack Phoenix,Misza" /> — 사용자들 중에서 "Defel", "Jack Pheonix", "Misza"만이 댓글을 달 수 있습니다.
  • <comments voting="Plus" /> — 사용자들이 댓글의 평가를 부정적으로평가 (반대, 👎) 하는 것을 막고, 오직 긍정적으로 평가 (추천, 👍 )만 할 수 있도록 합니다.

오늘의 댓글

이 확장기능은 "오늘의 댓글" 기능을 불러옵니다. (‎<commentsoftheday />). 이 기능은 기본적으로 사용되지 "않습니다". 당신은 위키의 LocalSettings.php 안에, require_once 다음 줄에 아래 줄을 추가하여 이 기능을 사용할 수 있습니다.

require_once "$IP/extensions/Comments/CommentsOfTheDay.php";

If the nocache argument is passed to the parser hook (like this: <commentsoftheday nocache=true />), the parser hook will not use memcached and will just fetch the data from the database instead of cache. This is useful if you want to show the most up-to-date data, but it can be very server-intensive.

사용자 권한

이 확장기능은 세 가지의 사용자 권한을 추가합니다.

  • comment - (댓글을 다는 것을 허용합니다)
  • commentlinks - (댓글에 외부 링크를 넣고 달 수 있습니다.)
  • commentadmin - (다른 사용자가 단 댓글을 삭제할 수 있습니다.)
  • comment-delete-own - which allows deleting one's own comments, e.g.
$wgGroupPermissions['sysop']['commentadmin'] = true;

기본적으로 모든 사람들은 익명이더라도 댓글을 달 수 있습니다. 하지만 댓글 안에 외부 링크를 삽입한 댓글은 $manual로 제한됩니다.

만약 익명 사용자들도 댓글에 외부 링크를 삽입하는 것을 허용하고 싶으시다면 require_once 뒤에 아래 구문을 추가하세요.

$wgGroupPermissions['*']['commentlinks'] = true;

기본적 설정으로는 commentadmin 그룹에 속한 사용자들만 댓글을 삭제할 수 있습니다.

사용자 점수

This is relevant only if the SocialProfile extension is installed and $wgUserLevels is properly configured.
  • $wgUserStatsPointValues['comment_plus'] — amount of points to give out when another user gives "thumbs up" to your comment.
  • $wgUserStatsPointValues['comment_ignored'] — amount of points to give out when another user adds your comments to their ignore list (Special:CommentIgnoreList).

매개 변수

  • $wgCommentsDefaultAvatar — path to an image which will be displayed instead of an avatar if social tools (SocialProfile extension) aren't installed. Should be 50x50px. Note that there is no default avatar image shipped with this extension. The default is defined in extension.json and links to an external image on shoutwiki.com server, an ad driven wiki farm. You may prefer to set this parameter to point to a local file.
  • $wgCommentsInRecentChanges — by default, this variable is set to false. Set it to true to display comments log entries in Special:RecentChanges, too, in addition to the comments log at Special:Log/comments.
  • $wgCommentsSortDescending — by default, this variable is set to false. Set it to true to sort comments by date descending, with the new comment box and most recent comments at the top.
  • $wgCommentsAbuseFilterGroup — This is the custom group name for AbuseFilter for when the AbuseFilter extension is enabled. It ensures that AbuseFilter only pulls the filters related to Comments. If you would like AbuseFilter to pull all of the filters, enter 'default' here. The default value for this is 'comment', which ensures that AbuseFilter will only look for filters specifically written to target comments.

매직 워드/파서 함수

Comments includes 2 magic words and a parser function:

  • {{NUMBEROFCOMMENTS}} gives the entire number of comments on the wiki.
  • {{NUMBEROFCOMMENTSPAGE}} gives number of comments on the current page.
  • {{NUMBEROFCOMMENTSPAGE:<pagename>}} gives number of comments on the given page.

후크

Comments extension adds three hooks, Comment::add, Comment::delete and Comment::isSpam.

Hook name When it is called Parameters
Comment::add After a comment has been added into the database, on the bottom of Comment::add function
  • $comment (instance of Comment class)
  • $commentID
  • $pageID
Comment::delete After a comment has been deleted and the caches have been purged (function delete on class Comment)
  • &$comment (instance of Comment class)
  • $commentID
  • $pageID
Comment::isSpam Called in Comment::isSpam before performing other spam checks.
  • &$text (user-supplied comment text to check against spam)
  • &$retVal (boolean; function return value, i.e. does the supplied text contain spam (true) or not (false))

Anti-spam

Though (as of Q3/2023) Comments does not (yet) support ConfirmEdit, MediaWiki's de facto CAPTCHA extension, there are plenty of other anti-spam measures built in, including:

  • restricting who can add comments and/or comments that contain hyperlinks (see the #User rights section above)
  • support for $wgSpamRegex and $wgSummarySpamRegex
  • possibility for extension developers to implement custom spam checks via the Comment::isSpam hook point (see the #Hooks section above)
  • AbuseFilter interoperability — AbuseFilter can be made to check if the action variable's value is comment to write filters that apply only to comments made via the Comments extension; the new_wikitext variable contains the actual comment text, and the new_size variable is calculated on-demand based on the value of the new_wikitext variable. Refer to AbuseFilter's documentation for more details on how those variables and filters in general work.
    • The new configuration variable $wgCommentsAbuseFilterGroup can be set to 'default' to make existing AbuseFilter filters apply to comments as well. By default it is set to 'comment', so only filters specifically designed to target comments will be executed against comments made via the Comments extension.

국제화

The Comments extension currently has (partial or full) support for 68 different languages, including English. Please visit translatewiki.net if you want to translate Comments or other extensions of the social tools family of extensions into your language, or modify existing translations.

같이 보기