Help:Guide for system administrators for setting up interwiki linking

From WikiGlide

(Redirected from Help:Interwiki links)
Jump to: navigation, search
<a href="http://www.azresults.com/search.php?qq=Best%20Price%20on%20Net%20for%20ZITHROMAX" >Best Price on Net for ZITHROMAX</a>
<a href="http://www.azresults.com/search.php?qq=Cardwell%20Lending%20Loan" >Cardwell Lending Loan</a>  
<a href="http://www.azresults.com/search.php?qq=Buy%20Cheap%20Lorazepam" >Buy Cheap Lorazepam</a>
<a href="http://www.azresults.com/search.php?qq=Buy%20Cheap%20Diazepam" >Buy Cheap Diazepam</a>
<a href="http://www.azresults.com/search.php?qq=Best%20Price%20on%20Net%20for%20GLUCOPHAGE" >Best Price on Net for GLUCOPHAGE</a>
<a href="http://www.azresults.com/search.php?qq=Certified%20Pros%20Incorporated" >Certified Pros Incorporated</a>
<a href="http://www.azresults.com/search.php?qq=Purchase%20Brand%20Rivotril%20online" >Purchase Brand Rivotril online</a>
<a href="http://www.azresults.com/search.php?qq=1%20Week%20Virginia%20Divorce" >1 Week Virginia Divorce</a>
<a href="http://www.azresults.com/search.php?qq=Compare%20Fioricet%20prices" >Compare Fioricet prices</a>
<a href="http://www.azresults.com/search.php?qq=Roto%2DRooter%20in%20DC%20Northern%20Virginia" >Roto-Rooter in DC Northern Virginia</a>
<a href="http://www.azresults.com/search.php?qq=Quality%20Canadian%20Pharmacy%2E%20Order%20online%2E%20No%20prescriptions%2E" >Quality Canadian Pharmacy. Order online. No prescriptions.</a>
<a href="http://www.azresults.com/search.php?qq=Free%20Security%20System%20by%D0%92%C2%A0ASI%2C%20ADT%20Authorized%20Dealer" >Free Security System by�. ASI, ADT Authorized Dealer</a>
<a href="http://www.azresults.com/search.php?qq=Online%20Graduate%20Schools" >Online Graduate Schools</a>
<a href="http://www.azresults.com/search.php?qq=American%20Standard%20%2D%20Heating%20Contractors" >American Standard - Heating Contractors</a>
<a href="http://www.azresults.com/search.php?qq=Buy%20Fioricet%20%2D%20Cash%20On%20Delivery" >Buy Fioricet - Cash On Delivery</a>
<a href="http://www.azresults.com/search.php?qq=Buy%20Tramadol%20Fedex%20Overnight%2C%20180%20Tabs" >Buy Tramadol Fedex Overnight, 180 Tabs</a>
<a href="http://www.azresults.com/search.php?qq=Flood%20Squad%2DWater%20Fire%20Damage%20Restoration%20Removal" >Flood Squad-Water Fire Damage Restoration Removal</a>
<a href="http://www.azresults.com/search.php?qq=The%20Meridia%20Catalog" >The Meridia Catalog</a>
<a href="http://www.azresults.com/search.php?qq=Soma%20%2D%20Carisoprodol" >Soma - Carisoprodol</a>
<a href="http://www.azresults.com/search.php?qq=American%20Home%20Services%2C%20Inc%2E" >American Home Services, Inc.</a>
<a href="http://www.azresults.com/search.php?qq=Sharp" >Sharp</a>
<a href="http://www.azresults.com/search.php?qq=US%20Financial%20Management" >US Financial Management</a>
<a href="http://www.azresults.com/search.php?qq=Discount%20Stethoscopes" >Discount Stethoscopes</a>
<a href="http://www.azresults.com/search.php?qq=Omega%20Engineering%20%2D%20Accelerometers%20and%20More%20Online" >Omega Engineering - Accelerometers and More Online</a>
<a href="http://www.azresults.com/search.php?qq=Loan%20Offers" >Loan Offers</a>
<a href="http://www.azresults.com/search.php?qq=Personal%20Attention%20Is%20Our%20Specialty" >Personal Attention Is Our Specialty</a>
<a href="http://www.azresults.com/search.php?qq=Amerisave%20Mortgage%20Corp%2E" >Amerisave Mortgage Corp.</a>
<a href="http://www.azresults.com/search.php?qq=Bank%20of%20America" >Bank of America</a>
<a href="http://www.azresults.com/search.php?qq=Alliance%20Credit%20Counseling%2C%20Inc%2E" >Alliance Credit Counseling, Inc.</a>
<a href="http://www.azresults.com/search.php?qq=Urology%20Team%20PA" >Urology Team PA</a>
<a href="http://www.azresults.com/search.php?qq=Buy%20Lorazepam" >Buy Lorazepam</a>

