Changeset 254
- Timestamp:
- 12/05/07 20:53:40 (15 years ago)
- Location:
- dev
- Files:
-
- 10 removed
- 50 modified
- 50 copied
Legend:
- Unmodified
- Added
- Removed
-
dev/common/about.php
r207 r254 22 22 // Please leave the information on the next line as is so that other people can easily find the EVE-Dev website. 23 23 // Remember to share any modifications to the EVE-Dev Killboard. 24 $html .= "This is the EVE Development Network Killboard running version ".KB_VERSION." rev ".SVN_REV.", created for <a href=\"http://www.eve-online.com/\">EVE Online</a> corporations and alliances. Based on the EVE-Killboard created by <a href=\"mailto:rig0r@eve-killboard.net\">rig0r,</a>it is now developed and maintained by the <a href=\"http://www.eve-dev.net/\">EVE-Dev</a> group.<br/>"24 $html .= "This is the EVE Development Network Killboard running version ".KB_VERSION." rev ".SVN_REV.", created for <a href=\"http://www.eve-online.com/\">EVE Online</a> corporations and alliances. Based on the EVE-Killboard created by rig0r, it is now developed and maintained by the <a href=\"http://www.eve-dev.net/\">EVE-Dev</a> group.<br/>" 25 25 ."All EVE graphics and data used are property of <a href=\"http://www.ccpgames.com/\">CCP</a>.<br/><br/>"; 26 26 $html .= '<a href="http://www.eve-dev.net/" target="_blank"><img src="http://www.eve-dev.net/e107_images/evedev_button.png" border="0"/></a><br/><br/>'; -
dev/common/admin/admin_kill_export.php
r190 r254 11 11 if (!$_POST['dir']) 12 12 { 13 $dir = getcwd().'/cache/kill_export';13 $dir = str_replace('\\','/',getcwd()).'/cache/kill_export'; 14 14 } 15 15 if (!$_POST['ext']) … … 43 43 $ext = $_SESSION['admin_kill_export']['ext']; 44 44 } 45 if (!strstr(stripslashes($dir), stripslashes( getcwd())))46 { 47 $dir = getcwd().$dir;45 if (!strstr(stripslashes($dir), stripslashes(str_replace('\\','/',getcwd())))) 46 { 47 $dir = str_replace('\\','/',getcwd()).$dir; 48 48 } 49 49 -
dev/common/admin/admin_mapoptions.php
r213 r254 1 1 <?php 2 require_once('common/includes/class.contract.php');3 2 require_once('common/includes/class.http.php'); 4 3 require_once('common/admin/admin_menu.php'); … … 12 11 config::checkCheckbox('map_map_showlines'); 13 12 config::checkCheckbox('map_reg_showlines'); 13 config::checkCheckbox('map_region_cache'); 14 14 config::checkCheckbox('map_con_showlines'); 15 15 config::checkCheckbox('map_con_shownames'); … … 76 76 77 77 $options[1]['name'] = 'Constellation Options'; 78 $options[1]['option'][] = array('descr' => 'Cache const maps', 'name' => 'map_region_cache'); 78 79 $options[1]['option'][] = array('descr' => 'Show Lines', 'name' => 'map_reg_showlines'); 79 80 $options[1]['option'][] = array('descr' => 'Paint Security', 'name' => 'map_reg_security'); -
dev/common/admin/option_generic.php
r215 r254 15 15 options::fadd('Enable Comments', 'comments', 'checkbox'); 16 16 options::fadd('Require password for Comments', 'comments_pw', 'checkbox'); 17 options::fadd('Display Comment Count on Killlists', 'comments_count', 'checkbox');18 17 options::fadd('Display Standings', 'show_standings', 'checkbox'); 19 18 options::fadd('Enable Lost Item Values', 'item_values', 'checkbox'); … … 35 34 options::fadd('ReAdd known killmails', 'readd_dupes', 'checkbox'); 36 35 36 options::cat('Appearance', 'Generic', 'Killlists'); 37 options::fadd('Display Comment Count on Killlists', 'comments_count', 'checkbox'); 38 options::fadd('Display Alliance Logos on killlists', 'killlist_alogo', 'checkbox'); 39 37 40 options::cat('Appearance', 'Generic', 'Public-Mode-Beta (Provided by eve-kill.net, the TRUE public KB... *jokeing*)'); 38 41 options::fadd('Only Kills in SummaryTables', 'public_summarytable', 'checkbox','','','CORP_ID and ALLIANCE_ID in config.php has to be 0 to work "public"'); … … 118 121 } 119 122 $options[] = array('value' => 'do nothing', 'descr' => 'do nothing', 'state' => $state); 120 123 121 124 if (config::get('public_stats') == 'remove') 122 125 { … … 138 141 } 139 142 $options[] = array('value' => 'replace', 'descr' => 'replace (not rdy yet)', 'state' => $state); 140 143 141 144 return $options; 142 145 } 143 146 144 147 function dateSelector() 145 148 { -
dev/common/corp_detail.php
r239 r254 24 24 $html .= "<table class=kb-table width=\"100%\" border=\"0\" cellspacing=1><tr class=kb-table-row-even><td rowspan=8 width=128 align=center bgcolor=black>"; 25 25 26 if (file_exists("img/corps/".$corp->getID().".jpg") )26 if (file_exists("img/corps/".$corp->getID().".jpg") || file_exists("img/corps/".$corp->getUnique().".jpg")) 27 27 { 28 28 $html .= "<img src=\"".$corp->getPortraitURL(128)."\" border=\"0\"></td>"; … … 30 30 else 31 31 { 32 $html .= "<img src=\"" . IMG_URL ."/campaign-big.gif\" border=\"0\"></td>";32 $html .= "<img src=\"".IMG_URL."/campaign-big.gif\" border=\"0\"></td>"; 33 33 } 34 34 -
dev/common/includes/class.comments.php
r190 r254 38 38 39 39 // create comment_added event 40 event::call('comment_added', &$this);40 event::call('comment_added', $this); 41 41 } 42 42 -
dev/common/includes/class.config.php
r226 r254 93 93 } 94 94 } 95 $cache[$key] = $value; 95 96 96 if (is_array($value)) 97 97 { 98 $cache[$key] = $value; 98 99 $value = serialize($value); 99 100 } 101 else 102 { 103 $cache[$key] = stripslashes($value); 104 } 105 $value = addslashes($value); 100 106 101 107 $qry = new DBQuery(); … … 122 128 return null; 123 129 } 124 return $cache[$key];130 return stripslashes($cache[$key]); 125 131 } 126 132 } -
dev/common/includes/class.corp.php
r190 r254 1 1 <?php 2 require_once("db.php"); 3 require_once("class.alliance.php"); 2 require_once('class.alliance.php'); 4 3 5 4 class Corporation … … 20 19 } 21 20 21 function getUnique() 22 { 23 return preg_replace('/[^a-z0-9]/', '', strtolower($this->getName())); 24 } 25 22 26 function getPortraitURL($size = 64) 23 27 { 24 return '?a=thumb&type=corp&id='.$this->id_.'&size='.$size; 28 if ($this->isNPCCorp() || file_exists('img/corps/'.$this->getUnique().'.jpg')) 29 { 30 return '?a=thumb&type=corp&id='.$this->getUnique().'&size='.$size; 31 } 32 return '?a=thumb&type=corp&id='.$this->id_.'&size='.$size; 25 33 } 26 34 -
dev/common/includes/class.db.php
r209 r254 32 32 class DBQuery 33 33 { 34 var $object; 35 36 // php5 style object overloading 37 // we internally load up the wanted object and reroute all 38 // object actions to it 39 function __construct() 40 { 41 if (DB_USE_QCACHE === true) 42 { 43 $object = new DBCachedQuery(); 44 } 45 else 46 { 47 $object = new DBNormalQuery(); 48 } 49 $this->object = $object; 50 } 51 52 function __call($name, $args) 53 { 54 return call_user_func_array(array($this->object, $name), $args); 55 } 56 57 function __set($name, $value) 58 { 59 $this->object->$name = $value; 60 } 61 62 function __unset($name) 63 { 64 unset($this->object->$name); 65 } 66 67 function __isset($name) 68 { 69 return isset($this->object->$name); 70 } 71 72 function __get($name) 73 { 74 return $this->object->$name; 75 } 76 77 // php4 style object overloading 78 // we just hijack $this but we need to use a helper 79 // function for this because php5 fatals if it sees 80 // $this = ... in the src 34 81 function DBQuery() 82 { 83 $object = &$this->getRef($this); 84 if (DB_USE_QCACHE === true) 85 { 86 $object = new DBCachedQuery(); 87 } 88 else 89 { 90 $object = new DBNormalQuery(); 91 } 92 } 93 94 function &getRef(&$var) 95 { 96 return $var; 97 } 98 } 99 100 class DBNormalQuery 101 { 102 function DBNormalQuery() 35 103 { 36 104 $this->executed_ = false; -
dev/common/includes/class.db_cache.php
r216 r254 1 1 <?php 2 2 3 class DBC onnection3 class DBCachedQuery 4 4 { 5 function DBConnection() 6 { 7 static $conn_id; 8 9 if (is_resource($conn_id)) 10 { 11 $this->id_ = $conn_id; 12 return; 13 } 14 if (!$this->id_ = mysql_connect(DB_HOST, DB_USER, DB_PASS)) 15 die("Unable to connect to mysql database."); 16 17 mysql_select_db(DB_NAME); 18 $conn_id = $this->id_; 19 } 20 21 function id() 22 { 23 return $this->id_; 24 } 25 26 function affectedRows() 27 { 28 return mysql_affected_rows($this->id_); 29 } 30 } 31 32 class DBQuery 33 { 34 function DBQuery() 5 function DBCachedQuery() 35 6 { 36 7 $this->executed_ = false; … … 51 22 // only cache selects 52 23 // we don't use select ... into so there is no problem 24 $this->_sql = str_replace(array("\r\n", "\n"), ' ', $this->_sql); 53 25 if (strtolower(substr($this->_sql, 0, 6)) != 'select' && strtolower(substr($this->_sql, 0, 4)) != 'show') 54 26 { … … 90 62 $parse = str_replace(',', ' join ', $parse); 91 63 } 64 65 $parse = 'join '.$parse; 92 66 if (strpos($parse, 'join')) 93 67 { -
dev/common/includes/class.item.php
r213 r254 1 1 <?php 2 require_once("db.php");2 define('DGM_TECHLEVEL', 422); 3 3 4 4 class Item … … 7 7 { 8 8 $this->id_ = $id; 9 $this->qry_ = new DBQuery();10 9 } 11 10 … … 18 17 { 19 18 $this->execQuery(); 19 if (DB_USE_CCP) 20 { 21 return $this->row_['typeName']; 22 } 20 23 return $this->row_['itm_name']; 21 24 } … … 26 29 global $smarty; 27 30 28 // slot 6 is dronebay29 if ($this->row_['itt_ slot'] == 6)31 // cat 18 are combat drones 32 if ($this->row_['itt_cat'] == 18) 30 33 { 31 34 $img = IMG_URL.'/drones/'.$size.'_'.$size.'/'.$this->row_['itm_externalid'].'.png'; 35 } 36 // cat 6 are ships (destroyed in cargo) 37 elseif ($this->row_['itt_cat'] == 6) 38 { 39 $img = IMG_URL.'/ships/'.$size.'_'.$size.'/'.$this->row_['itm_externalid'].'.png'; 32 40 } 33 41 else … … 47 55 else 48 56 { 49 $icon = IMG_URL.'/items/32_32/blank.gif';57 $icon = IMG_URL.'/items/32_32/blank.gif'; 50 58 } 51 59 … … 63 71 function execQuery() 64 72 { 73 if (!isset($this->qry_)) 74 { 75 $this->qry_ = new DBQuery(); 76 } 77 65 78 if (!$this->qry_->executed_) 66 79 { … … 73 86 left join kb3_item_types on itm_type = itt_id 74 87 where itm_id = '".$this->id_."'"; 88 89 if (DB_USE_CCP) 90 { 91 // new 92 $this->sql_ = "select inv.*, kb3_item_types.*, dga.value as techlevel, itp.price 93 from kb3_invtypes inv 94 left join kb3_dgmtypeattributes dga on dga.typeID=inv.typeID and dga.attributeID=".DGM_TECHLEVEL." 95 left join kb3_item_price itp on itp.typeID=inv.typeID 96 left join kb3_item_types on groupID=itt_id 97 where inv.typeID = '".$this->id_."'"; 98 } 75 99 $this->qry_->execute($this->sql_); 76 100 $this->row_ = $this->qry_->getRow(); 101 if (DB_USE_CCP) 102 { 103 $this->row_['itm_icon'] = $this->row_['icon']; 104 $this->row_['itm_techlevel'] = $this->row_['techlevel']; 105 $this->row_['itm_externalid'] = $this->row_['typeID']; 106 $this->row_['itm_value'] = $this->row_['price']; 107 } 77 108 } 78 109 } … … 82 113 $name = trim($name); 83 114 $qry = new DBQuery(); 84 $qry->execute("select * from kb3_items itm 85 where itm_name = '".slashfix($name)."'"); 115 $query = "select * from kb3_items itm 116 where itm_name = '".slashfix($name)."'"; 117 if (DB_USE_CCP) 118 { 119 $query = "select *,typeID as itm_id from kb3_invtypes itm 120 where typeName = '".slashfix($name)."'"; 121 } 122 $qry->execute($query); 86 123 $row = $qry->getRow(); 87 124 if (!isset($row['itm_id'])) 88 125 { 89 if (config::get('adapt_items') )126 if (config::get('adapt_items') && DB_USE_CCP !== true) 90 127 { 91 128 // if the item is a tec2 we likely have the tec1 … … 110 147 $row['itm_id'] = $qry->getInsertID(); 111 148 } 149 else 150 { 151 // that item doesnt exist or is misspelled 152 return false; 153 } 112 154 } 113 155 $this->id_ = $row['itm_id']; … … 117 159 { 118 160 $qry = new DBQuery(); 119 $q ry->execute("select *161 $query = "select * 120 162 from kb3_items 121 where itm_name = '".slashfix($name)."'"); 163 where itm_name = '".slashfix($name)."'"; 164 if (DB_USE_CCP) 165 { 166 $query = "select *,typeID as itm_id 167 from kb3_items 168 where typeName = '".slashfix($name)."'"; 169 } 170 $qry->execute($query); 122 171 123 172 $row = $qry->getRow(); -
dev/common/includes/class.kill.php
r240 r254 15 15 $this->involvedparties_ = array(); 16 16 $this->destroyeditems_ = array(); 17 $this->droppeditems_ = array(); 18 } 19 20 function set($var, $value) 21 { 22 $this->$var = $value; 17 23 } 18 24 … … 202 208 $system = $this->getSystem(); 203 209 $mail .= "System: ".$system->getName()."\r\n"; 204 $mail .= "Security: ".$system->getSecurity(true)."\r\n\r\n"; 210 $mail .= "Security: ".$system->getSecurity(true)."\r\n"; 211 $mail .= "Damage Taken: ".$this->VictimDamageTaken."\r\n\r\n"; 205 212 $mail .= "Involved parties:\r\n\r\n"; 206 213 … … 236 243 $mail .= "Ship: ".$ship->getName()."\r\n"; 237 244 $mail .= "Weapon: ".$weapon->getName()."\r\n"; 245 $mail .= "Damage Done: ".$inv->dmgdone_."\r\n"; 246 } 247 else 248 { 249 $mail .= "Damage Done: ".$inv->dmgdone_."\r\n"; 238 250 } 239 251 $mail .= "\r\n"; … … 269 281 $mail .= " (Cargo)"; 270 282 if ($destroyed->getLocationID() == 6) // drone 283 $mail .= " (Drone Bay)"; 284 $mail .= "\r\n"; 285 } 286 } 287 288 if (count($this->droppeditems_) > 0) 289 { 290 $mail .= "\r\nDropped items:\r\n\r\n"; 291 292 foreach($this->droppeditems_ as $dropped) 293 { 294 $item = $dropped->getItem(); 295 $mail .= $item->getName(); 296 if ($dropped->getQuantity() > 1) 297 { 298 // if the option is enabled and the item is fitted then split it up 299 // this is aworkaround for the lazy parser of griefwatch 300 if (config::get('kill_splitfit') && $dropped->getQuantity() < 9 && ($dropped->getLocationID() == 1 301 || $dropped->getLocationID() == 2 || $dropped->getLocationID() == 3)) 302 { 303 for ($i = $dropped->getQuantity(); $i > 1; $i--) 304 { 305 $mail .= "\r\n".$item->getName(); 306 } 307 308 } 309 else 310 { 311 $mail .= ", Qty: ".$dropped->getQuantity(); 312 } 313 } 314 if ($dropped->getLocationID() == 4) // cargo 315 $mail .= " (Cargo)"; 316 if ($dropped->getLocationID() == 6) // drone 271 317 $mail .= " (Drone Bay)"; 272 318 $mail .= "\r\n"; … … 324 370 fbplt.plt_name as fbplt_name, 325 371 fbcrp.crp_name as fbcrp_name, 326 fbali.all_name as fbali_name 372 fbali.all_name as fbali_name, 373 kll_dmgtaken 327 374 from kb3_kills kll, kb3_pilots plt, kb3_corps crp, 328 375 kb3_alliances ali, kb3_alliances fbali, kb3_corps fbcrp, … … 366 413 $this->plt_ext_ = $row['plt_externalid']; 367 414 $this->fbplt_ext_ = $row['fbplt_externalid']; 415 $this->VictimDamageTaken = $row['kll_dmgtaken']; 368 416 369 417 // involved 370 418 $sql = "select ind_plt_id, ind_crp_id, ind_all_id, ind_sec_status, 371 ind_shp_id, ind_wep_id 419 ind_shp_id, ind_wep_id, ind_dmgdone 372 420 from kb3_inv_detail 373 421 where ind_kll_id = ".$this->getID()." … … 383 431 new Ship($row['ind_shp_id']), 384 432 new Item($row['ind_wep_id'])); 433 $involved->dmgdone_ = $row['ind_dmgdone']; 385 434 array_push($this->involvedparties_, $involved); 386 435 } 387 436 // destroyed items 388 $sql = "select sum( itd.itd_quantity ) as itd_quantity, itd_itm_id, 389 itd_itl_id, itl_location 390 from kb3_items_destroyed itd, kb3_items itm, 391 kb3_item_locations itl 437 $sql = "select sum(itd.itd_quantity) as itd_quantity, itd_itm_id, 438 itd_itl_id, itl_location 439 from kb3_items_destroyed itd 440 left join kb3_items itm on itd.itd_itm_id = itm.itm_id 441 left join kb3_item_locations itl on (itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1)) 392 442 where itd.itd_kll_id = ".$this->getID()." 393 and itd.itd_itm_id = itm.itm_id394 and ( itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1))395 443 group by itd_itm_id, itd_itl_id 396 444 order by itd.itd_itl_id, itm.itm_type"; 397 445 446 if (DB_USE_CCP) 447 { 448 $sql = "select sum(itd.itd_quantity) as itd_quantity, itd_itm_id, 449 itd_itl_id, itl_location 450 from kb3_items_destroyed itd 451 left join kb3_item_locations itl on (itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1)) 452 where itd.itd_kll_id = ".$this->getID()." 453 group by itd_itm_id, itd_itl_id 454 order by itd.itd_itl_id"; 455 } 398 456 $qry->execute($sql); 399 457 while ($row = $qry->getRow()) … … 404 462 array_push($this->destroyeditems_, $destroyed); 405 463 } 464 465 if (DB_USE_CCP) 466 { 467 $sql = "select sum(itd.itd_quantity) as itd_quantity, itd_itm_id, 468 itd_itl_id, itl_location 469 from kb3_items_dropped itd 470 left join kb3_item_locations itl on (itd.itd_itl_id = itl.itl_id or (itd.itd_itl_id = 0 and itl.itl_id = 1)) 471 where itd.itd_kll_id = ".$this->getID()." 472 group by itd_itm_id, itd_itl_id 473 order by itd.itd_itl_id"; 474 $qry->execute($sql); 475 while ($row = $qry->getRow()) 476 { 477 $destroyed = new DroppedItem(new Item($row['itd_itm_id']), 478 $row['itd_quantity'], 479 $row['itl_location']); 480 array_push($this->droppeditems_, $destroyed); 481 } 482 } 406 483 } 407 484 } … … 417 494 418 495 $offset = config::get('kill_classified')*3600; 419 if (strtotime($this->timestamp_) > time()-$offset) 496 if (config::get('date_gmtime')) 497 { 498 $time = time()-date('Z'); 499 } 500 else 501 { 502 $time = time(); 503 } 504 if (strtotime($this->timestamp_) > $time-$offset) 420 505 { 421 506 return true; … … 430 515 { 431 516 $offset = config::get('kill_classified')*3600; 432 if (strtotime($this->timestamp_) > time()-$offset) 433 { 434 return ($offset-time()+strtotime($this->timestamp_)); 517 if (config::get('date_gmtime')) 518 { 519 $time = time()-date('Z'); 520 } 521 else 522 { 523 $time = time(); 524 } 525 if (strtotime($this->timestamp_) > $time-$offset) 526 { 527 return ($offset-$time+strtotime($this->timestamp_)); 435 528 } 436 529 } … … 667 760 { 668 761 $qid = $id; 762 } 763 if (!$this->dmgtaken) 764 { 765 $this->dmgtaken = 0; 669 766 } 670 767 … … 675 772 ".$this->victimcorpid_.", ".$this->victimship_->getID().", 676 773 ".$this->solarsystem_->getID().", ".$this->getFBAllianceID().", 677 ".$this->getFBCorpID().", ".$this->getFBPilotID().", ".$this->calculateKillPoints()." )";774 ".$this->getFBCorpID().", ".$this->getFBPilotID().", ".$this->calculateKillPoints().", ".$this->dmgtaken." )"; 678 775 $qry->execute($sql); 679 776 … … 702 799 } 703 800 801 if (!$inv->dmgdone_) 802 { 803 $inv->dmgdone_ = 0; 804 } 805 704 806 $sql = "insert into kb3_inv_detail 705 807 values ( ".$this->getID().", ".$inv->getPilotID().", '".$inv->getSecStatus()."', " 706 808 .$inv->getAllianceID().", ".$inv->getCorpID().", ".$ship->getID().", " 707 .$weapon->getID().", ".$order++." 809 .$weapon->getID().", ".$order++.", ".$inv->dmgdone_.")"; 708 810 $qry->execute($sql) or die($qry->getErrorMsg()); 709 811 … … 730 832 $item = $dest->getItem(); 731 833 $loc_id = $dest->getLocationID(); 732 if (!is_numeric($ item->getID()) || !is_numeric($item->getID()) || !is_numeric($dest->getQuantity()) || !is_numeric($loc_id))834 if (!is_numeric($this->getID()) || !is_numeric($item->getID()) || !is_numeric($dest->getQuantity()) || !is_numeric($loc_id)) 733 835 { 734 836 trigger_error('error with destroyed item.', E_USER_WARNING); … … 743 845 } 744 846 847 // dropped 848 foreach ($this->droppeditems_ as $dest) 849 { 850 $item = $dest->getItem(); 851 $loc_id = $dest->getLocationID(); 852 if (!is_numeric($this->getID()) || !is_numeric($item->getID()) || !is_numeric($dest->getQuantity()) || !is_numeric($loc_id)) 853 { 854 trigger_error('error with dropped item.', E_USER_WARNING); 855 var_dump($dest);exit; 856 continue; 857 } 858 859 $sql = "insert into kb3_items_dropped 860 values ( ".$this->getID().", ".$item->getID().", ".$dest->getQuantity().", " 861 .$loc_id." )"; 862 $qry->execute($sql); 863 } 864 745 865 // call the event that we added this mail 746 event::call('killmail_added', &$this);866 event::call('killmail_added', $this); 747 867 return $this->id_; 748 868 } … … 753 873 return; 754 874 755 event::call('killmail_delete', &$this);875 event::call('killmail_delete', $this); 756 876 757 877 $qry = new DBQuery(); … … 762 882 $qry->execute("delete from kb3_inv_plt where inp_kll_id = ".$this->id_); 763 883 $qry->execute("delete from kb3_items_destroyed where itd_kll_id = ".$this->id_); 884 $qry->execute("delete from kb3_items_dropped where itd_kll_id = ".$this->id_); 764 885 if ($delcomments) 765 886 { … … 776 897 { 777 898 array_push($this->destroyeditems_, $destroyed); 899 } 900 901 function addDroppedItem($dropped) 902 { 903 array_push($this->droppeditems_, $dropped); 778 904 } 779 905 } … … 842 968 } 843 969 970 function getFormatttedValue() 971 { 972 if (!isset($this->value)) 973 { 974 $this->getValue(); 975 } 976 if ($this->value > 0) 977 { 978 $value = $this->value * $this->getQuantity(); 979 // Value Manipulation for prettyness. 980 if (strlen($value) > 6) // Is this value in the millions? 981 { 982 $formatted = round($value / 1000000, 2); 983 $formatted = number_format($formatted, 2); 984 $formatted = $formatted." M"; 985 } 986 elseif (strlen($value) > 3) // 1000's ? 987 { 988 $formatted = round($value / 1000, 2); 989 990 $formatted = number_format($formatted, 2); 991 $formatted = $formatted." K"; 992 } 993 else 994 { 995 $formatted = number_format($value, 2); 996 $formatted = $formatted." isk"; 997 } 998 } 999 else 1000 { 1001 $formatted = "0 isk"; 1002 } 1003 return $formatted; 1004 } 1005 844 1006 function getValue() 845 //returns the value of an item846 1007 { 1008 if ($this->value) 1009 { 1010 return $this->value; 1011 } 1012 if (DB_USE_CCP) 1013 { 1014 $this->value = 0; 1015 $qry = new DBQuery(); 1016 $qry->execute("select basePrice, price from kb3_invtypes left join kb3_item_price using (typeID) where typeID='".$this->item_->getID()."'"); 1017 if ($row = $qry->getRow()) 1018 { 1019 if ($row['price']) 1020 { 1021 $this->value = $row['price']; 1022 } 1023 else 1024 { 1025 $this->value = $row['basePrice']; 1026 } 1027 } 1028 return $this->value; 1029 } 1030 1031 //returns the value of an item 847 1032 $value = 0; // Set 0 value incase nothing comes back 848 1033 $id = $this->item_->getID(); // get Item ID … … 875 1060 } 876 1061 } 1062 1063 class DroppedItem extends DestroyedItem 1064 { 1065 function DroppedItem($item, $quantity, $location) 1066 { 1067 $this->item_ = $item; 1068 $this->quantity_ = $quantity; 1069 $this->location_ = $location; 1070 } 1071 } 877 1072 ?> -
dev/common/includes/class.killlisttable.php
r213 r254 40 40 } 41 41 42 43 42 while ($kill = $this->kill_list_->getKill()) 44 43 { … … 76 75 $kll['systemsecurity'] = $kill->getSolarSystemSecurity(); 77 76 $kll['timestamp'] = $kill->getTimeStamp(); 77 if (config::get('killlist_alogo')) 78 { 79 $kll['victimallianceicon'] = preg_replace('/[^a-zA-Z0-9]/', '', $kll['victimalliancename']); 80 $kll['allianceexists'] = file_exists('img/alliances/'.$kll['victimallianceicon'].'.png'); 81 } 82 78 83 if (isset($kill->_tag)) 79 84 { -
dev/common/includes/class.map.php
r212 r254 139 139 and sjp.sjp_from = sys.sys_eve_id'; 140 140 141 $regioncache = 'cache/map/'.KB_SITE.'_'.$this->regionid_.'_'.$this->imgwidth_.'.png';142 $cached = false;143 144 141 if ($this->mode_ == "map") 145 142 { 146 if (file_exists($regioncache)) 147 { 148 header("Content-type: image/png"); 149 readfile($regioncache); 150 return; 151 } 143 $regioncache = 'cache/map/'.KB_SITE.'_'.$this->regionid_.'_'.$this->imgwidth_.'.png'; 152 144 $caption = $this->regname_; 153 145 } 154 155 if ($this->mode_ == "region")156 {146 elseif ($this->mode_ == "region") 147 { 148 $regioncache = 'cache/map/'.KB_SITE.'_'.$this->conid_.'_'.$this->imgwidth_.'.png'; 157 149 $sql .= " and reg.reg_id = ".$this->regionid_; 158 150 $caption = $this->conname_; 159 151 } 160 161 if ($this->mode_ == "cons") 162 { 152 elseif ($this->mode_ == "cons") 153 { 154 $regioncache = 'cache/map/'.KB_SITE.'_'.$this->systemid_.'_'.$this->imgwidth_.'.png'; 155 163 156 $sql .= " and con.con_id = ".$this->conid_; 164 157 $caption = $this->sysname_." (".roundsec($this->syssec_).")"; 165 158 } 166 167 if (!$cached) 159 if (file_exists($regioncache)) 160 { 161 header("Content-type: image/png"); 162 readfile($regioncache); 163 return; 164 } 165 166 if (true) 168 167 { 169 168 $qry = new DBQuery(); … … 357 356 358 357 imagestring($img, 1, 2, 2, $title, $captioncolor); 359 // imagettftext ( $img, 6, 0, 360 // 5, 361 // 10, 362 // $captioncolor, 363 // "../fonts/04B_03__.TTF", 364 // $title ); 365 if ($this->mode_ == "map" && !$cached) 358 if ($this->mode_ == "map") 359 { 360 imagepng($img, $regioncache); 361 } 362 // optionally cache constellation maps 363 elseif ($this->mode_ == 'region' && config::get('map_region_cache')) 364 { 365 imagepng($img, $regioncache); 366 } 367 // cache everything if we are reinforced 368 elseif (config::get('is_reinforced')) 366 369 { 367 370 imagepng($img, $regioncache); -
dev/common/includes/class.options.php
r191 r254 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')); -
dev/common/includes/class.page.php
r219 r254 10 10 config::set('public_stats','do nothing'); 11 11 } 12 12 13 13 $this->title_ = $title; 14 14 $this->admin_ = false; 15 $this->headlines = $this->bodylines = array(); 15 16 16 17 $this->igb_ = IS_IGB; … … 22 23 $this->cachable_ = $cachable; 23 24 $this->cachetime_ = 5; 24 25 // if you have probs with missing tables uncomment this and 25 26 // if you have probs with missing tables uncomment this and 26 27 // require_once('common/includes/autoupgrade.php'); 27 28 // check_navigationtable(); … … 47 48 } 48 49 50 function addHeader($line) 51 { 52 $this->headlines[] = $line; 53 } 54 55 function addBody($line) 56 { 57 $this->bodylines[] = $line; 58 } 59 49 60 function generate() 50 61 { … … 61 72 $smarty->assign('on_load', ' onload="'.$this->onload_.'"'); 62 73 } 74 63 75 // header 76 event::call('page_assembleheader', $this); 77 $smarty->assign('page_headerlines', join("\n", $this->headlines)); 78 79 event::call('page_assemblebody', $this); 80 $smarty->assign('page_bodylines', join("\n", $this->bodylines)); 64 81 65 82 if (!$this->igb_) 66 83 { 67 if (strpos(config::get('mods_active'), 'rss_feed') !== false)68 {69 $smarty->assign('rss_feed', 1);70 }71 84 if (MAIN_SITE) 72 85 { … … 79 92 } 80 93 $smarty->assign('banner', $banner); 81 94 82 95 $nav = new Navigation(); 83 96 $nav->setSite($_GET['a']); 84 97 $menu = $nav->generateMenu(); 85 98 $w = floor(100 / count($menu->get())); 86 99 87 100 $smarty->assign('menu_w',$w.'%'); 88 101 $smarty->assign('menu', $menu->get()); … … 107 120 } 108 121 $smarty->assign('context_html', $this->contexthtml_); 122 event::call('smarty_displayindex', $smarty); 109 123 $smarty->display(get_tpl('index')); 110 124 } … … 160 174 $this->cachetime_ = $cachetime; 161 175 } 162 176 163 177 } 164 178 -
dev/common/includes/class.parser.php
r232 r254 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:')) … … 96 97 { 97 98 $this->error('No security found.'); 99 } 100 $dmgtaken = false; 101 if (preg_match("/Damage Taken: (.*)/", $header, $matches)) 102 { 103 $dmgtaken = trim($matches[1]); 104 $this->dmgtaken = $dmgtaken; 98 105 } 99 106 … … 142 149 $kill->setVictimShip($ship); 143 150 $kill->setSolarSystem($system); 151 if ($dmgtaken) 152 { 153 $kill->set('dmgtaken', $dmgtaken); 154 } 144 155 145 156 if (ALLIANCE_ID != 0 && $alliance->getID() == ALLIANCE_ID) … … 206 217 $isname = "Unknown"; 207 218 $iwname = $pmatches[1]; 219 if ($dmgtaken) 220 { 221 preg_match("/Damage Done: (.*)/", $involved[++$i], $matches); 222 $idmgdone = $matches[1]; 223 } 208 224 209 225 if (!strlen($icname) && !strlen($iwname)) … … 252 268 $iwname = $matches[1]; 253 269 $i += 6; 270 if ($dmgtaken) 271 { 272 preg_match("/Damage Done: (.*)/", $involved[$i++], $matches); 273 $idmgdone = $matches[1]; 274 } 254 275 255 276 $ialliance = new Alliance(); … … 344 365 $iparty = new InvolvedParty($ipilot->getID(), $icorp->getID(), 345 366 $ialliance->getID(), $secstatus, $iship, $iweapon); 367 if ($dmgtaken) 368 { 369 $iparty->dmgdone_ = $idmgdone; 370 } 346 371 $kill->addInvolvedParty($iparty); 347 372 … … 359 384 if ($destroyedpos > 0) 360 385 { 361 $destroyed = explode("\n", trim(substr($this->killmail_, 362 strpos($this->killmail_, "Destroyed items:") + 16, 363 strlen($this->killmail_) - (strpos($this->killmail_, "Destroyed items:") + 16)))); 364 365 $i = 0; 366 $num = count($destroyed); 367 while ($i < $num) 368 { 369 $destroyed[$i] = trim($destroyed[$i]); 370 if ($destroyed[$i] == "") 371 { 372 $i++; 373 continue; 374 } 375 376 if ($destroyed[$i] == "Empty.") 377 { 378 $container = false; 379 $i++; 380 continue; 381 } 382 383 $qtypos = 0; 384 $locpos = 0; 385 $itemname = ""; 386 $quantity = ""; 387 $location = ""; 388 389 $qtypos = strpos($destroyed[$i], ", Qty: "); 390 $locpos = strrpos($destroyed[$i], "("); 391 392 if ($container && $locpos != false) 393 { 394 $container = false; 395 } 396 if (strpos($destroyed[$i], "Container")) 397 { 398 $container = true; 399 } 400 if ($qtypos <= 0 && !$locpos) 401 { 402 $itemlen = strlen($destroyed[$i]); 403 if ($container) $location = "Cargo"; 404 } 405 if ($qtypos > 0 && !$locpos) 406 { 407 $itemlen = $qtypos; 408 $qtylen = strlen($destroyed[$i]) - $qtypos; 409 if ($container) $location = "Cargo"; 410 } 411 if ($locpos > 0 && $qtypos <= 0) 412 { 413 $itemlen = $locpos - 1; 414 $qtylen = 0; 415 $loclen = strlen($destroyed[$i]) - $locpos - 2; 416 if (!$locpos) $container = false; 417 } 418 if ($locpos > 0 && $qtypos > 0) 419 { 420 $itemlen = $qtypos; 421 $qtylen = $locpos - $qtypos - 7; 422 $loclen = strlen($destroyed[$i]) - $locpos - 2; 423 if (!$locpos) $container = false; 424 } 425 426 $itemname = substr($destroyed[$i], 0, $itemlen); 427 if ($qtypos) $quantity = substr($destroyed[$i], $qtypos + 6, $qtylen); 428 if ($locpos) $location = substr($destroyed[$i], $locpos + 1, $loclen); 429 430 if ($quantity == "") 431 { 432 $quantity = 1; 433 } 434 435 $item = new Item(); 436 $item->lookup(trim($itemname)); 437 if (!$item->getID()) 438 { 439 $this->error('Item not found.', trim($itemname)); 440 } 441 $ditem = new DestroyedItem($item, $quantity, $location); 386 $endpos = strlen($this->killmail_) - $destroyedpos + 16; 387 if ($dmgtaken) 388 { 389 $endpos = strpos($this->killmail_, "Dropped items:") - $destroyedpos - 16; 390 } 391 392 $destroyed = explode("\n", trim(substr($this->killmail_, $destroyedpos + 16, $endpos))); 393 #var_dump($destroyed); exit; 394 $destroyed_items = $this->scanForItems($destroyed); 395 foreach ($destroyed_items as $item) 396 { 397 $ditem = new DestroyedItem($item['item'], $item['quantity'], $item['location']); 442 398 $kill->addDestroyedItem($ditem); 443 444 $i++; 445 } 446 } 399 } 400 } 401 if ($dmgtaken) 402 { 403 $startpos = strpos($this->killmail_, "Dropped items:"); 404 $endpos = strlen($this->killmail_) - $startpos + 16; 405 406 $dropped = explode("\n", trim(substr($this->killmail_, $startpos + 16, $endpos))); 407 #var_dump($dropped); exit; 408 409 $dropped_items = $this->scanForItems($dropped); 410 foreach ($dropped_items as $item) 411 { 412 $ditem = new DroppedItem($item['item'], $item['quantity'], $item['location']); 413 $kill->addDroppedItem($ditem); 414 } 415 } 416 447 417 448 418 if (!$authorized) … … 455 425 } 456 426 427 if ($this->returnmail) 428 { 429 return $kill; 430 } 457 431 $id = $kill->add(); 458 432 if ($id == -1) … … 462 436 463 437 return $id; 438 } 439 440 function scanForItems($destroyed) 441 { 442 $i = 0; 443 $num = count($destroyed); 444 while ($i < $num) 445 { 446 $destroyed[$i] = trim($destroyed[$i]); 447 if ($destroyed[$i] == "") 448 { 449 $i++; 450 continue; 451 } 452 453 if ($destroyed[$i] == "Empty.") 454 { 455 $container = false; 456 $i++; 457 continue; 458 } 459 460 $qtypos = 0; 461 $locpos = 0; 462 $itemname = ""; 463 $quantity = ""; 464 $location = ""; 465 466 $qtypos = strpos($destroyed[$i], ", Qty: "); 467 $locpos = strrpos($destroyed[$i], "("); 468 469 if ($container && $locpos != false) 470 { 471 $container = false; 472 } 473 if (strpos($destroyed[$i], "Container")) 474 { 475 $container = true; 476 } 477 if ($qtypos <= 0 && !$locpos) 478 { 479 $itemlen = strlen($destroyed[$i]); 480 if ($container) $location = "Cargo"; 481 } 482 if ($qtypos > 0 && !$locpos) 483 { 484 $itemlen = $qtypos; 485 $qtylen = strlen($destroyed[$i]) - $qtypos; 486 if ($container) $location = "Cargo"; 487 } 488 if ($locpos > 0 && $qtypos <= 0) 489 { 490 $itemlen = $locpos - 1; 491 $qtylen = 0; 492 $loclen = strlen($destroyed[$i]) - $locpos - 2; 493 if (!$locpos) $container = false; 494 } 495 if ($locpos > 0 && $qtypos > 0) 496 { 497 $itemlen = $qtypos; 498 $qtylen = $locpos - $qtypos - 7; 499 $loclen = strlen($destroyed[$i]) - $locpos - 2; 500 if (!$locpos) $container = false; 501 } 502 503 $itemname = substr($destroyed[$i], 0, $itemlen); 504 if ($qtypos) $quantity = substr($destroyed[$i], $qtypos + 6, $qtylen); 505 if ($locpos) $location = substr($destroyed[$i], $locpos + 1, $loclen); 506 507 if ($quantity == "") 508 { 509 $quantity = 1; 510 } 511 512 $item = new Item(); 513 $item->lookup(trim($itemname)); 514 if (!$item->getID()) 515 { 516 $this->error('Item not found.', trim($itemname)); 517 } 518 if ($location == 'In Container') 519 { 520 $location = 'Cargo'; 521 } 522 523 $items[] = array('item' => $item, 'quantity' => $quantity, 'location' => $location); 524 $i++; 525 } 526 527 return $items; 464 528 } 465 529 -
dev/common/includes/class.pilot.php
r192 r254 1 1 <?php 2 require_once("db.php"); 3 require_once("class.corp.php"); 4 require_once("class.item.php"); 2 require_once('class.corp.php'); 3 require_once('class.item.php'); 5 4 6 5 class Pilot -
dev/common/includes/class.session.php
r190 r254 1 1 <?php 2 2 3 class Session3 class session 4 4 { 5 5 function init() -
dev/common/includes/class.ship.php
r212 r254 8 8 * 9 9 */ 10 11 require_once("db.php");12 10 13 11 class Ship -
dev/common/includes/class.thumb.php
r238 r254 49 49 { 50 50 case 'corp': 51 $this->_id = intval($this->_id);51 $this->_id = preg_replace('/[^a-z0-9]/', '', $this->_id); 52 52 break; 53 53 case 'alliance': … … 109 109 } 110 110 // 20070911 - Gate: Support EVE/Capture/Portraits images 111 elseif (file_exists('cache/portraits/'.$this->_id.'.jpg')) 112 { 113 $img = imagecreatefromjpeg('cache/portraits/'.$this->_id.'.jpg'); 114 $newimg = imagecreatetruecolor($this->_size, $this->_size); 115 imagecopyresampled($newimg, $img, 0, 0, 0, 0, $this->_size, $this->_size, 1024, 1024); 116 imagejpeg($newimg, $this->_thumb, 90); 117 imagedestroy($newimg); 118 119 return; 111 elseif (file_exists('img/portraits/'.$this->_id.'.jpg')) 112 { 113 $img = imagecreatefromjpeg('img/portraits/'.$this->_id.'.jpg'); 120 114 } 121 115 else … … 136 130 } 137 131 132 // in case of a dead eve server we only want to wait 5 seconds 138 133 @ini_set('default_socket_timeout', 5); 139 134 $file = @file_get_contents('http://img.eve.is/serv.asp?s=256&c='.$this->_id); … … 165 160 { 166 161 $newimg = imagecreatetruecolor($this->_size, $this->_size); 167 imagecopyresampled($newimg, $img, 0, 0, 0, 0, $this->_size, $this->_size, 256, 256); 162 $srcwidth = imagesx($img); 163 $srcheight = imagesy($img); 164 165 imagecopyresampled($newimg, $img, 0, 0, 0, 0, $this->_size, $this->_size, $srcwidth, $srcheight); 168 166 imagejpeg($newimg, $this->_thumb, 90); 167 imagedestroy($newimg); 169 168 } 170 169 else -
dev/common/includes/class.toplist.php
r234 r254 885 885 { 886 886 $sql = "select count(*) as cnt, ind.ind_wep_id as itm_id 887 from kb3_inv_detail ind 888 inner join kb3_items itm on ( itm_id = ind.ind_wep_id )"; 887 from kb3_inv_detail ind 888 inner join kb3_items itm on (itm_id = ind.ind_wep_id)"; 889 if (DB_USE_CCP) 890 { 891 $sql = "select count(*) as cnt, ind.ind_wep_id as itm_id 892 from kb3_inv_detail ind 893 inner join kb3_invtypes itm on (typeID = ind.ind_wep_id)"; 894 } 889 895 890 896 if ($this->invplt_) … … 907 913 908 914 $this->setSQLTop($sql); 915 if (DB_USE_CCP) 916 { 917 // since ccps database doesnt have icons for ships this will also fix the ship as weapon bug 918 $this->setSQLBottom(" and itm.icon != '' 919 and itm.typeName != 'Unknown' 920 group by ind.ind_wep_id order by 1 desc limit 20"); 921 } 922 else 909 923 $this->setSQLBottom(" and itm.itm_icon not in ( '1', 'icon_null' ) 910 924 and itm.itm_name != 'Unknown' 911 group by ind.ind_wep_id order by 1 desc 912 limit 20"); 925 group by ind.ind_wep_id order by 1 desc limit 20"); 913 926 } 914 927 } -
dev/common/includes/db.php
r202 r254 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 -
dev/common/includes/globals.php
r240 r254 6 6 // current version: major.minor.sub 7 7 // unpair numbers for minor = development version 8 define('KB_VERSION', '1. 3.0 (Tigerduck Memorial Edition)');8 define('KB_VERSION', '1.4.0 (Trinity)'); 9 9 10 10 // set the running-server for id-syncs here … … 13 13 14 14 // add new corporations here once you've added the logo to img/corps/ 15 $corp_npc = array("Guristas", 'Serpentis Corporation'); 15 $corp_npc = array('Guristas', 'Serpentis Corporation', 'Sansha\'s Nation', 'CONCORD', 16 'Mordus Legion', 'Blood Raider', 'Archangels', 'Guardian Angels'); 16 17 17 18 function shorten($shorten, $by = 22) -
dev/common/index.php
r240 r254 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'); … … 31 34 require_once('common/includes/class.user.php'); 32 35 require_once('common/includes/class.session.php'); 36 require_once('common/includes/class.cache.php'); 33 37 require_once('common/includes/class.involvedloader.php'); 34 38 require_once('common/smarty/Smarty.class.php'); … … 59 63 } 60 64 61 // killboard is instantiated by class::Page62 //$killboard = new Killboard(KB_SITE);63 64 65 // load the config from the database 65 66 $config = new Config(KB_SITE); 67 define('DB_USE_CCP', true); 68 define('KB_HOST', config::get('cfg_kbhost')); 69 define('MAIN_SITE', config::get('cfg_mainsite')); 70 define('STYLE_URL', config::get('cfg_style')); 71 define('COMMON_URL', config::get('cfg_common')); 72 define('IMG_URL', config::get('cfg_img')); 73 define('DB_HALTONERROR', (bool)config::get('cfg_sqlhalt')); 74 define('DB_USE_QCACHE', (bool)config::get('cfg_qcache')); 75 if (DB_USE_QCACHE) 76 { 77 // the object overloading system will switch to cached queries now 78 require_once('common/includes/class.db_cache.php'); 79 } 80 define('KB_TITLE', config::get('cfg_kbtitle')); 81 82 // corporation OR alliance id 83 if (config::get('cfg_corpid')) 84 { 85 define('CORP_ID', config::get('cfg_corpid')); 86 define('ALLIANCE_ID', 0); 87 } 88 else 89 { 90 define('CORP_ID', 0); 91 define('ALLIANCE_ID', config::get('cfg_allianceid')); 92 } 93 if (!$dir = config::get('cache_dir')) 94 { 95 $dir = 'cache/data'; 96 } 97 define('KB_CACHEDIR', $dir); 66 98 67 99 // setting up smarty and feed it with some config … … 79 111 80 112 // start session management 81 Session::init(); 82 83 // this is to make sure that smarty is able to create output 84 if (!is_dir('./cache/templates_c')) 85 { 86 if (mkdir('./cache/templates_c')) 87 { 88 chmod('./cache/templates_c', 0777); 113 session::init(); 114 115 // reinforced management 116 if (config::get('auto_reinforced')) 117 { 118 // first check if we are in reinforced 119 if (config::get('is_reinforced')) 120 { 121 // every 1/x request we check for disabling RF 122 if (rand(1, config::get('reinforced_rf_prob')) == 1) 123 { 124 cache::checkLoad(); 125 } 89 126 } 90 127 else 91 128 { 92 exit('please create cache/templates_c and chmod it 777'); 129 // reinforced not active 130 // check for load and activate reinforced if needed 131 if (rand(1, config::get('reinforced_prob')) == 1) 132 { 133 cache::checkLoad(); 134 } 93 135 } 94 136 } … … 134 176 } 135 177 136 if (KB_CACHE == 1 && count($_POST) == 0 && !in_array($page, $cacheignore)) 137 { 138 $docache = true; 139 } 140 else 141 { 142 $docache = false; 143 } 144 145 if ($docache) 146 { 147 if (!file_exists(KB_CACHEDIR.'/'.KB_SITE)) 148 { 149 @mkdir(KB_CACHEDIR.'/'.KB_SITE); 150 } 151 152 if ($cachetimes[$page]) 153 { 154 $cachetime = $cachetimes[$page]; 155 } 156 else 157 { 158 $cachetime = 5; 159 } 160 161 $cachetime = $cachetime * 60; 162 163 $cachefile = KB_CACHEDIR.'/'.KB_SITE.'/'.md5($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']).'.cache'; 164 $timestamp = ((@file_exists($cachefile))) ? @filemtime($cachefile) : 0; 165 166 if (time() - $cachetime < $timestamp) 167 { 168 ob_start('ob_gzhandler'); 169 @readfile($cachefile); 170 ob_end_flush(); 171 exit(); 172 } 173 174 ob_start(); 175 } 176 178 cache::check($page); 177 179 if ($settingsPage) 178 180 { 179 if (! Session::isAdmin())181 if (!session::isAdmin()) 180 182 { 181 183 header('Location: ?a=login'); … … 195 197 } 196 198 197 if ($docache) 198 { 199 $fp = @fopen($cachefile, 'w'); 200 @fwrite($fp, ob_get_contents()); 201 @fwrite($fp, '<!-- Generated from cache -->'); 202 @fclose($fp); 203 ob_end_flush(); 204 } 199 cache::generate(); 205 200 ?> -
dev/common/kill_detail.php
r213 r254 49 49 $smarty->assign('VictimAllianceURL', "?a=alliance_detail&all_id=".$kill->getVictimAllianceID()); 50 50 $smarty->assign('VictimAllianceName', $kill->getVictimAllianceName()); 51 $smarty->assign('VictimDamageTaken', $kill->VictimDamageTaken); 51 52 52 53 // involved … … 69 70 $involved[$i]['AlliName'] = $alliance->getName(); 70 71 $involved[$i]['ShipName'] = $ship->getName(); 72 $involved[$i]['ShipID'] = $ship->externalid_; 73 $involved[$i]['damageDone'] = $inv->dmgdone_; 71 74 72 75 if ($pilot->getID() == $kill->getFBPilotID()) … … 89 92 90 93 if ($weapon->getName() != "Unknown" && $weapon->getName() != $ship->getName()) 94 { 91 95 $involved[$i]['weaponName'] = $weapon->getName(); 96 $involved[$i]['weaponID'] = $weapon->row_['itm_externalid']; 97 } 92 98 else 93 99 $involved[$i]['weaponName'] = "Unknown"; … … 110 116 $smarty->assign('ShipImage', $ship->getImage(64)); 111 117 $smarty->assign('ShipName', $ship->getName()); 118 $smarty->assign('ShipID', $ship->externalid_); 112 119 $smarty->assign('ClassName', $shipclass->getName()); 113 120 … … 138 145 { 139 146 $dest_array = array(); 140 $dest_array[1] = array('img' => 'fitted_-_high_slot.jpg', 'text' => 'Fitted - High slot', 'items' => array()); 141 $dest_array[2] = array('img' => 'fitted_-_medium_slot.jpg', 'text' => 'Fitted - Mid slot', 'items' => array()); 142 $dest_array[3] = array('img' => 'fitted_-_low_slot.jpg', 'text' => 'Fitted - Low slot', 'items' => array()); 143 $dest_array[6] = array('img' => 'drone_bay.jpg', 'text' => 'Drone bay', 'items' => array()); 144 $dest_array[4] = array('img' => 'cargo.jpg', 'text' => 'Cargo Bay', 'items' => array()); 147 $dest_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 148 $dest_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 149 $dest_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 150 $dest_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 151 $dest_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 152 $dest_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 145 153 146 154 foreach($kill->destroyeditems_ as $destroyed) … … 150 158 { 151 159 $value = $destroyed->getValue(); 152 $value_single = $value; 153 if ($value > 0) 154 { 155 $value = $destroyed->getValue() * $destroyed->getQuantity(); 156 $TotalValue = $TotalValue + $value; 157 // Value Manipulation for prettyness. 158 if (strlen($value) > 1) // 1000's ? 159 { 160 $Formatted = number_format($value, 2); 161 $Formatted = $Formatted." isk"; 162 } 163 164 if (strlen($value) > 3) // 1000's ? 165 { 166 $Formatted = round($value / 1000, 2); 167 168 $Formatted = number_format($Formatted, 2); 169 $Formatted = $Formatted." K"; 170 } 171 172 if (strlen($value) > 6) // Is this value in the millions? 173 { 174 $Formatted = round($value / 1000000, 2); 175 $Formatted = number_format($Formatted, 2); 176 $Formatted = $Formatted." M"; 177 } 178 } 179 else 180 { 181 $value = 0; 182 $Formatted = "0 isk"; 183 } 160 $TotalValue += $value*$destroyed->getQuantity(); 161 $formatted = $destroyed->getFormatttedValue(); 184 162 } 185 $dest_array[$destroyed->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $Formatted, 'single_unit' => $value_single, 'itemID' => $item->getID()); 163 $dest_array[$destroyed->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID()); 164 } 165 } 166 167 if (count($kill->droppeditems_) > 0) 168 { 169 $drop_array = array(); 170 $drop_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 171 $drop_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 172 $drop_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 173 $drop_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 174 $drop_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 175 $drop_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 176 177 foreach($kill->droppeditems_ as $dropped) 178 { 179 $item = $dropped->getItem(); 180 if (config::get('item_values')) 181 { 182 $value = $dropped->getValue(); 183 $dropvalue += $value*$dropped->getQuantity(); 184 $formatted = $dropped->getFormatttedValue(); 185 } 186 $drop_array[$dropped->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $dropped->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID()); 186 187 } 187 188 } … … 196 197 $TotalLoss = number_format($TotalValue + $ShipValue, 2); 197 198 $ShipValue = number_format($ShipValue, 2); 199 $dropvalue = number_format($dropvalue, 2); 198 200 199 201 $smarty->assign_by_ref('destroyed', $dest_array); 202 $smarty->assign_by_ref('dropped', $drop_array); 200 203 $smarty->assign('ItemValue', $Formatted); 204 $smarty->assign('DropValue', $dropvalue); 201 205 $smarty->assign('ShipValue', $ShipValue); 202 206 $smarty->assign('TotalLoss', $TotalLoss); … … 224 228 } 225 229 226 //Admin is able to see classsiefied systems 230 //Admin is able to see classsiefied systems 227 231 if ((!$kill->isClassified()) || ($page->isAdmin())) 228 232 { -
dev/common/login.php
r206 r254 6 6 if ($_POST['usrlogin'] == '' && $_POST['usrpass'] == ADMIN_PASSWORD) 7 7 { 8 Session::create(true);8 session::create(true); 9 9 10 10 header('Location: ?a=admin'); -
dev/common/search.php
r207 r254 6 6 $html .= "<td>Type:</td><td>Text: (3 letters minimum)</td>"; 7 7 $html .= "</tr><tr>"; 8 $html .= "<td><select id=searchtype name=searchtype><option value=pilot>Pilot</option><option value=corp>Corporation</option><option value=alliance>Alliance</option><option value=system>System</option>< /select></td>";8 $html .= "<td><select id=searchtype name=searchtype><option value=pilot>Pilot</option><option value=corp>Corporation</option><option value=alliance>Alliance</option><option value=system>System</option><option value=item>Items</option></select></td>"; 9 9 $html .= "<td><input id=searchphrase name=searchphrase type=text size=30/></td>"; 10 10 $html .= "<td><input type=submit name=submit value=Search></td>"; … … 45 45 order by sys.sys_name"; 46 46 $header = "<td>System</td><td></td>"; 47 break; 48 case "item": 49 $sql = "select typeID, typeName from kb3_invtypes where typeName like ('%".slashfix($_REQUEST['searchphrase'])."%')"; 47 50 break; 48 51 } … … 87 90 $html .= "<td><a href=\"$link\">".$row['sys_name']."</a></td><td></td>"; 88 91 break; 92 case 'item': 93 $link = "?a=invtype&id=".$row['typeID']; 94 $html .= "<td><a href=\"$link\">".$row['typeName']."</a></td><td></td>"; 95 break; 89 96 } 90 97 $html .= "</tr>"; -
dev/install/config.data
r88 r254 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 -
dev/install/config.tpl
r103 r254 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 -
dev/install/index.php
r190 r254 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> -
dev/install/install_step1.php
r88 r254 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> -
dev/install/install_step2.php
r215 r254 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 -
dev/install/install_step3.php
r168 r254 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 { -
dev/install/install_step4.php
r205 r254 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/>'; -
dev/install/install_step7.php
r212 r254 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/> -
dev/install/install_step8.php
r88 r254 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/> -
dev/style/generic.js
r196 r254 70 70 } 71 71 //--> 72 73 /* 74 75 Correctly handle PNG transparency in Win IE 5.5 & 6. 76 http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006. 77 78 Use in <HEAD> with DEFER keyword wrapped in conditional comments: 79 <!--[if lt IE 7]> 80 <script defer type="text/javascript" src="pngfix.js"></script> 81 <![endif]--> 82 83 */ 84 85 var arVersion = navigator.appVersion.split("MSIE") 86 var version = parseFloat(arVersion[1]) 87 88 if ((version >= 5.5) && (document.body.filters)) 89 { 90 for(var i=0; i<document.images.length; i++) 91 { 92 var img = document.images[i] 93 var imgName = img.src.toUpperCase() 94 if (imgName.substring(imgName.length-3, imgName.length) == "PNG") 95 { 96 var imgID = (img.id) ? "id='" + img.id + "' " : "" 97 var imgClass = (img.className) ? "class='" + img.className + "' " : "" 98 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " 99 var imgStyle = "display:inline-block;" + img.style.cssText 100 if (img.align == "left") imgStyle = "float:left;" + imgStyle 101 if (img.align == "right") imgStyle = "float:right;" + imgStyle 102 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 103 var strNewHTML = "<span " + imgID + imgClass + imgTitle 104 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" 105 + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 106 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 107 img.outerHTML = strNewHTML 108 i = i-1 109 } 110 } 111 } -
dev/templates/icon.tpl
r159 r254 1 <!-- icon.tpl --> 2 <div class="item-icon" style="background: url({$img}); border: none; height:32px; width:32px; text-align:left;"><img border="0" src="{$icon}"/></div> 3 <!-- /icon.tpl --> 1 <span class="item-icon" style="position:relative; border: none; height:32px; width:32px; text-align:left;"> 2 <img border="0" height="32" width="32" style="position:absolute;" src="{$img}"> 3 <img border="0" style="position:absolute;" src="{$icon}"> 4 </span> -
dev/templates/index.tpl
r209 r254 6 6 <link rel="stylesheet" type="text/css" href="{$style_url}/common.css"> 7 7 <link rel="stylesheet" type="text/css" href="{$style_url}/{$style}/style.css"> 8 {if $rss_feed} 9 <link rel="alternate" type="application/rss+xml" title="RSS feed for watched kills" href="?a=rss" /> 10 {/if} 8 {$page_headerlines} 11 9 <script language=javascript src="{$style_url}/generic.js"></script> 12 10 <!--[if lt IE 7]> 11 <script defer type="text/javascript" src="{$style_url}/generic.js"></script> 12 <![endif]--> 13 13 <style type="text/css"> 14 14 </style> 15 15 </head> 16 16 <body bgcolor="#222222" {$on_load} style="height: 100%"> 17 {$page_bodylines} 17 18 <div align="center" id="popup" style="display:none; 18 19 position:absolute; … … 33 34 </div> 34 35 {include file="menu.tpl"} 36 {if $message} 37 <table class="navigation" width="100%" height="25" border="0" cellspacing="1"> 38 <tr class="kb-table-row-odd"> 39 <td align="center"><b>{$message}</b></td> 40 </tr> 41 </table> 42 {/if} 35 43 <div id="page-title">{$page_title}</div> 36 44 <table cellpadding="0" cellspacing="0" width="100%" border="0"> -
dev/templates/kill_detail.tpl
r213 r254 21 21 {foreach from=$involved key=key item=i} 22 22 <tr class={cycle name=ccl}> 23 <td rowspan=5 width="64"><img {if $i.FB == "true"}class=finalblow{/if} src="{$i.portrait}" border="0"></td>24 <td rowspan=5 width="64"><img {if $i.FB == "true"}class=finalblow{/if}src="{$i.shipImage}" border="0"></td>23 <td rowspan=5 width="64"><img {if $i.FB == "true"}class=finalblow{/if} height="64" width="64" src="{$i.portrait}" border="0"></td> 24 <td rowspan=5 width="64"><img {if $i.FB == "true"}class=finalblow{/if} height="64" width="64" src="{$i.shipImage}" border="0"></td> 25 25 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;"><a href="{$i.PilotURL}">{$i.PilotName}</a></td> 26 26 </tr> … … 32 32 </tr> 33 33 <tr class={cycle name=ccl}> 34 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;"><b> {$i.ShipName}</b></td>34 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;"><b><a href="?a=invtype&id={$i.ShipID}">{$i.ShipName}</a></b></td> 35 35 </tr> 36 36 <tr class={cycle name=ccl}> 37 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;">{$i.weaponName}</td> 37 <td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;">{if $i.weaponID}<a href="?a=invtype&id={$i.weaponID}">{$i.weaponName}</a>{else}{$i.weaponName}{/if}</td> 38 </tr> 39 <tr class={cycle name=ccl}> 40 <td colspan=2 class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;">Damage done:</td><td class=kb-table-cell style="padding-top: 1px; padding-bottom: 1px;">{$i.damageDone|number_format}</td> 38 41 </tr> 39 42 {/foreach} … … 46 49 <td width="64" heigth="64" rowspan=3><img src="{$VictimShipImg}" width="64" heigth="64"></td> 47 50 <td class=kb-table-cell><b>Ship:</b></td> 48 <td class=kb-table-cell><b> {$ShipName}</b> ({$ClassName})</td>51 <td class=kb-table-cell><b><a href="?a=invtype&id={$ShipID}">{$ShipName}</a></b> ({$ClassName})</td> 49 52 </tr> 50 53 <tr class={cycle name=ccl}> … … 60 63 <div class="block-header">Ship details</div> 61 64 <table class="kb-table" width="360" border="0" cellspacing="1"> 62 {foreach from=$destroyed item=slot }65 {foreach from=$destroyed item=slot key=slotindex} 63 66 {* set to true to show empty slots *} 64 {if $slot.items }67 {if $slot.items or $dropped.slotindex.items} 65 68 <tr class="kb-table-row-even"> 66 <td class="item-icon" width="32"><img src="{$img_url}/{$slot.img}" alt="{$slot.text}" border="0"></td>69 <td class="item-icon" width="32"><img width="32" height="32" src="{$img_url}/{$slot.img}" alt="{$slot.text}" border="0"></td> 67 70 <td colspan="2" class="kb-table-cell"><b>{$slot.text}</b> </td> 68 71 {if $config->get('item_values')} … … 72 75 {foreach from=$slot.items item=i} 73 76 <tr class="kb-table-row-odd"> 74 <td class="item-icon" width="32" height="34" valign="top"> {$i.Icon}</td>77 <td class="item-icon" width="32" height="34" valign="top"><a href="?a=invtype&id={$i.itemID}">{$i.Icon}</a></td> 75 78 <td class="kb-table-cell">{$i.Name}</td> 76 79 <td width="30" align="center">{$i.Quantity}</td> … … 97 100 </tr> 98 101 {/foreach} 102 {foreach from=$dropped.$slotindex.items item=i} 103 <tr class="kb-table-row-odd" style="background-color: green;"> 104 <td style="border: 1px solid green;" width="32" height="34" valign="top"><a href="?a=invtype&id={$i.itemID}">{$i.Icon}</a></td> 105 <td class="kb-table-cell">{$i.Name}</td> 106 <td width="30" align="center">{$i.Quantity}</td> 107 {if $config->get('item_values')} 108 <td align="center">{$i.Value}</td> 109 {/if} 110 </tr> 111 {if $admin and $config->get('item_values')} 112 <tr class="kb-table-row-even"> 113 <form method="post" action=""> 114 <td height="34" colspan="3" valign="top"> 115 <div align="right"> 116 Current single Item Value: 117 <input name="IID" value="{$i.itemID}" type="hidden"> 118 <input name="{$i.itemID}" type="text" class="comment-button" value="{$i.single_unit}" size="6"> 119 </div> 120 <td height="34" valign="top"><input type="submit" name="submit" value="Update" class="comment-button"></td> 121 </form> 122 </tr> 123 {/if} 124 {/foreach} 99 125 {/if} 100 126 {/foreach} 101 127 {if $item_values} 102 128 <tr class={cycle name=ccl}> 129 <td align="right" colspan="3"><b>Damage taken:</b></td> 130 <td align="right">{$VictimDamageTaken|number_format}</td> 131 </tr> 132 <tr class={cycle name=ccl}> 103 133 <td colspan="3"><div align="right"><strong>Total Module Loss:</strong></div></td> 104 134 <td align="right">{$ItemValue}</td> 135 </tr> 136 <tr class={cycle name=ccl} style="background-color: green;"> 137 <td style="border: 1px solid green;" colspan="3"><div align="right"><strong>Total Module Drop:</strong></div></td> 138 <td style="border: 1px solid green;" align="right">{$DropValue}</td> 105 139 </tr> 106 140 <tr class={cycle name=ccl}> -
dev/templates/killlisttable.tpl
r154 r254 6 6 <tr class="kb-table-header"> 7 7 <td class="kb-table-header" colspan="2" align="center">Ship type</td> 8 <td class="kb-table-header" >Victim</td>8 <td class="kb-table-header"{if $config->get('killlist_alogo')} colspan="2"{/if}>Victim</td> 9 9 <td class="kb-table-header">Final blow</td> 10 10 <td class="kb-table-header" align="center">System</td> … … 21 21 <td width="32" align="center"><img src="{$k.victimshipimage}" border="0" width="32" heigth="32"></td> 22 22 <td height="34" width=150 valign="middle"><div class="kb-shiptype"><b>{$k.victimshipname}</b><br>{$k.victimshipclass}</div><div class="kb-shipicon"><img src="{$k.victimshipindicator}" border="0"></div></td> 23 {if $config->get('killlist_alogo')} 24 {if $k.allianceexists} 25 <td width="32" align="center"><img src="{$img_url}/alliances/{$k.victimallianceicon}.png" border="0" width="32" height="32"></td> 26 {elseif $k.victimalliancename != "None"} 27 <td width="32" align="center"><img src="{$img_url}/alliances/default.gif" border="0" width="32" height="32"></td> 28 {else} 29 <td width="32" align="center"> </td> 30 {/if} 31 {/if} 23 32 <td width="200" class="kb-table-cell"><b>{$k.victim}</b><br/>{$k.victimcorp|truncate:30}</td> 24 33 <td width="200" class="kb-table-cell"><b>{$k.fb}</b><br>{$k.fbcorp|truncate:30}</td>