Расширение:Comments
![]() Статус релиза: стабильно |
|
---|---|
![]() |
|
Реализация | Расширение парсера , Хук |
Описание | Добавляет тэг <comments /> , позволяющий комментировать статьи. |
Автор(ы) |
|
Последняя версия | 4.6.0 (2019-08-08) |
MediaWiki | 1.39+ |
Изменения в БД | Да |
Таблицы | Comments Comments_Vote Comments_block |
Лицензия | GNU General Public License 2.0 или позднее |
Скачать | |
Пример | Social Tools Development Wiki |
|
|
<comments /> |
|
Quarterly downloads | 131 (Ranked 73rd) |
Public wikis using | 194 (Ranked 412nd) |
Переведите расширение Comments, если оно доступно на translatewiki.net | |
Проблемы | Открытые задачи · Сообщить об ошибке |
Расширение Comments добавляет парсер <comments />
, позволяющий комментировать статьи там, где этот тэг присутствует.
Действия в комментариях регистрируются в Special:Log/comments
, но по умолчанию скрыты, так же как записи в журнале патрулирований .
You can set $wgCommentsInRecentChanges = true;
to show comments log entries in Special:RecentChanges (available in version 2.8+).
Majority of the code fixes were done by Misza and Jack Phoenix.
Установка
- Скачайте и распакуйте файл(ы) в папку с названием
Comments
в вашей папкеextensions/
. - Добавьте следующий код внизу вашего
LocalSettings.php
:wfLoadExtension( 'Comments' );
- Выполните скрипт обновления, который автоматически создаст необходимые таблицы, используемые расширением.
- Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.
Использование
<comments />
— basic comment form, sufficient for most things.<comments allow="Derfel,Jack Phoenix,Misza" />
— only allows the users Derfel, Jack Phoenix and Misza to submit comments.<comments voting="Plus" />
— prevents users from rating comments negatively (thumb down), allowing only positive (thumb up) votes.
Comments of the Day
The extension also comes with a "Comments of the Day" feature (<commentsoftheday />
), which by default is not enabled. You can enable this feature in the wiki's LocalSettings.php
, by adding the following after the require_once
line:
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;
By default, everyone, even anonymous users, can post comments, but posting comments that contain external links is limited to autoconfirmed users.
If you want anonymous users to be able to post external links, add this after the require_once
:
$wgGroupPermissions['*']['commentlinks'] = true;
By default only users in the commentadmin
group can delete comments.
User points
$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).
Parameters
$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 inextension.json
and links to an external image onshoutwiki.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 tofalse
. Set it totrue
to display comments log entries in Special:RecentChanges, too, in addition to the comments log atSpecial:Log/comments
.$wgCommentsSortDescending
— by default, this variable is set tofalse
. Set it totrue
to sort comments by date descending, with the new comment box and most recent comments at the top.
Magic words/Parser functions
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.
Hooks
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::delete
|
After a comment has been deleted and the caches have been purged (function delete on class Comment )
|
|
Comment::isSpam
|
Called in Comment::isSpam before performing other spam checks.
|
|
Internationalization
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 into your language.
TODO list
- HTML output is not valid XHTML - would be nice if it were but we can live without that
- Would be nice if there was a special page that gives a overview of all uses of the Comments extension on all pages (for an adminstrator to be able to moderate easier)
См. также
Это расширение включено в следующие пакеты и/или вики-фермы: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |