扩展:ChangePersonal
此頁面已过时。 |
请扩充此页面。 |
此扩展在wiki页面上存储其源代码。 请注意此代码可能未审核,或被恶意修改。 其可能包含安全漏洞,不再兼容的过时界面等等。 注意: translatewiki.net 不提供此扩展的本地化更新。 |
此扩展目前不再活跃维护! 尽管它可能仍然工作,但任何错误报告或功能请求将很可能被忽略。 |
changepersonal 发布状态: 未维护 |
|
---|---|
实现 | 解析器扩展 |
描述 | 这允许更改个人链接 |
作者 | Thomas Lorentsen (matx讨论) |
最新版本 | 0.9 (2007-11-15) |
MediaWiki | 1.11 |
许可协议 | 未指定许可协议 |
下载 | 参见下方 |
这个扩展能做什么?
This is a quick extension to allow changes to personal_urls. I used this to modify the login link to point to the special page. Other personal_urls can be modifed quickly with this extension.
用法
Install and edit or append to the extension what you need to change
安装
要安装此扩展,将下列代码加入LocalSettings.php 即可:
require_once("$IP/extensions/changepersonal.php");
代码
<?
/*
* Change Personal for changing the personal urls
* @author Thomas Lorentsen
* @copyright © 2007 by Thomas Lorentsen
* @licence GNU General Public Licence 3.0 or later
*/
if( !defined( 'MEDIAWIKI' ) ) {
echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
die();
}
$wgExtensionCredits['parserhook'][] = array(
'name' => 'Change Personal',
'author' => 'Thomas Lorentsen',
'url' => 'https://www.mediawiki.org/wiki/Extension:ChangePersonal',
'description' => "Changes the personal urls such as the login link"
);
function changePersonal(&$personal_urls, &$wgTitle) {
# This points the login link at the top right to the special page
$personal_urls['login']['href'] = './Special:Userlogin?returnto=' . $wgTitle->mUrlform;
$personal_urls['anonlogin']['href'] = './Special:Userlogin?returnto=' . $wgTitle->mUrlform;
# Append to this as needed
return true;
}
$wgHooks['PersonalUrls'][] = 'changePersonal';
问题
When viewing special pages, this can cause the redirection to be wrong. It has been found that using a hardcoded url works.
A better solution is needed!