Recent versions: ||| Galaxytool: v5.1 ||| Galaxytoolbar: v2.6.32 |||

Difference between revisions of "Installation"

From Galaxytool wiki
Jump to: navigation, search
m (serbianknightriders.piczo.com/path/to/galaxytool/install.php)
m (Important for those hosted on a Linux Server)
 
(45 intermediate revisions by 10 users not shown)
Line 1: Line 1:
<?php
+
== General ==
/**
 
* DO NOT EDIT THIS FILE WITH NOTEPAD - USE WORDPAD INSTEAD!
 
*/
 
  
// Database connection
+
After [[Download|downloading]] the ZIP file, you need to extract it.
$dbusername    = "zappo";      // database username
+
After that you need to upload all files to your server.
$dbpassword    = "ivantrmcic2";  // database password
+
Now you should [[How to set writable permissions|set writable permissions]] to the '''config''' folder.
$dbname        = "XXXXXXX";    // database name
+
Then, start the install.php on your webserver by typing
$dbhost        = "trmex_trme@yahoo.com";    // host address of your mysql server
 
  
// Database tables
+
http://example.com/path/to/galaxytool/install.php (this address is just a template!)
$dbtablename  = "galaxy";
 
$utablename    = "usertable";
 
$playertable  = "players"; 
 
$allytable    = "alliances";   
 
$noticetable  = "notices";
 
$reporttable  = "reports";
 
$iptablename  = "iptable";
 
$shouttable    = "shoutbox";
 
$allyhistory  = "alliances_history";
 
$playerhistory = "players_history";
 
  
 +
in your browser and have a look at the screen.
  
/*
+
Now follow the instructions on the screen.
* Only required if you want to update from a version lower than 4.0
+
They will give you detailed information about what to enter or they'll tell you, if something did not work as expected.<br>'''Everything is created automatically during installation - no need to edit any file.'''
*/
 
/*
 
$old_dbname      = "stoned_352";
 
$old_dbtablename = "tabelle";      // Tabellenname in der Datenbank für die Galaxiedaten (Tabelle wird autom. erzeugt!) | tablename for galaxy data - will be created!
 
$old_utablename  = "tabelle2";      // Tabellenname in der Datenbank für die Benutzer | tablename for users - will be created
 
$old_pstablename = "tabelle3";      // Tabellenname für die Playerstats | tablename for playerstats
 
$old_astablename = "tabelle4";      // Tabellenname für die Allystats | tablename for allystats
 
$old_noticetable = "tabelle5"; // Tabellenname für Notizen | tablename for notices
 
$old_reporttable = "tabelle6"; // Tabellenname für Spios | tablename for espionage reports
 
$old_iptablename = "tabelle7"; // Tabellenname für die zu speichernden IP Adressen | tablename for ip addresses
 
$old_shouttable  = "tabelle8"; // Tabellenname für die Shoutbox (aktuelle Nachrichten) | tablename for shoutbox
 
$old_allyhistory = "tabelle9";      // Tabellenname für Allyhistory | tablename for allyhistory
 
*/
 
  
/*
+
== After installation ==
* Do not change anything below this line
 
*/
 
  
// Update last action time at DB
+
After the installation you have to delete the install.php and the update.php! Then you can logon with the account data created during installation.
if (isset($_SESSION['s_userid']) && is_numeric($_SESSION['s_userid'])) {
 
$query = "UPDATE $utablename SET last_action=now() WHERE id='".$_SESSION['s_userid']."'";
 
mysql_connect($dbhost,$dbusername,$dbpassword);
 
mysql_select_db($dbname);
 
mysql_query($query);
 
mysql_close();
 
}
 
?>
 
<?php
 
/*
 
* DO NOT EDIT THIS FILE WITH NOTEPAD - USE WORDPAD INSTEAD!
 
*/
 
require "version1.php";
 
  
/**
+
=== Important for those hosted on a Linux Server ===
* Set your name here. It will be shown at the logon page.
+
'''Please note: the following setting can also be harmful for the Galaxytool, so you cannot logon at all, but see only a white page or a Fatal error when you try to do so. This is therefore no general solution.'''<br>
*/
+
For those who have been getting session time out messages as soon as you logged in: the problem is in your php.ini file. Log into your hosting providers control panel and find the php controls. Edit the php.ini: search for session.auto_start and change its attribute of 0 to 1, then save it. Now you should be able to log into gtool as you normally would.
$owner      = "Zappo";     
 
  
/**
+
[[de:Installation]]
* Settings for shoutbox = maximum number of shout entries
+
[[es:Instalación]]
*
 
*/
 
