扩展:標記修訂

本頁使用了標題或全文手工轉換
From mediawiki.org
This page is a translated version of the page Extension:FlaggedRevs and the translation is 84% complete.
Outdated translations are marked like this.
警告 警告: Flagged Revisions is very clunky, complex and not recommended for production use, despite the "stable" tag. See phab:T185664. As of April 2017, Flagged Revisions will no longer be installed on additional WMF wikis (see m:Flagged Revisions#Enabling).
MediaWiki的扩展的手冊
Flagged Revisions
發佈狀態: 穩定版本
实现 用户界面, 特殊页面 , 用户权限 , 数据库 , Ajax, API
描述 允許條目由「編輯者」和「審核員」進行內容管理。
作者 Aaron Schulz, Joerg Baach
兼容性政策 快照跟随MediaWiki发布。 master分支不向後兼容。
MediaWiki 1.21+
数据库更改
flaggedpages
flaggedpage_pending
flaggedrevs
flaggedtemplates
flaggedpage_config
flaggedrevs_tracking
flaggedrevs_promote
flaggedrevs_statistics
许可协议 GNU通用公眾授權條款2.0或更新版本
下載
帮助 Help:Extension:FlaggedRevs/zh
  • $wgFlaggedRevsRestrictionLevels
  • $wgSimpleFlaggedRevsUI
  • $wgFlaggedRevsTagsAuto
  • $wgFlaggedRevsAutoReview
  • $wgFlaggedRevsHandleIncludes
  • $wgFlaggedRevsTagsRestrictions
  • $wgFlaggedRevsTags
  • $wgFlaggedRevsLowProfile
  • $wgFlaggedRevsAutoconfirm
  • $wgFlaggedRevsOverride
  • $wgFlaggedRevsProtection
  • $wgFlaggedRevsAutopromote
  • $wgFlaggedRevsNamespaces

  • review
  • validate
  • autoreview
  • autoreviewrestore
  • unreviewedpages
  • stablesettings
  • movestable
季度下載量 74 (Ranked 107th)
翻譯FlaggedRevs的扩展
問題 尚未完成的工作 · 报告錯誤

標記修訂擴展允許編輯者審核員用戶對條目的修訂版本進行評級,並將這些修訂設定為在普通查看頁面時的預設版本。 這讓MediaWiki更像是一個內容管理系統(CMS)。

下載

此扩展可直接从Git检索到 [?]:

  • 浏览代码
  • 部分扩展有稳定版本标签。
  • 每个分支与过去的MediaWiki发布版本相关联。 这里也有一个“主线”分支,包含最新alpha版本(可能需要MediaWiki的alpha版本)。

提取快照,并将它放置在您的MediaWiki安装副本的extensions/FlaggedRevs/目录中。

如果您对git熟悉,并且拥有您服务器的shell访问权,您也可以通过以下方法获得扩展:

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

设置

安装说明中的示例是针对现代类Unix操作系统(尤其是Linux和Mac OS X)编写的,并假设MediaWiki安装在/var/www/mediawiki目录中。 如果您正在使用不同系列的操作系统,则需要使用适合于操作系统的命令和文件路径。

请按照以下步骤安装Flagged Revs:

  • Ensure that file hashes are up-to-date by running the populateImageSha1.php maintenance script.[1] 例如:
    php maintenance/populateImageSha1.php
  • 下载文件,并将其放置在您extensions/文件夹中的FlaggedRevs目录内。
  • 将下列代码放置在您的LocalSettings.php 的底部:
    wfLoadExtension( 'FlaggedRevs' );
    
  • 运行更新脚本,它将自动创建此扩展必须依赖的数据库表。
  • Configure as required.
  • Yes 完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。

致使用MediaWiki 1.33或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.33和更早版本)中安装此扩展,而不是wfLoadExtension( 'FlaggedRevs' );,您需要使用:

require_once "$IP/extensions/FlaggedRevs/FlaggedRevs.php";
  • 启用条目审阅统计信息的收集。
    • 设置计划的统计信息生成。 创建一个cron作业以定期运行extensions/FlaggedRevs/maintenance/updateStats.php 运行time php updateStats.php以查看脚本运行所需的时间并适当地设置cron作业间隔。 例如,建立一個cron任務在每個小時以www-data的身分執行updateStats.php
      echo "@hourly php /var/www/mediawiki/extensions/FlaggedRevs/maintenance/updateStats.php" | crontab -u www-data -
    警告 警告: 这将删除用户的所有现有cron作业。
  • 授權用户成为审阅者。 首次安装FlaggedRevs后,没有用户可以看到审阅者的工具集。 To fix this, login as a wiki bureaucrat and go to Special:UserRights, then grant review rights to one or more users. 審閱者將會在可編輯頁面的底部看到審閱者的工具集。

