扩展:按页面许可协议
此扩展目前不再活跃维护! 尽管它可能仍然工作,但任何错误报告或功能请求将很可能被忽略。 如果您对承担开发与维护该扩展的任务工作感兴趣,您可以请求自己的存储库。 As a courtesy, you may want to contact the author. 或者您应移除该模板,并在页面的{{Extension/zh }}信息框中将您自己列为扩展的维护人员。 |
A request to archive this extension has been made on Phabricator. See 工單T346010 for the archival request and the rationale for the request, and to leave comments about the request. |
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 |
|
|
季度下載量 | 2 (Ranked 138th) |
前往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";
- 完成 – 在您的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.