Jump to content

Extension:Thanks

From DawoumWiki, the free Mathematics self-learning
이 확장은 미디어위키 1.40과 그 이후 버전과 함께 제공됩니다. 따라서 여러분은 그것을 다시 다운로드할 필요가 없습니다. 어쨌든, 여러분은 여전히 제공된 다른 지침을 따라야 합니다.

Thanks 확장은 미디어위키 사이트에서 생산적인 기여에 대해 긍정적인 피드백을 제공하는 빠른 방법을 추가합니다. 그것은 사용자에게 개별 편집 및 일부 로그화된 동작에 대해 다른 사용자에게 공개 '감사' 알림 (Echo 를 통해)을 보내도록 허용합니다.

"감사"를 받는 특정 개정은 공개 로그화 테이블에 저장되지 않습니다. 타임스탬프, 발신자, 및 수신자만 공개적으로 로그화됩니다.

다음 위치에 'thank' 링크가 추가됩니다:

  • history와 diff 보기에서 'undo' 링크 옆에;
  • Special:Log의 일부 로그 항목에 대해 (아래 #Configuration 참조); 그리고
  • Flow가 설치되어 있으며, Flow 보드 댓글에.

그것은 역시 감사의 말을 전하기 위한 API도 제공합니다.

감사 인사를 받고 싶지 않으시다면 아래 설명한 대로 환경 설정에서 이 알림을 쉽게 비활성화할 수 있습니다.

Example of a 'thanks' notification

일단 이 확장을 사용해보고 나면, 토론 페이지에서 해당 기능에 대한 피드백을 남겨주시기 바랍니다.

Thanks 알림이 서로의 작업에 대한 감사를 더 쉽게 표현할 수 있게 되기를 바랍니다. 특히 위키에서 첫 번째 중요한 단계를 밟는 새로운 사용자를 격려하는 데 도움이 될 것입니다. 이 알림은 의도적으로 가능한 한 간단하게 유지하여, 함께 평가하고 개선할 수 있도록 했습니다. 즐기세요…

Installation

Thanks 확장을 사용하기 위해, 먼저 Extension:Echo 확장을 설치해야 합니다.

미디어위키 확장 내려받기 지면에서 해당하는 버전을 다운로드하고 위키의 extensions 디렉토리에 Thanks에 푸십시오.

또는 개발자와 코드 기여자는 대신 다음을 사용하여 Git에서 확장 프로그램을 설치해야 합니다.

cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks

미디어위키 설정 LocalSettings.php에 다음을 추가하십시오:

wfLoadExtension( 'Thanks' );

필요하다면, 설정하십시오.

Go to the History action of a page to see the new "Thank" interface.

Special:Version에 접근해서 확장이 정상적으로 설치가 되었는지 확인하십시오.

Configuration

Enable the Thank interface for bot edits (disabled by default)

$wgThanksSendToBots = false;

Log Thank actions to "Special:Log" (enabled by default)

$wgThanksLogging = true;

Whether or not confirmation is required for sending thanks (enabled by default)

$wgThanksConfirmationRequired = true;

Log entry types that can be thanked from Special:Log:

$wgThanksAllowedLogTypes = [
	"contentmodel",
	"delete",
	"import",
	"merge",
	"move",
	"patrol",
	"protect",
	"tag",
	"managetags",
	"rights"
];

Usage

To thank another user, go to the History tab of any page. Next to each revision will be a 'thank' link. Click the link to send thanks to that user. This link is also available in the diff view, on some entries in Special:Log, and below comments on Flow boards if Flow is installed.

When the thank link is clicked, the recipient will receive a notification with your thanks via the Echo extension (unless they have opted out of receiving thanks notifications). A record of the action is also recorded as a log entry at Special:Log/thanks.

If the wiki is using memcached, a rate limit is imposed of no more than 10 thanks per minute per user. The limit can be configured with $wgRateLimits ['thanks-notification'].

Avoiding thanks

To stop getting thanks notifications, you can opt out from them in your notification preferences. Go to the Notifications tab of your preferences. This only prevents you from getting notified, it does not prevent users from thanking you.

API documentation

The Thanks extension includes an API for sending thanks. In order to call the API, use the parameter action=thank.

Parameters:

  • rev - The revision ID you would like to thank someone for (either this or log is required)
  • log - The log ID you would like to thank someone for (either this or rev is required)
  • source - Source of the thank event. This is a short string that identifies where the thanks was sent from. For example, if the thanks was sent from Huggle, the value could be 'huggle'. (optional)
  • token - Edit token (a.k.a. CSRF token). You can get one of these through the tokens API. (required)

Example:

 api.php?action=thank&rev=16543&token=%2B\

To send thanks via OAuth only the "Basic" grant permission is required. A python example is available.

Flow Thanks

There is a separate API for sending Thanks for comments on Flow boards. To call the API, use action=flowthank.

Parameters:

  • postid - The UUID of the comment for which to send thanks (required)
  • token - Edit token. You can get one of these through prop=info. (required)

Example:

 api.php?action=flowthank&postid=abc123&token=%2B\

Errors and Warnings

Code Info
invalidrecipient No valid recipient found
Bots cannot be thanked
You cannot thank yourself

SQL Documentation

Understanding who thanked who from the logs requires some understanding of the columns. Within the logging table, the log_title represents the receiver, and the log_user_text represents the sender.

The following SQL which finds all the thanks a receiver received within a time period illustrates this:

select log_timestamp as thank_timestamp,
  replace(log_title, '_', ' ') as receiver,
  log_user_text as sender
from logging_logindex
where log_title = :user_name
  and log_action = 'thank'
  and :start_date <= log_timestamp
  and log_timestamp <= :end_date

Notice also that the logging table is not selected from directly, but on Wikimedia servers we take advantage of the logging_logindex table. In order to quickly search for all the thanks a user sent the logging_userindex provides the correct index.

See also