Changeset 430
- Timestamp:
- 07/18/09 09:11:42 (13 years ago)
- Location:
- dev
- Files:
-
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/includes/class.contract.php
r370 r430 57 57 while ($carow = $caqry->getRow()) 58 58 { 59 $contracttarget = &new ContractTarget($this, $carow['ctd_crp_id'], $carow['ctd_all_id'], $carow['ctd_reg_id'], $carow['ctd_sys_id']);59 $contracttarget = new ContractTarget($this, $carow['ctd_crp_id'], $carow['ctd_all_id'], $carow['ctd_reg_id'], $carow['ctd_sys_id']); 60 60 array_push($this->contracttargets_, $contracttarget); 61 61 if ($carow['ctd_crp_id']) … … 262 262 $this->sys_id_ = $sys_id; 263 263 264 $this->klist_ = &new KillList();265 $this->llist_ = &new KillList();264 $this->klist_ = new KillList(); 265 $this->llist_ = new KillList(); 266 266 267 267 if ($this->crp_id_) -
dev/common/includes/class.corp.php
r379 r430 121 121 $qry->execute("select * from kb3_corps 122 122 where crp_name = '".slashfix($name)."'"); 123 123 // If the corp name is not present in the db add it. 124 124 if ($qry->recordCount() == 0) 125 125 { 126 if(intval($externalid)) $qry->execute("insert into kb3_corps ". 126 $externalid = intval($externalid); 127 // If no external id is given then look it up. 128 if(!$externalid) 129 { 130 $corpname = str_replace(" ", "%20", $name ); 131 require_once("common/includes/class.eveapi.php"); 132 $myID = new API_NametoID(); 133 $myID->setNames($corpname); 134 $myID->fetchXML(); 135 $myNames = $myID->getNameData(); 136 $externalid = $myNames[0]['characterID']; 137 } 138 // If we have an external id then check it isn't already in use 139 // If we find it then update the old corp with the new name and 140 // return. 141 if($externalid) 142 { 143 $qry->execute("SELECT * FROM kb3_corps WHERE crp_external_id = ".$externalid); 144 if ($qry->recordCount() > 0) 145 { 146 $row = $qry->getRow(); 147 $qry->execute("UPDATE kb3_corps SET crp_name = '".slashfix($name)."' WHERE crp_external_id = ".$externalid); 148 149 $this->id_ = $row['crp_id']; 150 $this->name_ = slashfix($name); 151 $this->externalid_ = $row['crp_external_id']; 152 $this->alliance_ = $row['crp_all_id']; 153 154 // Now check if the alliance needs to be updated. 155 if ($row['crp_all_id'] != $alliance->getID() && $this->isUpdatable($timestamp)) 156 { 157 $sql = 'update kb3_corps 158 set crp_all_id = '.$alliance->getID().', '; 159 $sql .= "crp_updated = date_format( '". 160 $timestamp."','%Y.%m.%d %H:%i:%s') ". 161 "where crp_id = ".$this->id_; 162 $qry->execute($sql); 163 $this->alliance_ = $alliance; 164 } 165 return $this->id_; 166 } 167 } 168 // Neither corp name or external id was found so add this corp as new 169 if($externalid) $qry->execute("insert into kb3_corps ". 127 170 "(crp_id, crp_name, crp_all_id, crp_external_id, crp_updated) ". 128 171 "values ( null, '".slashfix($name)."',".$alliance->getID(). 129 ", ". intval($externalid).", date_format('".$timestamp.172 ", ".$externalid.", date_format('".$timestamp. 130 173 "','%Y.%m.%d %H:%i:%s'))"); 131 174 else $qry->execute("insert into kb3_corps ". -
dev/common/includes/class.pilot.php
r419 r430 80 80 else return '?a=thumb&id='.$this->externalid_.'&size='.$size; 81 81 } 82 } 82 } 83 83 //! Fetch the pilot details from the database using the id given on construction. 84 84 function execQuery() … … 109 109 $this->corp_ = $row['plt_crp_id']; 110 110 $this->externalid_ = intval($row['plt_externalid']); 111 111 112 112 } 113 113 } … … 141 141 * \param $externalID CCP external id 142 142 */ 143 function add($name, $corp, $timestamp, $externalID = '0')143 function add($name, $corp, $timestamp, $externalID = 0) 144 144 { 145 145 $qry = new DBQuery(); … … 150 150 if ($qry->recordCount() == 0) 151 151 { 152 $externalid = intval($externalid); 153 // If no external id is given then look it up. 154 if(!$externalid) 155 { 156 $pilotname = str_replace(" ", "%20", $name ); 157 require_once("common/includes/class.eveapi.php"); 158 $myID = new API_NametoID(); 159 $myID->setNames($pilotname); 160 $myID->fetchXML(); 161 $myNames = $myID->getNameData(); 162 $externalid = $myNames[0]['characterID']; 163 } 164 // If we have an external id then check it isn't already in use. 165 // If we find it then update the old corp with the new name and 166 // return. 167 if($externalid) 168 { 169 $qry->execute("SELECT * FROM kb3_pilots WHERE plt_externalid = ".$externalid); 170 if ($qry->recordCount() > 0) 171 { 172 $row = $qry->getRow(); 173 $qry->execute("UPDATE kb3_pilots SET plt_name = '".slashfix($name)."' WHERE plt_externalid = ".$externalid); 174 175 $this->id_ = $row['plt_id']; 176 $this->name_ = slashfix($name); 177 $this->externalid_ = $row['plt_externalid']; 178 $this->corp_ = $row['plt_crp_id']; 179 180 // Now check if the corp needs to be updated. 181 if ($row['plt_crp_id'] != $corp->getID() && $this->isUpdatable($timestamp)) 182 { 183 $qry->execute("update kb3_pilots 184 set plt_crp_id = ".$corp->getID().", 185 plt_updated = date_format( '".$timestamp."', '%Y.%m.%d %H:%i:%s') where plt_id = ".$this->id_); 186 } 187 return $this->id_; 188 } 189 } 152 190 $qry->execute("insert into kb3_pilots (plt_id, plt_name, plt_crp_id, plt_externalid, plt_updated) values ( null, 153 191 '".slashfix($name)."', -
dev/common/includes/globals.php
r429 r430 7 7 else 8 8 { 9 $svn_rev = '4 29';9 $svn_rev = '430'; 10 10 } 11 11 define('SVN_REV', $svn_rev); -
dev/common/kill_related.php
r428 r430 12 12 } 13 13 $kill = new Kill($kll_id); 14 echo $kill->getID();15 14 if($kill->isClassified()) 16 15 { -
dev/cron/cron_fetcher.php
r408 r430 16 16 //echo "Edit the \$KB_HOME and remove this line and the next\n"; 17 17 //die(); 18 $KB_HOME = ereg_replace('[/\\]cron$', '', getcwd());18 $KB_HOME = preg_replace('/[\/\\\\]cron$/', '', getcwd()); 19 19 chdir($KB_HOME); 20 20