User:Dantman/GE Extended/Custom Extensions/GENetwork/SpecialGENetwork.php

<?php

/** * The SpecialPage extension "Special:ConNetwork" task's are: * - Management of Con Items * * @author Daniel Friesen (http://www.wikia.com/wiki/User:Dantman) (dan_the_man@telus.net) * @license http://www.gnu.org/copyleft/gpl.html GNU General Public Licence 2.0 or later */

if( !defined( 'MEDIAWIKI' ) ) die( "This is an extension to the MediaWiki package and cannot be run standalone." );

require_once( 'SpecialPage.php' );

$wgExtensionFunctions[] = 'efConNetwork'; $wgExtensionCredits['specialpage'][] = array(			'name' => 'Con Network',			'author' => 'Daniel Friesen(aka: Dantman)',			'url' => 'http://www.wikia.com/wiki/User:Dantman/WAP_Extended/Custom_Extensions/ConNetwork'	); $wgHooks['LogPageValidTypes'][] = 'efConAddLogType'; $wgHooks['LogPageLogName'][] = 'efConAddLogName'; $wgHooks['LogPageLogHeader'][] = 'efConAddLogHeader'; $wgHooks['LogPageActionText'][] = 'efConAddActionText'; function efConNetwork { global $wgOut, $wgParser, $wgMessageCache; SpecialPage::addPage( new ConNetwork ); $wgMessageCache->addMessages(		array( 'connetwork' => "Con Network", 'connetwork_list' => "Con World List", 'connetwork_world' => "Con World", 'connetwork_world_info' => "World Info", 'connetwork_world_uid' => "World ID's", 'connetwork_error' => "Error", 'connetwork_error_unknown' => "An unknown error ocurred.", 'connetwork_error_blank' => "The '$1' parameter was left blank, please fill it in.", 'connetwork_error_couldnotfind' => "Could not find the $1.", 'connetwork_error_unknownaction' => "Unknown action '$1' specified.", 'connetwork_error_nonexistant' => "The $1 '$2' does not exist.", 'connetwork_error_nonexistant_with' => "The $1 with the $2 '$3' does not exist.", 'connetwork_error_exists' => "The $1 '$2' already exists.", 'connetwork_error_existsas' => "The $1 '$2' already exists as part of '$3'.", 'connetwork_error_startswith' => "The $1 '$2' starts with the $3 '$4', This cannot be allowed because $5.", 'connetwork_error_endswith' => "The $1 '$2' ends with the $3 '$4', This cannot be allowed because $5.", 'connetwork_error_contains' => "The $1 '$2' contains the $3 '$4', This cannot be allowed because $5.", 'connetwork_error_matches' => "The $1 '$2' matches the $3 '$4', This cannot be allowed because $5.", 'connetwork_result' => "Result", 'connetwork_result_changed' => "$1 for '$2' changed from '$3' to '$4'", 'connetwork_fail' => ' The action failed. ',			'connetwork_sucess' => ' The action was a success. ',			'connetwork_new' => "New", 'connetwork_new_label' => "New Con World", 'connetwork_new_button' => "Add", 'connetwork_edit button' => "Update", 'connetwork_delete' => "(Delete)", 'connetwork_delete_label' => "Delete Con World", 'connetwork_delete_msg_world' => "You are about to delete the '$1' and all of it's id's '$2'. Are you sure you wish to do this?", 'connetwork_delete_msg_uid' => "You are about to delete the '$1' from the  '$2'. Are you sure you wish to do this?", 'connetwork_delete_yes' => "Ok", 'connetwork_delete_no' => "Cancel", 'connetwork_label_nid' => "nid", 'connetwork_label_wid' => "wid", 'connetwork_label_uid' => "World ID", 'connetwork_label_world' => "World", 'connetwork_label_prefix' => "Interwiki Prefix", 'connetwork_label_forceslash' => "Force Slash", 'connetwork_label_forceslash_off' => "Off", 'connetwork_label_forceslash_on' => "On", 'connetwork_label_forcecase' => "Force Case", 'connetwork_label_forcecase_none' => "None", 'connetwork_label_forcecase_upper' => "Upper", 'connetwork_label_forcecase_lower' => "Lower", 'connetwork_logpagename' => "Con Network table log", 'connetwork_logpagetext' => "This is a log of changes to the Con Network table.", 'connetwork_logentry' => "", 'connetwork_log_added_world' => "Created the '$1' with the  '$2',  set to '$3', and  set to '$4'.", 'connetwork_log_deleted_world' => "Deleted the '$1' and all of it's id's '$2'.", 'connetwork_log_changed' => "Changed the $1 for '$2' from '$3' to '$4'.", 'connetwork_log_added_uid' => "Added the '$1' for the  '$2'.", 'connetwork_log_deleted_uid' => "Deleted the '$1' from the  '$2'." )	); }
 * 1) Add a new log type

