Changeset 92
- Timestamp:
- 11/25/06 16:43:24 (16 years ago)
- Location:
- dev
- Files:
-
- 2 added
- 1 removed
- 19 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/about.php
r84 r92 7 7 8 8 $html .= "<div class=block-header2>The Killboard</div>"; 9 // Please leave the information on the next line as is so that other people can easily find the EVE-Dev website. Remember to share any modifications to the EVE-Dev Killboard. 10 $html .= KB_TITLE . " killboard, created for <a href=\"http://www.eve-online.com/\">EVE Online</a> corporations and alliances.<br><p>Developed by the <a href=\"http://www.eve-dev.net/\">EVE-Dev</a> group.<br><p>Based on the EVE-Killboard created by <a href=\"mailto:rig0r@eve-killboard.net\">rig0r</a>. All EVE graphics used are © <a href=\"http://www.ccpgames.com/\">CCP</a>.<br><br>"; 9 10 // Please leave the information on the next line as is so that other people can easily find the EVE-Dev website. 11 // Remember to share any modifications to the EVE-Dev Killboard. 12 $html .= "This is the EVE Development Network Killboard running version 1.2, created for <a href=\"http://www.eve-online.com/\">EVE Online</a> corporations and alliances.<br/>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/>All EVE graphics and data used are property of <a href=\"http://www.ccpgames.com/\">CCP</a>.<br/><br/>"; 11 13 12 14 $qry = new DBQuery(); -
dev/common/alliance_detail.php
r71 r92 13 13 $page = new Page("Alliance details - " . $alliance->getName()); 14 14 15 $html .= "<table class=kb-table width=\"100%\" border=\"0\" cellspacing=1><tr class=kb-table-row-even><td rowspan=8 width=128 align=center >";15 $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>"; 16 16 17 17 if (file_exists("img/alliances/".$alliance->getUnique().".png")) … … 205 205 $list = new TopScoreList(); 206 206 $list->addInvolvedAlliance($alliance); 207 $list->setPodsNoobShips( false);207 $list->setPodsNoobShips(true); 208 208 $list->setMonth(date("m")); 209 209 $list->setYear(date("Y")); … … 216 216 $list = new TopScoreList(); 217 217 $list->addInvolvedAlliance($alliance); 218 $list->setPodsNoobShips( false);218 $list->setPodsNoobShips(true); 219 219 $table = new TopPilotTable($list, "Points"); 220 220 $html .= $table->generate(); -
dev/common/class.kill.php
r75 r92 517 517 { 518 518 $name = explode("#", $fbpilotname); 519 $plt = new Item(); 520 $name = $plt->lookup($name[2]); 521 $this->fbpilotname_ = $name; 519 $plt = new Item($name[2]); 520 $this->fbpilotname_ = $plt->getName(); 522 521 } 523 522 } … … 572 571 function add($id = null) 573 572 { 573 if (!$this->solarsystem_->getID()) 574 { 575 echo 'INTERNAL ERROR; SOLARSYSTEM NOT FOUND; PLEASE CONTACT A DEV WITH THIS MESSAGE<br/>'; 576 var_dump($this->solarsystem_); 577 var_dump($this->solarsystemname_); 578 return 0; 579 } 580 581 $dupe = $this->getDupe(true); 582 if ($dupe == 0) 583 { 584 $this->realadd(); 585 } 586 else 587 { 588 $this->dupeid_ = $dupe; 589 $this->id_ = $dupe; 590 $this->remove(false); 591 $this->realadd($dupe); 592 $this->id_ = -1; 593 } 594 return $this->id_; 595 } 596 597 function realadd($id = null) 598 { 574 599 // if ( $this->timestamp_ == "" || !$this->victimid_ || !$this->victimship_->getID() || !$this->solarsystem_->getID() || 575 600 // !$this->victimallianceid_ || !$this->victimcorpid_ || !$this->getFBAllianceID() || !$this->getFBCorpID() || 576 601 // !$this->getFBPilotID() ) 577 602 // return 0; 578 if (!$this->solarsystem_->getID()) 579 { 580 echo 'INTERNAL ERROR; SOLARSYSTEM NOT FOUND; PLEASE CONTACT A DEV WITH THIS MESSAGE<br/>'; 581 var_dump($this->solarsystem_); 582 var_dump($this->solarsystemname_); 583 return 0; 584 } 585 $dupe = $this->getDupe(true); 586 587 if ($dupe == 0) 588 { 589 $qry = new DBQuery(); 590 $sql = "insert into kb3_kills 591 values ( null, 592 date_format('".$this->timestamp_."', '%Y.%m.%d %H:%i:%s'), 593 ".$this->victimid_.", ".$this->victimallianceid_.", 594 ".$this->victimcorpid_.", ".$this->victimship_->getID().", 595 ".$this->solarsystem_->getID().", ".$this->getFBAllianceID().", 596 ".$this->getFBCorpID().", ".$this->getFBPilotID().", ".$this->calculateKillPoints()." )"; 603 if ($id == null) 604 { 605 $qid = 'null'; 606 } 607 else 608 { 609 $qid = $id; 610 } 611 612 $qry = new DBQuery(); 613 $sql = "insert into kb3_kills values (".$qid.", 614 date_format('".$this->timestamp_."', '%Y.%m.%d %H:%i:%s'), 615 ".$this->victimid_.", ".$this->victimallianceid_.", 616 ".$this->victimcorpid_.", ".$this->victimship_->getID().", 617 ".$this->solarsystem_->getID().", ".$this->getFBAllianceID().", 618 ".$this->getFBCorpID().", ".$this->getFBPilotID().", ".$this->calculateKillPoints()." )"; 619 $qry->execute($sql); 620 621 if ($id) 622 { 623 $this->id_ = $id; 624 } 625 else 626 { 627 $this->id_ = $qry->getInsertID(); 628 } 629 630 // involved 631 $order = 0; 632 $invall = array(); 633 $invcrp = array(); 634 $invplt = array(); 635 foreach ($this->involvedparties_ as $inv) 636 { 637 $ship = $inv->getShip(); 638 $weapon = $inv->getWeapon(); 639 if (!$inv->getPilotID() || $inv->getSecStatus() == "" || !$inv->getAllianceID() || !$inv->getCorpID() || !$ship->getID() || !$weapon->getID()) 640 { 641 $this->remove(); 642 return 0; 643 } 644 645 $sql = "insert into kb3_inv_detail 646 values ( ".$this->getID().", ".$inv->getPilotID().", '".$inv->getSecStatus()."', " 647 .$inv->getAllianceID().", ".$inv->getCorpID().", ".$ship->getID().", " 648 .$weapon->getID().", ".$order++." )"; 649 $qry->execute($sql) or die($qry->getErrorMsg()); 650 651 if (!in_array($inv->getAllianceID(), $invall) && $inv->getAllianceID() != 14) 652 { 653 array_push($invall, $inv->getAllianceID()); 654 $qry->execute("insert into kb3_inv_all values ( ".$this->getID().", ".$inv->getAllianceID()." )") or die($qry->getErrorMsg()); 655 } 656 if (!in_array($inv->getCorpID(), $invcrp)) 657 { 658 array_push($invcrp, $inv->getCorpID()); 659 $qry->execute("insert into kb3_inv_crp values ( ".$this->getID().", ".$inv->getCorpID()." )") or die($qry->getErrorMsg()); 660 } 661 if (!in_array($inv->getPilotID(), $invplt)) 662 { 663 array_push($invplt, $inv->getPilotID()); 664 $qry->execute("insert into kb3_inv_plt values ( ".$this->getID().", ".$inv->getPilotID()." )") or die($qry->getErrorMsg()); 665 } 666 } 667 668 // destroyed 669 foreach ($this->destroyeditems_ as $dest) 670 { 671 $item = $dest->getItem(); 672 if (!$item->getID() || !$dest->getQuantity() || !$dest->getLocationID()) 673 continue; 674 675 $sql = "insert into kb3_items_destroyed 676 values ( ".$this->getID().", ".$item->getID().", ".$dest->getQuantity().", " 677 .$dest->getLocationID()." )"; 597 678 $qry->execute($sql); 598 if ($id)599 {600 $this->id_ = $id;601 }602 else603 {604 $this->id_ = $qry->getInsertID();605 }606 // involved607 $order = 0;608 $invall = array();609 $invcrp = array();610 $invplt = array();611 foreach ($this->involvedparties_ as $inv)612 {613 $ship = $inv->getShip();614 $weapon = $inv->getWeapon();615 if (!$inv->getPilotID() || $inv->getSecStatus() == "" || !$inv->getAllianceID() || !$inv->getCorpID() || !$ship->getID() || !$weapon->getID())616 {617 $this->remove();618 return 0;619 }620 621 $sql = "insert into kb3_inv_detail622 values ( ".$this->getID().", ".$inv->getPilotID().", '".$inv->getSecStatus()."', "623 .$inv->getAllianceID().", ".$inv->getCorpID().", ".$ship->getID().", "624 .$weapon->getID().", ".$order++." )";625 $qry->execute($sql) or die($qry->getErrorMsg());626 627 if (!in_array($inv->getAllianceID(), $invall) && $inv->getAllianceID() != 14)628 {629 array_push($invall, $inv->getAllianceID());630 $qry->execute("insert into kb3_inv_all values ( ".$this->getID().", ".$inv->getAllianceID()." )") or die($qry->getErrorMsg());631 }632 if (!in_array($inv->getCorpID(), $invcrp))633 {634 array_push($invcrp, $inv->getCorpID());635 $qry->execute("insert into kb3_inv_crp values ( ".$this->getID().", ".$inv->getCorpID()." )") or die($qry->getErrorMsg());636 }637 if (!in_array($inv->getPilotID(), $invplt))638 {639 array_push($invplt, $inv->getPilotID());640 $qry->execute("insert into kb3_inv_plt values ( ".$this->getID().", ".$inv->getPilotID()." )") or die($qry->getErrorMsg());641 }642 }643 // destroyed644 foreach ($this->destroyeditems_ as $dest)645 {646 $item = $dest->getItem();647 if (!$item->getID() || !$dest->getQuantity() || !$dest->getLocationID())648 continue;649 650 $sql = "insert into kb3_items_destroyed651 values ( ".$this->getID().", ".$item->getID().", ".$dest->getQuantity().", "652 .$dest->getLocationID()." )";653 $qry->execute($sql);654 }655 }656 else657 {658 $this->dupeid_ = $dupe;659 $this->id_ = -1;660 679 } 661 680 return $this->id_; 662 681 } 663 682 664 function remove( )683 function remove($delcomments = true) 665 684 { 666 685 if (!$this->id_) … … 674 693 $qry->execute("delete from kb3_inv_plt where inp_kll_id = ".$this->id_); 675 694 $qry->execute("delete from kb3_items_destroyed where itd_kll_id = ".$this->id_); 676 $qry->execute("delete from kb3_comments where kll_id = ".$this->id_); 695 if ($delcomments) 696 { 697 $qry->execute("delete from kb3_comments where kll_id = ".$this->id_); 698 } 677 699 } 678 700 … … 756 778 { 757 779 $value = 0; // Set 0 value incase nothing comes back 758 $id = $this->item_->getID(); // get Item ID780 $id = $this->item_->getID(); // get Item ID 759 781 $qry = new DBQuery(); 760 $qry->execute("select Value from kb3_items where itm_id= '".$id."'") or die($qry->getErrorMsg());782 $qry->execute("select value from kb3_items where itm_id= '".$id."'"); 761 783 $row = $qry->getRow(); 762 $value = $row['Value']; 763 if ($value == "") { 784 $value = $row['value']; 785 if ($value == "") 786 { 764 787 $value = 0; 765 788 } … … 781 804 $id = $row['itl_id']; 782 805 } 783 784 806 return $id; 785 807 } -
dev/common/class.killlisttable.php
r44 r92 11 11 12 12 $this->kill_list_ = $kill_list; 13 14 13 $this->daybreak_ = true; 15 14 } … … 32 31 function generate() 33 32 { 34 global $config; 35 $odd = false; 33 global $config, $smarty; 36 34 $prevdate = ""; 37 35 $this->kill_list_->rewind(); 36 $smarty->assign('daybreak', $this->daybreak_); 37 $smarty->assign('comments_count', $config->getConfig('comments_count')); 38 39 // evil hardcode-hack, don't do this at home kids ! ;) 40 if ($config->getConfig('style_name') == 'revelations') 41 { 42 $smarty->assign('comment_white', '_white'); 43 } 44 45 38 46 while ($kill = $this->kill_list_->getKill()) 39 47 { 40 if ($this->limit_ && $c > $this->limit_) 48 if ($this->limit_ && $c >= $this->limit_) 49 { 41 50 break; 42 else43 $c++;44 45 if (!$odd)46 {47 $odd = true;48 $class = 'kb-table-row-odd';49 51 } 50 52 else 51 53 { 52 $odd = false; 53 $class = 'kb-table-row-even'; 54 $c++; 54 55 } 55 56 … … 57 58 if ($curdate != $prevdate) 58 59 { 59 if ( $prevdate != ""&& $this->daybreak_)60 if (count($kills) && $this->daybreak_) 60 61 { 61 $html .= "</table>\n"; 62 } 63 64 if ($this->daybreak_) 65 $html .= "<div class=kb-date-header>".date("l, F jS", strtotime($curdate))."</div><br>\n"; 66 67 if ($this->daybreak_ || $prevdate == "") 68 { 69 $html .= "<table class=kb-table width=\"99%\" align=center cellspacing=\"1\">\n"; 70 $html .= "<tr class=kb-table-header>\n"; 71 $html .= "<td class=kb-table-header colspan=2 align=\"center\">Ship type</td>\n"; 72 $html .= "<td class=kb-table-header>Victim</td>\n"; 73 $html .= "<td class=kb-table-header>Final blow</td>\n"; 74 $html .= "<td class=kb-table-header align=\"center\">System</td>\n"; 75 $html .= "<td class=kb-table-header align=\"center\">Time</td>"; 76 77 if ($config->getConfig('comments_count')) 78 { 79 $html .= "<td class=kb-table-header align=\"center\"><img src=\"".IMG_URL."/comment.gif\"></td>\n"; 80 } 81 $html .= "</tr>\n"; 62 $kl[] = array('kills' => $kills, 'date' => $prevdate); 63 $kills = array(); 82 64 } 83 65 $prevdate = $curdate; 84 66 } 85 86 $html .= "<tr class=".$class." style=\"height: 34px; cursor: pointer;\" onmouseover=\"this.className='kb-table-row-hover';\" onmouseout=\"this.className='".$class."';\" onClick=\"window.location.href='?a=kill_detail&kll_id=".$kill->getID()."';\">"; 87 88 $html .= "<td width=32 align=center><img src=\"".$kill->getVictimShipImage(32)."\" border=\"0\"></td>"; 89 90 $html .= "<td height=34 width=150 valign=center><div class=kb-shiptype><b>".$kill->getVictimShipName()."</b><br>".$kill->getVictimShipClassName()."</div><div class=kb-shipicon><img src=\"".$kill->getVictimShipValueIndicator()."\" border=\"0\"></div></td>"; 91 92 $html .= "<td width=200 class=kb-table-cell><b>".$kill->getVictimName()."</b><br>".shorten($kill->getVictimCorpName())."</td>"; 93 $html .= "<td width=200 class=kb-table-cell><b>".$kill->getFBPilotName()."</b><br>".shorten($kill->getFBCorpName())."</td>"; 94 $html .= "<td width=110 class=kb-table-cell align=\"center\"><b>".shorten($kill->getSolarSystemName(), 10)."</b><br>(".roundsec($kill->getSolarSystemSecurity()).")</td>"; 95 if ($this->daybreak_) 96 $html .= "<td class=kb-table-cell align=\"center\"><b>".substr($kill->getTimeStamp(), 11, 5)."</b></td>"; 97 else 98 $html .= "<td class=kb-table-cell align=\"center\" width=80><b>".substr($kill->getTimeStamp(), 0, 10)."<br>".substr($kill->getTimeStamp(), 11, 5)."</b></td>"; 67 $kll = array(); 68 $kll['id'] = $kill->getID(); 69 $kll['victimshipimage'] = $kill->getVictimShipImage(32); 70 $kll['victimshipname'] = $kill->getVictimShipName(); 71 $kll['victimshipclass'] = $kill->getVictimShipClassName(); 72 $kll['victimshipindicator'] = $kill->getVictimShipValueIndicator(); 73 $kll['victim'] = $kill->getVictimName(); 74 $kll['victimcorp'] = $kill->getVictimCorpName(); 75 $kll['fb'] = $kill->getFBPilotName(); 76 $kll['fbcorp'] = $kill->getFBCorpName(); 77 $kll['system'] = $kill->getSolarSystemName(); 78 $kll['systemsecurity'] = $kill->getSolarSystemSecurity(); 79 $kll['timestamp'] = $kill->getTimeStamp(); 99 80 if ($config->getConfig('comments_count')) 100 81 { 101 $ html .= "<td width=10 class=kb-table-cell align=\"center\"><b>".shorten($kill->countComment($kill->getID()), 10)."</b></td>";82 $kll['commentcount'] = $kill->countComment($kill->getID()); 102 83 } 103 $html .= "</tr>\n"; 84 $kills[] = $kll; 85 } 86 if (count($kills)) 87 { 88 $kl[] = array('kills' => $kills, 'date' => date("l, F jS", strtotime($prevdate))); 104 89 } 105 90 106 if ($c > 0) 107 $html .= "</table>\n"; 108 else 109 $html .= "<p>No data."; 110 111 return $html; 91 $smarty->assign_by_ref('killlist', $kl); 92 return $smarty->fetch('killlisttable.tpl'); 112 93 } 113 94 } -
dev/common/class.parser.php
r71 r92 10 10 function Parser($killmail) 11 11 { 12 $this->killmail_ = trim(str_replace("\r", "", $killmail)); 13 14 if (strpos($this->killmail_, "**** Truncated - mail is too large ****") > 0) 15 { 16 $this->killmail_ = str_replace("**** Truncated - mail is too large ****", "", $this->killmail_); 17 } 18 19 /* Parser fix, since some killmails don't have a final blow, they would break the KB */ 20 if (strpos($this->killmail_, "laid the final blow") < 1) 12 $this->error_ = array(); 13 $this->killmail_ = trim(str_replace("\r", '', $killmail)); 14 15 if (strpos($this->killmail_, 'Beteiligte Parteien:')) 16 { 17 $this->preparse('german'); 18 } 19 20 if (strpos($this->killmail_, '**** Truncated - mail is too large ****') > 0) 21 { 22 $this->killmail_ = str_replace('**** Truncated - mail is too large ****', '', $this->killmail_); 23 } 24 25 // Parser fix, since some killmails don't have a final blow, they would break the KB 26 if (strpos($this->killmail_, 'laid the final blow') < 1) 21 27 { 22 28 $this->needs_final_blow_ = 1; 23 29 } 24 /* END FIX */25 // if ( strpos( $this->killmail_, "Empty." ) > 0 ) {26 // $this->killmail_ = str_replace( "Empty.\n", "", $this->killmail_ );27 // }28 30 } 29 31 30 32 function parse($checkauth = true) 31 33 { 34 global $config; 32 35 // header 33 36 $involvedpos = strpos($this->killmail_, "Involved parties:"); … … 35 38 $header = substr($this->killmail_, 0, $involvedpos); 36 39 $timestamp = substr($header, 0, 16); 37 preg_match("/Victim: (.*)/", $header, $matches); 38 $victimname = trim($matches[1]); 39 preg_match("/Alliance: (.*)/", $header, $matches); 40 $alliancename = trim($matches[1]); 41 preg_match("/Corp: (.*)/", $header, $matches); 42 $corpname = trim($matches[1]); 43 preg_match("/Destroyed: (.*)/", $header, $matches); 44 $shipname = trim($matches[1]); 45 preg_match("/System: (.*)/", $header, $matches); 46 $systemname = trim($matches[1]); 47 preg_match("/Security: (.*)/", $header, $matches); 48 $systemsec = trim($matches[1]); 49 50 if (strlen($timestamp) < 1 || 51 strlen($alliancename) < 1 || 52 strlen($corpname) < 1 || 53 strlen($victimname) < 1 || 54 strlen($shipname) < 1 || 55 strlen($systemname) < 1 || 56 strlen($systemsec) < 1) 40 41 if (preg_match("/Victim: (.*)/", $header, $matches)) 42 { 43 $victimname = trim($matches[1]); 44 } 45 else 46 { 47 $this->error('No victim found.'); 48 } 49 if (preg_match("/Alliance: (.*)/", $header, $matches)) 50 { 51 $alliancename = trim($matches[1]); 52 } 53 else 54 { 55 $this->error('No alliance found.'); 56 } 57 if (preg_match("/Corp: (.*)/", $header, $matches)) 58 { 59 $corpname = trim($matches[1]); 60 } 61 else 62 { 63 $this->error('No corp found.'); 64 } 65 if (preg_match("/Destroyed: (.*)/", $header, $matches)) 66 { 67 $shipname = trim($matches[1]); 68 } 69 else 70 { 71 $this->error('No destroyed ship found.'); 72 } 73 if (preg_match("/System: (.*)/", $header, $matches)) 74 { 75 $systemname = trim($matches[1]); 76 } 77 else 78 { 79 $this->error('No system found.'); 80 } 81 if (preg_match("/Security: (.*)/", $header, $matches)) 82 { 83 $systemsec = trim($matches[1]); 84 } 85 else 86 { 87 $this->error('No security found.'); 88 } 89 90 if (!isset($timestamp) || 91 !isset($alliancename) || 92 !isset($corpname) || 93 !isset($victimname) || 94 !isset($shipname) || 95 !isset($systemname) || 96 !isset($systemsec)) 57 97 return 0; 58 98 59 99 if ($checkauth) 100 { 60 101 $authorized = false; 61 else 102 } 103 else 104 { 62 105 $authorized = true; 106 } 107 63 108 // populate/update database 64 109 $alliance = new Alliance(); … … 70 115 $system = new SolarSystem(); 71 116 $system->lookup($systemname); 117 if (!$system->getID()) 118 { 119 $this->error('System not found.', $systemname); 120 } 72 121 $ship = new Ship(); 73 122 $ship->lookup($shipname); 123 if (!$ship->getID()) 124 { 125 $this->error('Ship not found.', $shipname); 126 } 74 127 $kill = new Kill(); 75 128 $kill->setTimeStamp($timestamp); … … 91 144 } 92 145 } 146 93 147 // involved 94 148 $end = strpos($this->killmail_, "Destroyed items:"); 95 if ($end == 0) $end = strlen($this->killmail_); 149 if ($end == 0) 150 { 151 $end = strlen($this->killmail_); 152 } 96 153 $involved = explode("\n", trim(substr($this->killmail_, strpos($this->killmail_, "Involved parties:") + 17, $end - (strpos($this->killmail_, "Involved parties:") + 17)))); 97 154 … … 102 159 { 103 160 if ($involved[$i] == "") 161 { 104 162 $i++; 163 continue; 164 } 105 165 106 166 preg_match("/Name: (.*)/", $involved[$i], $matches); 107 167 $ipname = $matches[1]; 108 168 109 preg_match("/(.*) \ (laid the final blow\)/", $ipname, $matches);169 preg_match("/(.*) \\(laid the final blow\\)/", $ipname, $matches); 110 170 if ($matches[1]) 111 171 { … … 113 173 $finalblow = 1; 114 174 } 115 else $finalblow = 0; 175 else 176 { 177 $finalblow = 0; 178 } 116 179 117 180 /* This is part of the final blow fix, mentioned above */ … … 148 211 $iweapon = new Item(); 149 212 $iweapon->lookup($pmatches[1]); 150 $ipname = '#'.$tmpcorp->getID().'#'.$iweapon->getID() ;213 $ipname = '#'.$tmpcorp->getID().'#'.$iweapon->getID().'#'.$iwname; 151 214 $tmpall = $tmpcorp->getAlliance(); 152 215 // name will be None if no alliance is set … … 179 242 } 180 243 244 $ipilot = new Pilot(); 245 $ipilot->add($ipname, $icorp, $timestamp); 246 247 $iship = new Ship(); 248 $iship->lookup($isname); 249 if (!$iship->getID()) 250 { 251 $this->error('Ship not found.', $iship); 252 } 253 $iweapon = new Item(); 254 $iweapon->lookup($iwname); 255 if (!$iweapon->getID()) 256 { 257 $this->error('Weapon not found.', $iwname); 258 } 259 181 260 if (ALLIANCE_ID != 0 && $ialliance->getID() == ALLIANCE_ID) 182 261 { … … 192 271 } 193 272 } 194 else 195 { 196 $authorized = true; 197 } 198 199 $ipilot = new Pilot(); 200 $ipilot->add($ipname, $icorp, $timestamp); 201 $iship = new Ship(); 202 $iship->lookup($isname); 203 $iweapon = new Item(); 204 $iweapon->lookup($iwname); 273 if (!$authorized) 274 { 275 if ($string = $config->getConfig('post_permission')) 276 { 277 if ($string == 'all') 278 { 279 $authorized = true; 280 } 281 else 282 { 283 $tmp = explode(',', $string); 284 foreach ($tmp as $item) 285 { 286 if (!$item) 287 { 288 continue; 289 } 290 $typ = substr($item, 0, 1); 291 $id = substr($item, 1); 292 if ($typ == 'a') 293 { 294 if ($ialliance->getID() == $id) 295 { 296 $authorized = true; 297 break; 298 } 299 } 300 elseif ($typ == 'c') 301 { 302 if ($icorp->getID() == $id) 303 { 304 $authorized = true; 305 break; 306 } 307 } 308 elseif ($typ == 'p') 309 { 310 if ($ipilot->getID() == $id) 311 { 312 $authorized = true; 313 break; 314 } 315 } 316 } 317 } 318 } 319 } 205 320 206 321 $iparty = new InvolvedParty($ipilot->getID(), $icorp->getID(), 207 $ialliance->getID(), $secstatus, 208 $iship, $iweapon); 322 $ialliance->getID(), $secstatus, $iship, $iweapon); 209 323 $kill->addInvolvedParty($iparty); 210 324 … … 216 330 } 217 331 } 332 218 333 // destroyed items 219 334 $destroyedpos = strpos($this->killmail_, "Destroyed items:"); … … 222 337 { 223 338 $destroyed = explode("\n", trim(substr($this->killmail_, 224 strpos($this->killmail_, "Destroyed items:") + 16,225 strlen($this->killmail_) - (strpos($this->killmail_, "Destroyed items:") + 16))));339 strpos($this->killmail_, "Destroyed items:") + 16, 340 strlen($this->killmail_) - (strpos($this->killmail_, "Destroyed items:") + 16)))); 226 341 227 342 $i = 0; … … 289 404 290 405 if ($quantity == "") 406 { 291 407 $quantity = 1; 408 } 292 409 293 410 $item = new Item(); 294 411 $item->lookup(trim($itemname)); 412 if (!$item->getID()) 413 { 414 $this->error('Item not found.', trim($itemname)); 415 } 295 416 $ditem = new DestroyedItem($item, $quantity, $location); 296 417 $kill->addDestroyedItem($ditem); … … 304 425 return -2; 305 426 } 427 if ($this->getError()) 428 { 429 return 0; 430 } 306 431 307 432 $id = $kill->add(); 308 433 if ($id == -1) 434 { 309 435 $this->dupeid_ = $kill->dupeid_; 436 } 310 437 311 438 return $id; 439 } 440 441 function error($message, $debugtext = null) 442 { 443 $this->error_[] = array($message, $debugtext); 444 } 445 446 function getError() 447 { 448 if (count($this->error_)) 449 { 450 return $this->error_; 451 } 452 return false; 453 } 454 455 function preparse($set) 456 { 457 if ($set == 'german') 458 { 459 $search = array('Ziel:','Allianz: nichts','Allianz:','Zerstört','Sicherheit:','Beteiligte Parteien:'); 460 $replace = array('Victim:','Alliance: None','Alliance:','Destroyed','Security:','Involved parties:'); 461 $this->killmail_ = str_replace($search, $replace, $this->killmail_); 462 return; 463 } 312 464 } 313 465 } -
dev/common/class.pilot.php
r56 r92 6 6 class Pilot 7 7 { 8 9 8 function Pilot($id = 0) 10 9 { … … 21 20 { 22 21 $this->execQuery(); 23 $npc= strpos($this->row_['plt_name'], "#");24 if($npc === false) { 25 return $this->row_['plt_name']; 26 } 27 else { 28 $name = explode("#",$this->row_['plt_name']); 29 $item = new Item; 30 $name = $item ->lookup($name[2]);31 return $name;32 } 33 22 $pos = strpos($this->row_['plt_name'], "#"); 23 if ($pos === false) 24 { 25 return $this->row_['plt_name']; 26 } 27 else 28 { 29 $name = explode("#", $this->row_['plt_name']); 30 $item = new Item($name[2]); 31 return $item->getName(); 32 } 34 33 } 35 34 … … 83 82 " . $corp->getID() . ", 84 83 0, 0, 0, 85 date_format( '" .$timestamp."', '%Y.%m.%d %H:%i:%s'))");84 date_format( '" . $timestamp . "', '%Y.%m.%d %H:%i:%s'))"); 86 85 $this->id_ = $qry->getInsertID(); 87 86 } … … 93 92 { 94 93 $qry->execute("update kb3_pilots 95 set plt_crp_id = " .$corp->getID().",96 plt_updated = date_format( '" .$timestamp."', '%Y.%m.%d %H:%i:%s') where plt_id = " . $this->id_);94 set plt_crp_id = " . $corp->getID() . ", 95 plt_updated = date_format( '" . $timestamp . "', '%Y.%m.%d %H:%i:%s') where plt_id = " . $this->id_); 97 96 } 98 97 } … … 120 119 } 121 120 } 121 122 122 ?> -
dev/common/class.session.php
r30 r92 6 6 function Session() 7 7 { 8 if ( $_REQUEST['PHPSESSID'])8 if (isset($_REQUEST['PHPSESSID'])) 9 9 { 10 10 session_start(); -
dev/common/class.ship.php
r2 r92 1 <? 2 require_once( "db.php" ); 1 <?php 3 2 4 class Ship { 3 /** 4 * Changes 5 * 11/23/06 - function getActualValue() 6 * Returns actual value of the ship unrounded, rounding is retarded but 7 * I dont want to fuck anything else up - Coni 8 * 9 */ 5 10 6 function Ship( $id = 0 ) 11 require_once("db.php"); 12 13 class Ship 14 { 15 function Ship($id = 0) 7 16 { 8 $this->id_ = $id;17 $this->id_ = $id; 9 18 } 10 19 11 20 function getID() 12 21 { 13 return $this->id_;22 return $this->id_; 14 23 } 15 24 16 25 function getName() 17 26 { 18 if ( $this->shipname_ == "") $this->execQuery();19 return $this->shipname_;27 if ($this->shipname_ == "") $this->execQuery(); 28 return $this->shipname_; 20 29 } 21 30 22 31 function getClass() 23 32 { 24 if ( !$this->shipclass_) $this->execQuery();25 return $this->shipclass_;33 if (!$this->shipclass_) $this->execQuery(); 34 return $this->shipclass_; 26 35 } 27 36 28 37 function getTechLevel() 29 38 { 30 $this->execQuery();31 return $this->row_['shp_techlevel'];39 $this->execQuery(); 40 return $this->row_['shp_techlevel']; 32 41 } 33 42 34 function getImage( $size)43 function getImage($size) 35 44 { 36 if ( !$this->externalid_ ) $this->execQuery(); 37 return IMG_URL."/ships/".$size."_".$size."/" 38 .$this->externalid_.".png"; 45 if (!$this->externalid_) 46 { 47 $this->execQuery(); 48 } 49 return IMG_URL."/ships/".$size."_".$size."/".$this->externalid_.".png"; 39 50 } 40 51 41 function setName( $shipname)52 function setName($shipname) 42 53 { 43 $this->shipname_ = $shipname;54 $this->shipname_ = $shipname; 44 55 } 45 56 46 function setClass( $shipclass)57 function setClass($shipclass) 47 58 { 48 $this->shipclass_ = $shipclass;59 $this->shipclass_ = $shipclass; 49 60 } 50 61 51 62 function execQuery() 52 63 { 53 if ( !$this->qry_ ) { 54 $this->qry_ = new DBQuery(); 55 56 $this->sql_ = "select * 57 from kb3_ships shp, kb3_ship_classes scl 58 where shp_id = ".$this->id_." 59 and shp.shp_class = scl.scl_id"; 64 if (!$this->qry_) 65 { 66 $this->qry_ = new DBQuery(); 60 67 61 $this->qry_->execute( $this->sql_ ); 62 $row = $this->qry_->getRow(); 63 $this->shipname_ = $row['shp_name']; 64 $this->shipclass_ = new ShipClass( $row['scl_id'] ); 65 $this->shiptechlevel_ = $row['shp_techlevel']; 66 $this->externalid_ = $row['shp_externalid']; 67 } 68 $this->sql_ = "select * 69 from kb3_ships shp, kb3_ship_classes scl 70 where shp_id = ".$this->id_." 71 and shp.shp_class = scl.scl_id"; 72 73 $this->qry_->execute($this->sql_); 74 $row = $this->qry_->getRow(); 75 $this->shipname_ = $row['shp_name']; 76 $this->shipclass_ = new ShipClass($row['scl_id']); 77 $this->shiptechlevel_ = $row['shp_techlevel']; 78 $this->externalid_ = $row['shp_externalid']; 79 } 68 80 } 69 81 70 function lookup( $name)82 function lookup($name) 71 83 { 72 $qry = new DBQuery();73 $qry->execute("select *84 $qry = new DBQuery(); 85 $qry->execute("select * 74 86 from kb3_ships 75 where shp_name = '".slashfix( $name )."'");76 77 $row = $qry->getRow();78 if ( $row['shp_id']) $this->id_ = $row['shp_id'];87 where shp_name = '".slashfix($name)."'"); 88 89 $row = $qry->getRow(); 90 if ($row['shp_id']) $this->id_ = $row['shp_id']; 79 91 } 80 92 } 81 93 82 83 84 function ShipClass( $id = 0)94 class ShipClass 95 { 96 function ShipClass($id = 0) 85 97 { 86 if ( !$id) $id = 0;87 $this->id_ = $id;98 if (!$id) $id = 0; 99 $this->id_ = $id; 88 100 89 $this->qry_ = new DBQuery();101 $this->qry_ = new DBQuery(); 90 102 } 91 103 92 104 function getID() 93 105 { 94 return $this->id_;106 return $this->id_; 95 107 } 96 108 97 109 function getName() 98 110 { 99 if ( $this->name_ == "") $this->execQuery();100 return $this->name_;111 if ($this->name_ == "") $this->execQuery(); 112 return $this->name_; 101 113 } 102 114 115 // Why would you round here this is fucking retarded! 103 116 function getValue() 104 117 { 105 if ( !$this->value_ ) $this->execQuery(); 106 return round( $this->value_ / 1000000, 2 ); 118 if (!$this->value_) $this->execQuery(); 119 return round($this->value_ / 1000000, 2); 120 } 121 122 function getActualValue() 123 { 124 if (!$this->value_) $this->execQuery(); 125 return $this->value_; 107 126 } 108 127 109 128 function getPoints() 110 129 { 111 if ( !$this->points_) $this->execQuery();112 return $this->points_;130 if (!$this->points_) $this->execQuery(); 131 return $this->points_; 113 132 } 114 133 115 function setName( $name)134 function setName($name) 116 135 { 117 $this->name_ = $name;136 $this->name_ = $name; 118 137 } 119 138 120 function setValue( $value)139 function setValue($value) 121 140 { 122 $this->value_ = $value;141 $this->value_ = $value; 123 142 } 124 143 125 144 function getValueIndicator() 126 145 { 127 $value = $this->getValue();146 $value = $this->getValue(); 128 147 129 if ( $value >= 0 && $value <= 1)130 $color = "gray";131 elseif ( $value > 1 && $value <= 15)132 $color = "blue";133 elseif ( $value > 15 && $value <= 25)134 $color = "green";135 elseif ( $value > 25 && $value <= 40)136 $color = "yellow";137 elseif ( $value > 40 && $value <= 80)138 $color = "red";139 elseif ( $value > 80 && $value <= 250)140 $color = "orange";141 elseif ( $value > 250)142 $color = "purple";148 if ($value >= 0 && $value <= 1) 149 $color = "gray"; 150 elseif ($value > 1 && $value <= 15) 151 $color = "blue"; 152 elseif ($value > 15 && $value <= 25) 153 $color = "green"; 154 elseif ($value > 25 && $value <= 40) 155 $color = "yellow"; 156 elseif ($value > 40 && $value <= 80) 157 $color = "red"; 158 elseif ($value > 80 && $value <= 250) 159 $color = "orange"; 160 elseif ($value > 250) 161 $color = "purple"; 143 162 144 return IMG_URL."/ships/ship-".$color.".gif";163 return IMG_URL."/ships/ship-".$color.".gif"; 145 164 } 146 165 147 166 function execQuery() 148 167 { 149 if ( !$this->qry_->executed_ ) {150 151 $sql = "select *168 if (!$this->qry_->executed_) 169 { 170 $sql = "select * 152 171 from kb3_ship_classes 153 172 where scl_id = ".$this->id_; 154 173 155 $this->qry_->execute( $sql);156 174 $this->qry_->execute($sql); 175 $row = $this->qry_->getRow(); 157 176 158 159 160 161 }177 $this->name_ = $row['scl_class']; 178 $this->value_ = $row['scl_value']; 179 $this->points_ = $row['scl_points']; 180 } 162 181 } 163 182 } 164 183 ?> -
dev/common/class.system.php
r73 r92 11 11 $this->sql_ = "select * 12 12 from kb3_systems sys, kb3_constellations con, 13 kb3_regions reg14 where sys.sys_id = " . $this->id_ ."15 16 13 kb3_regions reg 14 where sys.sys_id = ".$this->id_." 15 and con.con_id = sys.sys_con_id 16 and reg.reg_id = con.con_reg_id"; 17 17 } 18 18 … … 68 68 $qry = new DBQuery(); 69 69 $qry->execute("select * 70 71 where sys_name = '" . slashfix($name) ."'");70 from kb3_systems 71 where sys_name = '".slashfix($name)."'"); 72 72 73 73 $row = $qry->getRow(); 74 74 if (!$row['sys_id']) 75 75 { 76 echo 'INTERNAL ERROR: SYSTEM NOT FOUND: "'.$name.'"<br/>';76 return null; 77 77 } 78 78 $this->id_ = $row['sys_id']; … … 104 104 $this->qry_ = new DBQuery(); 105 105 $this->qry_->execute("select * from kb3_regions 106 where reg_id = " .$this->id_);106 where reg_id = ".$this->id_); 107 107 $this->row_ = $this->qry_->getRow(); 108 108 } -
dev/common/class.toplist.php
r51 r92 14 14 $this->vic_scl_id_ = array(); 15 15 $this->regions_ = array(); 16 $this->systems_ = array(); 16 17 } 17 18 … … 24 25 array_push($this->exclude_scl_, 11); 25 26 } 27 else 28 { 29 $this->exclude_scl_ = array(); 30 } 26 31 } 27 32 … … 38 43 function addInvolvedPilot($pilot) 39 44 { 40 $this->inv_plt_ .= $pilot->getID() .", ";45 $this->inv_plt_ .= $pilot->getID().", "; 41 46 if ($this->inv_crp_ || $this->inv_all_) 42 47 $this->mixedinvolved_ = true; … … 45 50 function addInvolvedCorp($corp) 46 51 { 47 $this->inv_crp_ .= $corp->getID() .", ";52 $this->inv_crp_ .= $corp->getID().", "; 48 53 if ($this->inv_plt_ || $this->inv_all_) 49 54 $this->mixedinvolved_ = true; … … 52 57 function addInvolvedAlliance($alliance) 53 58 { 54 $this->inv_all_ .= $alliance->getID() .", ";59 $this->inv_all_ .= $alliance->getID().", "; 55 60 if ($this->inv_plt_ || $this->inv_crp_) 56 61 $this->mixedinvolved_ = true; … … 59 64 function addVictimPilot($pilot) 60 65 { 61 $this->vic_plt_ .= $pilot->getID() .", ";66 $this->vic_plt_ .= $pilot->getID().", "; 62 67 if ($this->vic_crp_ || $this->vic_all_) 63 68 $this->mixedvictims_ = true; … … 66 71 function addVictimCorp($corp) 67 72 { 68 $this->vic_crp_ .= $corp->getID() .", ";73 $this->vic_crp_ .= $corp->getID().", "; 69 74 if ($this->vic_plt_ || $this->vic_all_) 70 75 $this->mixedvictims_ = true; … … 73 78 function addVictimAlliance($alliance) 74 79 { 75 $this->vic_all_ .= $alliance->getID() .", ";80 $this->vic_all_ .= $alliance->getID().", "; 76 81 if ($this->vic_plt_ || $this->vic_crp_) 77 82 $this->mixedvictims_ = true; … … 94 99 { 95 100 array_push($this->regions_, $region->getID()); 101 } 102 103 function addSystem($system) 104 { 105 array_push($this->systems_, $system->getID()); 96 106 } 97 107 … … 137 147 function setStartDate($timestamp) 138 148 { 139 $this->timeframe_ .= " and kll.kll_timestamp >= '" . $timestamp ."'";149 $this->timeframe_ .= " and kll.kll_timestamp >= '".$timestamp."'"; 140 150 } 141 151 142 152 function setEndDate($timestamp) 143 153 { 144 $this->timeframe_ .= " and kll.kll_timestamp <= '" . $timestamp ."'";154 $this->timeframe_ .= " and kll.kll_timestamp <= '".$timestamp."'"; 145 155 } 146 156 … … 156 166 if ($this->inv_plt_) 157 167 $this->sql_ .= " inner join kb3_inv_plt inp 158 on ( inp.inp_plt_id in ( " . substr($this->inv_plt_, 0, strlen($this->inv_plt_) - 2) ." ) and kll.kll_id = inp.inp_kll_id ) ";168 on ( inp.inp_plt_id in ( ".substr($this->inv_plt_, 0, strlen($this->inv_plt_) - 2)." ) and kll.kll_id = inp.inp_kll_id ) "; 159 169 if ($this->inv_crp_) 160 170 $this->sql_ .= " inner join kb3_inv_crp inc 161 on ( inc.inc_crp_id in ( " . substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2) ." ) and kll.kll_id = inc.inc_kll_id ) ";171 on ( inc.inc_crp_id in ( ".substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2)." ) and kll.kll_id = inc.inc_kll_id ) "; 162 172 163 173 if ($this->inv_all_) 164 174 $this->sql_ .= " inner join kb3_inv_all ina 165 on ( ina.ina_all_id in ( " . substr($this->inv_all_, 0, strlen($this->inv_all_) - 2) ." ) and kll.kll_id = ina.ina_kll_id ) ";175 on ( ina.ina_all_id in ( ".substr($this->inv_all_, 0, strlen($this->inv_all_) - 2)." ) and kll.kll_id = ina.ina_kll_id ) "; 166 176 167 177 if (count($this->exclude_scl_)) … … 171 181 inner join kb3_ship_classes scl 172 182 on ( scl.scl_id = shp.shp_class )"; 173 $this->sql_ .= " and scl.scl_id not in ( " . implode(",", $this->exclude_scl_) ." )";183 $this->sql_ .= " and scl.scl_id not in ( ".implode(",", $this->exclude_scl_)." )"; 174 184 } 175 185 … … 180 190 inner join kb3_ship_classes scl 181 191 on ( scl.scl_id = shp.shp_class )"; 182 $this->sql_ .= " and scl.scl_id in ( " . implode(",", $this->vic_scl_id_) ." )";192 $this->sql_ .= " and scl.scl_id in ( ".implode(",", $this->vic_scl_id_)." )"; 183 193 } 184 194 … … 191 201 inner join kb3_regions reg 192 202 on ( reg.reg_id = con.con_reg_id 193 and reg.reg_id in ( " . implode($this->regions_, ",") . " ) )"; 203 and reg.reg_id in ( ".implode($this->regions_, ",")." ) )"; 204 } 205 if (count($this->systems_)) 206 { 207 $this->sql_ .= " and kll.kll_system_id in ( ".implode($this->systems_, ",").")"; 194 208 } 195 209 // victim filter … … 202 216 203 217 if ($this->vic_plt_) 204 $this->sql_ .= " " . $op . " kll.kll_victim_id in ( " . substr($this->vic_plt_, 0, strlen($this->vic_plt_) - 2) ." )";218 $this->sql_ .= " ".$op." kll.kll_victim_id in ( ".substr($this->vic_plt_, 0, strlen($this->vic_plt_) - 2)." )"; 205 219 if ($this->vic_crp_) 206 $this->sql_ .= " " . $op . " kll.kll_crp_id in ( " . substr($this->vic_crp_, 0, strlen($this->vic_crp_) - 2) ." )";220 $this->sql_ .= " ".$op." kll.kll_crp_id in ( ".substr($this->vic_crp_, 0, strlen($this->vic_crp_) - 2)." )"; 207 221 if ($this->vic_all_) 208 $this->sql_ .= " " . $op . " kll.kll_all_id in ( " . substr($this->vic_all_, 0, strlen($this->vic_all_) - 2) ." )";222 $this->sql_ .= " ".$op." kll.kll_all_id in ( ".substr($this->vic_all_, 0, strlen($this->vic_all_) - 2)." )"; 209 223 210 224 if ($this->mixedvictims_) … … 213 227 if ($this->timeframe_) $this->sql_ .= $this->timeframe_; 214 228 215 $this->sql_ .= " " .$this->sqlbottom_;229 $this->sql_ .= " ".$this->sqlbottom_; 216 230 // echo $this->sql_."<br>"; 217 231 $this->qry_->execute($this->sql_); … … 249 263 on ( plt.plt_id = ind.ind_plt_id "; 250 264 if ($this->inv_crp_) 251 $sql .= " and plt.plt_crp_id in ( " . substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2) ." )";265 $sql .= " and plt.plt_crp_id in ( ".substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2)." )"; 252 266 $sql .= ")"; 253 267 … … 255 269 { 256 270 $sql .= ' inner join kb3_corps crp on ( crp.crp_id = ind.ind_crp_id '; 257 $sql .= " and crp.crp_all_id in ( " . substr($this->inv_all_, 0, strlen($this->inv_all_) - 2) ." )";271 $sql .= " and crp.crp_all_id in ( ".substr($this->inv_all_, 0, strlen($this->inv_all_) - 2)." )"; 258 272 $sql .= ')'; 259 273 } 260 261 274 262 275 $this->setSQLTop($sql); … … 284 297 on ( crp.crp_id = ind.ind_crp_id "; 285 298 if ($this->inv_all_) 286 $sql .= " and crp.crp_all_id in ( " . substr($this->inv_all_, 0, strlen($this->inv_all_) - 2) ." )";299 $sql .= " and crp.crp_all_id in ( ".substr($this->inv_all_, 0, strlen($this->inv_all_) - 2)." )"; 287 300 288 301 $sql .= ")"; … … 312 325 on ( plt.plt_id = ind.ind_plt_id "; 313 326 if ($this->inv_crp_) 314 $sql .= " and plt.plt_crp_id in ( " . substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2) ." )";327 $sql .= " and plt.plt_crp_id in ( ".substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2)." )"; 315 328 316 329 $sql .= ")"; … … 319 332 { 320 333 $sql .= ' inner join kb3_corps crp on ( crp.crp_id = ind.ind_crp_id '; 321 $sql .= " and crp.crp_all_id in ( " . substr($this->inv_all_, 0, strlen($this->inv_all_) - 2) ." )";334 $sql .= " and crp.crp_all_id in ( ".substr($this->inv_all_, 0, strlen($this->inv_all_) - 2)." )"; 322 335 $sql .= ')'; 323 336 } … … 327 340 $this->setSQLBottom("group by ind.ind_plt_id order by 1 desc 328 341 limit 30"); 329 $this->setPodsNoobShips(false);342 // $this->setPodsNoobShips(false); 330 343 } 331 344 } … … 381 394 on ( plt.plt_id = ind.ind_plt_id "; 382 395 if ($this->inv_crp_) 383 $sql .= " and plt.plt_crp_id in ( " . substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2) ." )";396 $sql .= " and plt.plt_crp_id in ( ".substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2)." )"; 384 397 385 398 $sql .= ")"; … … 409 422 on ( plt.plt_id = ind.ind_plt_id "; 410 423 if ($this->inv_crp_) 411 $sql .= " and plt.plt_crp_id in ( " . substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2) ." )";424 $sql .= " and plt.plt_crp_id in ( ".substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2)." )"; 412 425 413 426 $sql .= ")"; … … 441 454 and kll.kll_fb_plt_id = plt.plt_id"; 442 455 if ($this->inv_crp_) 443 $sql .= " and plt.plt_crp_id in ( " . substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2) ." )";456 $sql .= " and plt.plt_crp_id in ( ".substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2)." )"; 444 457 445 458 $sql .= ")"; … … 469 482 on ( plt.plt_id = ind.ind_plt_id"; 470 483 if ($this->inv_crp_) 471 $sql .= " and plt.plt_crp_id in ( " . substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2) ." )";484 $sql .= " and plt.plt_crp_id in ( ".substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2)." )"; 472 485 473 486 $sql .= ")"; … … 497 510 on ( plt.plt_id = ind.ind_plt_id"; 498 511 if ($this->inv_crp_) 499 $sql .= " and plt.plt_crp_id in ( " . substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2) ." )";512 $sql .= " and plt.plt_crp_id in ( ".substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2)." )"; 500 513 501 514 $sql .= ")"; … … 529 542 on ( plt.plt_id = ind.ind_plt_id"; 530 543 if ($this->inv_crp_) 531 $sql .= " and plt.plt_crp_id in ( " . substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2) ." )";544 $sql .= " and plt.plt_crp_id in ( ".substr($this->inv_crp_, 0, strlen($this->inv_crp_) - 2)." )"; 532 545 533 546 $sql .= ")"; … … 576 589 $this->addRegion(new Region($target->getID())); 577 590 break; 591 case "system": 592 $this->addSystem(new SolarSystem($target->getID())); 593 break; 578 594 } 579 595 } … … 612 628 $this->addRegion(new Region($target->getID())); 613 629 break; 630 case "system": 631 $this->addSystem(new SolarSystem($target->getID())); 632 break; 614 633 } 615 634 } … … 632 651 $html .= "<tr class=kb-table-header>"; 633 652 $html .= "<td class=kb-table-cell align=center colspan=2>Pilot</td>"; 634 $html .= "<td class=kb-table-cell align=center width=60>" . $this->entity_ ."</td>";653 $html .= "<td class=kb-table-cell align=center width=60>".$this->entity_."</td>"; 635 654 $html .= "</tr>"; 636 655 … … 650 669 $odd = true; 651 670 } 652 $html .= "<tr class=" . $class .">";653 $html .= "<td><img src=\"" . $pilot->getPortraitURL(32) ."\"></td>";654 $html .= "<td class=kb-table-cell width=200><b>" . $i . ".</b> <a class=kb-shipclass href=\"?a=pilot_detail&plt_id=" . $row['plt_id'] . "\">" . $pilot->getName() ."</a></td>";655 $html .= "<td class=kb-table-cell align=center><b>" . $row['cnt'] ."</b></td>";671 $html .= "<tr class=".$class.">"; 672 $html .= "<td><img src=\"".$pilot->getPortraitURL(32)."\"></td>"; 673 $html .= "<td class=kb-table-cell width=200><b>".$i.".</b> <a class=kb-shipclass href=\"?a=pilot_detail&plt_id=".$row['plt_id']."\">".$pilot->getName()."</a></td>"; 674 $html .= "<td class=kb-table-cell align=center><b>".$row['cnt']."</b></td>"; 656 675 657 676 $html .= "</tr>"; … … 681 700 $html .= "<td class=kb-table-cell align=center>#</td>"; 682 701 $html .= "<td class=kb-table-cell align=center>Corporation</td>"; 683 $html .= "<td class=kb-table-cell align=center width=60>" . $this->entity_ ."</td>";702 $html .= "<td class=kb-table-cell align=center width=60>".$this->entity_."</td>"; 684 703 $html .= "</tr>"; 685 704 … … 699 718 $odd = true; 700 719 } 701 $html .= "<tr class=" . $class .">";702 $html .= "<td class=kb-table-cell align=center><b>" . $i .".</b></td>";703 $html .= "<td class=kb-table-cell width=200><a href=\"?a=corp_detail&crp_id=" . $row['crp_id'] . "\">" . $corp->getName() ."</a></td>";704 $html .= "<td class=kb-table-cell align=center><b>" . $row['cnt'] ."</b></td>";720 $html .= "<tr class=".$class.">"; 721 $html .= "<td class=kb-table-cell align=center><b>".$i.".</b></td>"; 722 $html .= "<td class=kb-table-cell width=200><a href=\"?a=corp_detail&crp_id=".$row['crp_id']."\">".$corp->getName()."</a></td>"; 723 $html .= "<td class=kb-table-cell align=center><b>".$row['cnt']."</b></td>"; 705 724 706 725 $html .= "</tr>"; … … 746 765 on ( inp.inp_kll_id = ind.ind_kll_id 747 766 and inp.inp_plt_id = ind.ind_plt_id 748 and inp.inp_plt_id = " . $this->invplt_->getID() .")";767 and inp.inp_plt_id = ".$this->invplt_->getID().")"; 749 768 750 769 if ($this->invcrp_) … … 752 771 on ( inc.inc_kll_id = ind.ind_kll_id 753 772 and inc.inc_crp_id = ind.ind_crp_id 754 and inc.inc_crp_id = " . $this->invcrp_->getID() .")";773 and inc.inc_crp_id = ".$this->invcrp_->getID().")"; 755 774 756 775 if ($this->invall_) … … 758 777 on ( ina.ina_kll_id = ind.ind_kll_id 759 778 and ina.ina_all_id = ind.ind_all_id 760 and ina.ina_all_id = " . $this->invall_->getID() .")";779 and ina.ina_all_id = ".$this->invall_->getID().")"; 761 780 762 781 $this->setSQLTop($sql); … … 800 819 $odd = true; 801 820 } 802 $html .= "<tr class=" . $class .">";803 $html .= "<td><img src=\"" . $ship->getImage(32) ."\"></td>";804 $html .= "<td class=kb-table-cell width=200><b>" . $ship->getName() . "</b><br>" . $shipclass->getName() ."</td>";805 $html .= "<td class=kb-table-cell align=center><b>" . $row['cnt'] ."</b></td>";821 $html .= "<tr class=".$class.">"; 822 $html .= "<td><img src=\"".$ship->getImage(32)."\"></td>"; 823 $html .= "<td class=kb-table-cell width=200><b>".$ship->getName()."</b><br>".$shipclass->getName()."</td>"; 824 $html .= "<td class=kb-table-cell align=center><b>".$row['cnt']."</b></td>"; 806 825 807 826 $html .= "</tr>"; … … 846 865 on ( inp.inp_kll_id = ind.ind_kll_id 847 866 and inp.inp_plt_id = ind.ind_plt_id 848 and inp.inp_plt_id = " . $this->invplt_->getID() .")";867 and inp.inp_plt_id = ".$this->invplt_->getID().")"; 849 868 850 869 if ($this->invcrp_) … … 852 871 on ( inc.inc_kll_id = ind.ind_kll_id 853 872 and inc.inc_crp_id = ind.ind_crp_id 854 and inc.inc_crp_id = " . $this->invcrp_->getID() .")";873 and inc.inc_crp_id = ".$this->invcrp_->getID().")"; 855 874 856 875 if ($this->invall_) … … 858 877 on ( ina.ina_kll_id = ind.ind_kll_id 859 878 and ina.ina_all_id = ind.ind_all_id 860 and ina.ina_all_id = " . $this->invall_->getID() .")";879 and ina.ina_all_id = ".$this->invall_->getID().")"; 861 880 862 881 $this->setSQLTop($sql); … … 899 918 $odd = true; 900 919 } 901 $html .= "<tr class=" . $class .">";920 $html .= "<tr class=".$class.">"; 902 921 $html .= $item->getIcon(32); 903 $html .= "<td class=kb-table-cell width=200><b>" . $item->getName() ."</b></td>";904 $html .= "<td class=kb-table-cell align=center><b>" . $row['cnt'] ."</b></td>";922 $html .= "<td class=kb-table-cell width=200><b>".$item->getName()."</b></td>"; 923 $html .= "<td class=kb-table-cell align=center><b>".$row['cnt']."</b></td>"; 905 924 906 925 $html .= "</tr>"; … … 912 931 } 913 932 } 933 914 934 ?> -
dev/common/comments.php
r49 r92 42 42 $name = "Anonymous"; 43 43 } 44 $name = s trip_tags($name);44 $name = slashfix(strip_tags($name)); 45 45 // Password if right so insert the comment. 46 $qry->execute("INSERT INTO kb3_comments (`kll_id`,`comment`,`name` )47 VALUES ('$kll_id','$comment','$name' )");46 $qry->execute("INSERT INTO kb3_comments (`kll_id`,`comment`,`name`,`posttime`) 47 VALUES ('$kll_id','$comment','$name','".date('Y-m-d H:i:s')."')"); 48 48 } 49 49 } … … 56 56 57 57 $qry = new DBQuery(); 58 $qry->execute("SELECT *,id FROM kb3_comments WHERE `kll_id` = $kll_id");58 $qry->execute("SELECT *,id FROM kb3_comments WHERE `kll_id` = '".$kll_id."' order by posttime asc"); 59 59 if ($qry->recordCount() == 0) 60 60 { -
dev/common/corp_detail.php
r71 r92 19 19 20 20 $page = new Page("Corporation details - " . $corp->getName()); 21 $html .= "<table class=kb-table width=\"100%\" border=\"0\" cellspacing=1><tr class=kb-table-row-even><td rowspan=8 width=128 align=center >";21 $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>"; 22 22 23 23 if (file_exists("img/corps/".$corp->getID().".jpg")) … … 164 164 $list = new TopScoreList(); 165 165 $list->addInvolvedCorp($corp); 166 $list->setPodsNoobShips( false);166 $list->setPodsNoobShips(true); 167 167 $list->setMonth(date("m")); 168 168 $list->setYear(date("Y")); … … 175 175 $list = new TopScoreList(); 176 176 $list->addInvolvedCorp($corp); 177 $list->setPodsNoobShips( false);177 $list->setPodsNoobShips(true); 178 178 $table = new TopPilotTable($list, "Points"); 179 179 $html .= $table->generate(); -
dev/common/db.php
r44 r92 1 1 <?php 2 require_once( "config.php");3 require_once( "globals.php");2 require_once('config.php'); 3 require_once('globals.php'); 4 4 5 5 class DBConnection … … 10 10 die("Unable to connect to mysql database."); 11 11 12 mysql_select db(DB_NAME);12 mysql_select_db(DB_NAME); 13 13 } 14 14 … … 70 70 function getRow() 71 71 { 72 $row = mysql_fetch_assoc($this->resid_); 73 74 return $row; 72 if ($this->resid_) 73 { 74 return mysql_fetch_assoc($this->resid_); 75 } 76 return false; 75 77 } 76 78 … … 103 105 } 104 106 } 105 107 /* 108 * this looks like REALLY old code and isnt used anywhere 109 * commented out for now 110 * 106 111 class DBAction 107 112 { … … 489 494 } 490 495 } 496 */ 491 497 ?> -
dev/common/home.php
r71 r92 81 81 //$klist->setStartWeek($week - 1); 82 82 //$klist->setYear($year); 83 $klist->setLimit(20); 83 84 84 85 if ($_GET['scl_id']) -
dev/common/kill_detail.php
r54 r92 30 30 // victim 31 31 $html .= "<table class=kb-table width=360 cellpadding=0 cellspacing=1 border=0>"; 32 $html .= "<tr class=kb-table-row-odd><td rowspan=3 width=\"64\"><img src=\"" . $kill->getVictimPortrait(64) . "\" border=\"0\"></td>";33 $html .= "<td class=kb-table-cell width=64><b>Victim:</b></td><td class=kb-table-cell><a href=\"?a=pilot_detail&plt_id=" . $kill->getVictimID() . "\">" . $kill->getVictimName() ."</a></td>";32 $html .= "<tr class=kb-table-row-odd><td rowspan=3 width=\"64\"><img src=\"".$kill->getVictimPortrait(64)."\" border=\"0\" width=\"64\" heigth=\"64\"></td>"; 33 $html .= "<td class=kb-table-cell width=64><b>Victim:</b></td><td class=kb-table-cell><a href=\"?a=pilot_detail&plt_id=".$kill->getVictimID()."\">".$kill->getVictimName()."</a></td>"; 34 34 $html .= "</tr>"; 35 35 $html .= "<tr class=kb-table-row-odd>"; 36 $html .= "<td class=kb-table-cell width=64><b>Corp:</b></td><td class=kb-table-cell><a href=\"?a=corp_detail&crp_id=" . $kill->getVictimCorpID() . "\">" . $kill->getVictimCorpName() ."</a></td>";36 $html .= "<td class=kb-table-cell width=64><b>Corp:</b></td><td class=kb-table-cell><a href=\"?a=corp_detail&crp_id=".$kill->getVictimCorpID()."\">".$kill->getVictimCorpName()."</a></td>"; 37 37 $html .= "</tr>"; 38 38 $html .= "<tr class=kb-table-row-odd>"; … … 76 76 if ($corp->isNPCCorp()) 77 77 { 78 $html .= "<td rowspan=5 width=\"64\"><img " . $imgclass . "src=\"" . $corp->getPortraitURL(64) ."\" border=\"0\"></td>";79 } 80 else 81 { 82 $html .= "<td rowspan=5 width=\"64\"><img " . $imgclass . "src=\"" . $pilot->getPortraitURL(64) ."\" border=\"0\"></td>";83 } 84 $html .= "<td rowspan=5 width=\"64\"><img " . $imgclass . "src=\"" . $ship->getImage(64) ."\" border=\"0\"></td>";85 $html .= "<td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><a href=\"?a=pilot_detail&plt_id=" . $pilot->getID() . "\">" . $pilot->getName() ."</a></td>";78 $html .= "<td rowspan=5 width=\"64\"><img ".$imgclass."src=\"".$corp->getPortraitURL(64)."\" border=\"0\"></td>"; 79 } 80 else 81 { 82 $html .= "<td rowspan=5 width=\"64\"><img ".$imgclass."src=\"".$pilot->getPortraitURL(64)."\" border=\"0\"></td>"; 83 } 84 $html .= "<td rowspan=5 width=\"64\"><img ".$imgclass."src=\"".$ship->getImage(64)."\" border=\"0\"></td>"; 85 $html .= "<td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><a href=\"?a=pilot_detail&plt_id=".$pilot->getID()."\">".$pilot->getName()."</a></td>"; 86 86 $html .= "</tr>"; 87 87 88 $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><a href=\"?a=corp_detail&crp_id=" . $corp->getID() . "\">" . $corp->getName() ."</a></td></tr>";89 $html .= "<tr class=kb-table-row-even><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><a href=\"?a=alliance_detail&all_id=" . $alliance->getID() . "\">" . $alliance->getName() ."</a></td></tr>";90 $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><b>" . $ship->getName() ."</b></td></tr>";88 $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><a href=\"?a=corp_detail&crp_id=".$corp->getID()."\">".$corp->getName()."</a></td></tr>"; 89 $html .= "<tr class=kb-table-row-even><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><a href=\"?a=alliance_detail&all_id=".$alliance->getID()."\">".$alliance->getName()."</a></td></tr>"; 90 $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><b>".$ship->getName()."</b></td></tr>"; 91 91 92 92 if ($weapon->getName() != "Unknown" && $weapon->getName() != $ship->getName()) 93 $html .= "<tr class=kb-table-row-even><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\">" . $weapon->getName() ."</td></tr>";93 $html .= "<tr class=kb-table-row-even><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\">".$weapon->getName()."</td></tr>"; 94 94 else 95 95 $html .= "<tr class=kb-table-row-even><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\">Unknown</td></tr>"; … … 109 109 $ship = $kill->getVictimShip(); 110 110 $shipclass = $ship->getClass(); 111 $html .= "<tr class=kb-table-row-odd><td width=\"64\" rowspan=3><img src=\"" . $ship->getImage(64) . "\"></td>";112 $html .= "<td class=kb-table-cell><b>Ship:</b></td><td class=kb-table-cell><b>" . $ship->getName() . "</b> (" . $shipclass->getName() .")</td>";111 $html .= "<tr class=kb-table-row-odd><td width=\"64\" heigth=\"64\" rowspan=3><img src=\"".$ship->getImage(64)."\" width=\"64\" heigth=\"64\"></td>"; 112 $html .= "<td class=kb-table-cell><b>Ship:</b></td><td class=kb-table-cell><b>".$ship->getName()."</b> (".$shipclass->getName().")</td>"; 113 113 $html .= "</tr>"; 114 114 // $html .= "<tr class=kb-table-row-odd><td><b>Location:</b></td><td><b>".$sys_name."</b> (".$sys_sec.")</td>"; 115 115 $system = $kill->getSystem(); 116 $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell><b>Location:</b></td><td class=kb-table-cell><b><a href=\"javascript:openWindow( '?a=system_detail&sys_id=" . $system->getID() . "', '', 620, 260, '' );\">" . $system->getName() . "</a></b> (" . $system->getSecurity(true) .")</td>";117 118 $html .= "</tr>"; 119 $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell><b>Date:</b></td><td class=kb-table-cell>" . $kill->getTimeStamp() ."</td>";116 $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell><b>Location:</b></td><td class=kb-table-cell><b><a href=\"javascript:openWindow( '?a=system_detail&sys_id=".$system->getID()."', '', 620, 260, '' );\">".$system->getName()."</a></b> (".$system->getSecurity(true).")</td>"; 117 118 $html .= "</tr>"; 119 $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell><b>Date:</b></td><td class=kb-table-cell>".$kill->getTimeStamp()."</td>"; 120 120 $html .= "</tr>"; 121 121 $html .= "</table>"; … … 161 161 $lastlocation = $location; 162 162 $html .= "<tr class=kb-table-row-odd>"; 163 $html .= "<td width=\"32\"><img src=\"" . IMG_URL . "/" . strtolower(str_replace(' ', '_', $location)) . ".jpg\" alt=\"" . $location ."\" border=\"0\"></a></td>";164 $html .= "<td class=kb-table-cell colspan=2><b>" . $location ."</b></td>";163 $html .= "<td width=\"32\"><img src=\"".IMG_URL."/".strtolower(str_replace(' ', '_', $location)).".jpg\" alt=\"".$location."\" border=\"0\"></a></td>"; 164 $html .= "<td class=kb-table-cell colspan=2><b>".$location."</b></td>"; 165 165 $html .= "</tr>"; 166 166 } … … 178 178 $html .= $item->getIcon(32); 179 179 180 $html .= "<td class=kb-table-cell>" . $item->getName() ."</td>";181 $html .= "<td width=\"30\" align=\"center\">" . $destroyed->getQuantity() ."</td>";180 $html .= "<td class=kb-table-cell>".$item->getName()."</td>"; 181 $html .= "<td width=\"30\" align=\"center\">".$destroyed->getQuantity()."</td>"; 182 182 $html .= "</tr>"; 183 183 $imgid++; … … 192 192 $menubox = new MenuBox(); 193 193 $menubox->addCaption("View"); 194 $menubox->addOption("Killmail", "javascript:openWindow( '?a=kill_mail&kll_id=" . $kill->getID() ."', null, 355, 430, '' );");194 $menubox->addOption("Killmail", "javascript:openWindow( '?a=kill_mail&kll_id=".$kill->getID()."', null, 355, 430, '' );"); 195 195 if ($kill->relatedKillCount() > 1 || $kill->relatedLossCount() > 1) 196 196 { 197 $menubox->addOption("Related kills (" . $kill->relatedKillCount() . "/" . $kill->relatedLossCount() . ")", "?a=kill_related&kll_id=" .$kill->getID());197 $menubox->addOption("Related kills (".$kill->relatedKillCount()."/".$kill->relatedLossCount().")", "?a=kill_related&kll_id=".$kill->getID()); 198 198 } 199 199 if ($page->isAdmin()) … … 208 208 $scorebox = new Box("Points awarded"); 209 209 $scorebox->setHeight(64); 210 $scorebox->setContent("<div class=kill-points>" . $kill->getKillPoints() ."</div>");210 $scorebox->setContent("<div class=kill-points>".$kill->getKillPoints()."</div>"); 211 211 $page->addContext($scorebox->generate()); 212 212 } 213 213 214 214 $mapbox = new Box("Map"); 215 $maphtml = "<img src=\"?a=mapview&sys_id=" . $system->getID() ."&mode=map&size=145\" border=0><br>";216 $maphtml .= "<img src=\"?a=mapview&sys_id=" . $system->getID() ."&mode=region&size=145\" border=0><br>";217 $maphtml .= "<img src=\"?a=mapview&sys_id=" . $system->getID() ."&mode=cons&size=145\" border=0>";215 $maphtml = "<img src=\"?a=mapview&sys_id=".$system->getID()."&mode=map&size=145\" border=0><br>"; 216 $maphtml .= "<img src=\"?a=mapview&sys_id=".$system->getID()."&mode=region&size=145\" border=0><br>"; 217 $maphtml .= "<img src=\"?a=mapview&sys_id=".$system->getID()."&mode=cons&size=145\" border=0>"; 218 218 $mapbox->setContent($maphtml); 219 219 $page->addContext($mapbox->generate()); -
dev/common/login.php
r31 r92 5 5 $page = new Page("Login"); 6 6 7 if ( $_POST['password'])7 if (trim($_POST['password'])) 8 8 { 9 9 if ($_POST['password'] == ADMIN_PASSWORD || $_POST['password'] == SUPERADMIN_PASSWORD) -
dev/common/pilot_detail.php
r39 r92 156 156 { 157 157 $menubox->addCaption("Signature"); 158 $menubox->addOption("Link", "?a=sig &i=" . $pilot->getID());158 $menubox->addOption("Link", "?a=sig_list&i=" . $pilot->getID()); 159 159 } 160 160 $page->addContext($menubox->generate()); -
dev/common/post.php
r59 r92 41 41 if ($killid == 0) 42 42 { 43 $html = "Killmail is malformed."; 43 $html = "Killmail is malformed.<br/>"; 44 if ($errors = $parser->getError()) 45 { 46 foreach ($errors as $error) 47 { 48 $html .= 'Error: '.$error[0]; 49 if ($error[1]) 50 { 51 $html .= ' The text lead to this error was: "'.$error[1].'"'; 52 } 53 $html .= '<br/>'; 54 } 55 } 44 56 } 45 57 elseif ($killid == -1) -
dev/common/search.php
r16 r92 23 23 $sql = "select plt.plt_id, plt.plt_name, crp.crp_name 24 24 from kb3_pilots plt, kb3_corps crp 25 where lower( plt.plt_name ) like lower( '%" . slashfix($_REQUEST['searchphrase']) ."%' )25 where lower( plt.plt_name ) like lower( '%".slashfix($_REQUEST['searchphrase'])."%' ) 26 26 and plt.plt_crp_id = crp.crp_id 27 27 order by plt.plt_name"; … … 31 31 $sql = "select crp.crp_id, crp.crp_name, ali.all_name 32 32 from kb3_corps crp, kb3_alliances ali 33 where lower( crp.crp_name ) like lower( '%" . slashfix($_REQUEST['searchphrase']) ."%' )33 where lower( crp.crp_name ) like lower( '%".slashfix($_REQUEST['searchphrase'])."%' ) 34 34 and crp.crp_all_id = ali.all_id 35 35 order by crp.crp_name"; … … 39 39 $sql = "select ali.all_id, ali.all_name 40 40 from kb3_alliances ali 41 where lower( ali.all_name ) like lower( '%" . slashfix($_REQUEST['searchphrase']) ."%' )41 where lower( ali.all_name ) like lower( '%".slashfix($_REQUEST['searchphrase'])."%' ) 42 42 order by ali.all_name"; 43 43 $header = "<td>Alliance</td><td></td>"; … … 69 69 { 70 70 case "pilot": 71 $html .= "<td><a href=\"?a=pilot_detail&plt_id=" . $row['plt_id'] . "\">" . $row['plt_name'] . "</a></td><td>" . $row['crp_name'] . "</td>"; 71 $link = "?a=pilot_detail&plt_id=".$row['plt_id']; 72 $html .= "<td><a href=\"$link\">".$row['plt_name']."</a></td><td>".$row['crp_name']."</td>"; 72 73 break; 73 74 case "corp": 74 $html .= "<td><a href=\"?a=corp_detail&crp_id=" . $row['crp_id'] . "\">" . $row['crp_name'] . "</a></td><td>" . $row['all_name'] . "</td>"; 75 $link = "?a=corp_detail&crp_id=".$row['crp_id']; 76 $html .= "<td><a href=\"$link\">".$row['crp_name']."</a></td><td>".$row['all_name']."</td>"; 75 77 break; 76 78 case "alliance": 77 $html .= "<td><a href=\"?a=alliance_detail&all_id=" . $row['all_id'] . "\">" . $row['all_name'] . "</a></td><td></td>"; 79 $link = "?a=alliance_detail&all_id=".$row['all_id']; 80 $html .= "<td><a href=\"$link\">".$row['all_name']."</a></td><td></td>"; 78 81 break; 79 82 } 80 83 $html .= "</tr>"; 84 if ($qry->recordCount() == 1) 85 { 86 // if there is only one entry we redirect the user directly 87 header("Location: $link"); 88 } 81 89 } 82 90 if ($qry->recordCount() > 0)