Changeset 252
- Timestamp:
- 12/05/07 18:50:26 (15 years ago)
- Location:
- branch/rev3
- Files:
-
- 7 added
- 4 removed
- 17 modified
Legend:
- Unmodified
- Added
- Removed
-
branch/rev3/common/includes/class.comments.php
r190 r252 38 38 39 39 // create comment_added event 40 event::call('comment_added', &$this);40 event::call('comment_added', $this); 41 41 } 42 42 -
branch/rev3/common/includes/class.item.php
r243 r252 1 1 <?php 2 require_once('db.php');3 4 2 define('DGM_TECHLEVEL', 422); 5 3 … … 151 149 else 152 150 { 153 // that item doesnt exist or is mis pelled151 // that item doesnt exist or is misspelled 154 152 return false; 155 153 } -
branch/rev3/common/includes/class.options.php
r191 r252 129 129 foreach ($options as $option) 130 130 { 131 $html .= options::assembleElement( &$option);131 $html .= options::assembleElement($option); 132 132 } 133 133 $html .= $smarty->fetch(get_tpl('admin_options_set_foot')); -
branch/rev3/common/includes/class.parser.php
r244 r252 12 12 $this->error_ = array(); 13 13 $this->killmail_ = trim(str_replace("\r", '', $killmail)); 14 $this->returnmail = false; 14 15 15 16 if (strpos($this->killmail_, 'Beteiligte Parteien:')) … … 424 425 } 425 426 427 if ($this->returnmail) 428 { 429 return $kill; 430 } 426 431 $id = $kill->add(); 427 432 if ($id == -1) -
branch/rev3/common/includes/class.ship.php
r212 r252 8 8 * 9 9 */ 10 11 require_once("db.php");12 10 13 11 class Ship -
branch/rev3/common/includes/db.php
r202 r252 1 1 <?php 2 require_once('config.php'); 3 require_once('common/includes/globals.php'); 4 require_once('common/includes/php_compat.php'); 5 6 if (defined('DB_USE_QCACHE') && DB_USE_QCACHE === true) 7 { 8 require_once('common/includes/class.db_cache.php'); 9 } 10 else 11 { 12 require_once('common/includes/class.db.php'); 13 } 2 // cached query class will be loaded additionally once we received the config 3 // see common/index.php for details 4 require_once('common/includes/class.db.php'); 14 5 15 6 // get mysql server info and store it in a define so we know if its -
branch/rev3/common/includes/globals.php
r244 r252 6 6 // current version: major.minor.sub 7 7 // unpair numbers for minor = development version 8 define('KB_VERSION', '1.4.0 ( Revelations 3)');8 define('KB_VERSION', '1.4.0 (Trinity)'); 9 9 10 10 // set the running-server for id-syncs here -
branch/rev3/common/index.php
r245 r252 22 22 23 23 // many ppl had issues with pear and relative paths 24 require_once('kbconfig.php'); 25 require_once('common/includes/globals.php'); 26 require_once('common/includes/php_compat.php'); 24 27 require_once('common/includes/db.php'); 25 28 require_once('common/includes/class.config.php'); … … 62 65 // load the config from the database 63 66 $config = new Config(KB_SITE); 67 define('DB_USE_CCP', true); 64 68 define('KB_HOST', config::get('cfg_kbhost')); 65 69 define('MAIN_SITE', config::get('cfg_mainsite')); … … 71 75 if (DB_USE_QCACHE) 72 76 { 77 // the object overloading system will switch to cached queries now 73 78 require_once('common/includes/class.db_cache.php'); 74 79 } … … 131 136 } 132 137 133 // this is to make sure that smarty is able to create output134 if (!is_dir('./cache/templates_c'))135 {136 if (mkdir('./cache/templates_c'))137 {138 chmod('./cache/templates_c', 0777);139 }140 else141 {142 exit('please create cache/templates_c and chmod it 777');143 }144 }145 146 138 // all admin files are now in the admin directory and preload the menu 147 139 if (substr($page, 0, 5) == 'admin') -
branch/rev3/install/config.data
r88 r252 5 5 filter_date 0 6 6 kill_points 1 7 map_con_cl_bg 112,102,112 8 map_con_cl_capt 255,255,255 9 map_con_cl_hl 255,255,255 10 map_con_cl_line 78,70,82 11 map_con_cl_normal 0,0,0 7 mods_active signature_generator 8 post_password CHANGEME 9 adapt_items 0 10 auto_reinforced 0 11 bs_podlink 0 12 cache_enabled 0 13 date_gmtime 1 14 is_reinforced 0 15 item_values 1 16 killlist_alogo 1 17 kill_classified 0 18 kill_splitfit 1 19 least_active 0 20 loss_points 1 21 mail_host 22 map_con_security 1 12 23 map_con_showlines 1 13 24 map_con_shownames 1 14 map_map_cl_bg 112,102,112 15 map_map_cl_capt 255,255,255 16 map_map_cl_hl 255,255,255 17 map_map_cl_line 78,70,82 18 map_map_cl_normal 0,0,0 25 map_map_security 1 19 26 map_map_showlines 1 20 map_reg_cl_bg 112,102,112 21 map_reg_cl_capt 255,255,255 22 map_reg_cl_hl 255,255,255 23 map_reg_cl_line 78,70,82 24 map_reg_cl_normal 0,0,0 27 map_region_cache 1 28 map_reg_security 1 25 29 map_reg_showlines 1 26 mods_active signature_generator 27 post_password CHANGEME 28 ship_values 1 29 style_banner revelations 30 style_name revelations 30 post_forbid 0 31 post_permission all 32 public_losses 0 33 public_stats do nothing 34 public_summarytable 0 35 readd_dupes 0 36 reinforced_disable_threshold 5 37 reinforced_prob 20 38 reinforced_rf_prob 20 39 reinforced_threshold 5 40 ship_values 0 41 show_standing 1 42 show_standings 0 43 style_banner default 44 style_name default 45 summarytable_summary 1 46 total_points 1 47 user_regdisabled 1 48 user_showmenu 0 -
branch/rev3/install/config.tpl
r103 r252 9 9 */ 10 10 11 // general config 12 define('KB_TITLE', '{$title}'); 13 define('KB_HOST', '{$host}'); 11 // configuration key 14 12 define('KB_SITE', '{$site}'); 15 16 // Main website, leave blank if killboard is by itself17 define('MAIN_SITE', '');18 19 // corporation OR alliance id20 define('CORP_ID', {$cid});21 define('ALLIANCE_ID', {$aid});22 13 23 14 // admin password 24 15 define('ADMIN_PASSWORD', '{$adminpw}'); 25 define('SUPERADMIN_PASSWORD', '');26 27 // debug, shows page time generation28 define('KB_PROFILE', 0);29 30 // page cache31 define('KB_CACHE', 0);32 define('KB_CACHEDIR', 'cache/data');33 34 $cacheignore = array(35 'home',36 'pilot_detail',37 'kill_detail',38 'admin',39 'admin_cc',40 'admin_rental',41 'igb',42 'post_igb',43 'portrait_grab');44 45 $cachetimes = array (46 'awards' => 1440,47 'campaigns' => 30,48 'contracts' => 30,49 'corp_detail' => 60,50 'alliance_detail' => 240);51 52 define('STYLE_URL', '{$style}');53 define('COMMON_URL', '{$common}');54 define('IMG_URL', '{$img}');55 56 define('DB_HALTONERROR', true);57 16 58 17 // database config -
branch/rev3/install/index.php
r190 r252 24 24 <td valign="top" height="100%" style="height: 100%"> 25 25 <div id="header"> 26 <img src=" revelations.jpg" border="0">26 <img src="trinity.jpg" border="0"> 27 27 </div> 28 28 <div id="page-title">Install Step <?php echo $_SESSION['state']; ?></div> -
branch/rev3/install/install_step1.php
r88 r252 1 <p>Welcome to the new installer, it will help you to set up everything correctly.<br/>1 <p>Welcome to the installer and updater, it will help you to set up everything correctly.<br/> 2 2 The next step will test if your server has the needed modules to run the Killboard with all features. 3 3 </p> -
branch/rev3/install/install_step2.php
r215 r252 66 66 } 67 67 68 echo '<br/><div class="block-header2">Config</div>'; 69 if (!file_exists('../kbconfig.php')) 70 { 71 $stoppage = true; 72 echo 'Please create the file \'kbconfig.php\' and make it writeable by the webserver.<br/>'; 73 } 74 elseif (is_writeable('../kbconfig.php')) 75 { 76 echo 'The config file \'../kbconfig.php\' is there and writeable, excellent!<br/>'; 77 } 78 else 79 { 80 $stoppage = true; 81 echo 'I cannot write into ../kbconfig.php, you need to fix that for me before you can continue.<br/>'; 82 echo 'Please issue a "chmod 777 ../kbconfig" on the commandline inside of this directory<br/>'; 83 } 84 68 85 echo '<br/><div class="block-header2">Connectivity</div>'; 69 86 // connectivity -
branch/rev3/install/install_step3.php
r168 r252 1 1 <?php 2 2 $stoppage = true; 3 3 4 if ($_REQUEST['submit']) 4 5 { … … 14 15 $host = 'localhost'; 15 16 } 17 if (file_exists('../config.php')) 18 { 19 echo '<div class="block-header2">Found old config</div>'; 20 echo 'We will just reuse the data and create a new one.<br/>'; 21 include_once('../config.php'); 22 $_SESSION['sql'] = array(); 23 $_SESSION['sql']['host'] = DB_HOST; 24 $_SESSION['sql']['user'] = DB_USER; 25 $_SESSION['sql']['pass'] = DB_PASS; 26 $_SESSION['sql']['db'] = DB_NAME; 27 } 28 else 29 { 16 30 ?> 17 31 <form id="options" name="options" method="post" action="?step=3"> … … 25 39 <tr><td width="120"></td><td><input type=submit name=submit value="Test"></td></tr> 26 40 </table> 41 <?php 42 } 27 43 28 <?php29 44 if ($_SESSION['sql']['db']) 30 45 { -
branch/rev3/install/install_step4.php
r205 r252 1 1 <?php 2 if (file_exists('../config.php')) 3 { 4 echo 'Redirecting you to the Update page, please wait.<br/>'; 5 echo '<meta http-equiv="refresh" content="1; URL=?step=40" />'; 6 return; 7 } 8 2 9 $stoppage = true; 3 10 include('../common/includes/php_compat.php'); 11 include('../common/includes/class.xml.php'); 12 13 echo 'Reading packages...'; 14 $xml = new sxml(); 15 $kb = $xml->parse(file_get_contents('../packages/database/contents.xml')); 4 16 5 17 $struct = $opt = $data = array(); 6 $dir = opendir('./sql'); 7 while ($file = readdir($dir)) 8 { 9 if (strpos($file, 'sql_') !== false) 10 { 11 $table = str_replace(array('sql_tblstrct_', 'sql_tbldata_opt_', 'sql_tbldata_', '.sql'), '', $file); 12 $table = 'kb3_'.preg_replace('/(_p\d{1,4})/', '', $table); 13 if (strpos($file, 'tblstrct')) 14 { 15 $structc++; 16 $struct[$table][] = $file; 17 } 18 elseif (strpos($file, '_opt_')) 18 $tables = array(); 19 foreach($kb['kb3']['table'] as $idx => $tbl) 20 { 21 $table = $tbl['name']; 22 $files = array(); 23 $dir = opendir('../packages/database/'.$table); 24 25 $xml = new sxml(); 26 $st = $xml->parse(file_get_contents('../packages/database/'.$table.'/table.xml')); 27 $struct[$table] = $st['kb3']['structure']; 28 $kb['kb3']['table'][$idx]['rows'] = $st['kb3']['rows']; 29 $structc++; 30 31 while ($file = readdir($dir)) 32 { 33 if ($file == '.' || $file == '..') 34 { 35 continue; 36 } 37 if (strpos($file, '_opt_')) 19 38 { 20 39 $dcnt++; 21 40 $optcnt++; 22 $opt[$table][] = $file;41 $opt[$table][] = '../packages/database/'.$table.'/'.$file; 23 42 asort($opt[$table]); 24 43 } 25 else 44 elseif (!strpos($file, 'xml')) 26 45 { 27 46 $dcnt++; 28 47 $datacnt++; 29 $data[$table][] = $file;48 $data[$table][] = '../packages/database/'.$table.'/'.$file; 30 49 asort($data[$table]); 31 50 } … … 33 52 } 34 53 35 $db = mysql_ pconnect($_SESSION['sql']['host'], $_SESSION['sql']['user'], $_SESSION['sql']['pass']);54 $db = mysql_connect($_SESSION['sql']['host'], $_SESSION['sql']['user'], $_SESSION['sql']['pass']); 36 55 mysql_select_db($_SESSION['sql']['db']); 37 56 $result = mysql_query('show tables'); … … 44 63 if ($_REQUEST['sub'] == 'struct') 45 64 { 46 foreach ($struct as $table => $files) 47 { 48 foreach ($files as $file) 49 { 50 echo 'Creating table '.$table.' from file '.$file.'...'; 51 $query = file_get_contents('./sql/'.$file); 52 $id = mysql_query($query); 53 if ($id) 54 { 55 echo 'done<br/>'; 56 } 57 else 58 { 59 echo 'error: '.mysql_error().'<br/>'; 60 } 65 foreach ($struct as $table => $structure) 66 { 67 echo 'Creating table '.$table.'...'; 68 $query = $struct[$table]; 69 #echo $query; 70 $id = mysql_query($query); 71 if ($id) 72 { 73 echo 'done<br/>'; 74 } 75 else 76 { 77 echo 'error: '.mysql_error().'<br/>'; 61 78 } 62 79 unset($struct[$table]); … … 98 115 continue; 99 116 } 100 echo 'Inserting data ('.$i.'/'.$datacnt.') into '.$table.' fromfile '.$file.'...<br/>';117 echo 'Inserting data ('.$i.'/'.$datacnt.') into '.$table.'<br/> using file '.$file.'...<br/>'; 101 118 102 119 $error = ''; 103 $ querys = file('./sql/'.$file);104 $lines = count($querys);120 $fp = gzopen($file, 'r'); 121 $lines = 0; 105 122 $errors = 0; 106 foreach ($querys as $query) 107 { 123 while ($query = gzgets($fp, 4000)) 124 { 125 $text .= $query; 126 if (substr($text, -3, 1) != ';') 127 { 128 continue; 129 } 130 $query = $text; 131 $text = ''; 132 $lines++; 108 133 if (trim($query)) 109 134 { … … 115 140 $query_count++; 116 141 $id = mysql_query($query); 142 #echo $query; 117 143 if (!$id) 118 144 { … … 122 148 } 123 149 } 124 echo 'File '.$file.' had '.$lines.' lines with '.$query_count.' querys. '.$errors.' Querys failed.<br/>';150 echo 'File '.$file.' had '.$lines.' lines with '.$query_count.' querys.<br/> '.$errors.' Querys failed.<br/>'; 125 151 if (!$error) 126 152 { 127 echo ' done<br/>';153 echo 'Finished importing of this file.<br/>'; 128 154 echo '<meta http-equiv="refresh" content="1; URL=?step=4&sub=data" />'; 129 155 echo 'Automatic reload in 1s for next chunk. <a href="?step=4&sub=data">Manual Link</a><br/>'; … … 175 201 continue; 176 202 } 177 echo 'Inserting optional data ('.$i.'/'.$optsel.') into '.$table.' from file '.$file.'...'; 178 $querys = file('./sql/'.$file); 179 foreach ($querys as $query) 180 { 203 echo 'Inserting optional data ('.$i.'/'.$optsel.') into '.$table.'<br/> using file '.$file.'...'; 204 $fp = gzopen($file, 'r'); 205 while ($query = gzgets($fp, 4000)) 206 { 207 $text .= $query; 208 if (substr($text, -3, 1) != ';') 209 { 210 continue; 211 } 212 $query = $text; 181 213 $query = trim($query); 182 214 if ($query) … … 187 219 } 188 220 $id = mysql_query($query); 221 #echo $query; 189 222 } 190 223 } … … 209 242 $stoppage = false; 210 243 echo 'All tables imported. Checking tables for correct data...<br/>'; 211 $check = file('./sql/tbl_check.txt'); 212 foreach ($check as $line) 213 { 214 $tmp = explode(chr(9), $line); 215 $table = trim($tmp[0]); 216 $count = trim($tmp[1]); 244 foreach ($kb['kb3']['table'] as $line) 245 { 246 $table = $line['name']; 247 $count = $line['rows']; 217 248 echo 'Checking table '.$table.': '; 218 249 $result = mysql_query('SELECT count(*) as cnt FROM '.$table); 219 250 $test = mysql_fetch_array($result); 220 if ($test['cnt'] != $count) 221 { 222 echo $test['cnt'].'/'.$count.' - FAILED'; 223 $stoppage = true; 251 $failed = 0; 252 if ($test['cnt'] != $count && $count != 0) 253 { 254 echo $test['cnt'].'/'.$count.' - <font color="red"><b>FAILED</b></font>'; 255 $failed++; 224 256 } 225 257 else 226 258 { 227 echo $test['cnt'].'/'.$count.' - PASSED';259 echo $test['cnt'].'/'.$count.' - <font color="green"><b>PASSED</b></font>'; 228 260 } 229 261 echo '<br/>'; … … 255 287 { 256 288 echo 'All table structures seem to be in the database.<br/>'; 257 echo 'I will now check some table structures in case you are upgrading from a previous version... ';258 include('install_step4_tblchk.php');259 echo ' done<br/>Please continue with <a href="?step=4&sub=datasel">Importing Data</a><br/>';289 # echo 'I will now check some table structures in case you are upgrading from a previous version... '; 290 # include('install_step4_tblchk.php'); 291 echo 'Please continue with <a href="?step=4&sub=datasel">Importing Data</a><br/>'; 260 292 261 293 echo '<br/><br/>In case you aborted the install and you got already data in those table you can bypass the import now by with <a href="?step=5">this link</a><br/>'; 262 294 echo 'To be sure i will check some table data for you now:<br/>'; 263 $check = file('./sql/tbl_check.txt'); 264 foreach ($check as $line) 265 { 266 $tmp = explode(chr(9), $line); 267 $table = trim($tmp[0]); 268 $count = trim($tmp[1]); 295 foreach ($kb['kb3']['table'] as $line) 296 { 297 $table = $line['name']; 298 $count = $line['rows']; 269 299 echo 'Checking table '.$table.': '; 270 300 $result = mysql_query('SELECT count(*) as cnt FROM '.$table); 271 301 $test = mysql_fetch_array($result); 272 302 $failed = 0; 273 if ($test['cnt'] != $count )274 { 275 echo $test['cnt'].'/'.$count.' - FAILED';303 if ($test['cnt'] != $count && $count != 0) 304 { 305 echo $test['cnt'].'/'.$count.' - <font color="red"><b>FAILED</b></font>'; 276 306 $failed++; 277 307 } 278 308 else 279 309 { 280 echo $test['cnt'].'/'.$count.' - PASSED';310 echo $test['cnt'].'/'.$count.' - <font color="green"><b>PASSED</b></font>'; 281 311 } 282 312 echo '<br/>'; 283 313 } 284 echo 'Checking table kb3_items: '; 285 $result = mysql_query('SELECT count(*) as cnt FROM kb3_items'); 286 $test = mysql_fetch_array($result); 287 $failed = 0; 288 if ($test['cnt'] <= 5000) 289 { 290 echo $test['cnt'].'<5000 - FAILED'; 291 $failed++; 292 } 293 else 294 { 295 echo $test['cnt'].'>5000 - PASSED'; 296 } 297 echo '<br/>'; 298 if (!$failed) 314 if ($failed == 0) 299 315 { 300 316 echo 'All important table data seems to be there, you are safe to bypass the import.<br/>'; -
branch/rev3/install/install_step7.php
r212 r252 7 7 8 8 $config = preg_replace("/\{([^\}]+)\}/e", "\\1", join('', file('config.tpl'))); 9 $fp = fopen('../ cache/config.php', 'w');9 $fp = fopen('../kbconfig.php', 'w'); 10 10 fwrite($fp, trim($config)); 11 11 fclose($fp); 12 chmod('../kbconfig.php', 0400); 12 13 ?> 13 <p>Here is the config i created for you, i saved it as ../cache/config.php with chmod 777.<br/> 14 Please move that file to the main dir or create a new one there with the following content.<br/> 15 You can continue once that config exists, i will try to delete the generated config if it should be stil there on the next step.<br/> 14 <p>I wrote the config to ../kbconfig.php and chmodded it to 400.<br/> 16 15 </p> 17 16 <?php … … 19 18 ?> 20 19 <?php 21 if (!file_exists('../ config.php'))20 if (!file_exists('../kbconfig.php')) 22 21 { 23 22 ?> 24 <p> <a href="?step=<?php echo $_SESSION['state']; ?>">Refresh</a></p>23 <p>Something went wrong, the file ../kbconfig.php is gone!</p> 25 24 <?php 26 25 return; … … 28 27 // config is there, use it to create all config vars which arent there 29 28 // to prevent that ppl with running installs get new values 30 require_once('../ config.php');29 require_once('../kbconfig.php'); 31 30 32 $db = mysql_ pconnect(DB_HOST, DB_USER, DB_PASS);31 $db = mysql_connect(DB_HOST, DB_USER, DB_PASS); 33 32 mysql_select_db(DB_NAME); 34 33 35 $confs = file('config.data'); 36 foreach ($confs as $line) 34 function insertConfig($key, $value) 37 35 { 38 list($key, $value) = explode(chr(9), trim($line)); 36 global $db; 37 39 38 $result = mysql_query('select * from kb3_config where cfg_site=\''.KB_SITE.'\' and cfg_key=\''.$key.'\''); 40 39 if (!$row = mysql_fetch_row($result)) … … 44 43 } 45 44 } 45 46 // move stuff from the config to the database 47 insertConfig('cfg_allianceid', $aid); 48 insertConfig('cfg_corpid', $cid); 49 50 insertConfig('cfg_common', $common); 51 insertConfig('cfg_img', $img); 52 insertConfig('cfg_kbhost', $host); 53 insertConfig('cfg_style', $style); 54 insertConfig('cfg_kbtitle', $title); 55 56 insertConfig('cfg_profile', 0); 57 insertConfig('cfg_qcache', 1); 58 insertConfig('cfg_sqlhalt', 0); 59 60 insertConfig('cfg_mainsite', ''); 61 62 $confs = file('config.data'); 63 foreach ($confs as $line) 64 { 65 list($key, $value) = explode(chr(9), trim($line)); 66 insertConfig($key, $value); 67 } 46 68 ?> 47 69 <br/><br/><font size=+1>Found the config on the right place, please continue...</font><br/> -
branch/rev3/install/install_step8.php
r88 r252 1 1 <?php 2 2 $stoppage = true; 3 4 @unlink('../cache/config.php');5 3 ?> 6 4 <div class="block-header2">Installation Complete</div> 7 <p>Congratulations, you successfully installed the EVE Development Network Killboard v1. 2!<br/>5 <p>Congratulations, you successfully installed the EVE Development Network Killboard v1.4!<br/> 8 6 Please check <a href="http://www.eve-dev.net/">EVE-Dev.net</a> for updates from time to time.<br/> 9 7 <br/>