-function wfSpecialMispeelings ()
-{
- global $wgUser, $wgOut, $wgLang, $wgTitle;
- $sk = $wgUser->getSkin();
- $fname = "wfSpecialMispeelings";
-
- list( $limit, $offset ) = wfCheckLimits();
-
- # Determine page name
- $ms = wfMsg ( "mispeelingspage" ) ;
- $mss = wfStrencode( str_replace ( " " , "_" , $ms ) );
- $msp = $wgLang->getNsText(4).":".$ms ;
- $msl = $sk->makeKnownLink ( $msp ) ;
-
- # Load list from database
- $sql = "SELECT cur_text FROM cur WHERE cur_title='{$mss}' AND cur_namespace=4" ;
- $res = wfQuery( $sql, DB_READ, $fname );
- $obj = wfFetchObject ( $res ) ;
- $l = $obj->cur_text ;
- $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 WHERE cur_namespace=0 AND cur_is_redirect=0 AND (MATCH(cur_ind_text) AGAINST ('" . wfStrencode( $wgLang->stripForSearch( $x ) ) . "'))" ;
- $sql = "SELECT DISTINCT cur_title FROM cur,searchindex WHERE cur_id=si_page AND cur_namespace=0 AND cur_is_redirect=0 AND (MATCH(si_text) AGAINST ('" . wfStrencode( $wgLang->stripForSearch( $x ) ) . "'))" ;
- $res = wfQuery( $sql, DB_READ, $fname );
- while ( $obj = wfFetchObject ( $res ) ) {
- if ( $cnt >= $offset AND $cnt < $offset+$limit ) {
- if ( $y != "" ) {
- if ( count ( $b ) > 0 ) $b[] = "</OL>\n" ;
- $b[] = "<H3>{$y}</H3>\n<OL start=".($cnt+1).">\n" ;
- $y = "" ;
- }
- $b[] = "<li>".
- $sk->makeKnownLink ( $obj->cur_title ).
- " (".
- $sk->makeBrokenLink ( $obj->cur_title , wfMsg ( "qbedit" ) ).
- ")</li>\n" ;
- }
- $cnt++ ;
- }
- }
- }
- $top = getMaintenancePageBacklink( "mispeelings" );
- $top .= "<p>".wfMsg( "mispeelingstext", $msl )."</p><br>\n";
- $top .= wfShowingResults( $offset, $limit );
- $wgOut->addHTML( "<p>{$top}\n" );
-
- $sl = wfViewPrevNext( $offset, $limit, "REPLACETHIS" ) ;
- $sl = str_replace ( "REPLACETHIS" , sns().":Maintenance&subfunction=mispeelings" , $sl ) ;
- $wgOut->addHTML( "<br>{$sl}\n" );
-
- $s = implode ( "" , $b ) ;
- if ( count ( $b ) > 0 ) $s .= "</ol>";
- $wgOut->addHTML( $s );
- $wgOut->addHTML( "<p>{$sl}\n" );
-}
-
-
-function wfSpecialMissingLanguageLinks()
-{
- global $wgUser, $wgOut, $wgLang, $wgTitle, $wgRequest;