Extension talk:Lockdown/hiding pages

Other patches
Note, that similar things should be done in a few other files...

I've done it in: global $wgUser, $wgContLang; + if ( namespaceIsVisible( $result->namespace ) ) { $fromObj = Title::makeTitle( $result->namespace, $result->title ); ... + }  global $wgContLang; + if ( namespaceIsVisible( $result->namespace ) ) { $fname = 'DoubleRedirectsPage::formatResult'; ... + }
 * includes/SpecialBrokenRedirects.php -- in function formatResult (similar to Special:Listredirects patch):
 * includes/SpecialDoubleRedirects.php -- in function formatResult (similar to Special:Listredirects patch):

foreach ( $rows as $row ) +    if ( namespaceIsVisible( $row->page_namespace ) ) { $nt = Title::makeTitle( $row->page_namespace, $row->page_title ); ... +    }
 * includes/SpecialWhatlinkshere.php -- in function showIndirectLinks in loop (similar to Special:Prefixindex patch):

...  if( is_null( $skin ) ) $skin = $wgUser->getSkin; + if ( namespaceIsVisible( $row->page_namespace ) ) { $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); ... + }
 * includes/SpecialProtectedpages.php -- in function formatRow:

--zuo (85.222.69.4 03:21, 20 April 2008 (UTC))

Please update the scripts for Mediawiki 1.16. They are needed. Thank you very much for your help guys!

Special:LinkSearch

 * /includes/specials/LinkSearch.php
 * function formatResult:

function formatResult( $skin, $result ) { +              if ( namespaceIsVisible( $result->namespace ) ) {

$title = Title::makeTitle( $result->namespace, $result->title ); $url = $result->url; $pageLink = $skin->makeKnownLinkObj( $title ); $urlLink = $skin->makeExternalLink( $url, $url );

return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink ); +              }else{ +                      return ''; +              }	}
 * ⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

Special:Contributions

 * /includes/specials/Contributions.php

Special Page

 * function formatRow:

+              if ( namespaceIsVisible( $page->getNamespace ) ) { return $ret; +              }else{ +                      return ' '; +              }
 * ⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

RSS/Atom Feed Page

 * function feed:

if( $pager->getNumRows > 0 ) { while( $row = $pager->mResult->fetchObject ) { +                              $title = Title::MakeTitle( intval( $row->page_namespace ), $row->page_title ); +                              if(namespaceIsVisible( $title->getNamespace )){ $feed->outItem( $this->feedItem( $row ) ); +                             }			}		}
 * ⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

Special:DeletedContributions

 * /includes/specials/DeletedContributions.php
 * function formatRow:

+              if ( namespaceIsVisible( $page->getNamespace ) ) { return $ret; +              }else{ +                      return ' '; +              }
 * ⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

Special:Disambiguations

 * /includes/specials/Disambiguations.php
 * function formatResult

function formatResult( $skin, $result ) { global $wgContLang; $title = Title::newFromID( $result->value ); +              if ( namespaceIsVisible( $title->getNamespace ) ) {

$dp = Title::makeTitle( $result->namespace, $result->title );

$from = $skin->link( $title ); $edit = $skin->link( $title, "(".wfMsgHtml("qbedit").")", array, array( 'redirect' => 'no', 'action' => 'edit' ) ); $arr = $wgContLang->getArrow; $to  = $skin->link( $dp );

return "$from $edit $arr $to"; +              }else{ +                      return ' '; +              }	}

Special:CategoryTree

 * /extensions/CategoryTree/CategoryTreeFunctions.php
 * function renderNodeInfo

$ns = $title->getNamespace; +              if (!( namespaceIsVisible( $ns ) )) { +                      return ' '; +              }		$key = $title->getDBkey;
 * ⇨ Dr Brains ∞ Doléances ∞ 13:35, 20 November 2010 (UTC)

Special:Book

 * /extensions/Collection/Collection.body.php
 * static function addArticle

+              if (! namespaceIsVisible( $title->getNamespace) ) return false; $article = new Article( $title, $oldid ); $latest = $article->getLatest; ...
 * ⇨ Dr Brains ∞ Doléances ∞ 17:25, 20 November 2010 (UTC)

Special:Nuke

 * /extensions/Nuke/SpecialNuke_body.php
 * function listForm

foreach( $pages as $info ) { +                      if (namespaceIsVisible( $title->getNamespace) ){ list( $title, $edits ) = $info; $image = $title->getNamespace == NS_IMAGE ? wfLocalFile( $title ) : false; $thumb = $image && $image->exists ? $image->getThumbnail( 120, 120 ) : false;

$changes = wfMsgExt( 'nchanges', 'parsemag', $wgLang->formatNum( $edits ) ); $wgOut->addHTML( '' .					Xml::check( 'pages[]', true, array( 'value' => $title->getPrefixedDbKey ) ) .					' ' .					( $thumb ? $thumb->toHtml( array( 'desc-link' => true ) ) : '' ) .					$sk->makeKnownLinkObj( $title ) .					' ('. $sk->makeKnownLinkObj( $title, $changes, 'action=history' ). ")\n" ); +                     }		}
 * ⇨ Dr Brains ∞ Doléances ∞ 17:31, 20 November 2010 (UTC)

Status MW 1.23: most patches for hiding pages obsolete
Dear all

pls be aware that as of mw 1.23 all but following more recent patches are completely obsolete. Due to code changes the patches need to be updated to be useful again. Following proved to work:


 * patch for SpecialSearch.php
 * Lockdown.php
 * Language/Language.php
 * /extensions/CategoryTree/CategoryTreeFunctions.php

Pls update. Great thanks, wolf --Stoettner (talk) 21:12, 14 June 2016 (UTC)