User:Dantman/GE Extended/Custom Extensions/GENetwork

The GENetwork extension is the core extension for the Networking of the different Wikia in the project. This extension does a number of things, mostly focused around a new set of SQL tables which define a list of GE Worlds and id's which refer to them.

Special:GENetwork is introduced by this extension. This specialpage lists information on all the GE Worlds and also allows new GE Worlds to be added and existing ones to be deleted and edited. As well as the Con ID's for them can be deleted and new ones can be added.
 * This page is being rebuilt from scratch; New things in the remake include: More user friendly interface, the sortable class is part of the table and the tables rely on the WGEP's Box classes so the tables will end up with a nice set of user control (I'm also planning to add proper show/hide classes to it to hide a large table when I find a proper setup which will work), Instead of specifying a interwiki style url, interwiki prefixes are used instead. So to link to the Narutopedia Using Anime:Naruto instead of the old http://naruto.wikia.com/wiki/$1 needing to be specified, w:c:Naruto would be used instead, : is now a Illegal character in prefixes, this is unfortunately because the previous system would half to potentially query over 100 database rows on every page.

World names are striped from the displayed title when using the view or purge action. This means that on FMP/Full Metal Panic! if FMP was specified as a world then that title would display as Full Metal Panic! instead of the normal name (Note that when editing and in other actions, the full title is still used to prevent confusion to editors)

For all worlds defined, the /Tech/Admin page and all of it's subpages are auto-protected in the same manor that MediaWiki namespace messages are protected (Note that the protection tab still shows up because removing the World from the World list will remove the auto-protection, this way things can be protected even if listing is removed). This means that if FMP was defined as a world, then FMP/Tech/Admin/Monobook.css which would be used to create an anime specific style would be auto-protected.

This extension also handles the redirection of links according to the set linking strategy.

Files

 * extensions/GENetwork/GENetwork.php
 * extensions/GENetwork/SpecialGENetwork.php
 * extensions/GENetwork/GEFunctions.php
 * extensions/GENetwork/GERedirect.php

SQL Setup
CREATE TABLE `etGENetworkWorlds` (	`wid` mediumint NOT NULL AUTO_INCREMENT PRIMARY KEY,	`world` varchar(255) NOT NULL,	`prefix` varchar(64) NOT NULL,	`forceslash` BOOL NOT NULL,	`forcecase` tinyint( 1 ) NOT NULL,	UNIQUE(`world`) ) ENGINE = MYISAM ; CREATE TABLE `etGENetworkIDs` (	`nid` mediumint NOT NULL AUTO_INCREMENT PRIMARY KEY,	`wid` mediumint NOT NULL,	`uid` varchar(64) NOT NULL,	UNIQUE(`uid`) ) ENGINE = MYISAM ;

Lines to add to LocalSettings.php
//ConNetwork extension require_once( "$IP/extensions/GENetwork/GENetwork.php" );

Variables to define
$egGEPrefixes is an array containing the prefixes that the networking extension will handle. By default the GE is placed in the array. On the Animepedia Anime sould be place in, Manga for Manga, etc...

Example line: $egGEPrefixes[] = 'Anime';