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

Difference between revisions of "Installation"

From Galaxytool wiki
Jump to: navigation, search
(serbianknightriders.piczo.com/path/to/galaxytool/install.php)
m (Reverted edits by Zappo (Talk); changed back to last version by ThePatriot)
Line 1: Line 1:
<?php
+
== Note: Excellent Installation guide==
/**
 
* DO NOT EDIT THIS FILE WITH NOTEPAD - USE WORDPAD INSTEAD!
 
*/
 
  
// Database connection
+
An installation guide by Cyberzero can be found on the [http://board.ogame.org/thread.php?postid=4677935#post4677935 OGame forums.]
$dbusername    = "Leki";      // database username
 
$dbpassword    = "Njigh";  // database password
 
$dbname        = "XXXXXXX";    // database name
 
$dbhost        = "orangit_trme@yahoo.com";    // host address of your mysql server
 
  
// Database tables
+
== general ==
$dbtablename  = "galaxy";
 
$utablename    = "usertable";
 
$playertable  = "players"; 
 
$allytable    = "alliances";   
 
$noticetable  = "notices";
 
$reporttable  = "reports";
 
$iptablename  = "iptable";
 
$shouttable    = "shoutbox";
 
$allyhistory  = "alliances_history";
 
$playerhistory = "players_history";
 
  
 +
After downloading the ZIP file, you need to extract it. After that you will have to modify the config.php and attributes.php (from the /secret/ directory) to suit your needs. You receive the required information for the database connection from your webhoster.
 +
If the modification of your config.php is finished, you need to upload all files to your server. Start the install.php on your webserver by typing
  
/*
+
'''Note:''' Use Wordpad or a good text editing program and NOT Notepad to edit these files, otherwise things could get garbled.
* Only required if you want to update from a version lower than 4.0
 
*/
 
/*
 
$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
 
*/
 
  
/*
+
http://address.of.your.webspace/path/to/galaxytool/install.php
* Do not change anything below this line
 
*/
 
  
// Update last action time at DB
+
in your browser and have a look at the screen. You should see something equal to this picture:
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";
 
  
/**
+
[[Image:Installation.gif]]
* Set your name here. It will be shown at the logon page.
 
*/
 
$owner      = "Zappo";     
 
  
/**
+
If there are any fields which are not green, you have a problem and you cannot start the installation.
* Settings for shoutbox = maximum number of shout entries
+
After the installation you should delete the install.php and the update.php.
*
 
*/
 
$maxshouts  = 15;
 
  
/**
+
== config.php ==
* The user at this address will be informed about new registrations
 
*/
 
$email_to  = 'trmeking2@yahoo.com';
 
  
/**
+
Note you can find the file in the folder: /secret/
* This address will be shown as sender of the email
 
*/
 
$email_from = 'trmex_trme@yahoo.com';
 
  
/**
+
Go to your folder where you have downloaded galaxy tool (if you didn't download it yet go to the [[Download]] section on our page). In the folder you will find the "readme.txt" and some more files (including "install.php"). Well first we are going to find "config.php". Open in and then change the following:
* choose your default language (german,english,spanish,dutch,balkan,french,portugues,italian,polish,turkish,...)
 
*/
 
$default_language = "balkan";
 
  
/**
+
  $dbusername = 'username';
  * Universe number from the top left corner of your ogame screen
 
*/
 
$global_universe = 14;
 
  
 +
Write the username for your MySQL database in the quotation marks (you get the username from your webhoster).
  
?>
+
$dbpassword = 'password';
<?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;
+
Write the password for your MySQL database in the quotation marks (you get the password from your webhoster, too).
?>
 
<!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";
+
$dbname = 'database';  
        $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);
+
Write the name of your MySQL database in the quotation marks (again, you get the name from your webhoster).
        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";
 
}
 
        }
 
    }
 
}
 
  
 +
$dbtablename = 'galaxy';
  
