Manual:Guide to setting up interwiki linking

Please fix, this need to be made understandable Interwiki links is a more proper place to discuss interwiki links, and, was an example of an interwiki link!

Mediawiki uses certain namespaces as pointers to articles on different wiki's.

view interwiki table
type interwiki to see a list of interwiki related tables

mysql> interwiki interwiki           interwiki.iw_prefix interwiki.iw_local  interwiki.iw_url mysql> interwiki

http://dev.mysql.com/doc/mysql/en/Retrieving_data.html gives us:

SELECT interwiki.iw_prefix FROM interwiki; SELECT interwiki.iw_url FROM interwiki;

Will show you what you have...

SELECT * FROM interwiki; works a bit better...

add your own custom
you can follow the format of the next section to create your own interwiki links to add..

bugzilla-interwiki.sql REPLACE INTO interwiki (iw_prefix,iw_url,iw_local) VALUES ('kdebug','http://bugs.kde.org/show_bug.cgi?id=$1',1), ('mozbug','http://bugzilla.mozilla.org/show_bug.cgi?$1',1), ('gentoobug','http://bugs.gentoo.org/show_bug.cgi?$1',1);

mysql -u -p <  mysql -u wikiuser -p wikidb < bugzilla-interwiki.sql THIS DOES NOT REPORT SUCCESS... there is a bug in the mysql database program... there is no feedback.. I hate not knowing!

use wikipedia's interwiki list
the file: maintanance/wikipedia-interwiki.sql contains data like this: REPLACE INTO interwiki (iw_prefix,iw_url,iw_local) VALUES ('w','http://www.wikipedia.org/wiki/$1',1), ('m','http://meta.wikipedia.org/wiki/$1',1), ('meta','http://meta.wikipedia.org/wiki/$1',1), ('zu','http://zu.wikipedia.org/wiki/$1',1);

I assume the replace into works...

so, mysql> \. /var/www/localhost/mediawiki-1.3.0/maintenance/wikipedia-interwiki.sql Query OK, 155 rows affected (0.24 sec) Records: 155 Duplicates: 0  Warnings: 0

mysql> should have enabled the interwiki links that I wanted...

more mysql help
Mysql Help

Maintanance script
See maintanance scripts for how to use it.

maintenance/wikipedia-interwiki.sql

When upgrading from a 1.2 to 1.3, your interwiki table will be created. however, it will not be updated on further upgrades.

undocumented feature
'''Q: I'm puzzled about doing Interwiki links, the Interwiki.php is obsoleted... how do you set up interwiki links?'''

A: Before we can answer that, we must ask another question: do you need language links or just external interwiki links?

To set up new interwiki link prefixes, you stick them into the 'interwiki' table in the database (which is undocumented... the source code is the documentation). iw_prefix iw_url  	                iw_local fr 	  http://fr.yourdomain.tld/$1 	1
 * Sample sql in the maintenance dir. Basically:
 * maintenance/interwiki.sql defines the standard prefixes
 * maintenance/wikipedia-interwiki.sql has the wikipedia language prefixes
 * set the magic global on then, and mark the local prefixes as local in the db
 * $wgInterwikiMagic = true; # Treat language links as magic connectors, not inline links
 * default is true
 * The 'iw_local' field in the interwiki table is currently only used for the redirect feature. Inline or 'other langues' box is determined by whether the prefix is in the array of language codes/names defined in the language file ($wgLanguageNames).

Next page: Custom skins >

bugzilla links
bugzilla-interwiki.sql REPLACE INTO interwiki (iw_prefix,iw_url,iw_local) VALUES ('kdebug','http://bugs.kde.org/show_bug.cgi?id=$1',1), ('mozbug','http://bugzilla.mozilla.org/show_bug.cgi?$1',1), ('gentoobug','http://bugs.gentoo.org/show_bug.cgi?$1',1);

edit a template
actually works vi another template..

[ Edit ]

it could be made to work via an interwiki link!