扩展:按页面许可协议

This page is a translated version of the page Extension:PerPageLicense and the translation is 43% complete.
MediaWiki的扩展的手冊
PerPageLicense
發佈狀態: 不再維護
实现 解析器扩展
描述 Enables licenses to be set on a per-namespace or per-page basis
作者 (Leucosticte讨论)
最新版本 1.1.0 (2017-10-30)
兼容性政策 快照跟随MediaWiki发布。 master分支不向後兼容。
MediaWiki 1.23+
数据库更改
许可协议 GNU通用公眾授權條款3.0或更新版本
下載
示例 http://wiki.mises.org
  • $wgPerPageLicenseLicenses
  • $wgPerPageLicenseTemplatePage
  • $wgPerPageLicenseNamespaces
季度下載量 0
翻譯PerPageLicense的扩展,若在translatewiki.net可用

The PerPageLicense extension enables license footer variables (viz. $wgRightsIcon , $wgRightsUrl , and $wgRightsText ) to be set on a per-namespace or per-page basis.

下載

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

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

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

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

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

安裝

  • 下载文件,并将其放置在您extensions/文件夹中的PerPageLicense目录内。
  • 将下列代码放置在您的LocalSettings.php 的底部:
    require_once "$IP/extensions/PerPageLicense/PerPageLicense.php";
    
  •   完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。

配置

Change these settings to your liking, making sure that you include them in LocalSettings.php after the require_once line installing the extension.

// Page from which to obtain templates and associated licenses.
$wgPerPageLicenseTemplatePage = 'MediaWiki:License-templates';
// Array of licenses.
$wgPerPageLicenseLicenses = array (
        'cc-0' => array(
                'url' => 'http://creativecommons.org/publicdomain/zero/1.0/',
                'src' => "{$wgStylePath}/common/images/cc-by-sa.png",
                'alt' => 'Creative Commons 0',
        ),
        'cc-by-nc-sa' => array(
                'url' => 'http://creativecommons.org/licenses/by-nc/3.0/',
                'src' => "{$wgStylePath}/common/images/cc-by-nc-sa.png",
                'alt' => 'Creative Commons Attribution-NonCommercial 3.0 Unported',
        ),
        'cc-by' => array(
                'url' => 'http://creativecommons.org/licenses/by/3.0/',
                'src' => "{$wgStylePath}/common/images/cc-by.png",
                'alt' => 'Creative Commons Attribution 3.0 Unported',
        ),
        'cc-by-sa' => array(
                'url' => 'http://creativecommons.org/licenses/by-sa/3.0/',
                'src' => "{$wgStylePath}/common/images/cc-by-sa.png",
                'alt' => 'Creative Commons Attribution Share-Alike 3.0 Unported',
        ),
        'gnu-fdl' => array(
                'url' => 'http://www.gnu.org/copyleft/fdl.html',
                'src' => "{$wgStylePath}/common/images/gnu-fdl.png",
                'alt' => 'GNU Free Documentation License',
        ),
        'public-domain' => array(
                'url' => 'http://creativecommons.org/licenses/publicdomain/',
                'src' => "{$wgStylePath}/common/images/public-domain.png",
                'alt' => 'public domain'
        ),
);
// Array of namespaces and their licenses.
$wgPerPageLicenseNamespaces = array();

举个例子,你可以:

$wgPerPageLicenseNamespaces = array (
	0 => 'cc-0',
);

This would license everything in mainspace as Creative Commons Zero.

用法

Edit MediaWiki:License-templates on your wiki. Add templates and their associated licenses. Put each on a separate line. E.g.:

|Wikipedia text || cc-by-sa

Now any page with the {{Wikipedia text}} template will show the license footers for CC BY-SA. Note that in the event of a conflict between per-namespace and per-page licensing, the per-page licensing prevails.