II./JG1_Krupinski wrote:How do you get a new sector to show up in the MP main page?
There are 3 files that need to be edited, MP-Admin.php, MP-Connection.php and default-green.php. I have added a Ukraine sector to my SE setup for a new sector that I am working on. Let's look at each one;
FIRST: backup these 3 files
MP-Admin.php
Towards the top of this file look for these lines, insert your sector in the appropriate place, mine is Ukraine so goes at the end of the list;
// Super-secret HTML content goes here
// First we start by defining the sector maps to gather DB connections for
$map=array("Ardennes","Crimea","Berlin","Cyrenaica","Guadalcanal","GulfofFinland","Hawaii","Imphal","Italy","IwoJima","KhalkhinGol","Kuban","Kurland","Kursk","Kyushu","Lvov","Manchuria","Marianas","Malta","Midway","Moscow","Murmansk","NewGuinea","Normandy","NorthSea","Okinawa","Oslo","Ostfriesland","Prokhorovka","Singapore","Smolensk","Stalingrad","Tunis"
,"Ukraine");
?>
---------------------------------------------------------------------------------------
MP-Connection.php
The connection data is in alphabetic order so navigate down the list to where your sector should fit and insert - Ukraine goes at the bottom;
<?php
//written by MP-Admin.php
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Here is information on how to define the database connections, e.g. MySQL or Access, for each sector.
// The idea is to associate each sector with a different SE database, so your MP can display information
// for many different campaigns simultaneously.
//
// Below there are sections describing the MySQL and MS Access connection formats in detail. How your MP
// is set up is entirely up to you. Large on-line SE wars may want to use different databases for each
// sector, while small intra-squad wars may just use the same database for all sectors. Remember, a single
// SE database can only hold a single campaign at a time.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
$DefaultDBCon = array("mysql","localhost","3306","seadmin","perth","SEDB31");
// Here is where you specify which database the MP will query for each SE sector.
$SectorDBCon["Ardennes"] = &$DefaultDBCon;
$SectorDBCon["Crimea"] = &$DefaultDBCon;
$SectorDBCon["Berlin"] = &$DefaultDBCon;
$SectorDBCon["Cyrenaica"] = &$DefaultDBCon;
$SectorDBCon["Guadalcanal"] = &$DefaultDBCon;
$SectorDBCon["GulfofFinland"] = &$DefaultDBCon;
$SectorDBCon["Hawaii"] = &$DefaultDBCon;
$SectorDBCon["Imphal"] = &$DefaultDBCon;
$SectorDBCon["Italy"] = &$DefaultDBCon;
$SectorDBCon["IwoJima"] = array("mysql","localhost","3306","seadmin","perth","IWOJIMA");
$SectorDBCon["KhalkhinGol"] = array("mysql","localhost","3306","seadmin","perth","KhalkhinGol");
$SectorDBCon["Kuban"] = &$DefaultDBCon;
$SectorDBCon["Kurland"] = &$DefaultDBCon;
$SectorDBCon["Kursk"] = &$DefaultDBCon;
$SectorDBCon["Kyushu"] = &$DefaultDBCon;
$SectorDBCon["Lvov"] = &$DefaultDBCon;
$SectorDBCon["Manchuria"] = &$DefaultDBCon;
$SectorDBCon["Marianas"] = &$DefaultDBCon;
$SectorDBCon["Malta"] = &$DefaultDBCon;
$SectorDBCon["Midway"] = &$DefaultDBCon;
$SectorDBCon["Moscow"] = &$DefaultDBCon;
$SectorDBCon["Murmansk"] = &$DefaultDBCon;
$SectorDBCon["NewGuinea"] = &$DefaultDBCon;
$SectorDBCon["Normandy"] = &$DefaultDBCon;
$SectorDBCon["NorthSea"] = array("mysql","localhost","3306","seadmin","perth","SHIPBUSTER");
$SectorDBCon["Okinawa"] = &$DefaultDBCon;
$SectorDBCon["Oslo"] = &$DefaultDBCon;
$SectorDBCon["Ostfriesland"] = array("mysql","localhost","3306","seadmin","perth","TUCHEL");
$SectorDBCon["Prokhorovka"] = array("mysql","localhost","3306","seadmin","perth","Prokhorovka");
$SectorDBCon["Singapore"] = &$DefaultDBCon;
$SectorDBCon["Smolensk"] = &$DefaultDBCon;
$SectorDBCon["Stalingrad"] = array("mysql","localhost","3306","seadmin","perth","Stalingrad");
$SectorDBCon["Tunis"] = &$DefaultDBCon;
$SectorDBCon["Ukraine"] = &$DefaultDBCon;
----------------------------------------------------------------------------------------
default-green.php
There are 2 areas in this file, the first area defines the Sectorlink, it's in alhabetical order so navigate down to where yours should fit in and insert. Then determine which region you are going to put your sector, in my case I've put Ukraine in the Eastern Europe region, navigate to where you want to insert your sector eg in my case imediately after Stalingrad and insert there.
<?php
//Required for PHP 4.0 and higher.
session_start();
// asp2php (vbscript) converted
include 'adodb/adodb.inc.php';
include 'adodb/toexport.inc.php';
include 'MP-ApplicationMetadata.php';
include 'MP-Configuration.php';
include 'MP-Misc.php';
include 'MP-Connection.php';
function SectorLink($sector) {
extract($GLOBALS);
if ( ! makeDBConnection($adoConSector,$SectorDBCon[$sector]) ) {
noConnection($sector,$SectorDBCon[$sector]);
return;
}
//Create a recordset for the number of flown missions
$SQLFlownMissions="SELECT Count(Mis_Nbr) AS NFlownMissions FROM MissionData WHERE (Map='".FBMapName($sector)."')";
$rsFlownMissions = $adoConSector->Execute($SQLFlownMissions);
//Create a variable that holds the number of flown missions from the count sql
if (!$rsFlownMissions->EOF) {
$NFlownMissions=$rsFlownMissions->fields['NFlownMissions'];
}
else {
$NFlownMissions=0;
}
//Close the ADO recordset and connection.
$rsFlownMissions->Close();
$adoConSector->Close();
if ($NFlownMissions>0) {
return '<a style="text-decoration:none;color:#cfbfbf;" title="In Dispute: Proceed to '.str_replace('Lvov','L\'vov',FBMapName($sector)).' Sector war room" href="./MP-Checkpoint.php?Sector_DB='.$sector.'&Status=new">'.str_replace('Lvov','L\'vov',FBMapName($sector)).'</a>';
}
else {
return '<a style="text-decoration:none" title="All Quiet: Proceed to '.str_replace('Lvov','L\'vov',FBMapName($sector)).' Sector war room" href="./MP-Checkpoint.php?Sector_DB='.$sector.'&Status=new">'.str_replace('Lvov','L\'vov',FBMapName($sector)).'</a>';
}
}
$SectorLinkData["Ardennes"] = SectorLink("Ardennes");
$SectorLinkData["Berlin"] = SectorLink("Berlin");
$SectorLinkData["Crimea"] = SectorLink("Crimea");
$SectorLinkData["Cyrenaica"] = SectorLink("Cyrenaica");
$SectorLinkData["Kuban"] = SectorLink("Kuban");
$SectorLinkData["Guadalcanal"] = SectorLink("Guadalcanal");
$SectorLinkData["GulfofFinland"] = SectorLink("GulfofFinland");
$SectorLinkData["Hawaii"] = SectorLink("Hawaii");
$SectorLinkData["Imphal"] = SectorLink("Imphal");
$SectorLinkData["Italy"] = SectorLink("Italy");
$SectorLinkData["IwoJima"] = SectorLink("IwoJima");
$SectorLinkData["KhalkhinGol"] = SectorLink("KhalkhinGol");
$SectorLinkData["Kurland"] = SectorLink("Kurland");
$SectorLinkData["Kursk"] = SectorLink("Kursk");
$SectorLinkData["Kyushu"] = SectorLink("Kyushu");
$SectorLinkData["Lvov"] = SectorLink("Lvov");
$SectorLinkData["Manchuria"] = SectorLink("Manchuria");
$SectorLinkData["Marianas"] = SectorLink("Marianas");
$SectorLinkData["Malta"] = SectorLink("Malta");
$SectorLinkData["Midway"] = SectorLink("Midway");
$SectorLinkData["Moscow"] = SectorLink("Moscow");
$SectorLinkData["Murmansk"] = SectorLink("Murmansk");
$SectorLinkData["NewGuinea"] = SectorLink("NewGuinea");
$SectorLinkData["NorthSea"] = SectorLink("NorthSea");
$SectorLinkData["Normandy"] = SectorLink("Normandy");
$SectorLinkData["Okinawa"] = SectorLink("Okinawa");
$SectorLinkData["Oslo"] = SectorLink("Oslo");
$SectorLinkData["Ostfriesland"] = SectorLink("Ostfriesland");
$SectorLinkData["Prokhorovka"] = SectorLink("Prokhorovka");
$SectorLinkData["Singapore"] = SectorLink("Singapore");
$SectorLinkData["Smolensk"] = SectorLink("Smolensk");
$SectorLinkData["Stalingrad"] = SectorLink("Stalingrad");
$SectorLinkData["Tunis"] = SectorLink("Tunis");
$SectorLinkData["Ukraine"] = SectorLink("Ukraine");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>SEOW? Mission Planner - Campaign Sectors</title>
<link href="css/basic.css" rel="stylesheet" type="text/css" media="all" />
<style type="text/css" media="screen"><!--
#layer1 { background-image: url(../uniticons/tile.gif); height: 480px; width: 800px; left: 8px; top: 187px; position: absolute; z-index: -10; visibility: visible; }
--></style>
</head>
<body bgcolor="<?php echo SkinBG();?>" link="<?php echo SkinText();?>" vlink="<?php echo SkinText();?>" alink="<?php echo SkinText();?>">
<div id="layer1"></div>
<div style="position:relative;width:801px;height:698px;-adbe-g:p;">
<div style="position:absolute;top:192px;left:16px;width:400px;height:32px;-adbe-c:c">
<font size="4" color="<?php echo SkinStrong();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Western Europe and Mediterranean</strong></font></div>
<div style="position:absolute;top:272px;left:16px;width:600px;height:32px;-adbe-c:c">
<font size="4" color="<?php echo SkinStrong();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Northern Europe and Baltic</strong></font></div>
<div style="position:absolute;top:352px;left:16px;width:800px;height:32px;-adbe-c:c">
<font size="4" color="<?php echo SkinStrong();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Eastern Europe</strong></font></div>
<div style="position:absolute;top:432px;left:16px;width:400px;height:32px;-adbe-c:c">
<font size="4" color="<?php echo SkinStrong();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Pacific Islands</strong></font></div>
<div style="position:absolute;top:512px;left:16px;width:400px;height:32px;-adbe-c:c">
<font size="4" color="<?php echo SkinStrong();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Asia and Indo-China</strong></font></div>
<div style="position:absolute;top:224px;left:32px;width:608px;height:32px;-adbe-c:c">
<font size="3" color="<?php echo SkinText();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Sectors:? <?php echo $SectorLinkData["Ardennes"]; ?>, <?php echo $SectorLinkData["Berlin"]; ?>, <?php echo $SectorLinkData["Cyrenaica"]; ?>, <?php echo $SectorLinkData["Italy"]; ?>, <?php echo $SectorLinkData["Malta"]; ?>, <?php echo $SectorLinkData["Normandy"]; ?>, <?php echo $SectorLinkData["Ostfriesland"]; ?>, <?php echo $SectorLinkData["Tunis"]; ?></strong></font></div>
<div style="position:absolute;top:304px;left:32px;width:608px;height:32px;-adbe-c:c">
<font size="3" color="<?php echo SkinText();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Sectors:? <?php echo $SectorLinkData["GulfofFinland"]; ?>, <?php echo $SectorLinkData["Kurland"]; ?>, <?php echo $SectorLinkData["Murmansk"]; ?>, <?php echo $SectorLinkData["NorthSea"]; ?>, <?php echo $SectorLinkData["Oslo"]; ?></strong></font></div>
<div style="position:absolute;top:384px;left:32px;width:800px;height:39px;-adbe-c:c">
<font size="3" color="<?php echo SkinText();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Sectors: <?php echo $SectorLinkData["Crimea"]; ?>, <?php echo $SectorLinkData["Kuban"]; ?>, <?php echo $SectorLinkData["Kursk"]; ?>, <?php echo $SectorLinkData["Lvov"]; ?>, <?php echo $SectorLinkData["Moscow"]; ?>, <?php echo $SectorLinkData["Prokhorovka"]; ?>, <?php echo $SectorLinkData["Smolensk"]; ?>, <?php echo $SectorLinkData["Stalingrad"]; ?>
, <?php echo $SectorLinkData["Ukraine"]; ?></strong></font></div>
<div style="position:absolute;top:464px;left:32px;width:658px;height:32px;-adbe-c:c">
<font size="3" color="<?php echo SkinText();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Sectors:? <?php echo $SectorLinkData["Guadalcanal"]; ?>, <?php echo $SectorLinkData["Hawaii"]; ?>, <?php echo $SectorLinkData["IwoJima"]; ?>, <?php echo $SectorLinkData["Marianas"]; ?>, <?php echo $SectorLinkData["Midway"]; ?>, <?php echo $SectorLinkData["NewGuinea"]; ?>, <?php echo $SectorLinkData["Okinawa"]; ?></strong></font></div>
<div style="position:absolute;top:544px;left:32px;width:608px;height:32px;-adbe-c:c">
<font size="3" color="<?php echo SkinText();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><strong>Sectors: <?php echo $SectorLinkData["Imphal"]; ?>, <?php echo $SectorLinkData["KhalkhinGol"]; ?>, <?php echo $SectorLinkData["Kyushu"]; ?>, <?php echo $SectorLinkData["Manchuria"]; ?> <?php echo $SectorLinkData["Singapore"]; ?></strong></font></div>
<div style="position:absolute;top:608px;left:0px;width:800px;height:18px;-adbe-c:c">
<div align="center">
<font size="-2" color="<?php echo SkinText();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><?php echo $Meta1; ?></font></div>
</div>
<div style="position:absolute;top:0px;left:0px;width:800px;height:160px;">
<img src="../uniticons/GREEN-SEOW-MP-Banner.jpg"/></div>
<div style="position:absolute;top:160px;left:0px;width:800px;height:16px;background-color:#467;-adbe-c:c">
<div align="center">
<font size="-1" color="<?php echo SkinText();?>" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><a style="text-decoration:none" href="../Statistics/MP-Statistics.php">Campaign Statistics</a> |? <a style="text-decoration:none" href="../Merger/default.php">Template Merger</a> |? <a style="text-decoration:none" href="./MP-Admin.php">Database Configuration</a> |? <a style="text-decoration:none" href="
http://seow.sourceforge.net/">SEOW? Home</a> |? <a style="text-decoration:none" href="
http://raf74.net/seow/">SEOW? Forums</a> |? <a style="text-decoration:none" href="./MP-Credits.php">Credits</a></font>
</div>
</div>
<div style="position:absolute;top:626px;left:0px;width:800px;height:18px;-adbe-c:c">
<div align="center">
<?php
if ( $ShowServer == true ) {print '<font size="-2" color="'.SkinText().'" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">{running on '.$_SERVER['SERVER_SOFTWARE'].'}</font>';}
?>
</div>
</div>
</div>
<p></p>
</body>
</html>
------------------------------------------------------------------------------
That's that and all should be good to go.
Hope this helps
Cheers
Goanna