function efConAddLogType( &$types ) { if ( !in_array( 'connetwork', $types ) ) $types[] = 'connetwork'; return true; }

function efConAddLogName( &$names ) { $names['connetwork'] = 'connetwork_logpagename'; return true; }

function efConAddLogHeader( &$headers ) { $headers['connetwork'] = 'connetwork_logpagetext'; return true; }

function efConAddActionText( &$actions ) { $actions['connetwork/connetwork'] = 'connetwork_logentry'; return true; }

class ConNetwork extends SpecialPage { var $canEdit; /**	 * Constructor: ConNetwork */	function ConNetwork { SpecialPage::SpecialPage( 'ConNetwork', '', true, false, 'default', false ); }	/**	 * Function: execute * - Main execution function *	 * @param $par */	function execute( $par ) { global $wgOut, $wgServer, $wgScript, $wgTitle, $wgUser, $wgVersion, $wgRequest, $wgArticlePath, $wgGroupPermissions, $action; global $egConPrefixes; $this->setHeaders; $selfTitle = Title::makeTitle( NS_SPECIAL, 'ConNetwork' ); #If user is blocked. if( $wgUser->isBlocked ) { $wgOut->blockedPage( false ); return false; }		#If user can view list. if( !$wgUser->isAllowed( 'viewconnetwork' ) ) { $wgOut->permissionRequired( "viewconnetwork" ); return false; }		#If user can edit list. $this->canEdit = $wgUser->isAllowed( 'editconnetwork' ); # If Page is readonly if ( wfReadOnly ) { $wgOut->readOnlyPage; return; }		//Get Used Variables $wid = $wgRequest->getInt( 'wid', 0 ); $nid = $wgRequest->getInt( 'nid', 0 ); if( $wgRequest->wasPosted ) { if( $this->canEdit ) { if( $action == 'world_new' ) { $result = array; $fail = false; $world     = trim( $wgRequest->getText('world'), "	 _\n" ); $world     = str_replace( '_', ' ', $world ); $prefix    = trim( $wgRequest->getText('prefix'), "	 _\n" ); $prefix    = str_replace( '_', ' ', $prefix ); $forceslash = $wgRequest->getBool( 'forceslash', false ); $forcecase = $wgRequest->getInt( 'forcecase', 0 ); if( empty( $world ) ) { $result[] = wfMsg( 'connetwork_error_blank', wfMsg('connetwork_label_world') ); $fail = true; }					$dbr =& wfGetDB( DB_SLAVE ); $ConRes = $dbr->select( 'etConNetworkWorlds',						array( 'wid', 'world', 'prefix', 'forceslash', 'forcecase' ),						array( 'world' => $world ),						null,						array( "LIMIT" => 1 ) ); if( $dbr->numRows( $ConRes ) > 0 ) { $result[] = wfMsg( 'connetwork_error_exists', wfMsg('connetwork_label_world'), $world ); $fail = true; }					foreach( $egConPrefixes as $conPrefix ) { if( preg_match( "/^{$conPrefix}(:|$)/i", $prefix ) ) { $result[] = wfMsg( 'connetwork_error_startswith',								wfMsg( 'connetwork_label_prefix' ), $prefix,								'Con Prefix', $conPrefix,								'it would cause an infinite loop of links' ); $fail = true; }					}					if( !$fail ) { $dbw =& wfGetDB( DB_MASTER ); $ConRes = $dbw->insert( 'etConNetworkWorlds',							array( 'wid' => "DEFAULT", 'world' => $world, 'prefix' => $prefix, 'forceslash' => $forceslash, 'forcecase' => $forcecase ) );						if( $ConRes ) { $result[] = wfMsg('connetwork_sucess'); $log = new LogPage( 'connetwork' ); $log->addEntry( 'connetwork', $selfTitle, wfMsgForContent( 'connetwork_log_added_world', $world, $prefix, wfMsg('connetwork_label_forceslash_'.($forceslash?'on':'off')), wfMsg('connetwork_label_forcecase_'.($forcecase==2?'lower':($forcecase==1?'upper':'none'))) ) ); $dbr =& wfGetDB( DB_SLAVE ); $ConRes = $dbr->select( 'etConNetworkWorlds',								array( 'wid' ),								array( 'world' => $world ),								null,								array( "LIMIT" => 1 ) ); if( $row = $dbr->fetchObject( $ConRes ) ) { $wid = $row->wid; } else $result[] = wfMsg('connetwork_error_couldnotfind', wfMsg('connetwork_label_wid') ); } else { $result[] = wfMsg('connetwork_error_unknown'); $fail = true; }					}					if( $fail ) $result[] = wfMsg('connetwork_fail'); if( count( $result ) > 0 ) { $wgOut->addHTML( ' '.wfMsg('connetwork_result').' ' ); $wgOut->addHTML( implode( ' ', $result ) ); $wgOut->addHTML( ' ' ); }				} else if( $action == 'world_edit' ) { $result = array; $fail = false; $old       = null; $world     = trim( $wgRequest->getText('world'), "	 _\n" ); $world     = str_replace( '_', ' ', $world ); $prefix    = trim( $wgRequest->getText('prefix'), "	 _\n" ); $prefix    = str_replace( '_', ' ', $prefix ); $forceslash = $wgRequest->getBool( 'forceslash', false ); $forcecase = $wgRequest->getInt( 'forcecase', 0 ); if( empty( $world ) ) { $result[] = wfMsg( 'connetwork_error_blank', wfMsg('connetwork_label_world') ); $fail = true; }					$dbr =& wfGetDB( DB_SLAVE ); $ConRes = $dbr->select( 'etConNetworkWorlds',						array( 'wid', 'world', 'prefix', 'forceslash', 'forcecase' ),						array( 'wid' => $wid ),						null,						array( "LIMIT" => 1 ) ); if( $row = $dbr->fetchObject( $ConRes ) ) { $old = $row; } else { $result[] = wfMsg( 'connetwork_error_nonexistant_with',							wfMsg('connetwork_label_world'),							wfMsg('connetwork_label_wid'),							$wid ); $fail = true; }					foreach( $egConPrefixes as $conPrefix ) { if( preg_match( "/^{$conPrefix}(:|$)/i", $prefix ) ) { $result[] = wfMsg( 'connetwork_error_startswith',								wfMsg( 'connetwork_label_prefix' ), $prefix,								'Con Prefix', $conPrefix,								'it would cause an infinite loop of links' ); $fail = true; }					}					if( !$fail ) { $dbw =& wfGetDB( DB_MASTER ); $log = new LogPage( 'connetwork' ); if( $old->world != $world ) { $res = $dbw->set( 'etConNetworkWorlds',								'world', $world,								$dbw->makeList( array( 'wid' => $wid ), LIST_AND ) ); if( $res ) { $result[] = wfMsg('connetwork_result_changed',									wfMsg('connetwork_label_world'),									$old->world,									$old->world,									$world ); $log->addEntry( 'connetwork', $selfTitle, wfMsgForContent( 'connetwork_log_changed', wfMsg('connetwork_label_world'), $old->world, $old->world, $world ) ); } else { $result[] = wfMsg('connetwork_error_unknown'); $fail = true; }						}						if( $old->prefix != $prefix ) { $res = $dbw->set( 'etConNetworkWorlds',								'prefix', $prefix,								$dbw->makeList( array( 'wid' => $wid ), LIST_AND ) ); if( $res ) { $result[] = wfMsg('connetwork_result_changed',									wfMsg('connetwork_label_prefix'),									$old->world,									$old->prefix,									$prefix ); $log->addEntry( 'connetwork', $selfTitle, wfMsgForContent( 'connetwork_log_changed', wfMsg('connetwork_label_prefix'), $old->world, $old->prefix, $prefix ) ); } else { $result[] = wfMsg('connetwork_error_unknown'); $fail = true; }						}						if( $old->forceslash != $forceslash ) { $res = $dbw->set( 'etConNetworkWorlds',								'forceslash', $forceslash,								$dbw->makeList( array( 'wid' => $wid ), LIST_AND ) ); if( $res ) { $result[] = wfMsg('connetwork_result_changed',									wfMsg('connetwork_label_forceslash'),									$old->world,									wfMsg('connetwork_label_forceslash_'.($old->forceslash?'on':'off')),									wfMsg('connetwork_label_forceslash_'.($forceslash?'on':'off')) ); $log->addEntry( 'connetwork', $selfTitle, wfMsgForContent( 'connetwork_log_changed', wfMsg('connetwork_label_forceslash'), $old->world, wfMsg('connetwork_label_forceslash_'.($old->forceslash?'on':'off')), wfMsg('connetwork_label_forceslash_'.($forceslash?'on':'off')) ) ); } else { $result[] = wfMsg('connetwork_error_unknown'); $fail = true; }						}						if( $old->forcecase != $forcecase ) { $res = $dbw->set( 'etConNetworkWorlds',								'forcecase', $forcecase,								$dbw->makeList( array( 'wid' => $wid ), LIST_AND ) ); if( $res ) { $result[] = wfMsg('connetwork_result_changed',									wfMsg('connetwork_label_forcecase'),									$old->world,									wfMsg('connetwork_label_forcecase_'.($old->forcecase==2?'lower':($old->forcecase==1?'upper':'none'))),									wfMsg('connetwork_label_forcecase_'.($forcecase==2?'lower':($forcecase==1?'upper':'none'))) ); $log->addEntry( 'connetwork', $selfTitle, wfMsgForContent( 'connetwork_log_changed', wfMsg('connetwork_label_forcecase'), $old->world, wfMsg('connetwork_label_forcecase_'.($old->forcecase==2?'lower':($old->forcecase==1?'upper':'none'))), wfMsg('connetwork_label_forcecase_'.($forcecase==2?'lower':($forcecase==1?'upper':'none'))) ) ); } else { $result[] = wfMsg('connetwork_error_unknown'); $fail = true; }						}					}					if( $fail ) $result[] = wfMsg('connetwork_fail'); else $result[] = wfMsg('connetwork_sucess'); if( count( $result ) > 0 ) { $wgOut->addHTML( ' '.wfMsg('connetwork_result').' ' ); $wgOut->addHTML( implode( ' ', $result ) ); $wgOut->addHTML( ' ' ); }				} else if( $action == 'world_delete' ) { if( $wgRequest->getBool( 'yes', false ) ) { $result = array; $fail = false; $dbr =& wfGetDB( DB_SLAVE ); $ConRes = $dbr->select( 'etConNetworkWorlds',							array( 'wid', 'world', 'prefix', 'forceslash', 'forcecase' ),							array( 'wid' => $wid ) ); $uids = array; $UidRes = $dbr->select( 'etConNetworkIds',							array( 'nid', 'wid', 'uid' ),							array( 'wid' => $wid ) ); while( $id = $dbr->fetchObject( $UidRes ) ) $uids[] = $id->uid; if( $row = $dbr->fetchObject( $ConRes ) ) { $dbw =& wfGetDB( DB_MASTER ); $DelWorldRes = $dbw->delete( 'etConNetworkWorlds',								array( 'wid' => $row->wid ) ); $DelUidsRes = $dbw->delete( 'etConNetworkIds',								array( 'wid' => $row->wid ) ); if( $DelWorldRes && $DelUidsRes ) { $result[] = wfMsg('connetwork_sucess'); $log = new LogPage( 'connetwork' ); $log->addEntry( 'connetwork', $selfTitle, wfMsgForContent( 'connetwork_log_deleted_world', $row->world,implode( ', ', $uids ) ) ); $wid = 0; } else { $result[] = wfMsg('connetwork_error_unknown'); $fail = true; }							if( $fail ) $result[] = wfMsg('connetwork_fail'); if( count( $result ) > 0 ) { $wgOut->addHTML( ' '.wfMsg('connetwork_result').' ' ); $wgOut->addHTML( implode( ' ', $result ) ); $wgOut->addHTML( ' ' ); }						} else { $wgOut->addHTML( ' '.wfMsg('connetwork_error').' ' ); $wgOut->addHTML( wfMsg( 'connetwork_error_nonexistant_with', wfMsg('connetwork_label_world'), wfMsg('connetwork_label_wid'), $wid ) ); $wgOut->addHTML( ' ' ); }					}				} else if( $action == 'uid_new' ) { $result = array; $fail = false; $dbr =& wfGetDB( DB_SLAVE ); $ConRes = $dbr->select( 'etConNetworkWorlds',						array( 'wid', 'world', 'prefix', 'forceslash', 'forcecase' ),						array( 'wid' => $wid ) ); if( $row = $dbr->fetchObject( $ConRes ) ) { $uid = trim( $wgRequest->getText('uid'), "	 _\n" ); $uid = str_replace( '_', ' ', $uid ); if( empty( $uid ) ) { $result[] = wfMsg( 'connetwork_error_blank', wfMsg('connetwork_label_uid') ); $fail = true; }						$ConRes = $dbr->select( 'etConNetworkIds',							array( 'nid', 'wid', 'uid' ),							array( 'uid' => $nid ),							null,							array( "LIMIT" => 1 ) ); if( $row = $dbr->fetchObject( $ConRes ) ) { $ConRes = $dbr->select( 'etConNetworkWorlds',								array( 'wid', 'world' ),								array( 'wid' => $row->wid ) ); if( $row = $dbr->fetchObject( $ConRes ) ) $result[] = wfMsg( 'connetwork_error_existsas', wfMsg('connetwork_label_uid'), $uid, $row->world ); else $result[] = wfMsg( 'connetwork_error_exists', wfMsg('connetwork_label_uid'), $uid ); $fail = true; }						if( !$fail ) { $dbw =& wfGetDB( DB_MASTER ); $ConRes = $dbw->insert( 'etConNetworkIds',								array( 'nid' => "DEFAULT", 'wid' => $wid, 'uid' => $uid ) );							if( $ConRes ) { $result[] = wfMsg('connetwork_sucess'); $log = new LogPage( 'connetwork' ); $ConRes = $dbr->select( 'etConNetworkWorlds',									array( 'wid', 'world' ),									array( 'wid' => $wid ) ); $wrow = $dbr->fetchObject( $ConRes ); $log->addEntry( 'connetwork', $selfTitle, wfMsgForContent( 'connetwork_log_added_uid', $uid, $wrow->world ) ); } else { $result[] = wfMsg('connetwork_error_unknown'); $fail = true; }						}						if( $fail ) $result[] = wfMsg('connetwork_fail'); if( count( $result ) > 0 ) { $wgOut->addHTML( ' '.wfMsg('connetwork_result').' ' ); $wgOut->addHTML( implode( ' ', $result ) ); $wgOut->addHTML( ' ' ); }					} else { $wgOut->addHTML( ' '.wfMsg('connetwork_error').' ' ); $wgOut->addHTML( wfMsg( 'connetwork_error_nonexistant_with', wfMsg('connetwork_label_world'), wfMsg('connetwork_label_wid'), $wid ) ); $wgOut->addHTML( ' ' ); }				} else if( $action == 'uid_delete' ) { if( $wgRequest->getBool( 'yes', false ) ) { $result = array; $fail = false; $dbr =& wfGetDB( DB_SLAVE ); $ConRes = $dbr->select( 'etConNetworkIds',							array( 'nid', 'wid', 'uid' ),							array( 'nid' => $nid ) ); if( $row = $dbr->fetchObject( $ConRes ) ) { $dbw =& wfGetDB( DB_MASTER ); $ConRes = $dbw->delete( 'etConNetworkIds',								array( 'nid' => $row->nid ) ); if( ConRes ) { $result[] = wfMsg('connetwork_sucess'); $ConRes = $dbr->select( 'etConNetworkWorlds',									array( 'wid', 'world' ),									array( 'wid' => $row->wid ) ); $wrow = $dbr->fetchObject( $ConRes ); $log = new LogPage( 'connetwork' ); $log->addEntry( 'connetwork', $selfTitle, wfMsgForContent( 'connetwork_log_deleted_uid', $row->uid, $wrow->world ) ); } else { $result[] = wfMsg('connetwork_error_unknown'); $fail = true; }							if( $fail ) $result[] = wfMsg('connetwork_fail'); if( count( $result ) > 0 ) { $wgOut->addHTML( ' '.wfMsg('connetwork_result').' ' ); $wgOut->addHTML( implode( ' ', $result ) ); $wgOut->addHTML( ' ' ); }						} else { $wgOut->addHTML( ' '.wfMsg('connetwork_error').' ' ); $wgOut->addHTML( wfMsg('connetwork_error_nonexistant_with', wfMsg('connetwork_label_uid'), wfMsg('connetwork_label_nid'), $nid) ); $wgOut->addHTML( ' ' ); }					}				} else { $wgOut->addHTML( ' '.wfMsg('connetwork_error').' ' ); $wgOut->addHTML( wfMsg('connetwork_error_unknownaction',$action) ); $wgOut->addHTML( ' ' ); }			} else { $wgOut->addHTML( ' '.wfMsg('connetwork_error').' ' ); $wgOut->permissionRequired( "editconnetwork" ); $wgOut->addHTML( ' ' ); }		}		$wgOut->addHTML( ' '.wfMsg('connetwork_list').' ' ); $wgOut->addHTML( ' ' ); if( $wid ) { if( $action == 'world_delete' && !$wgRequest->wasPosted ) { $wgOut->addHTML( ' '.wfMsg('connetwork_delete_label').' ' ); $dbr =& wfGetDB( DB_SLAVE ); $ConRes = $dbr->select( 'etConNetworkWorlds',					array( 'wid', 'world', 'prefix', 'forceslash', 'forcecase' ),					array( 'wid' => $wid ),					null,					array( "LIMIT" => 1 ) ); $row = $dbr->fetchObject( $ConRes ); $uids = array; $UidRes = $dbr->select( 'etConNetworkIds',					array( 'nid', 'wid', 'uid' ),					array( 'wid' => $row->wid ) ); while( $id = $dbr->fetchObject( $UidRes ) ) $uids[] = $id->uid; $wgOut->addHTML( '' ); $wgOut->addHTML( '' ); $wgOut->addHTML( 'wid.'" />' ); $wgOut->addHTML( ' '.wfMsg('connetwork_delete_msg_world',$row->world,implode( ', ', $uids )).' ' ); $wgOut->addHTML( '' ); $wgOut->addHTML( '' ); $wgOut->addHTML( ' ' ); $wgOut->addHTML( ' ' ); } else if( $action == 'uid_delete' && !$wgRequest->wasPosted ) { $wgOut->addHTML( ' '.wfMsg('connetwork_delete_label').' ' ); $dbr =& wfGetDB( DB_SLAVE ); $ConRes = $dbr->select( 'etConNetworkIds',					array( 'nid', 'wid', 'uid' ),					array( 'nid' => $nid ),					null,					array( "LIMIT" => 1 ) ); $id = $dbr->fetchObject( $ConRes ); $ConRes = $dbr->select( 'etConNetworkWorlds',					array( 'wid', 'world' ),					array( 'wid' => $id->wid ),					null,					array( "LIMIT" => 1 ) ); $world = $dbr->fetchObject( $ConRes ); $wgOut->addHTML( '' ); $wgOut->addHTML( '' ); $wgOut->addHTML( '' ); $wgOut->addHTML( 'nid.'" />' ); $wgOut->addHTML( ' '.wfMsg('connetwork_delete_msg_uid',$id->uid,$world->world).' ' ); $wgOut->addHTML( '' ); $wgOut->addHTML( '' ); $wgOut->addHTML( ' ' ); $wgOut->addHTML( ' ' ); } else { $wgOut->addHTML( ' '.wfMsg('connetwork_world').' ' ); $ConRes = $dbr->select( 'etConNetworkWorlds',					array( 'wid', 'world', 'prefix', 'forceslash', 'forcecase' ),					array( 'wid' => $wid ) ); if( $row = $dbr->fetchObject( $ConRes ) ) { $world     = $row->world; $prefix    = $row->prefix; $forceslash = ($forceslash?true:false); $forcecase = $row->forcecase; $wgOut->addHTML( ' '.wfMsg('connetwork_world_info').' ' ); if( $this->canEdit ) { $wgOut->addHTML( '' ); $wgOut->addHTML( '' ); $wgOut->addHTML( '' ); }					$wgOut->addHTML( ' ' ); if( $this->canEdit ) { $wgOut->addHTML( ' ' ); }				} else $wgOut->addHTML( wfMsg( 'connetwork_error_nonexistant_with', wfMsg('connetwork_label_world'), wfMsg('connetwork_label_wid'), $wid ) ); $wgOut->addHTML( ' ' ); $wgOut->addHTML( ' '.wfMsg('connetwork_world_uid').' ' ); $wgOut->addHTML( '<ul>' ); $UidRes = $dbr->select( 'etConNetworkIds',					array( 'nid', 'wid', 'uid' ),					array( 'wid' => $wid ) ); while( $row = $dbr->fetchObject( $UidRes ) ) { $wgOut->addHTML( '<li>' ); $action_delete = $wgScript.'?title=Special:ConNetwork&wid='.$row->wid.'&action=uid_delete&nid='.$row->nid; $wgOut->addHTML( $row->uid ); if( $this->canEdit ) $wgOut->addHTML( ' '.wfMsg('connetwork_delete').'</a>' ); $wgOut->addHTML( '</li>' ); }				$wgOut->addHTML( '</ul>' ); if( $this->canEdit ) { $wgOut->addHTML( '<form action="'.$wgScript.'?title=Special:ConNetwork" method="post">' ); $wgOut->addHTML( '<input type="hidden" name="action" value="uid_new" />' ); $wgOut->addHTML( '<input type="hidden" name="wid" value="'.$wid.'" />' ); $wgOut->addHTML( '<input type="text" name="uid" value="" />' ); $wgOut->addHTML( '<input type="submit" value="'.wfMsg('connetwork_new_button').'" />' ); $wgOut->addHTML( ' ' ); }				$wgOut->addHTML( ' ' ); $wgOut->addHTML( ' ' ); }		} else { if( $this->canEdit ) { $wgOut->addHTML( ' '.wfMsg('connetwork_new_label').' ' ); $wgOut->addHTML( '<form action="'.$wgScript.'?title=Special:ConNetwork" method="post">' ); $wgOut->addHTML( '<input type="hidden" name="action" value="world_new" />' ); $wgOut->addHTML( ' ' ); $wgOut->addHTML( ' ' ); }		}	} } ?>
 * 1) NEW CON WORLD
 * 1) NEW CON WORLD
 * 1) EDIT CON WORLD
 * 1) EDIT CON WORLD
 * 1) DELETE CON WORLD
 * 1) DELETE CON WORLD
 * 1) NEW CON ID
 * 1) NEW CON ID
 * 1) DELETE CON ID
 * 1) DELETE CON ID
 * 1) CON LIST
 * 1) CON LIST