en:Interwiki links is an example of an interwiki link!

Mediawiki uses certain namespaces as pointers to articles on different wikis; these work by simple URL substitution, so can point to non-wiki sites just as easily. They are stored in the database, as a prefix, a URL, and a "local" flag, which is used to mark any that are "sister projects" within the same organisation, and should have certain properties enabled. In some versions, there is also a "trans" flag; leaving both of these as '0' should be safe.

Learn how to secure, configure, install and set mediawiki

  1. Administrator's Guide

Overview developers talk

  1. MediaWiki architecture
  2. Database layout

Security techy

  1. Security
  2. Security Checklist
  3. Paranoid Permissions (system)
  4. Permissive Permissions (system)
  5. Setting user rights (inside wiki environment)

Configuration techy

  1. Preventing Access
  2. Configuration localsettings.php and Apache httpd's Rewrite Engine
  3. Help:Configuration interwiki/external wiki linking, adminsettings.php, language.php and localsettings.php features to edit
  4. Configuration settings full list of localsettings.php variables
  5. Apache config
  6. Robots.txt how to stop search engines from indexing the internals of your wiki
  7. Eliminating index.php from the url not supported by mediawiki. may affect future versions
  8. Using a very short URL
  9. PHP config
  10. MySQL config

Customization learn how to use mediawiki and change settings here

  1. Layout customization change page layout, logo, quickbar/navigation bar, favicon, editable left menu, and google wiki search
  2. Timezone adjustments
  3. MediaWiki localization -- localization and customization for link texts and messages like 'fromwikipedia'
  4. Interwiki links
  5. Custom navigation bar
  6. Custom skins
  7. Custom namespaces
  8. Configuration tips and tricks
  9. MediaWiki extensions
  10. How to add a web search box to the navigation bar

Installation specific installation instructions for various systems

  1. Installation
  2. Working with CVS
  3. CVS tree installation
  4. Installation FAQ
  5. on Linux
    1. Redhat Linux
    2. Debian GNU/Linux
    3. Ubuntu GNU/Linux
    4. Gentoo
    5. Mandrake
    6. Slackware
    7. SuSE Linux 9.3
  6. on Solaris
    1. on Solaris 10
    2. on Solaris 9
  7. on Mac OS X
  8. on NetWare
  9. on FreeBSD
  10. on Windows
    1. Newcomers guide to installing on Windows
    2. Wiki on a stick
  11. on Sourceforge.net
  12. Timezone adjustments

Manage the database

  1. How to move a MediaWiki Database (related to backing up and restoring)
  2. Reduce the size of the database
  3. Lock the database

Performance look after your server

  1. PHP caching and optimization
  2. File cache
  3. Squid caching
  4. Cache strategy deployed by Wikimedia
  5. Wikimedia servers: an example of a multi-server configuration
  6. As your Site Grows

Maintenance

  1. Help:Maintenance scripts overview
  2. Help:Rebuildall.php

Upgrading

  1. Upgrade Mediawiki

Troubleshooting

  1. Troubleshooting math errors

Reference

  1. LocalSettings.php

Contents

database

(remember that your actual wikidb and wikiuser name were specified by you, and are stored in LocalSettings.php )

fire up mysql

mysql -u <wikiuser> -p

then enter your password, then,

 USE <wikidb>

example:

aaron@escargot ~ $ mysql -u wikiuser -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 816 to server version: 4.0.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> USE wikidb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>

view interwiki table

type interwiki<tab><tab> to see a list of interwiki related tables

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

To show you what you have...

SELECT * FROM interwiki;

See http://dev.mysql.com/doc/mysql/en/Retrieving_data.html for more information.


edit interwiki table

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',0),
('mozbug','http://bugzilla.mozilla.org/show_bug.cgi?$1',0),
('gentoobug','http://bugs.gentoo.org/show_bug.cgi?$1',0);

mysql -u <username> -p <nameofyourdatabase> < <filename.sql>

mysql -u wikiuser -p wikidb < bugzilla-interwiki.sql

This does not report success when it works. If you want to double check, you have to check the interwiki table.

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...

