mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
chore: restoring installation folder
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<Files ~ "\.tpl$">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
||||
@@ -0,0 +1,296 @@
|
||||
<?php
|
||||
############################### S T A R T ################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename config.php ##
|
||||
## Version 8.0 ##
|
||||
## Developed by: Dzoki and Dixie Edited by Advocaite ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2013-2014. All rights reserved. ##
|
||||
## Modified by: Shadow and ronix ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
//////////////////////////////////
|
||||
// ***** ERROR REPORTING *****//
|
||||
//////////////////////////////////
|
||||
// (E_ALL ^ E_NOTICE) = enabled
|
||||
// (0) = disabled
|
||||
define("ERROR_REPORT","%ERRORREPORT%");
|
||||
%ERROR%
|
||||
|
||||
//////////////////////////////////
|
||||
// ***** SERVER SETTINGS *****//
|
||||
//////////////////////////////////
|
||||
|
||||
// ***** Name
|
||||
define("SERVER_NAME","%SERVERNAME%");
|
||||
|
||||
// ***** Time zone added by ronix
|
||||
// Defines server time zone.
|
||||
define("TIMEZONE","%STIMEZONE%");
|
||||
date_default_timezone_set(TIMEZONE);
|
||||
|
||||
// ***** Started
|
||||
// Defines when has server started.
|
||||
define("COMMENCE","%STARTTIME%");
|
||||
|
||||
// ***** Server Start Date / Time
|
||||
define("START_DATE", "%SSTARTDATE%");
|
||||
define("START_TIME", "%SSTARTTIME%");
|
||||
|
||||
// ***** Language
|
||||
// Choose your server language.
|
||||
define("LANG","%LANG%");
|
||||
|
||||
// ***** Speed
|
||||
// Choose your server speed. NOTICE: Higher speed, more likely
|
||||
// to have some bugs. Lower speed, most likely no major bugs.
|
||||
// Values: 1 (normal), 3 (3x speed) etc...
|
||||
define("SPEED", "%SPEED%");
|
||||
|
||||
// ***** World size
|
||||
// Defines world size. NOTICE: DO NOT EDIT!!
|
||||
define("WORLD_MAX", "%MAX%");
|
||||
|
||||
// ***** Graphic Pack
|
||||
// True = enabled, false = disabled
|
||||
//!!!!!!!!!!!! DO NOT ENABLE !!!!!!!!!!!!
|
||||
define("GP_ENABLE",false);
|
||||
// Graphic pack location (default: gpack/travian_default/)
|
||||
define("GP_LOCATE", "gpack/travian_default/");
|
||||
|
||||
// ***** Troop Speed
|
||||
// Values: 1 (normal), 3 (3x speed) etc...
|
||||
define("INCREASE_SPEED","%INCSPEED%");
|
||||
|
||||
// ***** Evasion Speed
|
||||
define("EVASION_SPEED","%EVASIONSPEED%");
|
||||
|
||||
// ***** Trader capacity
|
||||
// Values: 1 (normal), 3 (3x speed) etc...
|
||||
define("TRADER_CAPACITY","%TRADERCAP%");
|
||||
|
||||
// ***** Cranny capacity
|
||||
define("CRANNY_CAPACITY","%CRANNYCAP%");
|
||||
|
||||
// ***** Trapper capacity
|
||||
define("TRAPPER_CAPACITY","%TRAPPERCAP%");
|
||||
|
||||
// ***** Village Expand
|
||||
// 1 = slow village expanding - more Cultural Points needed for every new village
|
||||
// 0 = fast village expanding - less Cultural Points needed for every new village
|
||||
define("CP", %VILLAGE_EXPAND%);
|
||||
|
||||
// ***** Demolish Level Required
|
||||
// Defines which level of Main building is required to be able to
|
||||
// demolish. Min value = 1, max value = 20
|
||||
// Default: 10
|
||||
define("DEMOLISH_LEVEL_REQ","%DEMOLISH%");
|
||||
|
||||
// ***** Change storage capacity
|
||||
define("STORAGE_MULTIPLIER","%STORAGE_MULTIPLIER%");
|
||||
define("STORAGE_BASE",800*STORAGE_MULTIPLIER);
|
||||
|
||||
// ***** Quest
|
||||
// Ingame quest enabled/disabled.
|
||||
define("QUEST",%QUEST%);
|
||||
//quest type : 25 = Travian Official
|
||||
// 37 = TravianZ Extended
|
||||
define("QTYPE",%QTYPE%);
|
||||
|
||||
// ***** Beginners Protection
|
||||
// 3600 = 1 hour
|
||||
// 3600*12 = 12 hours
|
||||
// 3600*24 = 1 day
|
||||
// 3600*24*3 = 3 days
|
||||
// You can choose any value you want!
|
||||
define("PROTECTION","%BEGINNER%");
|
||||
|
||||
// ***** Enable WW Statistics
|
||||
define("WW",%WW%);
|
||||
|
||||
// ***** Show Natars in Statistics
|
||||
define("SHOW_NATARS",%SHOW_NATARS%);
|
||||
|
||||
// ***** Natars Units Multiplier
|
||||
define("NATARS_UNITS",%NATARS_UNITS%);
|
||||
|
||||
// ***** Nature troops regeneration time
|
||||
define("NATURE_REGTIME",%NATURE_REGTIME%);
|
||||
|
||||
// ***** Enable T4 is Coming screen
|
||||
define("T4_COMING",%T4_COMING%);
|
||||
|
||||
// ***** Activation Mail
|
||||
// true = activation mail will be sent, users will have to finish registration
|
||||
// by clicking on link recieved in mail.
|
||||
// false = users can register with any mail. Not needed to be real one.
|
||||
define("AUTH_EMAIL",%ACTIVATE%);
|
||||
|
||||
// ***** PLUS
|
||||
//Plus account lenght
|
||||
define("PLUS_TIME",%PLUS_TIME%);
|
||||
//+25% production lenght
|
||||
define("PLUS_PRODUCTION",%PLUS_PRODUCTION%);
|
||||
// ***** Medal Interval check
|
||||
define("MEDALINTERVAL",%MEDALINTERVAL%);
|
||||
// ***** Great Workshop
|
||||
define("GREAT_WKS",%GREAT_WKS%);
|
||||
// ***** Tourn threshold
|
||||
define("TS_THRESHOLD",%TS_THRESHOLD%);
|
||||
|
||||
// ***** Register open/close
|
||||
define("REG_OPEN",%REG_OPEN%);
|
||||
|
||||
// ***** Peace system
|
||||
// 0 = None
|
||||
// 1 = Normal
|
||||
// 2 = Christmas
|
||||
// 3 = New Year
|
||||
// 4 = Easter
|
||||
define("PEACE",%PEACE%);
|
||||
|
||||
//////////////////////////////////
|
||||
// **** LOG SETTINGS **** //
|
||||
//////////////////////////////////
|
||||
// LOG BUILDING/UPGRADING
|
||||
define("LOG_BUILD",%LOGBUILD%);
|
||||
// LOG RESEARCHES
|
||||
define("LOG_TECH",%LOGTECH%);
|
||||
// LOG USER LOGIN (IP's)
|
||||
define("LOG_LOGIN",%LOGLOGIN%);
|
||||
// LOG GOLD
|
||||
define("LOG_GOLD_FIN",%LOGGOLDFIN%);
|
||||
// LOG ADMIN
|
||||
define("LOG_ADMIN",%LOGADMIN%);
|
||||
// LOG ATTACK REPORTS
|
||||
define("LOG_WAR",%LOGWAR%);
|
||||
// LOG MARKET REPORTS
|
||||
define("LOG_MARKET",%LOGMARKET%);
|
||||
// LOG ILLEGAL ACTIONS
|
||||
define("LOG_ILLEGAL",%LOGILLEGAL%);
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
// **** NEWSBOX SETTINGS **** //
|
||||
//////////////////////////////////
|
||||
//true = enabled
|
||||
//false = disabled
|
||||
define("NEWSBOX1",%BOX1%);
|
||||
define("NEWSBOX2",%BOX2%);
|
||||
define("NEWSBOX3",%BOX3%);
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
// **** SQL SETTINGS **** //
|
||||
//////////////////////////////////
|
||||
|
||||
// ***** SQL Hostname
|
||||
// example. sql106.000space.com / localhost
|
||||
// If you host server on own PC than this value is: localhost
|
||||
// If you use online hosting, value must be written in host cpanel
|
||||
define("SQL_SERVER", "%SSERVER%");
|
||||
|
||||
// ***** Database Username
|
||||
define("SQL_USER", "%SUSER%");
|
||||
|
||||
// ***** Database Password
|
||||
define("SQL_PASS", "%SPASS%");
|
||||
|
||||
// ***** Database Name
|
||||
define("SQL_DB", "%SDB%");
|
||||
|
||||
// ***** Database - Table Prefix
|
||||
define("TB_PREFIX", "%PREFIX%");
|
||||
|
||||
// ***** Database type
|
||||
// 0 = MYSQL
|
||||
// 1 = MYSQLi
|
||||
// default: 1
|
||||
define("DB_TYPE", %CONNECTT%);
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// **** EXTRA SETTINGS **** //
|
||||
////////////////////////////////////
|
||||
|
||||
// ***** Censore words
|
||||
//define("WORD_CENSOR", "%ACTCEN%");
|
||||
|
||||
// ***** Words (censore)
|
||||
// Choose which words do you want to be censored
|
||||
//define("CENSORED","%CENWORDS%");
|
||||
|
||||
|
||||
// ***** Limit Mailbox
|
||||
// Limits mailbox to defined number of mails. (IGM's)
|
||||
define("LIMIT_MAILBOX",%LIMIT_MAILBOX%);
|
||||
// If enabled, define number of maximum mails.
|
||||
define("MAX_MAIL","%MAX_MAILS%");
|
||||
|
||||
// ***** Include administrator in statistics/rank
|
||||
define("INCLUDE_ADMIN", %ARANK%);
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// **** ADMIN SETTINGS **** //
|
||||
////////////////////////////////////
|
||||
|
||||
// ***** Admin Email
|
||||
define("ADMIN_EMAIL", "%AEMAIL%");
|
||||
|
||||
// ***** Admin Name
|
||||
define("ADMIN_NAME", "%ANAME%");
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
// **** DO NOT EDIT SETTINGS **** //
|
||||
//////////////////////////////////////////
|
||||
define("TRACK_USR","%UTRACK%");
|
||||
define("USER_TIMEOUT","%UTOUT%");
|
||||
define("ALLOW_BURST",false);
|
||||
define("BASIC_MAX",1);
|
||||
define("INNER_MAX",1);
|
||||
define("PLUS_MAX",1);
|
||||
define("ALLOW_ALL_TRIBE",false);
|
||||
define("CFM_ADMIN_ACT",true);
|
||||
define("SERVER_WEB_ROOT",false);
|
||||
define("USRNM_SPECIAL",true);
|
||||
define("USRNM_MIN_LENGTH",3);
|
||||
define("PW_MIN_LENGTH",4);
|
||||
define("BANNED",0);
|
||||
define("AUTH",1);
|
||||
define("USER",2);
|
||||
define("MULTIHUNTER",8);
|
||||
define("ADMIN",9);
|
||||
define("COOKIE_EXPIRE", 60*60*24*7);
|
||||
define("COOKIE_PATH", "/");
|
||||
|
||||
|
||||
////////////////////////////////////////////
|
||||
// **** DOMAIN/SERVER SETTINGS **** //
|
||||
////////////////////////////////////////////
|
||||
define("DOMAIN", "%DOMAIN%");
|
||||
define("HOMEPAGE", "%HOMEPAGE%");
|
||||
define("SERVER", "%SERVER%");
|
||||
|
||||
$requse = 0;
|
||||
|
||||
############################### E N D ##################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename config.php ##
|
||||
## Version 4.8.5 ##
|
||||
## Developed by: Dzoki and Dixie Edited by Advocaite ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// TRAVIANX //
|
||||
// Only for advanced users, do not edit if you dont know what are you doing! //
|
||||
// Made by: Dzoki & Dixie (TravianX) //
|
||||
// - TravianX = Travian Clone Project - //
|
||||
// DO NOT REMOVE COPYRIGHT NOTICE! //
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
include("constant.php");
|
||||
class MYSQLi_DB {
|
||||
var $connection;
|
||||
function MYSQLi_DB() {
|
||||
$this->connection = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB) or die(mysqli_error());
|
||||
}
|
||||
function query($query) {
|
||||
return mysqli_query($this->connection, $query);
|
||||
}
|
||||
};
|
||||
class MYSQL_DB {
|
||||
var $connection;
|
||||
function MYSQL_DB() {
|
||||
$this->connection = mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
|
||||
mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
|
||||
}
|
||||
|
||||
function mysql_exec_batch ($p_query, $p_transaction_safe = true) {
|
||||
if ($p_transaction_safe) {
|
||||
$p_query = 'START TRANSACTION;' . $p_query . '; COMMIT;';
|
||||
};
|
||||
$query_split = preg_split ("/[;]+/", $p_query);
|
||||
foreach ($query_split as $command_line) {
|
||||
$command_line = trim($command_line);
|
||||
if ($command_line != '') {
|
||||
$query_result = mysql_query($command_line);
|
||||
if ($query_result == 0) {
|
||||
break;
|
||||
};
|
||||
};
|
||||
};
|
||||
return $query_result;
|
||||
}
|
||||
|
||||
function query($query) {
|
||||
return mysql_query($query, $this->connection);
|
||||
}
|
||||
};
|
||||
|
||||
if(DB_TYPE) {
|
||||
$database = new MYSQLi_DB;
|
||||
}
|
||||
else {
|
||||
$database = new MYSQL_DB;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
$gameinstall = 1;
|
||||
|
||||
include ("../../GameEngine/config.php");
|
||||
include ("../../GameEngine/Database.php");
|
||||
include ("../../GameEngine/Admin/database.php");
|
||||
include ("../../GameEngine/Lang/" . LANG . ".php");
|
||||
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysql_select_db(SQL_DB);
|
||||
|
||||
if(isset($_POST['mhpw'])) {
|
||||
$password = $_POST['mhpw'];
|
||||
mysql_query("UPDATE " . TB_PREFIX . "users SET password = '" . md5($password) . "' WHERE username = 'Multihunter'");
|
||||
$wid = $admin->getWref(0, 0);
|
||||
$uid = 5;
|
||||
$status = $database->getVillageState($wid);
|
||||
if($status == 0) {
|
||||
$database->setFieldTaken($wid);
|
||||
$database->addVillage($wid, $uid, 'Multihunter', '0');
|
||||
$database->addResourceFields($wid, $database->getVillageType($wid));
|
||||
$database->addUnits($wid);
|
||||
$database->addTech($wid);
|
||||
$database->addABTech($wid);
|
||||
}
|
||||
}
|
||||
|
||||
$gameinstall = 0;
|
||||
header("Location: ../index.php?s=5");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
|
||||
if(!isset($_SESSION)) session_start();
|
||||
$gameinstall = 1;
|
||||
include ("../../GameEngine/config.php");
|
||||
include ("../../GameEngine/Database.php");
|
||||
include ("../../GameEngine/Admin/database.php");
|
||||
|
||||
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysql_select_db(SQL_DB);
|
||||
|
||||
$database->populateOasisdata();
|
||||
$database->populateOasis();
|
||||
$database->populateOasisUnits2();
|
||||
|
||||
|
||||
|
||||
|
||||
header("Location: ../index.php?s=6");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// TRAVIANX //
|
||||
// Only for advanced users, do not edit if you dont know what are you doing! //
|
||||
// Made by: Dzoki & Dixie (TravianX) //
|
||||
// - TravianX = Travian Clone Project - //
|
||||
// DO NOT REMOVE COPYRIGHT NOTICE! //
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
include("database.php");
|
||||
|
||||
|
||||
$xyas=(1+(2*WORLD_MAX));
|
||||
|
||||
for($i=0; $i<$xyas; $i++){
|
||||
$y=(WORLD_MAX-$i);
|
||||
|
||||
for($j=0; $j<$xyas; $j++){
|
||||
$x=((WORLD_MAX*-1)+$j);
|
||||
|
||||
//choose a field type
|
||||
if(($x == 0 & $y == 0) || ($x == WORLD_MAX & $y == WORLD_MAX)) {
|
||||
$typ='3';
|
||||
$otype='0';
|
||||
}else{
|
||||
$rand=rand(1, 1000);
|
||||
if("10" >= $rand){
|
||||
$typ='1';
|
||||
$otype='0';
|
||||
} else if("90" >= $rand){
|
||||
$typ='2';
|
||||
$otype='0';
|
||||
} else if("400" >= $rand){
|
||||
$typ='3';
|
||||
$otype='0';
|
||||
} else if("480" >= $rand){
|
||||
$typ='4';
|
||||
$otype='0';
|
||||
} else if("560" >= $rand){
|
||||
$typ='5';
|
||||
$otype='0';
|
||||
} else if("570" >= $rand){
|
||||
$typ='6';
|
||||
$otype='0';
|
||||
} else if("600" >= $rand){
|
||||
$typ='7';
|
||||
$otype='0';
|
||||
} else if("630" >= $rand){
|
||||
$typ='8';
|
||||
$otype='0';
|
||||
} else if("660" >= $rand){
|
||||
$typ='9';
|
||||
$otype='0';
|
||||
} else if("740" >= $rand){
|
||||
$typ='10';
|
||||
$otype='0';
|
||||
} else if("820" >= $rand){
|
||||
$typ='11';
|
||||
$otype='0';
|
||||
} else if("900" >= $rand){
|
||||
$typ='12';
|
||||
$otype='0';
|
||||
} else if("908" >= $rand){
|
||||
$typ='0';
|
||||
$otype='1';
|
||||
} else if("916" >= $rand){
|
||||
$typ='0';
|
||||
$otype='2';
|
||||
} else if("924" >= $rand){
|
||||
$typ='0';
|
||||
$otype='3';
|
||||
} else if("932" >= $rand){
|
||||
$typ='0';
|
||||
$otype='4';
|
||||
} else if("940" >= $rand){
|
||||
$typ='0';
|
||||
$otype='5';
|
||||
} else if("948" >= $rand){
|
||||
$typ='0';
|
||||
$otype='6';
|
||||
} else if("956" >= $rand){
|
||||
$typ='0';
|
||||
$otype='7';
|
||||
} else if("964" >= $rand){
|
||||
$typ='0';
|
||||
$otype='8';
|
||||
} else if("972" >= $rand){
|
||||
$typ='0';
|
||||
$otype='9';
|
||||
} else if("980" >= $rand){
|
||||
$typ='0';
|
||||
$otype='10';
|
||||
} else if("988" >= $rand){
|
||||
$typ='0';
|
||||
$otype='11';
|
||||
} else {
|
||||
$typ='0';
|
||||
$otype='12';
|
||||
}
|
||||
}
|
||||
//image pick
|
||||
if($otype=='0'){
|
||||
$image="t".rand(0,9)."";
|
||||
} else {
|
||||
$image="o".$otype."";
|
||||
}
|
||||
|
||||
//into database
|
||||
$q = "INSERT into ".TB_PREFIX."wdata values (0,'".$typ."','".$otype."','".$x."','".$y."',0,'".$image."')";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
|
||||
header("Location: ../index.php?s=4");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php include("templates/script.tpl");
|
||||
|
||||
if(!isset($_GET['s'])) {
|
||||
$_GET['s']=0;
|
||||
}
|
||||
$tz=(isset($_GET['t']))? $_GET['t']:1;
|
||||
switch($tz) {
|
||||
case 1: $t_zone="Africa/Dakar";break;
|
||||
case 2: $t_zone="America/New_York";break;
|
||||
case 3: $t_zone="Antarctica/Casey";break;
|
||||
case 4: $t_zone="Arctic/Longyearbyen";break;
|
||||
case 5: $t_zone="Asia/Kuala_Lumpur";break;
|
||||
case 6: $t_zone="Atlantic/Azores";break;
|
||||
case 7: $t_zone="Australia/Melbourne";break;
|
||||
case 8: $t_zone="Europe/Bucharest";break;
|
||||
case 9: $t_zone="Europe/London";break;
|
||||
case 10: $t_zone="Indian/Maldives";break;
|
||||
case 11: $t_zone="Pacific/Fiji";break;
|
||||
}
|
||||
date_default_timezone_set($t_zone);
|
||||
?>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>TravianZ Installation</title>
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
<meta http-equiv="cache-control" content="max-age=0" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<meta http-equiv="expires" content="0" />
|
||||
<meta http-equiv="imagetoolbar" content="no" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=us-ascii" />
|
||||
<script src="mt-full.js?0ac36" type="text/javascript"></script>
|
||||
<script src="unx.js?0ac36" type="text/javascript"></script>
|
||||
<script src="new.js?0ac36" type="text/javascript"></script>
|
||||
<link href="../gpack/travian_default/lang/en/lang.css?f4b7c" rel="stylesheet" type="text/css" />
|
||||
<link href="../gpack/travian_default/lang/en/compact.css?f4b7c" rel="stylesheet" type="text/css" />
|
||||
<link href="../gpack/travian_default/travian.css?e21d2" rel="stylesheet" type="text/css" />
|
||||
<link href="../gpack/travian_default/lang/en/lang.css?e21d2" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<script LANGUAGE="JavaScript">
|
||||
function refresh(tz) {
|
||||
var dt = new Array();
|
||||
dt=tz.split(",");
|
||||
tz=dt[0];
|
||||
location="?s=1&t="+tz;
|
||||
}
|
||||
function proceed() {
|
||||
document.dataform.Submit.disabled=true;
|
||||
return(true);
|
||||
}
|
||||
</script>
|
||||
<div class="wrapper">
|
||||
<img class="c1" src="img/x.gif" id="msfilter" alt="" name="msfilter" />
|
||||
|
||||
<div id="dynamic_header"></div>
|
||||
|
||||
<div id="header">
|
||||
<div id="mtop"></div>
|
||||
</div>
|
||||
|
||||
<div id="mid">
|
||||
<div id="side_navi">
|
||||
<?php include("templates/menu.tpl"); ?>
|
||||
</div>
|
||||
|
||||
<div id="content" class="login">
|
||||
<?php
|
||||
IHG_Progressbar::draw_css();
|
||||
$bar = new IHG_Progressbar(7, 'Step %d from %d ');
|
||||
$bar->draw();
|
||||
for($i = 0; $i < ($_GET['s']+1); $i++) {
|
||||
$bar->tick();
|
||||
}
|
||||
?>
|
||||
<div class="headline"><center>
|
||||
<span class="f18 c5">TravianZ Installation Script</span>
|
||||
</center></div>
|
||||
|
||||
<?php
|
||||
if(substr(sprintf('%o', fileperms('../')), -4)<'700'){
|
||||
echo"<span class='f18 c5'>ERROR!</span><br />It's not possible to write the config file. Change the permission to '777'. After that, refresh this page!";
|
||||
}
|
||||
else if (file_exists("installation_done")) {
|
||||
echo"<span class='f18 c5'>ERROR!</span><br />Installation appears to have been completed.<br />If this is an error remove installation_done file in install directory.";
|
||||
}
|
||||
else
|
||||
switch($_GET['s']){
|
||||
case 0:
|
||||
include("templates/greet.tpl");
|
||||
break;
|
||||
case 1:
|
||||
include("templates/config.tpl");
|
||||
break;
|
||||
case 2:
|
||||
include("templates/dataform.tpl");
|
||||
break;
|
||||
case 3:
|
||||
include("templates/field.tpl");
|
||||
break;
|
||||
case 4:
|
||||
include("templates/multihunter.tpl");
|
||||
break;
|
||||
case 5:
|
||||
include("templates/oasis.tpl");
|
||||
break;
|
||||
case 6:
|
||||
include("templates/end.tpl");
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="side_info" class="outgame"></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div class="footer-stopper outgame"></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php include("../Templates/footer.tpl"); ?>
|
||||
</div>
|
||||
|
||||
<div id="ce"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Filename process.php ##
|
||||
## License: TravianX Project ##
|
||||
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
if(file_exists("include/constant.php")) {
|
||||
include ("include/database.php");
|
||||
}
|
||||
class Process {
|
||||
|
||||
function Process() {
|
||||
if(isset($_POST['subconst'])) {
|
||||
$this->constForm();
|
||||
} else
|
||||
if(isset($_POST['substruc'])) {
|
||||
$this->createStruc();
|
||||
} else
|
||||
if(isset($_POST['subwdata'])) {
|
||||
$this->createWdata();
|
||||
} else
|
||||
if(isset($_POST['subacc'])) {
|
||||
$this->createAcc();
|
||||
} else {
|
||||
header("Location: index.php");
|
||||
}
|
||||
}
|
||||
|
||||
function constForm() {
|
||||
$myFile = "include/constant.php";
|
||||
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: install\include\constant.php");
|
||||
$text = file_get_contents("data/constant_format.tpl");
|
||||
$text = preg_replace("'%SERVERNAME%'", $_POST['servername'], $text);
|
||||
$text = preg_replace("'%SSTARTDATE%'", $_POST['start_date'], $text);
|
||||
$text = preg_replace("'%SSTARTTIME%'", $_POST['start_time'], $text);
|
||||
$tz = explode(",",$_POST['tzone']);
|
||||
$text = preg_replace("'%STIMEZONE%'", $tz[1], $text);
|
||||
$text = preg_replace("'%LANG%'", $_POST['lang'], $text);
|
||||
$text = preg_replace("'%SPEED%'", $_POST['speed'], $text);
|
||||
$text = preg_replace("'%INCSPEED%'", $_POST['incspeed'], $text);
|
||||
$text = preg_replace("'%EVASIONSPEED%'", $_POST['evasionspeed'], $text);
|
||||
$text = preg_replace("'%TRADERCAP%'", $_POST['tradercap'], $text);
|
||||
$text = preg_replace("'%CRANNYCAP%'", $_POST['crannycap'], $text);
|
||||
$text = preg_replace("'%TRAPPERCAP%'", $_POST['trappercap'], $text);
|
||||
$text = preg_replace("'%STORAGE_MULTIPLIER%'", $_POST['storage_multiplier'], $text);
|
||||
$text = preg_replace("'%UTRACK%'", $_POST['trackusers'], $text);
|
||||
$text = preg_replace("'%UTOUT%'", $_POST['timeout'], $text);
|
||||
$text = preg_replace("'%AUTOD%'", $_POST['autodel'], $text);
|
||||
$text = preg_replace("'%AUTODT%'", $_POST['autodeltime'], $text);
|
||||
$text = preg_replace("'%MAX%'", $_POST['wmax'], $text);
|
||||
$text = preg_replace("'%GP%'", $_POST['gpack'], $text);
|
||||
$text = preg_replace("'%SSERVER%'", $_POST['sserver'], $text);
|
||||
$text = preg_replace("'%SUSER%'", $_POST['suser'], $text);
|
||||
$text = preg_replace("'%SPASS%'", $_POST['spass'], $text);
|
||||
$text = preg_replace("'%SDB%'", $_POST['sdb'], $text);
|
||||
$text = preg_replace("'%PREFIX%'", $_POST['prefix'], $text);
|
||||
$text = preg_replace("'%CONNECTT%'", $_POST['connectt'], $text);
|
||||
$text = preg_replace("'%AEMAIL%'", $_POST['aemail'], $text);
|
||||
$text = preg_replace("'%ANAME%'", $_POST['aname'], $text);
|
||||
$text = preg_replace("'%SUBDOM%'", $_POST['subdom'], $text);
|
||||
$text = preg_replace("'%LOGBUILD%'", $_POST['log_build'], $text);
|
||||
$text = preg_replace("'%LOGTECH%'", $_POST['log_tech'], $text);
|
||||
$text = preg_replace("'%LOGLOGIN%'", $_POST['log_login'], $text);
|
||||
$text = preg_replace("'%LOGGOLDFIN%'", $_POST['log_gold_fin'], $text);
|
||||
$text = preg_replace("'%LOGADMIN%'", $_POST['log_admin'], $text);
|
||||
$text = preg_replace("'%LOGWAR%'", $_POST['log_war'], $text);
|
||||
$text = preg_replace("'%LOGMARKET%'", $_POST['log_market'], $text);
|
||||
$text = preg_replace("'%LOGILLEGAL%'", $_POST['log_illegal'], $text);
|
||||
$text = preg_replace("'%MINUSERLENGTH%'", $_POST['userlength'], $text);
|
||||
$text = preg_replace("'%MINPASSLENGTH%'", $_POST['passlength'], $text);
|
||||
$text = preg_replace("'%SPECIALCHARS%'", $_POST['specialchars'], $text);
|
||||
$text = preg_replace("'%ACTIVATE%'", $_POST['activate'], $text);
|
||||
$text = preg_replace("'%ARANK%'", $_POST['admin_rank'], $text);
|
||||
$text = preg_replace("'%QUEST%'", $_POST['quest'], $text);
|
||||
$text = preg_replace("'%QTYPE%'", $_POST['qtype'], $text);
|
||||
$text = preg_replace("'%BEGINNER%'", $_POST['beginner'], $text);
|
||||
$text = preg_replace("'%STARTTIME%'", time(), $text);
|
||||
$text = preg_replace("'%DOMAIN%'", $_POST['domain'], $text);
|
||||
$text = preg_replace("'%HOMEPAGE%'", $_POST['homepage'], $text);
|
||||
$text = preg_replace("'%SERVER%'", $_POST['server'], $text);
|
||||
$text = preg_replace("'%LIMIT_MAILBOX%'", $_POST['limit_mailbox'], $text);
|
||||
$text = preg_replace("'%MAX_MAILS%'", $_POST['max_mails'], $text);
|
||||
$text = preg_replace("'%DEMOLISH%'", $_POST['demolish'], $text);
|
||||
$text = preg_replace("'%BOX1%'", $_POST['box1'], $text);
|
||||
$text = preg_replace("'%BOX2%'", $_POST['box2'], $text);
|
||||
$text = preg_replace("'%BOX3%'", $_POST['box3'], $text);
|
||||
$text = preg_replace("'%VILLAGE_EXPAND%'", $_POST['village_expand'], $text);
|
||||
$text = preg_replace("'%ERRORREPORT%'", $_POST['error'], $text);
|
||||
$text = preg_replace("'%ERROR%'", $_POST['error'], $text);
|
||||
$text = preg_replace("'%GP_LOCATE%'", $_POST['gp_locate'], $text);
|
||||
$text = preg_replace("'%PLUS_TIME%'", $_POST['plus_time'], $text);
|
||||
$text = preg_replace("'%PLUS_PRODUCTION%'", $_POST['plus_production'], $text);
|
||||
$text = preg_replace("'%MEDALINTERVAL%'", $_POST['medalinterval'], $text);
|
||||
$text = preg_replace("'%GREAT_WKS%'", $_POST['great_wks'], $text);
|
||||
$text = preg_replace("'%TS_THRESHOLD%'", $_POST['ts_threshold'], $text);
|
||||
$text = preg_replace("'%WW%'", $_POST['ww'], $text);
|
||||
$text = preg_replace("'%SHOW_NATARS%'", $_POST['show_natars'], $text);
|
||||
$text = preg_replace("'%NATARS_UNITS%'", $_POST['natars_units'], $text);
|
||||
$text = preg_replace("'%NATURE_REGTIME%'", $_POST['nature_regtime'], $text);
|
||||
$text = preg_replace("'%T4_COMING%'", $_POST['t4_coming'], $text);
|
||||
$text = preg_replace("'%REG_OPEN%'", $_POST['reg_open'], $text);
|
||||
$text = preg_replace("'%PEACE%'", $_POST['peace'], $text);
|
||||
|
||||
fwrite($fh, $text);
|
||||
|
||||
if(file_exists("include/constant.php")) {
|
||||
header("Location: index.php?s=2");
|
||||
} else {
|
||||
header("Location: index.php?s=1&c=1");
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
}
|
||||
|
||||
function createStruc() {
|
||||
global $database;
|
||||
$str = file_get_contents("data/sql.sql");
|
||||
$str = preg_replace("'%PREFIX%'", TB_PREFIX, $str);
|
||||
if(DB_TYPE) {
|
||||
$result = $database->connection->multi_query($str);
|
||||
} else {
|
||||
$result = $database->mysql_exec_batch($str);
|
||||
}
|
||||
if($result) {
|
||||
header("Location: index.php?s=3");
|
||||
} else {
|
||||
header("Location: index.php?s=2&c=1");
|
||||
}
|
||||
}
|
||||
|
||||
function createWdata() {
|
||||
header("Location: include/wdata.php");
|
||||
}
|
||||
|
||||
}
|
||||
;
|
||||
|
||||
$process = new Process;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,4 @@
|
||||
<Files ~ "\.tpl$">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
||||
@@ -0,0 +1,345 @@
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Version: 22.06.2015 ##
|
||||
## Filename config.tpl ##
|
||||
## Developed by: Mr.php , Advocaite , brainiacX , yi12345 , Shadow , ronix ##
|
||||
## Fixed by: Shadow - STARVATION , HERO FIXED COMPL. ##
|
||||
## Fixed by: InCube - double troops ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2015. All rights reserved. ##
|
||||
## URLs: http://travian.shadowss.ro ##
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
if(isset($_GET['c']) && $_GET['c'] == 1) {
|
||||
echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php check cmod.</span></div><br>";
|
||||
}
|
||||
?>
|
||||
|
||||
<form action="process.php" method="post" id="dataform">
|
||||
|
||||
<p>
|
||||
<span class="f10 c">SERVER RELATED</span>
|
||||
<table><tr>
|
||||
<td><span class="f9 c6">Server name:</span></td><td width="140"><input type="text" name="servername" id="servername" value="TravianZ"></td></tr><tr>
|
||||
<td><span class="f9 c6">Server Timezone:</span></td><td>
|
||||
<select name="tzone" onChange="refresh(this.value)">
|
||||
<option value="1,Africa/Dakar" <?php if ($tz==1) echo "selected";?>>Africa</option>
|
||||
<option value="2,America/New_York" <?php if ($tz==2) echo "selected";?>>America</option>
|
||||
<option value="3,Antarctica/Casey" <?php if ($tz==3) echo "selected";?>>Antarctica</option>
|
||||
<option value="4,Arctic/Longyearbyen" <?php if ($tz==4) echo "selected";?>>Arctic</option>
|
||||
<option value="5,Asia/Kuala_Lumpur" <?php if ($tz==5) echo "selected";?>>Asia</option>
|
||||
<option value="6,Atlantic/Azores" <?php if ($tz==6) echo "selected";?>>Atlantic</option>
|
||||
<option value="7,Australia/Melbourne" <?php if ($tz==7) echo "selected";?>>Australia</option>
|
||||
<option value="8,Europe/Bucharest" <?php if ($tz==8) echo "selected";?>>Europe (Bucharest)</option>
|
||||
<option value="9,Europe/London" <?php if ($tz==9) echo "selected";?>>Europe (London)</option>
|
||||
<option value="10,Indian/Maldives" <?php if ($tz==10) echo "selected";?>>Indian</option>
|
||||
<option value="11,Pacific/Fiji" <?php if ($tz==11) echo "selected";?>>Pacific</option>
|
||||
</select>
|
||||
</td></tr><tr>
|
||||
<td><span class="f9 c6">Server speed:</span></td><td><input name="speed" type="text" id="speed" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Troop speed:</span></td><td width="140"><input type="text" name="incspeed" id="incspeed" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Evasion speed:</span></td><td><input name="evasionspeed" type="text" id="evasionspeed" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Trader capacity (1 = 1x...):</span></td><td width="140"><input type="text" name="tradercap" id="tradercap" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Cranny capacity:</span></td><td width="140"><input type="text" name="crannycap" id="crannycap" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Trapper capacity:</span></td><td width="140"><input type="text" name="trappercap" id="trappercap" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Natars Units Multiplier:</span></td><td width="140"><input type="text" name="natars_units" id="natars_units" value="100" size="3"></td></tr><tr>
|
||||
<td><span class="f9 c6">World size:</span></td><td>
|
||||
<select name="wmax">
|
||||
<option value="10">10x10</option>
|
||||
<option value="25">25x25</option>
|
||||
<option value="50">50x50</option>
|
||||
<option value="100" selected="selected">100x100</option>
|
||||
<option value="150">150x150</option>
|
||||
<option value="200">200x200</option>
|
||||
<option value="250">250x250</option>
|
||||
<option value="300">300x300</option>
|
||||
<option value="350">350x350</option>
|
||||
<option value="400">400x400</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Register Open:</span></td><td>
|
||||
<select name="reg_open">
|
||||
<option value="True" selected="selected">True</option>
|
||||
<option value="False">False</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Server:</span></td><td><input name="server" type="text" id="homepage" value="http://<?php echo $_SERVER['HTTP_HOST']; ?>/"></td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Domain:</span></td><td><input name="domain" type="text" id="homepage" value="http://<?php echo $_SERVER['HTTP_HOST']; ?>/"></td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Homepage:</span></td><td><input name="homepage" type="text" id="homepage" value="http://<?php echo $_SERVER['HTTP_HOST']; ?>/"></td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Language:</span></td><td>
|
||||
<select name="lang">
|
||||
<option value="en" selected="selected">English</option>
|
||||
<option value="es">Spanish</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Beginners protection length:</span></td><td>
|
||||
<select name="beginner">
|
||||
<option value="7200">2 hours</option>
|
||||
<option value="10800">3 hours</option>
|
||||
<option value="18000">5 hours</option>
|
||||
<option value="28800">8 hours</option>
|
||||
<option value="36000">10 hours</option>
|
||||
<option value="43200" selected="selected">12 hours</option>
|
||||
<option value="86400">24 hours (1 day)</option>
|
||||
<option value="172800">48 hours (2 days)</option>
|
||||
<option value="259200">72 hours (3 days)</option>
|
||||
<option value="432000">120 hours (5 days)</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Plus account length:</span></td><td>
|
||||
<select name="plus_time">
|
||||
<option value="(3600*12)">12 hours</option>
|
||||
<option value="(3600*24)">1 day</option>
|
||||
<option value="(3600*24*2)">2 days</option>
|
||||
<option value="(3600*24*3)">3 days</option>
|
||||
<option value="(3600*24*4)">4 days</option>
|
||||
<option value="(3600*24*5)">5 days</option>
|
||||
<option value="(3600*24*6)">6 days</option>
|
||||
<option value="(3600*24*7)" selected="selected">7 days</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">+25% production length:</span></td><td>
|
||||
<select name="plus_production">
|
||||
<option value="(3600*12)">12 hours</option>
|
||||
<option value="(3600*24)">1 day</option>
|
||||
<option value="(3600*24*2)">2 days</option>
|
||||
<option value="(3600*24*3)">3 days</option>
|
||||
<option value="(3600*24*4)">4 days</option>
|
||||
<option value="(3600*24*5)">5 days</option>
|
||||
<option value="(3600*24*6)">6 days</option>
|
||||
<option value="(3600*24*7)" selected="selected">7 days</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Nature troops regeneration time:</span></td><td>
|
||||
<select name="nature_regtime">
|
||||
<option value="28800">8 hours</option>
|
||||
<option value="36000">10 hours</option>
|
||||
<option value="43200" selected="selected">12 hours</option>
|
||||
<option value="57600">16 hours</option>
|
||||
<option value="72000">20 hours</option>
|
||||
<option value="86400">24 hours</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<tr class="hover">
|
||||
<td><span class="f9 c6">Medal Interval:</span></td><td>
|
||||
<select name="medalinterval">
|
||||
<option value="0">none</option>
|
||||
<option value="(3600*24)">1 day</option>
|
||||
<option value="(3600*24*2)">2 days</option>
|
||||
<option value="(3600*24*3)">3 days</option>
|
||||
<option value="(3600*24*4)">4 days</option>
|
||||
<option value="(3600*24*5)">5 days</option>
|
||||
<option value="(3600*24*6)">6 days</option>
|
||||
<option value="(3600*24*7)" selected="selected">7 days</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Storage Multipler:</span></td><td width="140"><input type="text" name="storage_multiplier" id="storage_multiplier" value="1"></td></tr><tr>
|
||||
<td><span class="f9 c6">Tourn Threshold:</span></td><td width="140"><input type="text" name="ts_threshold" id="ts_threshold" value="20"></td></tr><tr>
|
||||
<td><span class="f9 c6">Great Workshop:</span></td><td>
|
||||
<select name="great_wks">
|
||||
<option value="True">True</option>
|
||||
<option value="False" selected="selected">False</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">ww:</span></td><td>
|
||||
<select name="ww">
|
||||
<option value="True">True</option>
|
||||
<option value="False" selected="selected">False</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Show Natars in Statistics:</span></td><td>
|
||||
<select name="show_natars">
|
||||
<option value="True">True</option>
|
||||
<option value="False" selected="selected">False</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Peace system:</span></td><td>
|
||||
<select name="peace">
|
||||
<option value="0" selected="selected">None</option>
|
||||
<option value="1">Normal</option>
|
||||
<option value="2">Christmas</option>
|
||||
<option value="3">New Year</option>
|
||||
<option value="4">Easter</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="f10 c">ADMIN ACCOUNT</span>
|
||||
<table>
|
||||
<tr><td><span class="f9 c6">Admin name:</span></td><td><input type="text" name="aname" id="aname" value=""></td></tr>
|
||||
<tr><td><span class="f9 c6">Admin email:</span></td><td><input type="text" name="aemail" id="aemail" value=""></td></tr>
|
||||
|
||||
<td><span class="f9 c6">Show admin in stats:</span></td><td>
|
||||
<select name="admin_rank">
|
||||
<option value="True">True</option>
|
||||
<option value="False" selected="selected">False</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="f10 c">SQL RELATED</span>
|
||||
<table><tr>
|
||||
<td><span class="f9 c6">Hostname:</span></td><td><input name="sserver" type="text" id="sserver" value="localhost"></td></tr><tr>
|
||||
<td><span class="f9 c6">Username:</span></td><td><input name="suser" type="text" id="suser" value=""></td></tr><tr>
|
||||
<td><span class="f9 c6">Password:</span></td><td><input type="password" name="spass" id="spass"></td></tr><tr>
|
||||
<td><span class="f9 c6">DB name:</span></td><td><input type="text" name="sdb" id="sdb"></td></tr><tr>
|
||||
<td><span class="f9 c6">Prefix:</span></td><td><input type="text" name="prefix" id="prefix" value="s1_" size="5"></td></tr>
|
||||
<td><span class="f9 c6">Type:</span></td><td><select name="connectt">
|
||||
<option value="0" selected="selected">MYSQL</option>
|
||||
<option value="1">MYSQLi</option>
|
||||
</select></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<!-- <LEFT BOX - ADMIN RELATED>
|
||||
|
||||
<span><center><strong>ADMIN RELATED</strong></center></span><br />
|
||||
<span class="f9 c6 cc2">Admin Name:</span><span class="cc3"><input type="text" name="aname" id="aname"></span><br /><br />
|
||||
<span class="f9 c6 cc2">Admin Email:</span><span class="cc3"><input name="aemail" type="text" id="aemail"></span><br /><br />
|
||||
<span class="f9 c6 cc2">Admin rank:</span><span class="cc3" style="position: absolute;right:20%;"><select name="admin_rank">
|
||||
<option value="false">No</option>
|
||||
<option value="true" selected="selected">Yes</option></select></span><br /><br />
|
||||
|
||||
<!-- </LEFT BOX - ADMIN RELATED> -->
|
||||
|
||||
<!-- <RIGHT BOX - GPACK RELATED>
|
||||
|
||||
<span><center><strong>GPACK RELATED</strong></center></span><br />
|
||||
|
||||
|
||||
<span class="f9 c6 c2">GPack:</span><span class="c3"><select name="gpack">
|
||||
<option value="false" selected="selected">No</option>
|
||||
<option value="true" disabled="disabled">Yes</option></select></span><br /><br />
|
||||
<span class="f9 c6 c2">GPack Design:</span><span class="c3"><select name="gp_locate">
|
||||
<option value="gpack/travian_default/" selected="selected">Travian Default
|
||||
<option value="gpack/travianx_v1/">TravianX v1 by Dzoki</option></select></span><br /><br />
|
||||
|
||||
-->
|
||||
<!-- </RIGHT BOX - GPACK RELATED> -->
|
||||
|
||||
|
||||
<p>
|
||||
<span class="f10 c">NEWSBOX OPTIONS</span>
|
||||
<table><tr>
|
||||
<td><span class="f9 c6">Newsbox 1:</span></td><td><select name="box1">
|
||||
<option value="true">Enabled</option>
|
||||
<option value="false" selected="selected">Disabled</option>
|
||||
</select></td></tr>
|
||||
<td><span class="f9 c6">Newsbox 2:</span></td><td><select name="box2">
|
||||
<option value="true">Enabled</option>
|
||||
<option value="false" selected="selected">Disabled</option>
|
||||
</select></td></tr>
|
||||
<td><span class="f9 c6">Newsbox 3:</span></td><td><select name="box3">
|
||||
<option value="true">Enabled</option>
|
||||
<option value="false" selected="selected">Disabled</option>
|
||||
</select></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="f10 c">LOG RELATED (You should disable them)</span>
|
||||
<table><tr>
|
||||
<td><span class="f9 c6">Log Building:</span></td><td><select name="log_build">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">Log Tech:</span></td><td><select name="log_tech">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">Log Login:</span></td><td><select name="log_login">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Log Gold:</span></td><td><select name="log_gold_fin">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr>
|
||||
<tr> <td><span class="f9 c6">Log Admin:</span></td><td><select name="log_admin">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr>
|
||||
<tr> <td><span class="f9 c6">Log War:</span></td><td><select name="log_war">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">Log Market:</span></td><td><select name="log_market">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">Log Illegal:</span></td><td><select name="log_illegal">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">Log :</span></td><td><select name="">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="f10 c">EXTRA OPTIONS</span>
|
||||
<table><tr>
|
||||
<td><span class="f9 c6">Quest:</span></td><td><select name="quest">
|
||||
<option value="true" selected="selected">Yes</option>
|
||||
<option value="false">No</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">Quest Type:</span></td><td><select name="qtype">
|
||||
<option value="25" selected="selected">Official Travian</option>
|
||||
<option value="37">TravianZ Extended</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">Activate:</span></td><td><select name="activate">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">Limit Mailbox:</span></td><td><select name="limit_mailbox">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select> (NOT DONE)</td></tr>
|
||||
<tr><td><span class="f9 c6">Max mails:</span></td><td><input type="text" name="max_mails" id="max_mails" value="30" size="4"> (NOT DONE)</td></tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Demolish - lvl required:</span></td><td><select name="demolish">
|
||||
<option value="5">5</option>
|
||||
<option value="10" selected="selected">10 - Default</option>
|
||||
<option value="15">15</option>
|
||||
<option value="20">20</option>
|
||||
</select></td></tr>
|
||||
<tr> <td><span class="f9 c6">Village Expand:</span></td><td><select name="village_expand">
|
||||
<option value="1" selected="selected">Slow</option>
|
||||
<option value="0">Fast</option>
|
||||
</select></td></tr>
|
||||
<tr> <td><span class="f9 c6">Error Reporting:</span></td><td><select name="error">
|
||||
<option value="error_reporting (E_ALL ^ E_NOTICE ^ E_DEPRECATED);" selected="selected">Yes</option>
|
||||
<option value="error_reporting (0);">No</option>
|
||||
</select></td></tr><tr>
|
||||
<td><span class="f9 c6">T4 is Coming screen:</span></td><td><select name="t4_coming">
|
||||
<option value="true">Yes</option>
|
||||
<option value="false" selected="selected">No</option>
|
||||
</select></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
<br />
|
||||
<span class="f10 c">Server Start Settings</span>
|
||||
<table>
|
||||
<tr><td><span class="f9 c6">Start Date:</span></td><td width="140"><input type="text" name="start_date" id="start_date" value="<?php echo date('m/d/Y'); ?>"></td></tr>
|
||||
<tr><td><span class="f9 c6">Start Time:</span></td><td width="140"><input type="text" name="start_time" id="start_time" value="<?php echo date('H:i'); ?>"></td></tr>
|
||||
</table>
|
||||
|
||||
<center>
|
||||
<input type="submit" name="Submit" id="Submit" value="Submit">
|
||||
<input type="hidden" name="subconst" value="1"></center>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Version: 22.06.2015 ##
|
||||
## Filename dataform.tpl ##
|
||||
## Developed by: Mr.php , Advocaite , brainiacX , yi12345 , Shadow , ronix ##
|
||||
## Fixed by: Shadow - STARVATION , HERO FIXED COMPL. ##
|
||||
## Fixed by: InCube - double troops ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2015. All rights reserved. ##
|
||||
## URLs: http://travian.shadowss.ro ##
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
if(isset($_GET['c']) && $_GET['c'] == 1) {
|
||||
echo "<div class=\"headline\"><span class=\"f10 c5\">Error importing database. Check configuration.</span></div><br>";
|
||||
}
|
||||
?>
|
||||
<form action="process.php" method="post" id="dataform">
|
||||
<input type="hidden" name="substruc" value="1">
|
||||
|
||||
<p>
|
||||
<span class="f10 c">Create SQL Structure</span>
|
||||
<table>
|
||||
<tr><td>Warning: This can take some time. Wait till the next page has been loaded! Click Create to proceed..</td></tr>
|
||||
<tr><td><center><input type="submit" name="Submit" id="Submit" value="Create.." onClick="return proceed()"></center></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Version: 22.06.2015 ##
|
||||
## Filename end.tpl ##
|
||||
## Developed by: Mr.php , Advocaite , brainiacX , yi12345 , Shadow , ronix ##
|
||||
## Fixed by: Shadow - STARVATION , HERO FIXED COMPL. ##
|
||||
## Fixed by: InCube - double troops ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2015. All rights reserved. ##
|
||||
## URLs: http://travian.shadowss.ro ##
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
?>
|
||||
<p>
|
||||
Thanks for installing TravianZ.
|
||||
<h4>Please remove/rename the installation folder.</h4>
|
||||
All the files are placed. The database is created, so you can now start playing on your own Travian.
|
||||
</p>
|
||||
|
||||
<?php include("../GameEngine/config.php");
|
||||
$time = time();
|
||||
rename("../install/","../installed_".$time);
|
||||
touch("installation_done");
|
||||
?>
|
||||
<p>
|
||||
<center><font size="4"><a href="<?php echo HOMEPAGE; ?>">> My TravianZ homepage <</font></a></center>
|
||||
</p>
|
||||
</br>
|
||||
<center>
|
||||
<h2>Please support our developers and donate.</h2>
|
||||
</br>
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
||||
<input type="hidden" name="cmd" value="_s-xclick">
|
||||
<input type="hidden" name="hosted_button_id" value="LWVKB9LSJNL3C">
|
||||
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
||||
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
||||
</form>
|
||||
</center>
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Version: 22.06.2015 ##
|
||||
## Filename field.tpl ##
|
||||
## Developed by: Mr.php , Advocaite , brainiacX , yi12345 , Shadow , ronix ##
|
||||
## Fixed by: Shadow - STARVATION , HERO FIXED COMPL. ##
|
||||
## Fixed by: InCube - double troops ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2015. All rights reserved. ##
|
||||
## URLs: http://travian.shadowss.ro ##
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
if(isset($_GET['c']) && $_GET['c'] == 1) {
|
||||
echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating wdata. Check configuration or file.</span></div><br>";
|
||||
}
|
||||
?>
|
||||
<form action="process.php" method="post" id="dataform">
|
||||
<input type="hidden" name="subwdata" value="1">
|
||||
|
||||
<p>
|
||||
<span class="f10 c">Create World Data</span>
|
||||
<table>
|
||||
<tr><td><b>Warning</b>: This can take some time. Wait till the next page has been loaded! Click Create to proceed..</td></tr>
|
||||
<tr><td><center><input type="submit" name="Submit" id="Submit" value="Create.." onClick="return proceed()"></center></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,50 @@
|
||||
|
||||
<br>
|
||||
|
||||
<h4> Disclaimer</h4>
|
||||
|
||||
<ul>
|
||||
<li>Along with the installation/usage of this game, you shall be fully responsible for any legal results that may raised initiated by the owners of any unlicensed content you permit your copy of this game to publish.</li>
|
||||
|
||||
<li>Neither the team that created this script nor the team that customised it to create this distribution/release shall be responsible for any damage done to your computer/server system.</li>
|
||||
|
||||
<li>All code was confirmed to be running correctly by the creation team without any visible security risk they were aware of at the time the released it. Similarly for the customisation team who customised it to create this distribution/release.</li>
|
||||
|
||||
<li>Users are asked to review the code on their own accord and behalf.</li>
|
||||
|
||||
<li>Any customization to the source code are the property of each customisation's author, it is up to each author's discretion whether to share it by including it in free open source distributions such as this one.</li>
|
||||
|
||||
<li><b>You have no rights to edit copyright notices or/and claim this script as your own.</b></li>
|
||||
|
||||
<li>Last but not least, Enjoy.</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<ul>
|
||||
<li><h4>Before Installation (Linux):</h4></li>
|
||||
<li>CHMOD install to 777 (chmod -R 777 install)</li>
|
||||
<li>CHMOD GameEngine to 777 (chmod -R 777 GameEngine)</li>
|
||||
<li><h4>After Installation</h4></li>
|
||||
<li>Delete install folder (sudo rm -R install)</li>
|
||||
<li>CHMOD GameEngine back to 755 (sudo chmod -R 755 GameEngine)</li>
|
||||
<li>CHMOD Prevention to 777 (sudo chmod -R 777 GameEngine/Prevention)</li>
|
||||
<li>CHMOD Notes to 777 (sudo chmod -R 777 GameEngine/Notes)</li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><h4>After Installation</h4></li>
|
||||
<li>Protect folder /Admin with password protect directory</li>
|
||||
</ul>
|
||||
|
||||
<div class="lbox">
|
||||
TravianZ Team
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<center>
|
||||
<form>
|
||||
<input type="button" name="next" value="Next" onclick="location.href='?s=1'">
|
||||
</form>
|
||||
</center>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,44 @@
|
||||
<div class="menu">
|
||||
<?php
|
||||
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Version: 22.06.2015 ##
|
||||
## Filename menu.tpl ##
|
||||
## Developed by: Mr.php , Advocaite , brainiacX , yi12345 , Shadow , ronix ##
|
||||
## Fixed by: Shadow - STARVATION , HERO FIXED COMPL. ##
|
||||
## Fixed by: InCube - double troops ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2015. All rights reserved. ##
|
||||
## URLs: http://travian.shadowss.ro ##
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
switch($_GET['s']) {
|
||||
case 0:
|
||||
echo "<li class=\"c2 f9\">Intro</li><li class=\"c1 f9\">Configuration</li><li class=\"c1 f9\">Database</li><li class= \"c1 f9\">Field</li><li class=\"c1 f9\">Multihunter</li><li class=\"c1 f9\">Oasis</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 1:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c2 f9\">Configuration</li><li class=\"c1 f9\">Database</li><li class= \"c1 f9\">Field</li><li class=\"c1 f9\">Multihunter</li><li class=\"c1 f9\">Oasis</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 2:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c2 f9\">Database</li><li class= \"c1 f9\">Field</li><li class=\"c1 f9\">Multihunter</li><li class=\"c1 f9\">Oasis</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 3:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c2 f9\">Field</li><li class=\"c1 f9\">Multihunter</li><li class=\"c1 f9\">Oasis</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 4:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c3 f9\">Field</li><li class=\"c2 f9\">Multihunter</li><li class=\"c1 f9\">Oasis</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 5:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c3 f9\">Field</li><li class=\"c3 f9\">Multihunter</li><li class=\"c2 f9\">Oasis</li><li class=\"c1 f9\">End</li>";
|
||||
break;
|
||||
case 6:
|
||||
echo "<li class=\"c3 f9\">Intro</li><li class=\"c3 f9\">Configuration</li><li class=\"c3 f9\">Database</li><li class= \"c3 f9\">Field</li><li class=\"c3 f9\">Multihunter</li><li class=\"c3 f9\">Oasis</li><li class=\"c2 f9\">End</li>";
|
||||
break;
|
||||
}
|
||||
|
||||
?></div>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
## Project: TravianZ ##
|
||||
## Version: 22.06.2015 ##
|
||||
## Filename multihunter.tpl ##
|
||||
## Developed by: Mr.php , Advocaite , brainiacX , yi12345 , Shadow , ronix ##
|
||||
## Fixed by: Shadow - STARVATION , HERO FIXED COMPL. ##
|
||||
## Fixed by: InCube - double troops ##
|
||||
## License: TravianZ Project ##
|
||||
## Copyright: TravianZ (c) 2010-2015. All rights reserved. ##
|
||||
## URLs: http://travian.shadowss.ro ##
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
rename("include/constant.php","../GameEngine/config.php");
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form action="include/multihunter.php" method="post" id="dataform">
|
||||
|
||||
<p>
|
||||
<span class="f10 c">Create Multihunter account</span>
|
||||
<table>
|
||||
<tr><td>Name:</td><td><input type="text" name="mhpw" id="mhpw" value="Multihunter" disabled="disabled"></td></tr>
|
||||
<tr><td>Password:</td><td><input type="text" name="mhpw" id="mhpw" value=""></td></tr>
|
||||
<tr><td>Note: Rember this password! You need it for the ACP</td><td></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<center>
|
||||
<input type="submit" name="Submit" id="Submit" value="Submit"></center>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// TRAVIANX //
|
||||
// Only for advanced users, do not edit if you dont know what are you doing! //
|
||||
// Made by: Dzoki & Dixie (TravianX) //
|
||||
// - TravianX = Travian Clone Project - //
|
||||
// DO NOT REMOVE COPYRIGHT NOTICE! //
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
?>
|
||||
<form action="include/oasis.php" method="post" id="dataform">
|
||||
<p>
|
||||
<span class="f10 c">Populate Oasis</span>
|
||||
<table>
|
||||
<tr><td><b>Warning</b>: This can take some time. Wait till the next page has been loaded! Click Create to proceed..</td></tr>
|
||||
<tr><td><center><input type="submit" name="Submit" id="Submit" value="Create.." onClick="return proceed()"></center></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,145 @@
|
||||
<style type="text/css">
|
||||
.menu{
|
||||
margin-left: 23px;
|
||||
margin-top: 50px;
|
||||
}
|
||||
.f18 {
|
||||
font-size: 18pt;
|
||||
}
|
||||
span.cc3 {position: absolute;right:10%}
|
||||
span.cc2 {position: absolute;left:10%}
|
||||
|
||||
div.lbox {width: 280px; padding-left: 29px; padding-bottom: 15px;}
|
||||
div.rbox {width: 196px; padding-left: 10px; padding-bottom: 15px;}
|
||||
div.wholebox {width: 494px; padding-left: 29px; padding-bottom: 15px;}
|
||||
div.wholebox div {float:none;}
|
||||
div.lbox ul, div.rbox ul {margin: 0 0 0 15px; padding: 0 15px 0 0;}
|
||||
|
||||
</style>
|
||||
|
||||
<?php
|
||||
class IHG_Progressbar {
|
||||
|
||||
protected $bar_id;
|
||||
|
||||
protected $max_ticks;
|
||||
|
||||
protected $ticks;
|
||||
|
||||
protected $label;
|
||||
|
||||
public function __construct($max_ticks, $label = '%d van %d') {
|
||||
$this->bar_id = uniqid('progressbar');
|
||||
$this->label = $label;
|
||||
|
||||
$this->max_ticks = $max_ticks;
|
||||
$this->ticks = 0;
|
||||
}
|
||||
|
||||
public function tick() {
|
||||
$this->ticks++;
|
||||
$this->draw_progress();
|
||||
}
|
||||
|
||||
public function draw() {
|
||||
$this->draw_bar();
|
||||
$this->draw_progress();
|
||||
}
|
||||
|
||||
static public function draw_css() {
|
||||
echo '
|
||||
<style type="text/css">
|
||||
.ihg_progress_bar {
|
||||
display: block;
|
||||
width: 500px;
|
||||
height: 20px;
|
||||
border: 1px solid gray;
|
||||
padding: 1px;
|
||||
|
||||
margin: 3px auto;
|
||||
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ihg_progress_ticks {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
||||
background-color: orange;
|
||||
width: 0;
|
||||
height: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ihg_progress_label_a,
|
||||
.ihg_progress_label_b {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
||||
width: 500px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ihg_progress_label_a {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ihg_progress_label_b {
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
';
|
||||
}
|
||||
|
||||
protected function draw_bar() {
|
||||
echo '
|
||||
<div class="ihg_progress_bar">
|
||||
<span class="ihg_progress_label_a" id="' . $this->bar_id . '_label_a"></span>
|
||||
<div class="ihg_progress_ticks" id="' . $this->bar_id . '">
|
||||
<span class="ihg_progress_label_b" id="' . $this->bar_id . '_label_b"></span>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var bar = document.getElementById("' . $this->bar_id . '");
|
||||
var label_a = document.getElementById("' . $this->bar_id . '_label_a");
|
||||
var label_b = document.getElementById("' . $this->bar_id . '_label_b");
|
||||
|
||||
window["' . $this->bar_id . '"] = function(width, label) {
|
||||
bar.style.width = width + "%";
|
||||
label_a.innerHTML = label;
|
||||
label_b.innerHTML = label;
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
';
|
||||
|
||||
$this->flush();
|
||||
}
|
||||
|
||||
protected function draw_progress() {
|
||||
|
||||
$width = round($this->ticks / $this->max_ticks * 100, 2);
|
||||
$label = sprintf($this->label, $this->ticks, $this->max_ticks);
|
||||
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
window["' . $this->bar_id . '"]("' . $width . '", "' . addslashes($label) . '");
|
||||
</script>
|
||||
|
||||
';
|
||||
$this->flush();
|
||||
}
|
||||
|
||||
protected function flush() {
|
||||
while(ob_get_level() > 0) {
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
flush();
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user