注释

  1. If the hash table is up-to-date, files can be referenced by using their hashes rather than by a name/timestamp pair. References that use name/timestamp pairs are broken if a file is renamed.

配置

用户权限和用户组

預設情況下,沒有人可以進行審核,因此第一步是設定用戶權限。

用户组 用户权限
reviewer validate
review
editor
autoreview
unreviewedpages

用户权限

標記修訂新增以下用戶權限:

  • review – 用戶可以審核修訂
  • validate – 用戶可以審核修訂,並能夠設定任何標記為任何級別
  • autoreview – 用戶所做的任何新修訂都會被自動標記為已審核
  • autoreviewrestore – 用戶進行的回退被自動標記為審核。
  • unreviewedpages – 用戶可以查看Special:UnreviewedPages
  • stablesettings – 用戶可以更改任何頁面的穩定版本設定
  • movestable – 用戶可以移動有穩定版本的頁面

用户组

標記修訂新增以下用戶組:

  • editor – 擁有autoreview, review, unreviewedpages,以及MediaWiki標準用戶權限autoconfirmed, editsemiprotected
  • reviewer – 擁有autoreview, review, unreviewedpages, validate,以及MediaWiki標準用戶權限autoconfirmed, editsemiprotected
  • autoreview – 擁有autoreview

如何分配用户权限

用戶權限可以透過兩種方式授予:

  • 授予權限到用戶組
    將這些用戶權限授予給LocalSettings.php 中已存在的用戶組:
$wgGroupPermissions['sysop']['review'] = true; //allow administrators to review revisions
  • 授予權限給特定用戶
    透過Special:UserRights手動將用戶帳號添加到對應的用戶組。
默认值:
  • 行政员可以添加/移除复核者
  • 管理員可以添加/移除自動審核員和編輯者。

基本設定

FlaggedRevs.php附帶了許多可設定的變數。 這些應該在LocalSettings.php中進行設定。

  • $wgFlaggedRevsNamespaces – 設定可以進行審核的命名空間。 這是一個整數的陣列。 查閱Manual:命名空间常量 ,找到預設命名空間所對應的整數,並使用已定義的常數來提高可讀性。
  • $wgFlaggedRevsTags – 設定標籤及它們三個'levels'设置。
    定义
    $wgFlaggedRevsTags是一個關聯陣列,鍵為所對應的標籤名稱。 The only meaningful value of the array is 'levels', which controls the number of review levels, and the array can only have one element.
    標籤
    • 每個標記可以透過編輯頁面「MediaWiki:revreview-<tag-name>」來設定標籤。
    • 每個標記等級可以透過編輯頁面「MediaWiki:revreview-<tag-name>-<level-number>」來設定標籤。
    預設情況下,標記的標籤在$wgFlaggedRevsTags陣列中設定。 To override this, and show tags for example as their capitalized name, the admins have to edit these pages with the shown content, for example changing the content of MediaWiki:revreview-accuracy
要標籤標記級別,管理員必須建立這些頁面來顯示內容:
标签 等級 標籤頁面 内容
accuracy 0 MediaWiki:revreview-accuracy-0 不充分
1 MediaWiki:revreview-accuracy-1 可接受
2 MediaWiki:revreview-accuracy-2 准确
設定結果將會是:
標籤名稱 等級名稱
准确性 不充分 可接受 准确
  • $wgFlaggedRevsOverride – 穩定版本是否是頁面的預設內容。
    各個頁面皆可以由管理員設定預設內容為穩定版本還是草稿版本。
  • $wgFlaggedRevsTagsRestrictions – 關聯陣列,鍵為每個標籤的類型,值為可以設定最高標籤等級的對應權限陣列(整數的標籤等級)。
    示例
    $wgFlaggedRevsTagsRestrictions = [
    	'accuracy' => [ 'review' => 1 ],
    ];
    


用戶介面

  • $wgSimpleFlaggedRevsUI – 啟用後將使用更簡單基於圖示的UI。 Does not affect the tags shown in edit mode.
  • $wgFlaggedRevsLowProfileThis setting hides the review status box/bar for pages that are reviewed in their latest version. Explanatory text is also removed from some places.