$maxshouts  = 15;
 
 
 
/**
 
* The user at this address will be informed about new registrations
 
*/
 
$email_to  = 'trmeking2@yahoo.com';
 
 
 
/**
 
* This address will be shown as sender of the email
 
*/
 
$email_from = 'trmex_trme@yahoo.com';
 
 
 
/**
 
* choose your default language (german,english,spanish,dutch,balkan,french,portugues,italian,polish,turkish,...)
 
*/
 
$default_language = "balkan";
 
 
 
/**
 
* Universe number from the top left corner of your ogame screen
 
*/
 
$global_universe = 14;
 
 
 
 
 
?>
 
<?php
 
// config check
 
ob_start();
 
require "secret/config.php";
 
$config_content = ob_get_contents();
 
ob_end_clean();
 
// attributes check
 
ob_start();
 
chdir('secret');
 
require "attributes.php";
 
chdir('../');
 
$attributes_content = ob_get_contents();
 
ob_end_clean();
 
 
 
$error_occured = false;
 
?>
 
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
<html>
 
<head>
 
<title>Galaxytool installation program for version <?php echo VERSION; ?></title>
 
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 
<link rel="stylesheet" type="text/css" href="secret/styles.css" />
 
</head>
 
<body>
 
<?php
 
if (!isset($_GET['action']) || $_GET['action'] != "install") {
 
?>
 
<form action="index.php" method="GET">
 
<table class="standard" cellpadding="0" cellspacing="0" border="0" style="margin-top:200px; width:250px;" align="center">
 
<tr class="firstcolor"><td colspan="2" align="center" class="tblhead">Galaxytool <?php echo VERSION; ?> - Installation check</td></tr>
 
<?php
 
if ($config_content != "") {
 
echo "content: |".utf8_encode($config_content)."|";
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Syntax: config.php</td><td class=\"failure\">failed</td></tr>\n";
 
    $error_occured = true;
 
} else {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Syntax: config.php</td><td class=\"success\">success</td></tr>\n";
 
}
 
if (!empty($attributes_content)) {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Syntax: attributes.php</td><td class=\"failure\">failed</td></tr>\n";
 
    $error_occured = true;
 
} else {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Syntax: attributes.php</td><td class=\"success\">success</td></tr>\n";
 
}
 
if (empty($owner)) {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Owner</td><td class=\"failure\">failed</td></tr>\n";
 
    $error_occured = true;
 
} else {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Owner</td><td class=\"success\">$owner</td></tr>\n";
 
}
 
if (empty($default_language)) {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Language</td><td class=\"failure\">failed</td></tr>\n";
 
    $error_occured = true;
 
} else {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Language</td><td class=\"success\">$default_language</td></tr>\n";
 
}
 
if (empty($global_universe) || !is_numeric($global_universe)) {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Universe</td><td class=\"failure\">failed</td></tr>\n";
 
    $error_occured = true;
 
} else {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Universe</td><td class=\"success\">$global_universe</td></tr>\n";
 
}
 
$link = mysql_connect($dbhost, $dbusername, $dbpassword);
 
if (!$link) {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL connection</td><td class=\"failure\">failed</td></tr>\n";
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Database existency</td><td class=\"failure\">failed</td></tr>\n";
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL version check</td><td class=\"failure\">failed</td></tr>\n";
 
    $error_occured = true;
 
} else {
 
    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL connection</td><td class=\"success\">success</td></tr>\n";
 
    $db_selected = mysql_select_db($dbname, $link);
 
    if (!$db_selected) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Database existency</td><td class=\"failure\">failed</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Database existency</td><td class=\"success\">success</td></tr>\n";
 
 
 
        $query = "SELECT VERSION() as version";
 
        $res = mysql_query($query) or die(mysql_error());
 
        $version = mysql_fetch_object($res);
 
        if (strpos($version->version,"-") > 0) {
 
            $version = substr($version->version,0,strpos($version->version,"-"));
 
        } else {
 
            $version = $version->version;
 
        }
 
 
 
        $subversion = explode(".",$version);
 
        if (!isset($subversion[0]) || $subversion[0] < 4) {
 
            echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL version check</td><td class=\"failure\">$version</td></tr>\n";
 
            $error_occured = true;
 
        } else {
 
            if ($subversion[0] == 4) {
 
                // MySQL 4.x.x
 
                if (!isset($subversion[1]) || $subversion[1] < 1) {
 
                    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL version check</td><td class=\"failure\">$version</td></tr>\n";
 
                    $error_occured = true;
 
                } else {
 
                    if (!isset($subversion[2]) || $subversion[2] < 16) {
 
                        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL version check</td><td class=\"failure\">$version</td></tr>\n";
 
                        $error_occured = true;
 
                    } else {
 
                        // success
 
                        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL version check</td><td class=\"success\">$version</td></tr>\n";
 
                    }
 
                }
 
            } elseif ($subversion[0] == 5) {
 
                // MySQL 5.x.x
 
                if (!isset($subversion[1]) || !isset($subversion[2]) || ($subversion[1] == 0 && $subversion[2] < 16)) {
 
                    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL version check</td><td class=\"failure\">$version</td></tr>\n";
 
                    $error_occured = true;
 
                } else {
 
                    // success
 
                    echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL version check</td><td class=\"success\">$version</td></tr>\n";
 
                }
 
} elseif ($subversion[0] == 6) {
 
// MySQL 6.x.x
 
echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">MySQL version check</td><td class=\"success\">$version</td></tr>\n";
 
}
 
        }
 
    }
 
}
 
 
 
 
 
