Extension:HideCategorizedOrphans/ja
From Linux Web Expert
<translate> This extension stores its source code on a wiki page.</translate> <translate> Please be aware that this code may be unreviewed or maliciously altered.</translate> <translate> They may contain security holes, outdated interfaces that are no longer compatible etc.</translate> <translate> Note:</translate> <translate> No [[<tvar name=localisation>Special:MyLanguage/Localisation#Translation resources</tvar>|localisation]] updates are provided for this extension by <tvar name=twn>translatewiki.net </tvar>.</translate> |
<translate> This extension is currently not actively maintained!</translate> <translate> Although it may still work, any bug reports or feature requests will more than likely be ignored.</translate> |
HideCategorizedOrphans リリースの状態: 保守されていない |
|
---|---|
実装 | 自分のウィキ |
説明 | Makes MediaWiki consider pages that belong to a category not be orphans |
作者 | Steven Orvis (Sorvistalk) |
最新バージョン | 0.2.0 (2014-06-09) |
MediaWiki | 1.23+ |
PHP | 5.3+ |
データベースの変更 | いいえ |
ライセンス | GNU 一般公衆利用許諾書 2.0 以降 |
ダウンロード | コードの節を参照してください |
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
The HideCategorizedOrphans extension makes MediaWiki consider pages that belong to a category not be orphans. This is useful if you want to link to a category off of a page, but the links to that individual page show up nowhere else.
インストール
- <translate> <tvar name=1>Copy the code into files</tvar> and place the file(s) in a directory called <tvar name=name>
HideCategorizedOrphans/ja
</tvar> in your <tvar name=ext>extensions/
</tvar> folder.</translate> - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
require_once "$IP/extensions/HideCategorizedOrphans/ja/HideCategorizedOrphans/ja.php";
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
コード
- HideCategorizedOrphans.php
<?php
/**
* HideCategoizedOrphans extension
*
* For more info see https://mediawiki.org/wiki/Extension:HideCategorizedOrphans
*
* @file
* @ingroup Extensions
* @author Steven Orvis, 2014
* @license GNU General Public Licence 2.0 or later
*/
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'HideCategorizedOrphans',
'author' => array(
'Steven Orvis',
),
'version' => '0.2.0',
'url' => 'https://www.mediawiki.org/wiki/Extension:HideCategorizedOrphans',
'descriptionmsg' => 'Hides orphaned pages that belong to a category',
);
/* Setup */
// Register files
$wgAutoloadClasses['HideCategorizedOrphansHooks'] = __DIR__ . '/HideCategorizedOrphans.hooks.php';
// Register hooks
$wgHooks['LonelyPagesQuery'][] = 'HideCategorizedOrphansHooks::onLonelyPagesQuery';
- HideCategorizedOrphans.hooks.php
<?php
/**
* Hooks for HideCategorizedOrphans extension
*
* @file
* @ingroup Extensions
*/
class HideCategorizedOrphansHooks {
/**
* Add condition to LonelyPagesQuery to hide pages in categories
*/
public static function onLonelyPagesQuery( &$tables, &$conds, &$joinConds) {
$joinConds['categorylinks'] = array(
'LEFT JOIN', array(
'cl_from = page_id'
)
);
$tables[] = 'categorylinks';
$conds[] = 'cl_from is null';
return true;
}
}
Categories:
- Pages with script errors
- Pages with broken file links
- Extensions which host their code in-wiki/ja
- Unmaintained extensions/ja
- Personalization extensions/ja
- Extensions with manual MediaWiki version
- GPL licensed extensions/ja
- LonelyPagesQuery extensions/ja
- All extensions/ja
- Extensions not in ExtensionJson
- Extensions not using extension registration