工作流

  • $wgFlaggedRevsAutoReview – 如果啟用,則具有'autoreview'權限的用戶在每次保存編輯都會被自動審核。 無需點擊「送出審核」按鈕。 此功能要求以前的修訂版本已被審核,否則將不會發生自動審核。
  • $wgFlaggedRevsTagsAuto – 如果wgFlaggedRevsAutoReview啟用,此設定控制自動審核的每個標籤層級。 如果允許,標籤將被自動審核為與之前修訂相同的級別。 這是一個關聯陣列。每個鍵都是一個標記,每個值都是一個標記等級。
    示例
    $wgFlaggedRevsTagsAuto = [
    	'accuracy' => 1
    ];
    
模板和圖片的更改會被自動審核(根據頁面)。 這可能會導致糟的版本通過審核。 應鼓勵用戶使用預覽或是在儲存後查看頁面。 您或許希望設定$wgNamespaceProtection[NS_TEMPLATE][ 'editor' ][ 'autoconfirmed' ]

自動授權用戶

  • $wgFlaggedRevsAutopromote – 為一個包含鍵的陣列,鍵可以為年齡、編輯數、編輯時間間隔、benchmarks、是否確認電子郵件、最近內容頁面編輯數、總內容頁面編輯數、編輯內容頁面的數量、使用編輯摘要的數量、IP uniqueness和是否存在用戶頁。 這些值對應為用戶帳戶被自動授予「編輯者」狀態所需的天數/編輯數,以及是否通過電子郵件確認和擁有用戶頁。 用戶必須至少在Y或更多天分別有至少X次編輯,其中X是benchmarks,Y是時間間隔。 將此變數設定為false可完全停用此變數。
    • 如果用戶移除了他們的編輯者權限,則他們不會被重新自動授予(檢查編者的狀態日誌以確認是否撤銷)。
    • 其中一些計數不具有追溯力,因此您可能會發現延遲授權。
    示例
    $wgFlaggedRevsAutopromote可能包含:
    $wgFlaggedRevsAutopromote['days'] = 60; # 自註冊以來的天數
    $wgFlaggedRevsAutopromote['edits'] = 150; # 總編輯數
    $wgFlaggedRevsAutopromote['excludeDeleted'] = true; # 總編輯數是否不包含已刪編輯?
    $wgFlaggedRevsAutopromote['spacing'] = 3; # 编辑间隔的时长
    $wgFlaggedRevsAutopromote['benchmarks'] = 15; # 需要多少这样的编辑间隔?
    $wgFlaggedRevsAutopromote['recentContentEdits'] = 10; # 最近更改中$wgContentNamespaces的編輯數
    $wgFlaggedRevsAutopromote['totalContentEdits'] = 30; # $wgContentNamespaces的編輯數
    $wgFlaggedRevsAutopromote['uniqueContentPages'] = 10; # $wgContentNamespaces中相異頁面的編輯數
    $wgFlaggedRevsAutopromote['editComments'] = 5; # 使用編輯摘要的數量
    $wgFlaggedRevsAutopromote['email'] = true; # 用戶是否進行電子郵件確認?
    $wgFlaggedRevsAutopromote['userpageBytes'] = 0; # 如果需要用戶頁,則最少的大小為?
    

進階

  • $wgFlaggedRevsRestrictionLevels - Restriction levels for autoreview/review rights. When a level is selected for a page, an edit made by a user will not be auto-reviewed if the user lacks the specified permission. Levels are set at Special:Stabilization.
  • $wgFlaggedRevsProtection - Set this to use FlaggedRevs only as a protection-like mechanism (Help:Pending changes), rather than the standard configuration.
  • $wgFlaggedRevsAutoConfirm - Define when users get to have their own edits auto-reviewed. Set to false to disable.
  • $wgFlaggedRevsHandleIncludes - Whether to use stable versions of templates when rendering the stable version of a page.

要讓維基的未註冊用戶只能看到條目的穩定版本,請參閱Extension:FlaggedRevs/Restricting unapproved revisions

使用

参见: Help:FlaggedRevs

批准页面

擁有某些審核狀態級別的用戶將在檢視頁面(位於頁面底部)和差異(位於頁面頂部)時有小的評級表單,供他們審核修訂版本。 每個標記必須至少達到最低的批准級別。 在審核之前用戶應該查看整個頁面,包括模板和圖片。 與穩定版本間差異的連結對於加速此過程非常有用。

用戶無法審核他們無法編輯的頁面。 他們不能降低修訂級別為他們無法設定的級別。 被封鎖的用戶不能做任何事情。

維護

