From c8263c1510d1e8cdfbe9ef4c50473a0dfd0644a8 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 25 Jul 2004 02:54:21 +0000 Subject: [PATCH] from REL1_3 --- maintenance/rebuildInterwiki.inc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/maintenance/rebuildInterwiki.inc b/maintenance/rebuildInterwiki.inc index 22c0f7fb4c..ba4ca3ec44 100644 --- a/maintenance/rebuildInterwiki.inc +++ b/maintenance/rebuildInterwiki.inc @@ -28,8 +28,8 @@ function getRebuildInterwikiSQL() { $sites = array( 'wiki' => new Site( 'wiki', 'w', 'wikipedia.org' ), 'wiktionary' => new Site( 'wiktionary', 'wikt', 'wiktionary.org' ), - 'wikiquote' => new Site( 'wikiquote', 'wikiquote', 'wikiquote.org' ), - 'wikibooks' => new Site( 'wikibooks', 'wikibooks', 'wikibooks.org' ) + 'wikiquote' => new Site( 'wikiquote', 'q', 'wikiquote.org' ), + 'wikibooks' => new Site( 'wikibooks', 'b', 'wikibooks.org' ) ); $langlist = array_map( "trim", file( "/home/wikipedia/common/langlist" ) ); $dblist = array_map( "trim", file( "/home/wikipedia/common/all.dblist" ) ); @@ -51,6 +51,7 @@ function getRebuildInterwikiSQL() { $languageAliases = array( 'zh-cn' => 'zh', 'zh-tw' => 'zh', + 'dk' => 'da', ); # Construct a list of reserved prefixes @@ -123,7 +124,7 @@ function getRebuildInterwikiSQL() { # Extra links foreach ( $extraLinks as $link ) { - $sql .= makeLink( $link, $first ); + $sql .= makeLink( $link, $first ); } $sql .= ";\n"; @@ -152,7 +153,12 @@ function getRebuildInterwikiSQL() { # Intermap links foreach ( $iwArray as $iwEntry ) { - $sql .= makeLink( $iwEntry, $first ); + # Suppress links with the same name as the site + if ( ( $suffix == 'wiki' && $iwEntry['iw_prefix'] != 'wikipedia' ) || + ( $suffix != 'wiki' && $suffix != $iwEntry['iw_prefix'] ) ) + { + $sql .= makeLink( $iwEntry, $first ); + } } # Lateral links -- 2.20.1