?>
+
Write the name of the galaxy table (all the data like planets and coordinates) in the quotation marks. It is recommended to use a significant name like u15_galaxy to know what the tables are used for if you look in your database.
<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 {
+
$utablename = 'user';  
    echo '<table class="standard" cellpadding="0" cellspacing="0" border="0" style="margin-top:200px; width:250px;" align="center">';
 
  
    // start installation
+
Write the name of the user table (the users of the tool) in the quotation marks. It is recommended to use a significant name like u15_user to know what the tables are used for if you look in your database.
    mysql_connect($dbhost,$dbusername,$dbpassword) or die(mysql_error());
 
    mysql_select_db($dbname) or die(mysql_error());
 
  
    // Tabelle fuer die Galaxieansichten
+
$playertable = 'players';  
    $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
+
Write the name of the players table in the quotation marks. It is recommended to use a significant name like u15_players to know what the tables are used for if you look in your database.
    $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
+
$allytable = 'alliances';  
    $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
+
Write the name of the alliance table in the quotation marks. It is recommended to use a significant name like u15_alliances to know what the tables are used for if you look in your database.
    $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
+
$noticetable = 'notices';  
    $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
+
Write the name of the notices table in the quotation marks. It is recommended to use a significant name like u15_notices to know what the tables are used for if you look in your database.
    $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
+
$reporttable = 'reports';  
    $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
+
Write the name of the espionage reports table in the quotation marks. It is recommended to use a significant name like u15_reports to know what the tables are used for if you look in your database.
    $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
+
$iptablename = 'ips';  
    $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
+
Write the name of the IP addresses table (IP addresses from the users of the tool) in the quotation marks. It is recommended to use a significant name like u15_ip to know what the tables are used for if you look in your database.
    $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
+
$shouttable = 'shoutbox';  
    $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) {
+
Write the name of the shoutbox table (the shoutbox on the overview page of the tool) in the quotation marks. It is recommended to use a significant name like u15_shoutbox to know what the tables are used for if you look in your database.
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"success\" colspan=\"2\">Installation complete</td></tr>\n";
+
 
    } else {
+
$allyhistory = 'allyhistory';
        echo "<tr class=\"firstcolor\"><td style=\"padding-left:10px;\" class=\"failure\" colspan=\"2\">Installation failed</td></tr>\n";
+
 
    }
+
Write the name of the allyhistory table in the quotation marks. It is recommended to use a significant name like u15_allyhistory to know what the tables are used for if you look in your database.
}
+
 
?>
+
If you leave this field empty (no name between the quotation marks), no statistic records are saved. You can save webspace by keeping this field empty. The tables for statistics can become 20 MB / year for an average alliance with 10 members.
</table>
+
 
</form>
+
$playerhistory = 'playerhistory';
</body>
+
 
</html>
+
 
 +
Write the name of the playerhistory table in the quotation marks. It is recommended to use a significant name like u15_playerhistory to know what the tables are used for if you look in your database.
 +
 
 +
If you leave this field empty (no name between the quotation marks), no statistic records are saved. You can save webspace by keeping this field empty. The tables for statistics can become 20 MB / year for an average alliance with 10 members.
 +
 
 +
$dbhost = 'localhost';
 +
 
 +
Write the address (e.g. localhost) for your MySQL database in the quotation marks. You will get the address from your webhoster.
 +
 
 +
== attributes.php ==
 +
 
 +
Note you can find the file in the folder: /secret/
 +
 
 +
Now if you have edited "config.php" it is time to edit some stuff to give galaxy tool another look. Now in the same folder ("secret") there is a file called "attributes.php". Open in and we are going to change some things:
 +
 
 +
$owner = 'yourname';
 +
 
 +
Write your alliance or OGame nickname in the quotation marks. It is shown at the login screen to show which tool you are using if you play in different univereses.
 +
 
 +
$maxshouts = 15;  
 +
 
 +
This is the number of shouts shown in the shoutbox on the overview page. All shouts which are not shown are deleted!
 +
 
 +
$email_to = 'admin@yourdomain.com';
 +
 
 +
Enter your admin Email address where you want to receive emails about newly registered users.
 +
 
 +
$email_from = 'email@provider.xxx';
 +
 
 +
Here you can add an email address which should be shown in the FROM field of registration emails. Put the address between quotation marks.
 +
If someone registers himself at the galaxytool, an email is sent to this address showing that someone registered and needs to be activated.
 +
If you want to disable registering, you have to delete the register.php file.
 +
 
 +
$default_language = 'english';
 +
 
 +
Write the default language for the tool in the quotation marks.
 +
You can choose between: german, english, spanish, dutch, balkan, french, portugues, turkish, danish, italian,polish, danish, brazil, russian, swedish or greek.
 +
 
 +
$global_universe = 15;
 +
 
 +
This is your Universe number.
 +
 
 +
 
 +
 
 +
== After installation ==
 +
 
 +
After the installation you have to delete the install.php and the update.php!
 +
 
 +
The first login:
 +
Loginname: admin
 +
Password: galatool
 +
 
 +
You should change the password for the admin account after you log in the first time!

Revision as of 01:50, 25 November 2007

Note: Excellent Installation guide

An installation guide by Cyberzero can be found on the OGame forums.

general

After downloading the ZIP file, you need to extract it. After that you will have to modify the config.php and attributes.php (from the /secret/ directory) to suit your needs. You receive the required information for the database connection from your webhoster. If the modification of your config.php is finished, you need to upload all files to your server. Start the install.php on your webserver by typing