Special:UnreviewedPages中,有從未被審核過的頁面列表,僅對編輯者可見。 必須選擇命名空間,也有一個分類過濾器可供選擇。

Special:OldReviewedPages中,有已審核頁面但包含待定更改的頁面列表。 僅對編輯者可見。 也有一個分類過濾器可供選擇。

Pages that cannot be reviewed can still be patrolled for anti-vandalism purposes by Editors to see what has been checked already.

日誌

所有相关操作都会被永久记录,因此可以正确跟踪和监督所有操作。

备注

  • $wgUseRCPatrol 被此擴展啟用。 對於可審核的頁面,巡查被停用,但已標記的版本在最近更改中被標示為已巡查。 這表示巡查可審核修訂的唯一方法是標記它。 不可審核的頁面仍然表現正常(取決於站點巡查設定)。
  • 管理員可以對特定頁面更改預設,是否要优先显示穩定版本。 要禁用此功能,在LocalSettings.php添加$wgGroupPermissions['sysop']['stablesettings'] = false;
  • 頁面連結、分類、圖片、模板、語言和外部連結仍然基於當前版本的頁面。
  • 用戶無法移動他們無法審核的頁面。 這是故意的,見任务T15994要解決這個問題,在LocalSettings.php中添加$code。
  • 要除去編輯者權限,你可以暫時封鎖他們,或透過Special:UserRights來永久除權。 為了跟踪目的將出現額外的除權日誌項目。

API

FlaggedRevs adds API modules for reviewing revisions and configuring "stabilization" of pages, a module for retrieving flag configuration, and two list modules corresponding to the special pages for unreviewed pages and "old" reviewed pages.

action=review

審核一個頁面。

參數
  • revid: The revision ID for which to set the flags
  • token: 通过action=query&meta=tokens 取得的csrf權杖
  • comment: 审阅意见(可选)
  • flag_accuracy: Set the flag named "accuracy" to the specified value; (replace "accuracy" with the flag name to set another flag)
  • unapprove: If set, revision will be unapproved rather than approved
示例

审阅修订版本12345

结果
<api>
  <review revid="12345" />
</api>

action=stabilize

更改页面稳定版本设置。

參數
  • title: 稳定版本的页面标题
  • reason: 稳定版本的原因
  • expiry: 稳定期限到期。默认值:无限期
  • review: 是否自动审核页面
  • watch: 是否监视页面
  • token: 通过action=query&meta=tokens 取得的編輯權杖
  • For protection-like configurations ($wgFlaggedRevsProtection=true):
  • protectlevel: The right users must have in order for their edits to not require review.
  • Otherwise ($wgFlaggedRevsProtection=false):
  • default: Default revision to show (latest | stable)
    autoreview: Restriction level for the 'autoreview' right (sysop | none). Default: none
示例

Configure the page "Foo" such that only reviewed revisions are shown by default

结果
<api>
  <stabilize title="Foo" default="stable" autoreview="none" expiry="infinite" />
</api>

action=flagconfig

Shows information about review flag configuration.

The following parameters are returned for each tag:

  • name: 权限的名称
  • levels: the number of possible levels the flag has (not counting the "unreviewed" level)

The displayed name for each flag and the different level names for each flag are MediaWiki messages, so can be set and retrieved through the appropriate page; for example the name for the first level of the "accuracy" flag is located at MediaWiki:revreview-accuracy-1.

示例

Retrieve flag configuration

结果
<api>
  <flagconfig>
    <tag name="value" levels="3" tier1="1" />
  </flagconfig>
</api>

list=unreviewedpages

列出从未审核过的页面。

參數
  • urstart: 从这一页面标题开始列出。
  • urend: 从这一页面标题停止列出。
  • urnamespace: 要枚举的命名空间。
  • urfilterredir: 过滤重定向
  • urfilterlevel: 按质量过滤 (0=sighted,1=quality)
  • urlimit: 要返回的总页数
示例

List pages in the main namespace that have not been "sighted"