?>
 
<tr class="firstcolor"><td colspan="2">&nbsp;</td></tr>
 
<?php
 
if (!$error_occured) {
 
    echo "<tr class=\"firstcolor\"><td colspan=\"2\" align=\"center\"><a class=\"link\" href=\"install.php?action=install\">Install</a></td></tr>\n";
 
} else {
 
    echo "<tr class=\"firstcolor\"><td colspan=\"2\" align=\"center\"><a class=\"link\" href=\"install.php\">Check again</a></td></tr>\n";
 
}
 
 
 
} else {
 
    echo '<table class="standard" cellpadding="0" cellspacing="0" border="0" style="margin-top:200px; width:250px;" align="center">';
 
 
 
    // start installation
 
    mysql_connect($dbhost,$dbusername,$dbpassword) or die(mysql_error());
 
    mysql_select_db($dbname) or die(mysql_error());
 
 
 
    // Tabelle fuer die Galaxieansichten
 
    $query = "CREATE TABLE ".$dbtablename." (
 
              galaxy int(2) NOT NULL default '0',
 
              system int(3) NOT NULL default '0',
 
              planet int(2) NOT NULL default '0',
 
              player_id smallint(5) unsigned NOT NULL default '0',
 
              moon enum('true','false') NOT NULL default 'false',
 
              moonsize smallint(5) unsigned NOT NULL default '0',
 
              metal int(10) unsigned NOT NULL default '0',
 
              crystal int(10) unsigned NOT NULL default '0',
 
              planetname varchar(40) NOT NULL default '',
 
              last_update datetime NOT NULL default '0000-00-00 00:00:00',
 
              user_id smallint(5) unsigned NOT NULL default '0',
 
              PRIMARY KEY  (galaxy,system,planet),
 
              KEY player_id (player_id),
 
              KEY moon (moon),
 
              KEY moon_2 (moon),
 
              KEY last_update (last_update),
 
              KEY metal (metal),
 
              KEY crystal (crystal)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: galaxy</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: galaxy</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // Tabelle fuer die Benutzerverwaltung
 
    $query = "CREATE TABLE $utablename (
 
              id smallint(10) unsigned NOT NULL auto_increment,
 
              username varchar(20) NOT NULL default '',
 
              userpass varchar(32) NOT NULL default '',
 
              ogame_playerid int(11) unsigned NOT NULL default '0',
 
              email varchar(50) NOT NULL default '',
 
              ingame varchar(20) NOT NULL default '',
 
              allytag varchar(10) NOT NULL default '',
 
              stylepath varchar(255) NOT NULL default '',
 
              cansearch enum('true','false') NOT NULL default 'false',
 
              caninsert enum('true','false') NOT NULL default 'false',
 
              statusview enum('true','false') NOT NULL default 'false',
 
              probeview enum('true','false') NOT NULL default 'false',
 
              userman enum('true','false') NOT NULL default 'false',
 
              allyhistory enum('true','false') NOT NULL default 'false',
 
              diplomatic enum('true','false') NOT NULL default 'false',
 
              status enum('email','admin','active') NOT NULL default 'email',
 
              logins smallint(5) unsigned NOT NULL default '0',
 
              lastlogin datetime NOT NULL default '0000-00-00 00:00:00',
 
              last_action datetime NOT NULL default '0000-00-00 00:00:00',
 
              statspage mediumint(8) unsigned NOT NULL default '100',
 
              links text NOT NULL,
 
              bb_coordinates varchar(25) NOT NULL default 'deeppink',
 
              bb_moon varchar(25) NOT NULL default 'burlywood',
 
              bb_debris varchar(25) NOT NULL default 'firebrick',
 
              bb_ally varchar(25) NOT NULL default 'tomato',
 
              bb_allydetails varchar(25) NOT NULL default 'coral',
 
              bb_playername varchar(25) NOT NULL default 'teal',
 
              bb_banned varchar(25) NOT NULL default 'red',
 
              bb_vacation varchar(25) NOT NULL default 'skyblue',
 
              bb_noob varchar(25) NOT NULL default 'limegreen',
 
              bb_inactive varchar(25) NOT NULL default 'silver',
 
              bb_longinactive varchar(25) NOT NULL default 'silver',
 
              PRIMARY KEY  (id),
 
              UNIQUE KEY username (username),
 
              KEY last_action (last_action),
 
              KEY ingame (ingame),
 
              KEY ogame_playerid (ogame_playerid)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: usertable</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: usertable</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // Adminuser eintragen
 
    $query = "INSERT INTO $utablename
 
  (id, username, userpass, stylepath, cansearch, caninsert, statusview, probeview, userman, allyhistory, diplomatic, status, links) VALUES
 
  (1, 'admin', md5('galatool'),'styles.css', 'true', 'true', 'true', 'true', 'true', 'true', 'true', 'active', 'Galaxytool;http://www.galaxytool.eu')";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Creating Adminuser</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Creating Adminuser</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // Spielertabelle
 
    $query = "CREATE TABLE $playertable (
 
              id smallint(5) unsigned NOT NULL auto_increment,
 
              playername varchar(30) NOT NULL default '',
 
              ogame_playerid int(11) unsigned default NULL,
 
              alliance_id smallint(5) unsigned NOT NULL default '0',
 
              rank smallint(5) unsigned NOT NULL default '0',
 
              points int(10) unsigned NOT NULL default '0',
 
              frank smallint(5) unsigned NOT NULL default '0',
 
              fpoints int(10) unsigned NOT NULL default '0',
 
              rrank smallint(5) unsigned NOT NULL default '0',
 
              rpoints int(10) unsigned NOT NULL default '0',
 
              last_stats_update datetime NOT NULL default '0000-00-00 00:00:00',
 
              noob enum('true','false') NOT NULL default 'false',
 
              banned enum('true','false') NOT NULL default 'false',
 
              vacation enum('true','false') NOT NULL default 'false',
 
              inactive enum('true','false') NOT NULL default 'false',
 
              long_inactive enum('true','false') NOT NULL default 'false',
 
              diplomatic_status enum('nap','ally','war','boycott','neutral','nothing','own','wing') NOT NULL default 'nothing',
 
              spiolvl tinyint(3) unsigned NOT NULL default '0',
 
              computech tinyint(3) unsigned NOT NULL default '0',
 
              waffentech tinyint(3) unsigned NOT NULL default '0',
 
              schildtech tinyint(3) unsigned NOT NULL default '0',
 
              rpz tinyint(3) unsigned NOT NULL default '0',
 
              energytech tinyint(3) unsigned NOT NULL default '0',
 
              hypertech tinyint(3) unsigned NOT NULL default '0',
 
              vbt tinyint(3) unsigned NOT NULL default '0',
 
              impulse tinyint(3) unsigned NOT NULL default '0',
 
              hra tinyint(3) unsigned NOT NULL default '0',
 
              lasertech tinyint(3) unsigned NOT NULL default '0',
 
              iontech tinyint(3) unsigned NOT NULL default '0',
 
              plasmatech tinyint(3) unsigned NOT NULL default '0',
 
              forschungsnetz tinyint(3) unsigned NOT NULL default '0',
 
              gravi tinyint(3) unsigned NOT NULL default '0',
 
              last_tech_update datetime NOT NULL default '0000-00-00 00:00:00',
 
              PRIMARY KEY  (id),
 
              UNIQUE KEY ogame_playerid (ogame_playerid),
 
              KEY alliance_id (alliance_id),
 
              KEY noob (noob),
 
              KEY banned (banned),
 
              KEY vacation (vacation),
 
              KEY inactive (inactive),
 
              KEY playername (playername),
 
              KEY rank (rank),
 
              KEY frank (frank),
 
              KEY last_stats_update (last_stats_update)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: playertable</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: playertable</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // Allytabelle
 
    $query = "CREATE TABLE $allytable (
 
              id smallint(5) unsigned NOT NULL auto_increment,
 
              allyname varchar(30) default NULL,
 
              rank smallint(5) unsigned NOT NULL default '0',
 
              points int(10) unsigned NOT NULL default '0',
 
              frank smallint(5) unsigned NOT NULL default '0',
 
              fpoints int(10) unsigned NOT NULL default '0',
 
              rrank smallint(5) unsigned NOT NULL default '0',
 
              rpoints int(10) unsigned NOT NULL default '0',
 
              members smallint(5) unsigned NOT NULL default '0',
 
              diplomatic_status enum('nap','ally','war','boycott','neutral','nothing','own','wing') default 'nothing',
 
              last_update datetime default '0000-00-00 00:00:00',
 
              PRIMARY KEY  (id),
 
              UNIQUE KEY allyname (allyname),
 
              KEY last_update (last_update),
 
              KEY diplomatic_status (diplomatic_status),
 
              KEY rank (rank)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: allytable</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: allytable</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // Notiztabelle
 
    $query = "CREATE TABLE $noticetable (
 
              id int(11) NOT NULL auto_increment,
 
              noticetext text NOT NULL,
 
              player_id smallint(5) unsigned NOT NULL default '0',
 
              last_update datetime NOT NULL default '0000-00-00 00:00:00',
 
              PRIMARY KEY  (id),
 
              UNIQUE KEY player_id (player_id)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: noticetable</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: noticetable</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // Reporttabelle
 
    $query = "CREATE TABLE $reporttable (
 
  id int(10) unsigned NOT NULL auto_increment,
 
  galaxy int(2) unsigned NOT NULL default '0',
 
  system int(3) unsigned NOT NULL default '0',
 
  planet int(2) unsigned NOT NULL default '0',
 
  planetname varchar(20) NOT NULL default '',
 
  moon enum('true','false') NOT NULL default 'false',
 
  metal int(10) unsigned NOT NULL default '0',
 
  crystal int(10) unsigned NOT NULL default '0',
 
  deuterium int(10) unsigned NOT NULL default '0',
 
  energy int(10) unsigned NOT NULL default '0',
 
  kt mediumint(8) unsigned NOT NULL default '0',
 
  gt mediumint(8) unsigned NOT NULL default '0',
 
  lj mediumint(8) unsigned NOT NULL default '0',
 
  sj mediumint(8) unsigned NOT NULL default '0',
 
  krz mediumint(8) unsigned NOT NULL default '0',
 
  ss mediumint(8) unsigned NOT NULL default '0',
 
  kolo mediumint(8) unsigned NOT NULL default '0',
 
  rec mediumint(8) unsigned NOT NULL default '0',
 
  spio mediumint(8) unsigned NOT NULL default '0',
 
  bomb mediumint(8) unsigned NOT NULL default '0',
 
  zerri mediumint(8) unsigned NOT NULL default '0',
 
  ds mediumint(8) unsigned NOT NULL default '0',
 
  skrz mediumint(8) unsigned NOT NULL default '0',
 
  sat mediumint(8) unsigned NOT NULL default '0',
 
  rak mediumint(8) unsigned NOT NULL default '0',
 
  ll mediumint(8) unsigned NOT NULL default '0',
 
  sl mediumint(8) unsigned NOT NULL default '0',
 
  ion mediumint(8) unsigned NOT NULL default '0',
 
  gauss mediumint(8) unsigned NOT NULL default '0',
 
  plasma mediumint(8) unsigned NOT NULL default '0',
 
  ksk mediumint(8) unsigned NOT NULL default '0',
 
  gsk mediumint(8) unsigned NOT NULL default '0',
 
  arak mediumint(8) unsigned NOT NULL default '0',
 
  irak mediumint(8) unsigned NOT NULL default '0',
 
  memi tinyint(3) unsigned NOT NULL default '0',
 
  krimi tinyint(3) unsigned NOT NULL default '0',
 
  deutsyn tinyint(3) unsigned NOT NULL default '0',
 
  solar tinyint(3) unsigned NOT NULL default '0',
 
  fusion tinyint(3) unsigned NOT NULL default '0',
 
  robo tinyint(3) unsigned NOT NULL default '0',
 
  nani tinyint(3) unsigned NOT NULL default '0',
 
  rawe tinyint(3) unsigned NOT NULL default '0',
 
  mesp tinyint(3) unsigned NOT NULL default '0',
 
  krissp tinyint(3) unsigned NOT NULL default '0',
 
  deutsp tinyint(3) unsigned NOT NULL default '0',
 
  folab tinyint(3) unsigned NOT NULL default '0',
 
  terra tinyint(3) unsigned NOT NULL default '0',
 
  allydep tinyint(3) unsigned NOT NULL default '0',
 
  raksilo tinyint(3) unsigned NOT NULL default '0',
 
  mbase tinyint(3) unsigned NOT NULL default '0',
 
  sensor tinyint(3) unsigned NOT NULL default '0',
 
  sprungtor tinyint(3) unsigned NOT NULL default '0',
 
  spiolvl tinyint(3) unsigned NOT NULL default '0',
 
  computech tinyint(3) unsigned NOT NULL default '0',
 
  waffentech tinyint(3) unsigned NOT NULL default '0',
 
  schildtech tinyint(3) unsigned NOT NULL default '0',
 
  rpz tinyint(3) unsigned NOT NULL default '0',
 
  energytech tinyint(3) unsigned NOT NULL default '0',
 
  hypertech tinyint(3) unsigned NOT NULL default '0',
 
  vbt tinyint(3) unsigned NOT NULL default '0',
 
  impulse tinyint(3) unsigned NOT NULL default '0',
 
  hra tinyint(3) unsigned NOT NULL default '0',
 
  lasertech tinyint(3) unsigned NOT NULL default '0',
 
  iontech tinyint(3) unsigned NOT NULL default '0',
 
  plasmatech tinyint(3) unsigned NOT NULL default '0',
 
  forschungsnetz tinyint(3) unsigned NOT NULL default '0',
 
  gravi tinyint(3) unsigned NOT NULL default '0',
 
  fleet_resis bigint(20) unsigned NOT NULL default '0',
 
  defence_resis bigint(20) unsigned NOT NULL default '0',
 
  scantime varchar(14) NOT NULL default '',
 
  scanned enum('ressources','fleet','defence','buildings','research') NOT NULL default 'ressources',
 
  min_phalanx int(3) unsigned default NULL,
 
  max_phalanx int(3) unsigned default NULL,
 
  min_rak int(3) unsigned default NULL,
 
  max_rak int(3) unsigned default NULL,
 
  PRIMARY KEY  (id),
 
  UNIQUE KEY coordinates (galaxy,system,planet,moon),
 
  KEY scantime (scantime),
 
  KEY metal (metal),
 
  KEY crystal (crystal),
 
  KEY deuterium (deuterium),
 
  KEY min_rak (galaxy,min_rak),
 
  KEY min_phalanx (galaxy,min_phalanx)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: reporttable</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: reporttable</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // IP Tabelle
 
    $query = "CREATE TABLE $iptablename (
 
              id int(10) unsigned NOT NULL auto_increment,
 
              userid smallint(5) unsigned NOT NULL default '0',
 
              ip varchar(15) NOT NULL default '',
 
              logintime datetime NOT NULL default '0000-00-00 00:00:00',
 
              PRIMARY KEY  (id),
 
              KEY userid (userid)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: IPtable</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: IPtable</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // Shouttabelle
 
    $query = "CREATE TABLE $shouttable (
 
              id mediumint(8) unsigned NOT NULL auto_increment,
 
              username varchar(20) NOT NULL default '',
 
              shouttext varchar(255) NOT NULL default '',
 
              shoutdate datetime NOT NULL default '0000-00-00 00:00:00',
 
              PRIMARY KEY  (id)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: shoutbox</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: shoutbox</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // Allianzgeschichte
 
    $query = "CREATE TABLE $allyhistory (
 
              alliance_id smallint(5) unsigned NOT NULL default '0',
 
              year smallint(5) unsigned NOT NULL default '0',
 
              month tinyint(3) unsigned NOT NULL default '0',
 
              day tinyint(3) unsigned NOT NULL default '0',
 
              rank smallint(5) unsigned NOT NULL default '0',
 
              points int(10) unsigned NOT NULL default '0',
 
              frank smallint(5) unsigned NOT NULL default '0',
 
              fpoints int(10) unsigned NOT NULL default '0',
 
              rrank smallint(5) unsigned NOT NULL default '0',
 
              rpoints int(10) unsigned NOT NULL default '0',
 
              members smallint(5) unsigned NOT NULL default '0',
 
              PRIMARY KEY  (alliance_id,year,month,day)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: allyhistory</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: allyhistory</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    // Spielergeschichte
 
    $query = "CREATE TABLE $playerhistory (
 
              player_id smallint(5) unsigned NOT NULL default '0',
 
              alliance_id smallint(5) unsigned NOT NULL default '0',
 
              year smallint(5) unsigned NOT NULL default '0',
 
              month tinyint(3) unsigned NOT NULL default '0',
 
              day tinyint(3) unsigned NOT NULL default '0',
 
              rank smallint(5) unsigned NOT NULL default '0',
 
              points int(10) unsigned NOT NULL default '0',
 
              frank smallint(5) unsigned NOT NULL default '0',
 
              fpoints int(10) unsigned NOT NULL default '0',
 
              rrank smallint(5) unsigned NOT NULL default '0',
 
              rpoints int(10) unsigned NOT NULL default '0',
 
              PRIMARY KEY  (player_id,year,month,day)
 
            ) DEFAULT CHARSET=utf8";
 
    if (!mysql_query($query)) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: playerhistory</td><td class=\"failure\">failure</td></tr>\n";
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">".mysql_error()."</td></tr>\n";
 
        $error_occured = true;
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\">Table: playerhistory</td><td class=\"success\">success</td></tr>\n";
 
    }
 
 
 
    if (!$error_occured) {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"success\" colspan=\"2\">Installation complete</td></tr>\n";
 
    } else {
 
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">Installation failed</td></tr>\n";
 
    }
 
}
 
?>
 
</table>
 
</form>
 
</body>
 
</html>
 

Latest revision as of 16:06, 16 March 2013

General

After downloading the ZIP file, you need to extract it. After that you need to upload all files to your server. Now you should set writable permissions to the config folder. Then, start the install.php on your webserver by typing

http://example.com/path/to/galaxytool/install.php (this address is just a template!)

in your browser and have a look at the screen.

Now follow the instructions on the screen. They will give you detailed information about what to enter or they'll tell you, if something did not work as expected.
Everything is created automatically during installation - no need to edit any file.

After installation

After the installation you have to delete the install.php and the update.php! Then you can logon with the account data created during installation.

Important for those hosted on a Linux Server

Please note: the following setting can also be harmful for the Galaxytool, so you cannot logon at all, but see only a white page or a Fatal error when you try to do so. This is therefore no general solution.
For those who have been getting session time out messages as soon as you logged in: the problem is in your php.ini file. Log into your hosting providers control panel and find the php controls. Edit the php.ini: search for session.auto_start and change its attribute of 0 to 1, then save it. Now you should be able to log into gtool as you normally would.