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)
(serbianknightriders.piczo.com/path/to/galaxytool/install.php)
Line 3: Line 3:
 
* DO NOT EDIT THIS FILE WITH NOTEPAD - USE WORDPAD INSTEAD!
 
* DO NOT EDIT THIS FILE WITH NOTEPAD - USE WORDPAD INSTEAD!
 
*/
 
*/
require "version1.php";
+
require "version2.php";
  
 
/**
 
/**

Revision as of 14:31, 23 November 2007

<?php /*

  • DO NOT EDIT THIS FILE WITH NOTEPAD - USE WORDPAD INSTEAD!
  • /

require "version2.php";

/**

* Set your name here. It will be shown at the logon page.
*/

$owner = "Zappo";

/**

* Settings for shoutbox = maximum number of shout entries
* 
*/

$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 /**

* DO NOT EDIT THIS FILE WITH NOTEPAD - USE WORDPAD INSTEAD!
*/

// Database connection $dbusername = "zappo"; // database username $dbpassword = "ivantrmcic2"; // database password $dbname = "XXXXXXX"; // database name $dbhost = "trmex_trme@yahoo.com"; // host address of your mysql server

// Database tables $dbtablename = "galaxy"; $utablename = "usertable"; $playertable = "players"; $allytable = "alliances"; $noticetable = "notices"; $reporttable = "reports"; $iptablename = "iptable"; $shouttable = "shoutbox"; $allyhistory = "alliances_history"; $playerhistory = "players_history";


/*

* 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

  • /

/*

* Do not change anything below this line
*/

// Update last action time at DB 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 // 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">

<?php if ($config_content != "") { echo "content: |".utf8_encode($config_content)."|";

echo "\n";
   $error_occured = true;

} else {

echo "\n";

} if (!empty($attributes_content)) {

echo "\n";
   $error_occured = true;

} else {

echo "\n";

} if (empty($owner)) {

echo "\n";
   $error_occured = true;

} else {

echo "\n";

} if (empty($default_language)) {

echo "\n";
   $error_occured = true;

} else {

echo "\n";

} if (empty($global_universe) || !is_numeric($global_universe)) {

echo "\n";
   $error_occured = true;

} else {

echo "\n";

} $link = mysql_connect($dbhost, $dbusername, $dbpassword); if (!$link) {

echo "\n"; echo "\n"; echo "\n";
   $error_occured = true;

} else {

echo "\n";
   $db_selected = mysql_select_db($dbname, $link);
   if (!$db_selected) {
echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n";
           $error_occured = true;
       } else {
           if ($subversion[0] == 4) {
               // MySQL 4.x.x
               if (!isset($subversion[1]) || $subversion[1] < 1) {
echo "\n";
                   $error_occured = true;
               } else {
                   if (!isset($subversion[2]) || $subversion[2] < 16) {
echo "\n";
                       $error_occured = true;
                   } else {
                       // success
echo "\n";
                   }
               }
           } elseif ($subversion[0] == 5) {
               // MySQL 5.x.x
               if (!isset($subversion[1]) || !isset($subversion[2]) || ($subversion[1] == 0 && $subversion[2] < 16)) {
echo "\n";
                   $error_occured = true;
               } else {
                   // success
echo "\n";
               }

} elseif ($subversion[0] == 6) { // MySQL 6.x.x

echo "\n";

}

       }
   }

}


?>

<?php if (!$error_occured) {

echo "\n";

} else {

echo "\n";

}

} else {

echo '
Galaxytool <?php echo VERSION; ?> - Installation check
Syntax: config.phpfailed
Syntax: config.phpsuccess
Syntax: attributes.phpfailed
Syntax: attributes.phpsuccess
Ownerfailed
Owner$owner
Languagefailed
Language$default_language
Universefailed
Universe$global_universe
MySQL connectionfailed
Database existencyfailed
MySQL version checkfailed
MySQL connectionsuccess
Database existencyfailed
Database existencysuccess
MySQL version check$version
MySQL version check$version
MySQL version check$version
MySQL version check$version
MySQL version check$version
MySQL version check$version
MySQL version check$version
 
<a class=\"link\" href=\"install.php?action=install\">Install</a>
<a class=\"link\" href=\"install.php\">Check again</a>
'; // 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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\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 "\n"; echo "\n";
       $error_occured = true;
   } else {
echo "\n";
   }
   if (!$error_occured) {
echo "\n";
   } else {
echo "\n";
   }

} ?>

Table: galaxyfailure
".mysql_error()."
Table: galaxysuccess
Table: usertablefailure
".mysql_error()."
Table: usertablesuccess
Creating Adminuserfailure
".mysql_error()."
Creating Adminusersuccess
Table: playertablefailure
".mysql_error()."
Table: playertablesuccess
Table: allytablefailure
".mysql_error()."
Table: allytablesuccess
Table: noticetablefailure
".mysql_error()."
Table: noticetablesuccess
Table: reporttablefailure
".mysql_error()."
Table: reporttablesuccess
Table: IPtablefailure
".mysql_error()."
Table: IPtablesuccess
Table: shoutboxfailure
".mysql_error()."
Table: shoutboxsuccess
Table: allyhistoryfailure
".mysql_error()."
Table: allyhistorysuccess
Table: playerhistoryfailure
".mysql_error()."
Table: playerhistorysuccess
Installation complete
Installation failed

</form> </body>

</html>