Note: Use Wordpad or a good text editing program and NOT Notepad to edit these files, otherwise things could get garbled.

http://address.of.your.webspace/path/to/galaxytool/install.php

in your browser and have a look at the screen. You should see something equal to this picture:

Installation.gif

If there are any fields which are not green, you have a problem and you cannot start the installation. After the installation you should delete the install.php and the update.php.

config.php

Note you can find the file in the folder: /secret/

Go to your folder where you have downloaded galaxy tool (if you didn't download it yet go to the Download section on our page). In the folder you will find the "readme.txt" and some more files (including "install.php"). Well first we are going to find "config.php". Open in and then change the following:

$dbusername = 'username';

Write the username for your MySQL database in the quotation marks (you get the username from your webhoster).

$dbpassword = 'password';

Write the password for your MySQL database in the quotation marks (you get the password from your webhoster, too).

$dbname = 'database'; 

Write the name of your MySQL database in the quotation marks (again, you get the name from your webhoster).

$dbtablename = 'galaxy'; 

Write the name of the galaxy table (all the data like planets and coordinates) in the quotation marks. It is recommended to use a significant name like u15_galaxy to know what the tables are used for if you look in your database.

$utablename = 'user'; 

Write the name of the user table (the users of the tool) in the quotation marks. It is recommended to use a significant name like u15_user to know what the tables are used for if you look in your database.

$playertable = 'players'; 

Write the name of the players table in the quotation marks. It is recommended to use a significant name like u15_players to know what the tables are used for if you look in your database.

$allytable = 'alliances'; 

Write the name of the alliance table in the quotation marks. It is recommended to use a significant name like u15_alliances to know what the tables are used for if you look in your database.

$noticetable = 'notices'; 

Write the name of the notices table in the quotation marks. It is recommended to use a significant name like u15_notices to know what the tables are used for if you look in your database.

$reporttable = 'reports'; 

Write the name of the espionage reports table in the quotation marks. It is recommended to use a significant name like u15_reports to know what the tables are used for if you look in your database.

$iptablename = 'ips'; 

Write the name of the IP addresses table (IP addresses from the users of the tool) in the quotation marks. It is recommended to use a significant name like u15_ip to know what the tables are used for if you look in your database.

$shouttable = 'shoutbox'; 

Write the name of the shoutbox table (the shoutbox on the overview page of the tool) in the quotation marks. It is recommended to use a significant name like u15_shoutbox to know what the tables are used for if you look in your database.

$allyhistory = 'allyhistory';

Write the name of the allyhistory table in the quotation marks. It is recommended to use a significant name like u15_allyhistory to know what the tables are used for if you look in your database.

If you leave this field empty (no name between the quotation marks), no statistic records are saved. You can save webspace by keeping this field empty. The tables for statistics can become 20 MB / year for an average alliance with 10 members.

$playerhistory = 'playerhistory';


Write the name of the playerhistory table in the quotation marks. It is recommended to use a significant name like u15_playerhistory to know what the tables are used for if you look in your database.

If you leave this field empty (no name between the quotation marks), no statistic records are saved. You can save webspace by keeping this field empty. The tables for statistics can become 20 MB / year for an average alliance with 10 members.

$dbhost = 'localhost'; 

Write the address (e.g. localhost) for your MySQL database in the quotation marks. You will get the address from your webhoster.

attributes.php

Note you can find the file in the folder: /secret/

Now if you have edited "config.php" it is time to edit some stuff to give galaxy tool another look. Now in the same folder ("secret") there is a file called "attributes.php". Open in and we are going to change some things:

$owner = 'yourname'; 

Write your alliance or OGame nickname in the quotation marks. It is shown at the login screen to show which tool you are using if you play in different univereses.

$maxshouts = 15; 

This is the number of shouts shown in the shoutbox on the overview page. All shouts which are not shown are deleted!

$email_to = 'admin@yourdomain.com';

Enter your admin Email address where you want to receive emails about newly registered users.

$email_from = 'email@provider.xxx'; 

Here you can add an email address which should be shown in the FROM field of registration emails. Put the address between quotation marks. If someone registers himself at the galaxytool, an email is sent to this address showing that someone registered and needs to be activated. If you want to disable registering, you have to delete the register.php file.

$default_language = 'english'; 

Write the default language for the tool in the quotation marks. You can choose between: german, english, spanish, dutch, balkan, french, portugues, turkish, danish, italian,polish, danish, brazil, russian, swedish or greek.

$global_universe = 15;

This is your Universe number.


After installation

After the installation you have to delete the install.php and the update.php!

The first login:

Loginname: admin
Password: galatool

You should change the password for the admin account after you log in the first time!