扩展:按页面许可协议

From mediawiki.org
This page is a translated version of the page Extension:PerPageLicense and the translation is 38% 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
季度下載量 3 (Ranked 154th)
前往translatewiki.net翻譯PerPageLicense扩展

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

安裝

  • 下载文件,并将其放置在您extensions/文件夹中的PerPageLicense目录内。
    开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PerPageLicense
  • 将下列代码放置在您的LocalSettings.php 的底部:
    require_once "$IP/extensions/PerPageLicense/PerPageLicense.php";
    
  • Yes 完成 – 在您的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.