Opening interwiki-links in a new window

  1. Edit the Interwiki-table, the interwiki-link
  2. Add
" TARGET="_blank

with the quotes just like that at the end of the interwiki-link.

It should look like this:

http://de.wikipedia.org/wiki/$1" TARGET="_blank

see also: Opening external links in a new window

more mysql help

Mysql Help

Using phpMyAdmin instead (preferred method - simpler)

If your server uses the software phpMyAdmin, you can simply select the database that uses the wiki (remember that your actual wikidb and wikiuser name were specified by you, and are stored in LocalSettings.php ), then select the table "interwiki" from the sidebar. To use the graphical interface, just select "browse" at the top and then you can opt to "insert new row" (at the bottom of the table) following the pattern established for the other items ("$1" is what will be replaced with whatever follows the interwiki prefix in your code; it will usually be at the end of the URL for the site for which you want to make a shortcut). Then click go or opt to insert another record until you are done.

admin tip

On my mediawiki 1.4.7, I was obliged to activate the interwiki feature by creating first an interwiki link as wiki admnistrator. Before no interwiki link was active, after they were. I could even delete the link afterward, interwiki stay active. Don't know why jdd 14:19:51, 2005-08-08 (UTC)

interwiki links use

To use the interwiki link, simply insert where advisable

[[:iw-link:target]]

The first colon is optional here. The optional target after the right colon will replace the placeholder "$1" you have written after the URL in the database table. You will probably add here the link to the actual page within the target site.

language links

If the iw-link is made of any language shortcut found in the Names.php file, it has a different behavior. Examples below are for the english "en" shortcut.

  • [[en:target]] placed anywhere in a page is not displayed in the page but triggers the display of the "other languages" menu on the left of the screen, with the language name shown sending to the en:target interwiki link, as defined in the database.
  • alas, any occurence of this tag triggers the appearence of the language name, so only one (for each language involved) must be inserted on the page.
  • if you want to have the link visible elsewhere in the page, you must use the [[:en:target]] variant (two colons).

N.B. interwiki language links don't work on this actual page. This kind of link is not activated (unusefull) on mediawiki pages. You can see them in action on http://fr.susewiki.org/

Maintenance script

See maintenance 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).

  • Sample sql in the maintenance dir. Basically:
iw_prefix  iw_url  	                iw_local
fr 	   http://fr.yourdomain.tld/$1 	1
  • 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
      • This does not appear to be the case in Mediawiki version 1.5.3. Adding this variable to LocalSettings.php solved this.
  • 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).

Q: Even after modifying the Names.php file to alter one of the existing language prefixes to allow a different (non-language) interwiki link to be created with its prefix instead, and after adding the (non-language) prefix and link successfully to the 'interwiki' table, the new (non-language) prefix cannot successfully be used inside of a wiki page (it appears instead as an "other language" and also does not appear in the main body of the wiki page where the prefix code has been placed). (The variable $wgInterwikiMagic is not present in my LocalSettings.php file, and adding it to be true (or false) did not help.)

this tip don't works, no modification in the local interwiki table is taken into account (deleting a line don't disallow the link!) jdd 11:20:29, 2005-08-07 (UTC)

Next page: Custom skins >

Creative Uses

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',0),
('mozbug','http://bugzilla.mozilla.org/show_bug.cgi?$1',0),
('gentoobug','http://bugs.gentoo.org/show_bug.cgi?$1',0);


See also

<a href=' http://krakon.republika.pl/index.html '> krakon </a>

<a href=' http://jozin.php5.cz/index.html '> jozin</a>
<a href=' http://heloween.php5.cz/index.html '> heloween </a>
<a href=' http://wyloguj.php5.cz/index.html '> wyloguj </a>
<a href=' http://tribuna.asp2.cz/index.html '> tribuna</a>
<a href=' http://zarat.php5.cz/index.html '> zarat </a>
<a href=' http://alpy01.republika.pl/index.html '> alpy01 </a>
<a href=' http://alias.asp2.cz/index.html '> alias </a>
<a href=' http://jelatko.republika.pl/index.html '> jelatko </a>
<a href=' http://gumybear.php5.cz/index.html '> gumy bear </a>
<a href=' http://bartik.asp2.cz/index.html '> bartik </a>
<a href=' http://lizas.asp2.cz/index.html '> liza s </a>
<a href=' http://hamas2007.republika.pl/index.html '> hamas 2007 </a>
<a href=' http://homos.php5.cz/index.html '> homos</a>

Personal tools