Changeset 399
- Timestamp:
- 07/01/09 05:50:14 (13 years ago)
- Location:
- dev
- Files:
-
- 1 added
- 17 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin/admin_mods.php
r361 r399 32 32 if ($handle = opendir('mods')) 33 33 { 34 $modlist = array(); 34 35 while ($file = readdir($handle)) 35 36 { 36 37 if (is_dir("mods/$file") && $file != ".." &$file != "." &$file != ".svn") 37 38 { 38 $ html .= "<tr class=kb-table-row-odd style=\"height: 34px;\">";39 $modhtml = "<tr class=kb-table-row-odd style=\"height: 34px;\">"; 39 40 $id = $file; 40 41 … … 51 52 $file .= " [<a href=\"?a=settings_$file\">settings</a>]"; 52 53 } 53 $html .= "<td>$file</td><td align=center><input name=\"mod_$id\" type=\"checkbox\"$checked/></td></tr>"; 54 $modhtml .= "<td>$file</td><td align=center><input name=\"mod_$id\" type=\"checkbox\"$checked/></td></tr>"; 55 $modlist[] = $modhtml; 54 56 } 55 57 } 58 asort($modlist); 59 $html.=implode($modlist); 60 56 61 closedir($handle); 57 62 } -
dev/common/alliance_detail.php
r376 r399 108 108 { 109 109 case "": 110 $html .= "<div class=kb-kills-header>10 Most recent kills </div>";110 $html .= "<div class=kb-kills-header>10 Most recent kills in the last 30 days</div>"; 111 111 112 112 $list = new KillList(); 113 113 $list->setOrdered(true); 114 115 114 if (config::get('comments_count')) $list->setCountComments(true); 115 if (config::get('killlist_involved')) $list->setCountInvolved(true); 116 116 $list->setLimit(10); 117 117 $list->setPodsNoobships(true); … … 119 119 if ($_GET['scl_id']) 120 120 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 121 121 $list->setStartDate(date('Y-m-d H:i',strtotime('- 30 days'))); 122 122 $ktab = new KillListTable($list); 123 123 $ktab->setLimit(10); … … 125 125 $html .= $ktab->generate(); 126 126 127 $html .= "<div class=kb-losses-header>10 Most recent losses </div>";127 $html .= "<div class=kb-losses-header>10 Most recent losses in the last 30 days</div>"; 128 128 129 129 $list = new KillList(); 130 130 $list->setOrdered(true); 131 132 131 if (config::get('comments_count')) $list->setCountComments(true); 132 if (config::get('killlist_involved')) $list->setCountInvolved(true); 133 133 $list->setLimit(10); 134 134 $list->setPodsNoobships(true); … … 136 136 if ($_GET['scl_id']) 137 137 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 138 $list->setStartDate(date('Y-m-d H:i',strtotime('- 30 days'))); 138 139 139 140 $ltab = new KillListTable($list); … … 148 149 $list = new KillList(); 149 150 $list->setOrdered(true); 150 $list->setCountComments(true); 151 $list->setCountInvolved(true); 152 $list->addInvolvedAlliance($alliance); 151 $list->addInvolvedAlliance($alliance); 153 152 if ($_GET['scl_id']) 154 153 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); … … 166 165 $list = new KillList(); 167 166 $list->setOrdered(true); 168 $list->setCountComments(true); 169 $list->setCountInvolved(true); 170 $list->setPodsNoobships(true); 167 $list->setPodsNoobships(true); 171 168 $list->addVictimAlliance($alliance); 172 169 if ($_GET['scl_id']) -
dev/common/corp_detail.php
r376 r399 199 199 { 200 200 case "": 201 $html .= "<div class=kb-kills-header>10 Most recent kills </div>";201 $html .= "<div class=kb-kills-header>10 Most recent kills in the last 30 days</div>"; 202 202 203 203 $list = new KillList(); … … 208 208 if ($_GET['scl_id']) 209 209 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 210 $list->setStartDate(date('Y-m-d H:i',strtotime('- 30 days'))); 210 211 211 212 $ktab = new KillListTable($list); … … 214 215 $html .= $ktab->generate(); 215 216 216 $html .= "<div class=kb-losses-header>10 Most recent losses </div>";217 $html .= "<div class=kb-losses-header>10 Most recent losses in the last 30 days</div>"; 217 218 218 219 $list = new KillList(); … … 223 224 if ($_GET['scl_id']) 224 225 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 226 $list->setStartDate(date('Y-m-d H:i',strtotime('- 30 days'))); 225 227 226 228 $ltab = new KillListTable($list); -
dev/common/includes/autoupgrade.php
r398 r399 27 27 update007(); 28 28 update008(); 29 update009(); 29 30 } 30 31 } … … 181 182 function update007() 182 183 { 184 if(!config::get('007updatestatus')) config::set('007updatestatus',0); 183 185 //Checking if this Update already done 184 186 if (CURRENT_DB_UPDATE < "007" ) … … 231 233 */ 232 234 $qry->execute("SHOW COLUMNS FROM kb3_kills LIKE 'kll_external_id'"); 233 $testresult = $qry->recordCount(); 234 if(!$testresult) 235 if(!$qry->recordCount()) 235 236 { 236 237 $sql = "ALTER TABLE `kb3_kills` ". … … 240 241 } 241 242 // Add isk loss column to kb3_kills 242 $qry->execute("SHOW COLUMNS FROM kb3_kills LIKE 'kll_isk_loss'"); 243 $sql = "ALTER TABLE `kb3_kills` ADD `kll_isk_loss` FLOAT NOT NULL DEFAULT '0'"; 244 if(!$qry->recordCount()) $qry->execute($sql); 245 // Update price with items destroyed and ship value, excluding 246 // blueprints since default cost is for BPO and BPC looks identical 247 $sql = "CREATE TABLE IF NOT EXISTS `tmp_pricing` ( 248 `kll_id` int(11) NOT NULL DEFAULT '0', 249 `ship` float NOT NULL DEFAULT '0', 250 `destroyed` float NOT NULL DEFAULT '0', 251 `dropped` float NOT NULL DEFAULT '0', 252 PRIMARY KEY (`kll_id`), 253 KEY `ship` (`ship`), 254 KEY `destroyed` (`destroyed`), 255 KEY `dropped` (`dropped`) 256 ) ENGINE=MyISAM"; 257 $qry->execute($sql); 258 $qry->execute('SELECT * FROM tmp_pricing limit 1'); 259 if(!$qry->recordCount()) $qry->execute("INSERT INTO tmp_pricing select kll_id,0,0,0 FROM kb3_kills"); 260 $sql = "update tmp_pricing inner join kb3_kills on kb3_kills.kll_id = tmp_pricing.kll_id 261 INNER JOIN kb3_ships ON kb3_ships.shp_id = kll_ship_id 262 LEFT JOIN kb3_ships_values ON kb3_ships_values.shp_id = kll_ship_id 263 set ship = if(isnull(shp_value),shp_baseprice,shp_value) 264 where ship = 0"; 265 $qry->execute($sql); 266 $sql = "UPDATE tmp_pricing 267 INNER JOIN (SELECT itd_kll_id, 268 sum(if(typeName LIKE '%Blueprint%',0,if(isnull(itd_quantity), 269 0,itd_quantity * if(price = 0 OR isnull(price),basePrice,price)))) 270 AS killcost 271 FROM kb3_items_destroyed 272 LEFT JOIN kb3_item_price ON kb3_item_price.typeID = itd_itm_id 273 LEFT JOIN kb3_invtypes ON itd_itm_id = kb3_invtypes.typeID 274 GROUP BY itd_kll_id) cost on kll_id = itd_kll_id 275 SET destroyed = killcost 276 WHERE destroyed = 0"; 277 $qry->execute($sql); 278 if(config::get(kd_droptototal)) 279 $sql = "UPDATE tmp_pricing 280 INNER JOIN (SELECT itd_kll_id, 281 sum(if(typeName LIKE '%Blueprint%',0,if(isnull(itd_quantity), 282 0,itd_quantity * if(price = 0 OR isnull(price),basePrice,price)))) 283 AS killcost 284 FROM kb3_items_dropped 285 LEFT JOIN kb3_item_price ON kb3_item_price.typeID = itd_itm_id 286 LEFT JOIN kb3_invtypes ON itd_itm_id = kb3_invtypes.typeID 287 GROUP BY itd_kll_id) cost on kll_id = itd_kll_id 288 SET dropped = killcost 289 WHERE dropped = 0"; 290 $qry->execute($sql); 291 $qry->execute('UPDATE kb3_kills inner join tmp_pricing 292 ON kb3_kills.kll_id = tmp_pricing.kll_id SET kll_isk_loss = ship + destroyed + dropped'); 293 $qry->execute('DROP TABLE tmp_pricing'); 243 if(config::get('007updatestatus') <8) 244 { 245 // Update price with items destroyed and ship value, excluding 246 // blueprints since default cost is for BPO and BPC looks identical 247 $sql = "CREATE TABLE IF NOT EXISTS `tmp_price_ship` ( 248 `kll_id` int(11) NOT NULL DEFAULT '0', 249 `value` float NOT NULL DEFAULT '0', 250 PRIMARY KEY (`kll_id`) 251 ) ENGINE=MyISAM"; 252 $qry->execute($sql); 253 $sql = "CREATE TABLE IF NOT EXISTS `tmp_price_destroyed` ( 254 `kll_id` int(11) NOT NULL DEFAULT '0', 255 `value` float NOT NULL DEFAULT '0', 256 PRIMARY KEY (`kll_id`) 257 ) ENGINE=MyISAM"; 258 $qry->execute($sql); 259 $sql = "CREATE TABLE IF NOT EXISTS `tmp_price_dropped` ( 260 `kll_id` int(11) NOT NULL DEFAULT '0', 261 `value` float NOT NULL DEFAULT '0', 262 PRIMARY KEY (`kll_id`) 263 ) ENGINE=MyISAM"; 264 $qry->execute($sql); 265 $qry->execute("LOCK TABLES tmp_price_ship WRITE, tmp_price_destroyed WRITE, 266 tmp_price_dropped WRITE, kb3_kills WRITE, kb3_ships WRITE, 267 kb3_ships_values WRITE, kb3_items_destroyed WRITE, kb3_items_dropped WRITE, 268 kb3_invtypes WRITE, kb3_item_price WRITE, kb3_config WRITE"); 269 if(config::get('007updatestatus') <1) 270 { 271 if(!$qry->recordCount()) $qry->execute("INSERT IGNORE INTO tmp_price_ship select 272 kll_id,if(isnull(shp_value),shp_baseprice,shp_value) FROM kb3_kills 273 INNER JOIN kb3_ships ON kb3_ships.shp_id = kll_ship_id 274 LEFT JOIN kb3_ships_values ON kb3_ships_values.shp_id = kll_ship_id"); 275 $qry->execute($sql); 276 config::set('007updatestatus',1); 277 } 278 if(config::get('007updatestatus') <2) 279 { 280 $sql = "INSERT IGNORE INTO tmp_price_destroyed 281 SELECT itd_kll_id, 282 sum(if(typeName LIKE '%Blueprint%',0,if(isnull(itd_quantity), 283 0,itd_quantity * if(price = 0 OR isnull(price),basePrice,price)))) 284 FROM kb3_items_destroyed 285 LEFT JOIN kb3_item_price ON kb3_item_price.typeID = itd_itm_id 286 LEFT JOIN kb3_invtypes ON itd_itm_id = kb3_invtypes.typeID 287 GROUP BY itd_kll_id"; 288 $qry->execute($sql); 289 config::set('007updatestatus',2); 290 } 291 if(0 && config::get('007updatestatus') <3) 292 { 293 $sql = "UPDATE tmp_pricing 294 INNER JOIN tmp_price on tmp_pricing.kll_id = tmp_price.kll_id 295 SET tmp_pricing.destroyed = tmp_price.value 296 WHERE destroyed = 0"; 297 $qry->execute($sql); 298 config::set('007updatestatus',3); 299 } 300 if(0 && config::get('007updatestatus') <4) 301 { 302 $qry->execute('DELETE FROM tmp_price'); 303 config::set('007updatestatus',4); 304 } 305 if(config::get('007updatestatus') <5) 306 { 307 if(config::get(kd_droptototal)) 308 { 309 $sql = "INSERT INTO tmp_price_dropped 310 SELECT itd_kll_id, 311 sum(if(typeName LIKE '%Blueprint%',0,if(isnull(itd_quantity), 312 0,itd_quantity * if(price = 0 OR isnull(price),basePrice,price)))) 313 FROM kb3_items_dropped 314 LEFT JOIN kb3_item_price ON kb3_item_price.typeID = itd_itm_id 315 LEFT JOIN kb3_invtypes ON itd_itm_id = kb3_invtypes.typeID 316 GROUP BY itd_kll_id"; 317 $qry->execute($sql); 318 } 319 config::set('007updatestatus',5); 320 } 321 if(0 && config::get('007updatestatus') <6) 322 { 323 $sql = "UPDATE tmp_pricing 324 INNER JOIN tmp_price on tmp_pricing.kll_id = tmp_price.kll_id 325 SET tmp_pricing.dropped = tmp_price.value"; 326 $qry->execute($sql); 327 config::set('007updatestatus',6); 328 } 329 if(config::get('007updatestatus') <7) 330 { 331 $qry->execute("SHOW COLUMNS FROM kb3_kills LIKE 'kll_isk_loss'"); 332 if(!$qry->recordCount()) $qry->execute("ALTER TABLE `kb3_kills` ADD `kll_isk_loss` FLOAT NOT NULL DEFAULT '0'"); 333 config::set('007updatestatus',7); 334 } 335 if(config::get('007updatestatus') <8) 336 {$sql = 'UPDATE kb3_kills 337 natural join tmp_price_ship 338 natural left join tmp_price_destroyed '; 339 if(config::get(kd_droptototal)) $sql .= ' natural left join tmp_price_dropped '; 340 $sql .= 'SET kb3_kills.kll_isk_loss = tmp_price_ship.value + ifnull(tmp_price_destroyed.value,0) '; 341 if(config::get(kd_droptototal)) $sql .= ' + ifnull(tmp_price_dropped.value,0) '; 342 $qry->execute ($sql); 343 config::set('007updatestatus',8); 344 } 345 $qry->execute("UNLOCK TABLES"); 346 $qry->execute('DROP TABLE tmp_price_ship'); 347 $qry->execute('DROP TABLE tmp_price_destroyed'); 348 $qry->execute('DROP TABLE tmp_price_dropped'); 349 } 294 350 $qry->execute("SHOW COLUMNS FROM kb3_kills LIKE 'kll_fb_crp_id'"); 295 351 if($qry->recordCount()) $qry->execute("ALTER TABLE `kb3_kills` DROP `kll_fb_crp_id`"); … … 339 395 ) ENGINE = MYISAM "); 340 396 341 // set update complete397 // set API update complete 342 398 config::set('API_DBUpdate', '1'); 343 399 … … 353 409 $qry->execute("UPDATE `kb3_item_types` SET `itt_slot` = '7' WHERE `kb3_item_types`.`itt_id` = 958 LIMIT 1"); 354 410 } 355 $qry->execute("TRUNCATE kb3_inv_all"); 356 $qry->execute("TRUNCATE kb3_inv_crp"); 357 $qry->execute("TRUNCATE kb3_inv_plt"); 358 411 $qry->execute('SHOW TABLES'); 412 $qry2 = new DBQuery(true); 413 while($row = $qry->getRow()) 414 { 415 $tablename = implode($row); 416 if($tablename == 'kb3_inv_all') $qry2->execute("TRUNCATE kb3_inv_all"); 417 if($tablename == 'kb3_inv_crp') $qry2->execute("TRUNCATE kb3_inv_crp"); 418 if($tablename == 'kb3_inv_plt') $qry2->execute("TRUNCATE kb3_inv_plt"); 419 } 420 killCache(); 421 config::del('007updatestatus'); 359 422 config::set("DBUpdate","007"); 360 423 } … … 451 514 if(!$indexcexists) $qry->execute("ALTER TABLE `kb3_corps` DROP INDEX `".$indexcname."`"); 452 515 $qry->execute("ALTER TABLE `kb3_corps` ADD UNIQUE INDEX ( `crp_name` ) "); 516 517 453 518 config::set('008updatestatus', 7); 454 519 } … … 561 626 config::set('cache_update', '*'); 562 627 config::set('cache_time', '10'); 628 629 killCache(); 563 630 config::set("DBUpdate", "008"); 631 } 632 } 633 634 // Add alliance and corp summary tables. 635 function update009() 636 { 637 //Checking if this Update already done 638 if (CURRENT_DB_UPDATE < "009" ) 639 { 640 $qry = new DBQuery(); 641 $sql = "CREATE TABLE IF NOT EXISTS `kb3_sum_alliance` ( 642 `asm_all_id` int(11) NOT NULL DEFAULT '0', 643 `asm_shp_id` int(3) NOT NULL DEFAULT '0', 644 `asm_kill_count` int(11) NOT NULL DEFAULT '0', 645 `asm_kill_isk` float NOT NULL DEFAULT '0', 646 `asm_loss_count` int(11) NOT NULL DEFAULT '0', 647 `asm_loss_isk` float NOT NULL DEFAULT '0', 648 PRIMARY KEY (`asm_all_id`,`asm_shp_id`) 649 ) ENGINE=InnoDB"; 650 $qry->execute($sql); 651 $sql = "CREATE TABLE IF NOT EXISTS `kb3_sum_corp` ( 652 `csm_crp_id` int(11) NOT NULL DEFAULT '0', 653 `csm_shp_id` int(3) NOT NULL DEFAULT '0', 654 `csm_kill_count` int(11) NOT NULL DEFAULT '0', 655 `csm_kill_isk` float NOT NULL DEFAULT '0', 656 `csm_loss_count` int(11) NOT NULL DEFAULT '0', 657 `csm_loss_isk` float NOT NULL DEFAULT '0', 658 PRIMARY KEY (`csm_crp_id`,`csm_shp_id`) 659 ) ENGINE=InnoDB"; 660 $qry->execute($sql); 661 config::set("DBUpdate", "009"); 564 662 } 565 663 } … … 591 689 } 592 690 691 function killCache() 692 { 693 if(!is_dir(KB_CACHEDIR)) return; 694 $dir = opendir(KB_CACHEDIR); 695 while ($line = readdir($dir)) 696 { 697 if (strstr($line, 'qcache_qry') !== false) 698 { 699 @unlink(KB_CACHEDIR.'/'.$line); 700 } 701 elseif (strstr($line, 'qcache_tbl') !== false) 702 { 703 @unlink(KB_CACHEDIR.'/'.$line); 704 } 705 } 706 } 593 707 ?> -
dev/common/includes/class.cache.php
r396 r399 171 171 function touchCache() 172 172 { 173 touch(genCacheName()); 173 if(! KB_CACHE ) return; 174 if (!file_exists(KB_CACHEDIR.'/'.KB_SITE)) 175 mkdir(KB_CACHEDIR.'/'.KB_SITE); 176 touch(cache::genCacheName()); 174 177 } 175 178 //! Notify the cache that a kill has been added. 176 179 function notifyKillAdded() 177 180 { 181 if(! KB_CACHE ) return; 182 if (!file_exists(KB_CACHEDIR.'/'.KB_SITE)) 183 mkdir(KB_CACHEDIR.'/'.KB_SITE); 178 184 touch(KB_CACHEDIR.'/'.KB_SITE.'/killadded.mk'); 179 185 } -
dev/common/includes/class.db.mysqli.php
r391 r399 2 2 // mssql: select SCOPE_IDENTITY() AS id 3 3 // postgresql: INSERT INTO mytable (lastname) VALUES ('Cher') RETURNING id; 4 5 require_once('db.php');6 4 7 5 //! mysqli connection class. -
dev/common/includes/class.db.php
r397 r399 301 301 file_put_contents($qerrfile, $sql . "\nExecution time: " . $this->exectime_ . "\n", FILE_APPEND); 302 302 } 303 if(DB_TYPE != 'mysqli') return; 303 304 if (KB_PROFILE == 3) 304 305 { -
dev/common/includes/class.db_cache.php
r391 r399 1 1 <?php 2 3 require_once('db.php');4 2 5 3 //! mysqli file-cached query class. Manages SQL queries to a MySQL DB using mysqli. -
dev/common/includes/class.db_memcache.php
r391 r399 1 1 <?php 2 3 require_once('db.php');4 2 5 3 class DBMemcachedQuery -
dev/common/includes/class.kill.php
r396 r399 9 9 require_once('common/includes/class.itemlist.php'); 10 10 require_once('common/includes/class.cache.php'); 11 require_once('common/includes/class.summary.php'); 11 12 12 13 class Kill … … 1099 1100 return false; 1100 1101 } 1102 allianceSummary::addKill($this); 1103 corpSummary::addKill($this); 1101 1104 $qry->autocommit(true); 1102 1105 // call the event that we added this mail … … 1218 1221 function getFormatttedValue() 1219 1222 { 1220 return getFormattedValue();1221 } 1222 1223 return $this->getFormattedValue(); 1224 } 1225 //! Return value formatted into millions or thousands. 1223 1226 function getFormattedValue() 1224 1227 { -
dev/common/includes/class.killlist.php
r396 r399 70 70 else 71 71 { 72 $this->sql_ .= 'select kll.kll_id, kll.kll_timestamp, kll.kll_external_id,72 $this->sql_ .= 'select distinct kll.kll_id, kll.kll_timestamp, kll.kll_external_id, 73 73 plt.plt_name, crp.crp_name, crp.crp_id, 74 74 ali.all_name, ali.all_id, … … 139 139 if( $datefilter == "" && ( $this->inv_plt_ || $this->inv_crp_ || $this->inv_all_)) 140 140 { 141 $this->sql_ .= " INNER JOIN kb3_inv_detail ind ON (kll.kll_id = ind.ind_kll_id AND ("; 142 $invop = ""; 143 if($this->inv_plt_ ) 144 { 145 $this->sql_ .= " ind.ind_plt_id IN (". 146 implode(',', $this->inv_plt_)." ) "; 147 $invop = "OR"; 148 } 149 if($this->inv_crp_ ) 150 { 151 $this->sql_ .= $invop." ind.ind_crp_id IN (". 152 implode(',', $this->inv_crp_)." ) "; 153 } 154 if($this->inv_all_ ) 155 { 156 $this->sql_ .= $invop." ind.ind_all_id IN (". 157 implode(',', $this->inv_all_)." ) "; 158 } 159 $this->sql_ .= ") ) "; 160 /* Faster on <50k mails, much slower on >500k 141 161 $this->sql_ .= " INNER JOIN "; 142 162 if($this->inv_plt_ && !($this->inv_crp_ || $this->inv_all_)) … … 167 187 $this->sql_ .= ") ind ON (kll.kll_id = ind.ind_kll_id) "; 168 188 } 189 */ 169 190 } 170 191 // The first argument after WHERE affects sql optimisation so check -
dev/common/includes/class.killsummarytable.php
r394 r399 1 1 <?php 2 2 require_once("class.ship.php"); 3 require_once("class.summary.php"); 3 4 4 5 class KillSummaryTable … … 156 157 echo 'mode not supported<br>'; 157 158 exit; 159 } 160 if( count($this->inv_all_) == 1 && !$this->inv_crp_ && !$this->inv_plt_ && $this->setDateFilter() == "") 161 { 162 $allsum = new allianceSummary($this->inv_all_[0]); 163 $summary = $allsum->getSummary(); 164 foreach($summary as $key => $row) 165 { 166 $this->entry_[$row['class_name']] = array('id' => $key, 167 'kills' => $row['killcount'], 'kills_isk' => $row['killisk'], 168 'losses' => $row['losscount'], 'losses_isk' => $row['lossisk']); 169 170 $this->tkcount_ += $row['killcount']; 171 $this->tkisk_ += $row['killisk']; 172 $this->tlcount_ += $row['losscount']; 173 $this->tlisk_ += $row['lossisk']; 174 } 175 return; 176 } 177 178 if( count($this->inv_crp_) == 1 && !$this->inv_all_ && !$this->inv_plt_ && $this->setDateFilter() == "") 179 { 180 $crpsum = new corpSummary($this->inv_crp_[0]); 181 $summary = $crpsum->getSummary(); 182 foreach($summary as $key => $row) 183 { 184 $this->entry_[$row['class_name']] = array('id' => $key, 185 'kills' => $row['killcount'], 'kills_isk' => $row['killisk'], 186 'losses' => $row['losscount'], 'losses_isk' => $row['lossisk']); 187 188 $this->tkcount_ += $row['killcount']; 189 $this->tkisk_ += $row['killisk']; 190 $this->tlcount_ += $row['losscount']; 191 $this->tlisk_ += $row['lossisk']; 192 } 193 return; 158 194 } 159 195 -
dev/common/includes/db.php
r382 r399 5 5 require_once('common/includes/class.config.php'); 6 6 7 if(!defined('DB_TYPE')) define('DB_TYPE', 'mysql'); 7 8 if(DB_TYPE == 'mysqli' and function_exists('mysqli_connect')) define('DB_TYPE_USED', 'mysqli'); 8 9 if(DB_TYPE_USED == 'mysqli') require_once('common/includes/class.db.mysqli.php'); -
dev/common/includes/globals.php
r398 r399 7 7 else 8 8 { 9 $svn_rev = '39 8';9 $svn_rev = '399'; 10 10 } 11 11 define('SVN_REV', $svn_rev); … … 13 13 // current version: major.minor.sub 14 14 // unpair numbers for minor = development version 15 define('KB_VERSION', '2.0.0 RC 1');15 define('KB_VERSION', '2.0.0 RC2'); 16 16 define('KB_RELEASE', '(Apocrypha)'); 17 17 -
dev/common/index.php
r398 r399 74 74 define('KB_TITLE', config::get('cfg_kbtitle')); 75 75 76 // corporation OR alliance id77 if ( config::get('cfg_pilotid'))78 { 79 define('PILOT_ID', config::get('cfg_corpid') );80 define('CORP_ID', 0);81 define('ALLIANCE_ID', 0);82 } 83 if (config::get('cfg_corpid'))84 { 85 define('PILOT_ID', 0);86 define('CORP_ID', config::get('cfg_corpid'));87 define('ALLIANCE_ID', 0);88 } 89 else 90 { 91 define('PILOT_ID', 0);92 define('CORP_ID', 0);93 define('ALLIANCE_ID', config::get('cfg_allianceid'));76 // pilot id not fully implemented yet. 77 if (0 && config::get('cfg_pilotid')) 78 { 79 define('PILOT_ID', config::get('cfg_pilotid') ); 80 define('CORP_ID', 0); 81 define('ALLIANCE_ID', 0); 82 } 83 elseif (config::get('cfg_corpid')) 84 { 85 define('PILOT_ID', 0); 86 define('CORP_ID', config::get('cfg_corpid')); 87 define('ALLIANCE_ID', 0); 88 } 89 else 90 { 91 define('PILOT_ID', 0); 92 define('CORP_ID', 0); 93 define('ALLIANCE_ID', config::get('cfg_allianceid')); 94 94 } 95 95 … … 138 138 139 139 // Hardcode the DBUpdate 140 define(LASTEST_DB_UPDATE,"00 8");140 define(LASTEST_DB_UPDATE,"009"); 141 141 142 142 if(config::get('DBUpdate') < LASTEST_DB_UPDATE) $page = 'admin'; -
dev/common/pilot_detail.php
r376 r399 82 82 else 83 83 { 84 $pilot_survival = round($llist->getCount() / ($tklist->getCount() + $llist->getCount()) * 100,2); 85 $pilot_efficiency = round(($klist->getISK() / ($klist->getISK() + $llist->getISK())) * 100,2); 84 if($tklist->getCount() + $llist->getCount()) $pilot_survival = round($llist->getCount() / ($tklist->getCount() + $llist->getCount()) * 100,2); 85 else $pilot_survival = 0; 86 if($klist->getISK() + $llist->getISK()) $pilot_efficiency = round(($klist->getISK() / ($klist->getISK() + $llist->getISK())) * 100,2); 87 else $pilot_efficiency = 0; 86 88 } 87 89 -
dev/mods/apiuser/login.php
r365 r399 6 6 { 7 7 $result = user::login($_POST['usrlogin'], $_POST['usrpass']); 8 if ( $_POST['usrlogin'] == '' && $_POST['usrpass'] == ADMIN_PASSWORD || user::role('admin') ) 8 if ( $_POST['usrlogin'] == '' && 9 (crypt($_POST['usrpass'],ADMIN_PASSWORD) == ADMIN_PASSWORD || $_POST['usrpass'] == ADMIN_PASSWORD) 10 || user::role('admin') ) 9 11 { 10 12 session::create(true);