结果
<api>
  <query-continue>
    <unreviewedpages urstart="Arbeitgeberverband_Chemie_und_verwandte_Industrien_für_das_Land_Hessen" />
  </query-continue>
  <query>
    <unreviewedpages>
      <p pageid="4762806" ns="0" title="Aaftink" revid="65175047" />
      <p pageid="4747500" ns="0" title="Abt RS6" revid="64976429" />
      <p pageid="4749877" ns="0" title="Acht Vorlesungen über den Konstruktiven Realismus" revid="65089962" />
      <p pageid="4758156" ns="0" title="Alkylglycerole" revid="65169004" />
      <p pageid="4719044" ns="0" title="All Riot" revid="64767732" />
      <p pageid="4745418" ns="0" title="Allgäu-Panorama-Marathon" revid="64974783" />
      <p pageid="4729976" ns="0" title="An- und Einpressen" revid="64742640" />
      <p pageid="4742559" ns="0" title="Anjara I. Bartz" revid="64925772" />
      <p pageid="4740681" ns="0" title="Anthony Norris Groves" revid="65064712" />
      <p pageid="4759964" ns="0" title="Antonino Asta" revid="65169073" />
    </unreviewedpages>
  </query>
</api>

list=oldreviewedpages

Lists pages that have at some point been reviewed, but for which the most recent revision is not reviewed.

參數
  • orstart: 从此时间戳开始列出
  • orend: 从此时间戳停止列出
  • ordir: In which direction to list.
  • ornamespace: The namespaces to enumerate.
  • orfilterredir: 过滤重定向
  • orlimit: 要返回的总页数。
示例

列出主命名空间中最近未审阅的修订的页面

结果
<api>
  <query-continue>
    <oldreviewedpages orstart="2009-09-15T20:23:05Z" />
  </query-continue>
  <query>
    <oldreviewedpages>
      <p pageid="144735" ns="0" title="Two International Finance Centre" revid="64562654" stable_revid="62769201" pending_since="2009-09-15T16:16:33Z" flagged_level="0" flagged_level_text="stable" />
      <p pageid="1629949" ns="0" title="Porta San Sebastiano" revid="64791898" stable_revid="61610797" pending_since="2009-09-15T16:19:32Z" flagged_level="0" flagged_level_text="stable" />
      <p pageid="2157354" ns="0" title="Entwicklungspolitik der Europäischen Union" revid="64640078" stable_revid="59929751" pending_since="2009-09-15T16:38:33Z" flagged_level="0" flagged_level_text="stable" />
      <p pageid="971904" ns="0" title="Federpendel" revid="65142775" stable_revid="59587441" pending_since="2009-09-15T17:37:29Z" flagged_level="0" flagged_level_text="stable" />
      <p pageid="3106812" ns="0" title="Soultzbach-les-Bains" revid="64552516" stable_revid="60455707" pending_since="2009-09-15T19:04:07Z" flagged_level="0" flagged_level_text="stable" />
      <p pageid="1223029" ns="0" title="VfR Bürstadt" revid="65150048" stable_revid="62925935" pending_since="2009-09-15T19:35:30Z" flagged_level="0" flagged_level_text="stable" />
      <p pageid="829158" ns="0" title="GSP" revid="64553869" stable_revid="62913440" pending_since="2009-09-15T19:38:46Z" flagged_level="0" flagged_level_text="stable" />
      <p pageid="3453867" ns="0" title="Agios Dimitrios" revid="65103799" stable_revid="64544222" pending_since="2009-09-15T19:47:10Z" flagged_level="0" flagged_level_text="stable" />
      <p pageid="2583263" ns="0" title="Jörg Kudlich" revid="64554475" stable_revid="62429967" pending_since="2009-09-15T20:03:24Z" flagged_level="0" flagged_level_text="stable" />
      <p pageid="325478" ns="0" title="Liste deutscher Komponisten klassischer Musik" revid="65089571" stable_revid="63582610" pending_since="2009-09-15T20:21:55Z" flagged_level="0" flagged_level_text="stable" />
    </oldreviewedpages>
  </query>
</api>

prop=flagged

Use action=query&prop=flagged to get information about the flagging status of the given pages.

限制

  • 跨維基的嵌入引用不是穩定版本
  • 有條件地引用其他模板的元模板,可能會在審核者載入頁面和審核頁面之間的時間內,條件發生變化。 Therefore, there would be no pointers to the revision id for this different template to load from, making it blue linked. You will be notified if this happens during review.

解除安裝

  1. 移除在LocalSettings.php中包含的require_oncewfLoadExtension
  2. 刪除表格在的FlaggedRevs.sql
  3. 刪除欄位page_ext_reviewedpage_ext_qualitypage_ext_stablepage表的ext_namespace_reviewed索引(如果存在;只有舊版本的標記修訂使用他們)
  4. 在命令列執行maintenance/refreshLinks.php以清除穩定版本連結
  5. 如果你使用$wgFileCache,在命令列執行maintenance/rebuildFileCache.php 0 overwrite

測試平台

參見

外部連結

許可證

© GPL, Aaron Schulz, Joerg Baach, 2007