include_once('mapcfg.php'); if($pagecomp == 1){ ob_start("ob_gzhandler"); } echo (""); echo ("
"); if ($usecss == 1){ echo (""); echo (""); echo (""); } echo ("");
$ID = array();
$WONLogon = array();
$LastLoggedOn = array();
$IPAddress = array();
$HomeWorldLocationX = array();
$HomeWorldLocationY = array();
$CharacterName = array();
$CharacterRace = array();
$CharacterRank = array();
$CharacterPoliticalControl = array();
$CharacterLastBattleResult = array();
$CharacterLocationX = array();
$CharacterLocationY = array();
$CharacterRating = array();
$CharacterCurrentPrestige = array();
$CharacterLifetimePrestige = array();
$CharacterBattlesPlayed = array();
$Owner = array();
$Race = array();
$ClassType = array();
$BPV = array();
$ShipClassName = array();
$Name = array();
$empcolor = array();
$empcolor[0] = "#0000FF"; //Federation
$empcolor[1] = "#FF0000"; //Klingon
$empcolor[2] = "#00FF00"; //Romulan
$empcolor[3] = "#FFCC33"; //Lyran
$empcolor[4] = "#660099"; //Hydran
$empcolor[5] = "#996600"; //Gorn
$empcolor[6] = "#FF66CC"; //ISC
$empcolor[7] = "#00FFFF"; //Mirak
$empcolor[8] = "#CCCCCC"; //Orion
$empcolor[15] = "#CCCCCC"; //NeutralRace
$empname = array();
$empname[0] = "United Federation of Planets";
$empname[1] = "Klingon Empire";
$empname[2] = "Romulan Star Empire";
$empname[3] = "Lyran Star Empire";
$empname[4] = "Hydran Kingdom";
$empname[5] = "Gorn Confederacy";
$empname[6] = "Interstellar Concordium";
$empname[7] = "Kzinti Hegemony";
$empname[8] = "Orion Pirate Cartels";
$empname[15] = "Contested Sector";
$rankstring = array();
$rankstring[0] = "Ensign";
$rankstring[1] = "Lieutenant";
$rankstring[2] = "LtCommander";
$rankstring[3] = "Captain";
$rankstring[4] = "Commodore";
$rankstring[5] = "RearAdmiral";
$rankstring[6] = "Admiral";
$rankstring[7] = "FleetAdmiral";
$empcount = array($empname[0] => 0,
$empname[1] => 0,
$empname[2] => 0,
$empname[3] => 0,
$empname[4] => 0,
$empname[5] => 0,
$empname[6] => 0,
$empname[7] => 0);
$r=0;
$link = mysql_connect($D2dbhostname .":" .$D2dbport, $D2dbuser, $D2dbpass);
mysql_select_db($D2db);
$query = "SELECT Owner,Race,ClassType,BPV,ShipClassName,Name FROM ship ORDER BY Owner";
$result = mysql_query($query);
$a=0;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$Owner[$a] = $line['Owner'];
$Race[$a] = $line['Race'];
$ClassType[$a] = $line['ClassType'];
$BPV[$a] = $line['BPV'];
$ShipClassName[$a] = $line['ShipClassName'];
$Name[$a] = $line['Name'];
$a=$a+1;
}
mysql_free_result($result);
$query = "SELECT ID,WONLogon,LastLoggedOn,HomeWorldLocationX,HomeWorldLocationY,CharacterName,CharacterRank,CharacterPoliticalControl,CharacterLastBattleResult,CharacterLocationX,CharacterLocationY,CharacterRating,CharacterCurrentPrestige,CharacterLifetimePrestige,CharacterBattlesPlayed FROM servcharacter ORDER BY CharacterPoliticalControl, CharacterName";
$result = mysql_query($query);
$b=0;
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$ID[$b] = $line['ID'];
$WONLogon[$b] = $line['WONLogon'];
$LastLoggedOn[$b] = $line['LastLoggedOn'];
$HomeWorldLocationX[$b] = $line['HomeWorldLocationX'];
$HomeWorldLocationY[$b] = $line['HomeWorldLocationY'];
$CharacterName[$b] = $line['CharacterName'];
$CharacterRank[$b] = $line['CharacterRank'];
$CharacterPoliticalControl[$b] = $line['CharacterPoliticalControl'];
$CharacterLastBattleResult[$b] = $line['CharacterLastBattleResult'];
$CharacterLocationX[$b] = $line['CharacterLocationX'];
$CharacterLocationY[$b] = $line['CharacterLocationY'];
$CharacterRating[$b] = $line['CharacterRating'];
$CharacterCurrentPrestige[$b] = $line['CharacterCurrentPrestige'];
$CharacterLifetimePrestige[$b] = $line['CharacterLifetimePrestige'];
$CharacterBattlesPlayed[$b] = $line['CharacterBattlesPlayed'];
$b=$b+1;
}
mysql_free_result($result);
mysql_close($link);
echo (" "); for ($h=$b;$h--;) { if($WONLogon[$h] != "") { $empcount[$empname[$CharacterPoliticalControl[$h]]] = $empcount[$empname[$CharacterPoliticalControl[$h]]] + 1; } } arsort ($empcount); reset ($empcount); while (list ($key, $val) = each ($empcount)) { for ($k = 0; $k <= 8; $k++) { if($key == $empname[$k]) { echo ""; } } echo $key; echo ""; echo (": "); echo $val; echo (" players."); echo (" "); $r=$r+1; } echo (" "); for ($i=0; $i <= $b-1; $i++) { if($WONLogon[$i] != "") { echo (""); echo $rankstring[$CharacterRank[$i]]; echo (" "); echo ""; echo $CharacterName[$i]; echo ""; echo (" ("); echo $CharacterRating[$i]; echo (") "); echo ("Empire: "); echo $empname[$CharacterPoliticalControl[$i]]; echo (" "); echo ("Prestige: "); echo $CharacterCurrentPrestige[$i]; echo (" / "); echo $CharacterLifetimePrestige[$i]; echo (" "); for ($j=0; $j <= $a-1; $j++) { if($Owner[$j] ==$ID[$i]) { echo ("("); echo $ShipClassName[$j]; echo (")"); echo (" "); echo $Name[$j]; echo (" "); } } echo ("HomeWorld: "); echo $HomeWorldLocationX[$i]; echo (","); echo $HomeWorldLocationY[$i]; echo (" "); echo ("Battles Played: "); echo $CharacterBattlesPlayed[$i]; echo (" "); echo ("Last Battle Result: "); echo $CharacterLastBattleResult[$i]; echo (" "); //echo ("Last Logged On: "); //extract (cal_from_jd(unixtojd($LastLoggedOn[$i]), CAL_GREGORIAN ), EXTR_OVERWRITE); //echo $dayname .", " .$monthname ." " .$day .", " .$year; //echo (" "); echo ("Location: "); echo $CharacterLocationX[$i]; echo (","); echo $CharacterLocationY[$i]; echo (" "); echo (" "); } } echo (" | ");
echo ("