扩展:按页面许可协议

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:PerPageLicense and the translation is 43% complete.

Other languages:
English • ‎español • ‎français • ‎magyar • ‎polski • ‎português do Brasil • ‎中文 • ‎日本語 • ‎한국어
MediaWiki扩展手册
OOjs UI icon advanced.svg
PerPageLicense
发布状态: 测试
实现 解析器扩展
描述 Enables licenses to be set on a per-namespace or per-page basis
作者 (Leucostictetalk)
最新版本 1.0.1 (2014-06-02)
兼容性方针 发行分支
数据庫更新
许可协议 GNU通用公眾授權條款3.0 or later
下载
例子 http://wiki.mises.org
  • $wgPerPageLicenseLicenses
  • $wgPerPageLicenseTemplatePage
  • $wgPerPageLicenseNamespaces
翻译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";
    
  • 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.