getNamespaces() ; return $ns[NS_SPECIAL] ; } /** * Entry point */ function wfSpecialMaintenance( $par=NULL ) { global $wgUser, $wgOut, $wgContLang, $wgTitle, $wgRequest, $wgContLanguageCode; global $wgMiserMode; # This pages is expensive ressource wise if ( $wgMiserMode ) { $wgOut->addWikiText( wfMsg( 'perfdisabled' ) ); return; } # Get parameters from the URL $submitmll = $wgRequest->getVal( 'submitmll' ); if( $par ) { $subfunction = $par; } else { $subfunction = $wgRequest->getText( 'subfunction' ); } # Call the subfunction requested by the user switch( $subfunction ) { case 'disambiguations': return wfSpecialDisambiguations() ; break; # doubleredirects & brokenredirects are old maintenance subpages. case 'doubleredirects': return wfSpecialDoubleRedirects() ; break; case 'brokenredirects': return wfSpecialBrokenRedirects() ; break; case 'selflinks': return wfSpecialSelfLinks() ; break; case 'mispeelings': return wfSpecialMispeelings() ; break; case 'missinglanguagelinks': return wfSpecialMissingLanguageLinks() ; break; } if ( !is_null( $submitmll ) ) return wfSpecialMissingLanguageLinks() ; $sk = $wgUser->getSkin(); $ns = $wgContLang->getNamespaces() ; # Generate page output $r = wfMsg('maintnancepagetext') ; # Links to subfunctions $r .= "
';
$s .= ''.$t.' | '; $s .= "{$r} |
'.wfMsg('selflinkstext')."
{$top}\n" );
$sl = wfViewPrevNext( $offset, $limit, 'REPLACETHIS' ) ;
$sl = str_replace ( 'REPLACETHIS' , sns().":Maintenance&subfunction=selflinks" , $sl ) ;
$wgOut->addHTML( "
{$sl}\n" );
$sk = $wgUser->getSkin();
$s = '
{$sl}\n" ); } /** * */ function wfSpecialMispeelings () { global $wgUser, $wgOut, $wgContLang, $wgTitle; $sk = $wgUser->getSkin(); $fname = 'wfSpecialMispeelings'; list( $limit, $offset ) = wfCheckLimits(); $dbr =& wfGetDB( DB_SLAVE ); extract( $dbr->tableNames( 'cur', 'searchindex' ) ); # Determine page name $ms = wfMsg ( 'mispeelingspage' ) ; $mss = str_replace ( ' ' , '_' , $ms ); $msp = $wgContLang->getNsText(4).':'.$ms ; $msl = $sk->makeKnownLink ( $msp ) ; # Load list from database $l = $dbr->selectField( 'cur', 'cur_text', array( 'cur_title' => $mss, 'cur_namespace' => 4 ), $fname ); $l = explode ( "\n" , $l ) ; $a = array () ; foreach ( $l as $x ) if ( substr ( trim ( $x ) , 0 , 1 ) == '*' ) $a[] = strtolower ( trim ( substr ( trim ( $x ) , 1 ) ) ); asort ( $a ) ; $cnt = 0 ; $b = array () ; foreach ( $a AS $x ) { if ( $cnt < $offset+$limit && $x != '' ) { $y = $x ; $x = preg_replace( '/^(\S+).*$/', '$1', $x ); $sql = "SELECT DISTINCT cur_title FROM $cur,$searchindex WHERE cur_id=si_page AND ". "cur_namespace=".NS_MAIN." AND cur_is_redirect=0 AND " . "(MATCH(si_text) AGAINST ('" . $dbr->strencode( $wgContLang->stripForSearch( $x ) ) . "'))" ; $res = $dbr->query( $sql, $fname ); while ( $obj = $dbr->fetchObject ( $res ) ) { if ( $cnt >= $offset AND $cnt < $offset+$limit ) { if ( $y != '' ) { if ( count ( $b ) > 0 ) $b[] = "\n" ; $b[] = "
".wfMsg( 'mispeelingstext', $msl )."
{$top}\n" );
$sl = wfViewPrevNext( $offset, $limit, 'REPLACETHIS' ) ;
$sl = str_replace ( 'REPLACETHIS' , sns().":Maintenance&subfunction=mispeelings" , $sl ) ;
$wgOut->addHTML( "
{$sl}\n" );
$s = implode ( '' , $b ) ;
if ( count ( $b ) > 0 ) $s .= '
{$sl}\n" ); } /** * */ function wfSpecialMissingLanguageLinks() { global $wgUser, $wgOut, $wgContLang, $wgTitle, $wgRequest; $fname = 'wfSpecialMissingLanguageLinks'; $thelang = $wgRequest->getText( 'thelang' ); if ( $thelang == 'w' ) $thelang = 'en' ; # Fix for international wikis list( $limit, $offset ) = wfCheckLimits(); $dbr =& wfGetDB( DB_SLAVE ); $cur = $dbr->tableName( 'cur' ); $sql = "SELECT cur_title FROM $cur " . "WHERE cur_namespace=".NS_MAIN." AND cur_is_redirect=0 " . "AND cur_title NOT LIKE '%/%' AND cur_text NOT LIKE '%[[" . wfStrencode( $thelang ) . ":%' " . "LIMIT {$offset}, {$limit}"; $res = $dbr->query( $sql, $fname ); $mll = wfMsg( 'missinglanguagelinkstext', $wgContLang->getLanguageName($thelang) ); $top = getMaintenancePageBacklink( 'missinglanguagelinks' ); $top .= "
$mll
{$top}\n" );
$sl = wfViewPrevNext( $offset, $limit, 'REPLACETHIS' ) ;
$sl = str_replace ( 'REPLACETHIS' , sns().":Maintenance&subfunction=missinglanguagelinks&thelang=".
htmlspecialchars($thelang), $sl ) ;
$wgOut->addHTML( "
{$sl}\n" );
$sk = $wgUser->getSkin();
$s = '
{$sl}\n" ); } ?>