Changeset 282

Show
Ignore:
Timestamp:
12/11/07 19:28:13 (13 years ago)
Author:
exi
Message:

Removed autoupgrade code, all databases should be up to date.
Fixed 2 parser bugs with trinity mails.
Added event call after all mods have been loaded.
Added an option to include the dropped item value to total loss.

Location:
dev/common
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • dev/common/admin/option_db.php

    r233 r282  
    88    function checkDatabase() 
    99    { 
    10         require_once('common/includes/autoupgrade.php'); 
    11  
    12         // todo: write functions to take care of this 
    13         // based on a database description file 
    14         check_cap_industrial(); 
    15         check_pilots(); 
    16         check_invdetail(); 
    17         check_contracts(); 
    18         check_index(); 
    19         check_tblstrct1(); 
    20         check_tblstrct2(); 
    21         check_tblstrct3(); 
    22         check_tblstrct4(); 
    23         check_tblstrct5(); 
    24         chk_kb3_items(); 
    25         chk_kb3_items2(); 
    26         check_tblstrct6(); 
    27                 check_navigationtable(); 
    28         return 'Maintenance complete.<br/>'; 
     10        // nothing to do currently 
    2911    } 
    3012 
     
    4527            } 
    4628        } 
    47                  
     29 
    4830        // GB 
    4931        if (($size / 1073741824) > 1){ 
    5032                return round($size/1073741824, 4).' GB <input type="checkbox" name="option[sql_clearcache]">Clear cache ?'; 
    51         // MB    
     33        // MB 
    5234        }elseif (($size / 1048576) > 1){ 
    5335                return round($size/1048576, 4).' MB <input type="checkbox" name="option[sql_clearcache]">Clear cache ?'; 
    5436                // KB 
    55         }else{  
     37        }else{ 
    5638                return round($size/1024, 2).' KB <input type="checkbox" name="option[sql_clearcache]">Clear cache ?'; 
    5739        } 
  • dev/common/admin/option_generic.php

    r281 r282  
    3838options::fadd('Display Alliance Logos on killlists', 'killlist_alogo', 'checkbox'); 
    3939 
    40 options::cat('Appearance', 'Generic', 'Public-Mode v0.2 (Provided by eve-kill.net, the TRUE public KB... *jokeing*)'); 
     40options::cat('Appearance', 'Generic', 'Killdetail'); 
     41options::fadd('Include dropped value into total loss', 'kd_droptototal', 'checkbox'); 
     42 
     43options::cat('Appearance', 'Generic', 'Public-Mode v0.2'); 
    4144options::fadd('Only Kills in SummaryTables', 'public_summarytable', 'checkbox','','','CORP_ID and ALLIANCE_ID in config has to be 0 to work "public"'); 
    4245options::fadd('Remove Losses Page', 'public_losses', 'checkbox'); 
  • dev/common/includes/autoupgrade.php

    r237 r282  
    11<?php 
    2 require_once("db.php"); 
    3 function check_commenttable() 
    4 { 
    5     $qry = new DBQuery(); 
    6     $query = 'select count(*) from kb3_comments'; 
    7     $result = $qry->execute($query); 
    8     if ($result) 
    9     { 
    10         check_commenttablerow(); 
    11         return; 
    12     } 
    13     $query = 'CREATE TABLE `kb3_comments` ( 
    14         `ID` INT NOT NULL AUTO_INCREMENT , 
    15         `kll_id` INT NOT NULL , 
    16         `comment` TEXT NOT NULL , 
    17         `name` TINYTEXT NOT NULL , 
    18         `posttime` TIMESTAMP DEFAULT \'0000-00-00 00:00:00\' NOT NULL, 
    19         PRIMARY KEY ( `ID` ) 
    20         ) TYPE = MYISAM'; 
    21     $qry->execute($query); 
    22 } 
    232 
    24 function check_cap_industrial() 
    25 { 
    26     $qry = new DBQuery(); 
    27     $query = 'select count(*) as cnt from kb3_ship_classes where scl_class="Cap. Industrial";'; 
    28     $result = $qry->execute($query); 
    29         if ($result['cnt'] == 1) 
    30     { 
    31         return; 
    32     } 
    33     $queries =  "INSERT IGNORE INTO kb3_ship_classes(scl_id,scl_class,scl_value,scl_points)     values ('','Cap. Industrial','1850000000','5000'); 
    34                                  INSERT IGNORE INTO kb3_ships(shp_id,shp_name,shp_class,shp_externalid,shp_rce_id,shp_baseprice,shp_techlevel) values ('','Rorqual','','28352','0','1850000000','1'); 
    35                                  UPDATE kb3_ships set kb3_ships.shp_class=(select scl_id from kb3_ship_classes where scl_class='Cap. Industrial') where kb3_ships.shp_name='Rorqual'; 
    36                                  INSERT IGNORE INTO kb3_ships_values(shp_id,shp_value) values ((select kb3_ships.shp_id from kb3_ships where kb3_ships.shp_name='Rorqual'),'1850000000');"; 
    37         $query = explode("\n", $queries); 
    38         foreach ($query as $querystring) 
    39         { 
    40                 if ($string = trim(str_replace(');', ')', $querystring))) 
    41                 { 
    42                     $qry->execute($string); 
    43                 } 
    44         } 
    45 } 
    46  
    47 function check_navigationtable(){ 
    48         if (CORP_ID) 
    49         { 
    50             $statlink = '?a=corp_detail&crp_id='.CORP_ID; 
    51         } 
    52         elseif (ALLIANCE_ID) 
    53         { 
    54             $statlink = '?a=alliance_detail&all_id='.ALLIANCE_ID; 
    55         } 
    56         $qry = new DBQuery(); 
    57         $query = 'select count(*) from kb3_navigation'; 
    58         $result = mysql_query($query); 
    59         if ($result) 
    60         { 
    61                 $query = "select hidden from kb3_navigation limit 1";            
    62                 $result = @mysql_query($query); 
    63                 if (!$result) 
    64                 { 
    65                          $qry->execute("ALTER TABLE `kb3_navigation` ADD `hidden` BOOL NOT NULL DEFAULT '0' AFTER `page` ;"); 
    66                 } 
    67                 $query = "select count(KBSITE) from kb3_navigation WHERE KBSITE = '".KB_SITE."'"; 
    68                 $result = @mysql_query($query); 
    69                 if ($result) 
    70                 { 
    71                         $row = mysql_fetch_row($result); 
    72                         if ($row[0] == 0) 
    73                         { 
    74                                 $queries = "INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr`,`page` ,`hidden`,`KBSITE`) VALUES ('top',1,'Home','?a=home','_self',1,'ALL_PAGES',0,'".KB_SITE."'); 
    75                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Campaigns','?a=campaigns','_self',2,'ALL_PAGES',0,'".KB_SITE."'); 
    76                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Contracts','?a=contracts','_self',3,'ALL_PAGES',0,'".KB_SITE."'); 
    77                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Kills','?a=kills','_self',4,'ALL_PAGES',0,'".KB_SITE."'); 
    78                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Losses','?a=losses','_self',5,'ALL_PAGES',0,'".KB_SITE."'); 
    79                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Post Mail','?a=post','_self',6,'ALL_PAGES',0,'".KB_SITE."'); 
    80                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Stats','$statlink','_self',7,'ALL_PAGES',0,'".KB_SITE."'); 
    81                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Awards','?a=awards','_self',8,'ALL_PAGES',0,'".KB_SITE."'); 
    82                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Standings','?a=standings','_self',9,'ALL_PAGES',0,'".KB_SITE."'); 
    83                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Search','?a=search','_self',10,'ALL_PAGES',0,'".KB_SITE."'); 
    84                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'Admin','?a=admin','_self',11,'ALL_PAGES',0,'".KB_SITE."'); 
    85                                                         INSERT IGNORE INTO `kb3_navigation` (`nav_type`,`intern`,`descr` ,`url` ,`target`,`posnr` ,`page`,`hidden`,`KBSITE`) VALUES ('top',1,'About','?a=about','_self',12,'ALL_PAGES',0,'".KB_SITE."');"; 
    86                                 $query = explode("\n", $queries); 
    87                                 foreach ($query as $querystring) 
    88                                 { 
    89                                         if ($string = trim(str_replace(');', ')', $querystring))) 
    90                                         { 
    91                                             $qry->execute($string); 
    92                                         } 
    93                                 } 
    94                         } 
    95                         return; 
    96                 } 
    97                 $query = 'ALTER TABLE `kb3_navigation` ADD `KBSITE` VARCHAR( 16 ) NOT NULL'; 
    98         $qry->execute($query); 
    99                 $query = 'UPDATE `kb3_navigation` SET KBSITE = "'.KB_SITE.'" WHERE KBSITE LIKE "";'; 
    100         $qry->execute($query); 
    101                 return; 
    102         }else{ 
    103                 $query = 'CREATE TABLE `kb3_navigation` ( 
    104                 `ID` INT NOT NULL AUTO_INCREMENT , 
    105                 `nav_type` TINYTEXT NOT NULL, 
    106                 `intern` INT ( 1 ) NOT NULL,  
    107                 `descr` TINYTEXT NOT NULL , 
    108                 `url` TINYTEXT NOT NULL , 
    109                 `target` VARCHAR( 10 )  NOT NULL, 
    110                 `posnr` INT NOT NULL, 
    111                 `page` TINYTEXT NOT NULL, 
    112                 `hidden` BOOL NOT NULL DEFAULT "0", 
    113                 `KBSITE` VARCHAR ( 16 ) NOT NULL, 
    114                 PRIMARY KEY ( `ID` ) 
    115                 ) TYPE = MYISAM;'; 
    116                    $qry->execute($query); 
    117                 $queries = "INSERT IGNORE INTO `kb3_navigation` VALUES (1,'top',1,'Home','?a=home','_self',1,'ALL_PAGES',0,'".KB_SITE."'); 
    118                         INSERT IGNORE INTO `kb3_navigation` VALUES (2,'top',1,'Campaigns','?a=campaigns','_self',2,'ALL_PAGES',0,'".KB_SITE."'); 
    119                         INSERT IGNORE INTO `kb3_navigation` VALUES (3,'top',1,'Contracts','?a=contracts','_self',3,'ALL_PAGES',0,'".KB_SITE."'); 
    120                         INSERT IGNORE INTO `kb3_navigation` VALUES (4,'top',1,'Kills','?a=kills','_self',4,'ALL_PAGES',0,'".KB_SITE."'); 
    121                         INSERT IGNORE INTO `kb3_navigation` VALUES (5,'top',1,'Losses','?a=losses','_self',5,'ALL_PAGES',0,'".KB_SITE."'); 
    122                         INSERT IGNORE INTO `kb3_navigation` VALUES (6,'top',1,'Post Mail','?a=post','_self',6,'ALL_PAGES',0,'".KB_SITE."'); 
    123                         INSERT IGNORE INTO `kb3_navigation` VALUES (7,'top',1,'Stats','$statlink','_self',7,'ALL_PAGES',0,'".KB_SITE."'); 
    124                         INSERT IGNORE INTO `kb3_navigation` VALUES (8,'top',1,'Awards','?a=awards','_self',8,'ALL_PAGES',0,'".KB_SITE."'); 
    125                         INSERT IGNORE INTO `kb3_navigation` VALUES (9,'top',1,'Standings','?a=standings','_self',9,'ALL_PAGES',0,'".KB_SITE."'); 
    126                         INSERT IGNORE INTO `kb3_navigation` VALUES (10,'top',1,'Search','?a=search','_self',10,'ALL_PAGES',0,'".KB_SITE."'); 
    127                         INSERT IGNORE INTO `kb3_navigation` VALUES (11,'top',1,'Admin','?a=admin','_self',11,'ALL_PAGES',0,'".KB_SITE."'); 
    128                         INSERT IGNORE INTO `kb3_navigation` VALUES (12,'top',1,'About','?a=about','_self',12,'ALL_PAGES',0,'".KB_SITE."');"; 
    129                 $query = explode("\n", $queries); 
    130                 foreach ($query as $querystring) 
    131                 { 
    132                         if ($string = trim(str_replace(');', ')', $querystring))) 
    133                         { 
    134                             $qry->execute($string); 
    135                         } 
    136                 } 
    137         } 
    138 }        
    139  
    140 function check_commenttablerow() 
    141 { 
    142     $qry = new DBQuery(); 
    143     $query = 'select posttime from kb3_comments limit 1'; 
    144     $result = mysql_query($query); 
    145     if ($result) 
    146     { 
    147         $query = 'ALTER TABLE `kb3_comments` CHANGE `ID` `id` INT( 11 ) NOT NULL AUTO_INCREMENT'; 
    148         $qry->execute($query); 
    149         return; 
    150     } 
    151     $query = 'ALTER TABLE `kb3_comments` ADD `posttime` TIMESTAMP DEFAULT \'0000-00-00 00:00:00\' NOT NULL'; 
    152     $qry->execute($query); 
    153 } 
    154  
    155 function check_shipvaltable() 
    156 { 
    157     $qry = new DBQuery(); 
    158     $query = 'select count(*) from kb3_ships_values'; 
    159     $result = mysql_query($query); 
    160     if ($result) 
    161     { 
    162         return; 
    163     } 
    164     $query = 'CREATE TABLE `kb3_ships_values` ( 
    165 `shp_id` INT( 11 ) NOT NULL , 
    166 `shp_value` BIGINT( 4 ) NOT NULL , 
    167 PRIMARY KEY ( `shp_id` ) 
    168 ) TYPE = MYISAM ;'; 
    169     $qry->execute($query); 
    170     $qry->execute('UPDATE kb3_ships set shp_class = 8 WHERE shp_id=257 limit 1'); 
    171     $qry->execute('UPDATE kb3_ships set shp_class = 8 WHERE shp_id=252 limit 1'); 
    172     $qry->execute('UPDATE kb3_ships set shp_class = 4 WHERE shp_id=266 limit 1'); 
    173     $qry->execute('UPDATE kb3_ships set shp_class = 4 WHERE shp_id=275 limit 1'); 
    174     $qry->execute('UPDATE kb3_ships set shp_class = 4 WHERE shp_id=272 limit 1'); 
    175     $qry->execute('UPDATE kb3_ships set shp_class = 4 WHERE shp_id=246 limit 1'); 
    176     $qry->execute('UPDATE kb3_ships set shp_class = 4 WHERE shp_id=249 limit 1'); 
    177     $qry->execute('UPDATE kb3_ships set shp_techlevel = 2 where shp_class = 22'); 
    178 } 
    179  
    180 function check_invdetail() 
    181 { 
    182     $qry = new DBQuery(); 
    183     $query = 'select ind_sec_status from kb3_inv_detail limit 1'; 
    184     $qry->execute($query); 
    185     $len = mysql_field_len($qry->resid_,0); 
    186     if ($len == 4) 
    187     { 
    188         $query = 'ALTER TABLE `kb3_inv_detail` CHANGE `ind_sec_status` `ind_sec_status` VARCHAR(5)'; 
    189         $qry->execute($query); 
    190     } 
    191 } 
    192  
    193 function check_pilots() 
    194 { 
    195     $qry = new DBQuery(); 
    196     $query = 'select plt_name from kb3_pilots limit 1'; 
    197     $qry->execute($query); 
    198     $len = mysql_field_len($qry->resid_,0); 
    199     if ($len == 32) 
    200     { 
    201         $query = 'ALTER TABLE `kb3_pilots` CHANGE `plt_name` `plt_name` VARCHAR(64) NOT NULL'; 
    202         $qry->execute($query); 
    203     } 
    204 } 
    205  
    206 function check_contracts() 
    207 { 
    208     $qry = new DBQuery(); 
    209     $query = 'select ctd_sys_id from kb3_contract_details limit 1'; 
    210     $result = mysql_query($query); 
    211     if ($result) 
    212     { 
    213         return; 
    214     } 
    215     $qry->execute('ALTER TABLE `kb3_contract_details` ADD `ctd_sys_id` INT(11) NOT NULL DEFAULT \'0\''); 
    216  
    217     $qry->execute('SHOW columns from `kb3_contract_details` like \'ctd_ctr_id\''); 
    218     $arr = $qry->getRow(); 
    219     if ($arr['Key'] == 'PRI') 
    220     { 
    221         return; 
    222     } 
    223     $qry->execute('ALTER TABLE `kb3_contract_details` ADD INDEX (`ctd_ctr_id`) '); 
    224 } 
    225 function check_index() 
    226 { 
    227     check_index_invcrp(); 
    228     check_index_invall(); 
    229     $qry = new DBQuery(); 
    230     $qry->execute('SHOW columns from kb3_item_types like \'itt_id\''); 
    231     $arr = $qry->getRow(); 
    232     if ($arr['Key'] == 'PRI') 
    233     { 
    234         return; 
    235     } 
    236     $qry->execute('ALTER TABLE `kb3_item_types` ADD PRIMARY KEY ( `itt_id` ) '); 
    237 } 
    238 function check_index_invcrp() 
    239 { 
    240     $qry = new DBQuery(); 
    241     $qry->execute('SHOW columns from kb3_inv_crp like \'inc_kll_id\''); 
    242     $arr = $qry->getRow(); 
    243     if ($arr['Key'] == 'MUL') 
    244     { 
    245         return; 
    246     } 
    247     $qry->execute('ALTER TABLE `kb3_inv_crp` ADD INDEX ( `inc_kll_id` ) '); 
    248 } 
    249 function check_index_invall() 
    250 { 
    251     $qry = new DBQuery(); 
    252     $qry->execute('SHOW columns from kb3_inv_all like \'ina_kll_id\''); 
    253     $arr = $qry->getRow(); 
    254     if ($arr['Key'] == 'MUL') 
    255     { 
    256         return; 
    257     } 
    258     $qry->execute('ALTER TABLE `kb3_inv_all` ADD INDEX ( `ina_kll_id` ) '); 
    259 } 
    260 function check_tblstrct1() 
    261 { 
    262     $qry = new DBQuery(); 
    263     $query = 'select shp_description from kb3_ships limit 1'; 
    264     $result = mysql_query($query); 
    265     if (!$result) 
    266     { 
    267         return; 
    268     } 
    269     $query = 'ALTER TABLE `kb3_ships` DROP `shp_description`'; 
    270     $qry->execute($query); 
    271 } 
    272 function check_tblstrct2() 
    273 { 
    274     $qry = new DBQuery(); 
    275     $query = 'select itm_description from kb3_items limit 1'; 
    276     $result = mysql_query($query); 
    277     if (!$result) 
    278     { 
    279         return; 
    280     } 
    281     $query = 'ALTER TABLE `kb3_items` DROP `itm_description`'; 
    282     $qry->execute($query); 
    283 } 
    284 function check_tblstrct3() 
    285 { 
    286     $qry = new DBQuery(); 
    287     $query = 'select Value from kb3_items limit 1'; 
    288     $result = mysql_query($query); 
    289     if ($result) 
    290     { 
    291         $query = 'ALTER TABLE `kb3_items` CHANGE `Value` `itm_value` INT( 11 ) NOT NULL DEFAULT \'0\''; 
    292         $qry->execute($query); 
    293     } 
    294 } 
    295 function check_tblstrct4() 
    296 { 
    297     $qry = new DBQuery(); 
    298     $query = 'select itm_value from kb3_items limit 1'; 
    299     $result = mysql_query($query); 
    300     if ($result) 
    301     { 
    302         return; 
    303     } 
    304     $query = 'ALTER TABLE `kb3_items` ADD `itm_value` INT( 11 ) NOT NULL DEFAULT \'0\''; 
    305     $qry->execute($query); 
    306     $qry->execute('ALTER TABLE `kb3_items` CHANGE `itm_externalid` `itm_externalid` INT( 11 ) NOT NULL DEFAULT \'0\''); 
    307 } 
    308  
    309 function check_tblstrct5() 
    310 { 
    311     $qry = new DBQuery(); 
    312     $query = 'select count(*) from kb3_standings'; 
    313     $result = mysql_query($query); 
    314     if ($result) 
    315     { 
    316         $query = 'select count(*) from kb3_standings where sta_from=1 and sta_to=1 and sta_from_type=\'a\' and 
    317                   sta_to_type=\'c\''; 
    318         $result = mysql_query($query); 
    319         if ($result) 
    320         { 
    321             return; 
    322         } 
    323         $qry->execute('drop table kb3_standings'); 
    324     } 
    325 $query = 'CREATE TABLE `kb3_standings` ( 
    326   `sta_from` int(11) NOT NULL default \'0\', 
    327   `sta_to` int(11) NOT NULL default \'0\', 
    328   `sta_from_type` enum(\'a\',\'c\') NOT NULL default \'a\', 
    329   `sta_to_type` enum(\'a\',\'c\') NOT NULL default \'a\', 
    330   `sta_value` float NOT NULL default \'0\', 
    331   `sta_comment` varchar(200) NOT NULL, 
    332   KEY `sta_from` (`sta_from`) 
    333 ) TYPE=MyISAM;'; 
    334     $qry->execute($query); 
    335 } 
    336  
    337 function chk_kb3_items() 
    338 { 
    339     $qry = new DBQuery(); 
    340     $query = 'select count(*) from kb3_item_types where itt_id = 787'; 
    341     $result = mysql_query($query); 
    342     $result = mysql_fetch_array($result); 
    343     if ($result['cnt'] == 1) 
    344     { 
    345         return; 
    346     } 
    347     $queries = " 
    348         INSERT IGNORE INTO `kb3_item_types` VALUES (737, 'Gas Cloud Harvester',1); 
    349         INSERT IGNORE INTO `kb3_item_types` VALUES (762, 'Inertia Stabilizer',3); 
    350         INSERT IGNORE INTO `kb3_item_types` VALUES (763, 'Nanofiber Internal Structure',3); 
    351         INSERT IGNORE INTO `kb3_item_types` VALUES (764, 'Overdrive Injector System',3); 
    352         INSERT IGNORE INTO `kb3_item_types` VALUES (765, 'Expanded Cargohold',3); 
    353         INSERT IGNORE INTO `kb3_item_types` VALUES (766, 'Power Diagnostic System',3); 
    354         INSERT IGNORE INTO `kb3_item_types` VALUES (767, 'Capacitor Power Relay',3); 
    355         INSERT IGNORE INTO `kb3_item_types` VALUES (768, 'Capacitor Flux Coil',3); 
    356         INSERT IGNORE INTO `kb3_item_types` VALUES (769, 'Reactor Control Unit',3); 
    357         INSERT IGNORE INTO `kb3_item_types` VALUES (770, 'Shield Flux Coil',3); 
    358         INSERT IGNORE INTO `kb3_item_types` VALUES (771, 'Missile Launcher Heavy Assault',1); 
    359         INSERT IGNORE INTO `kb3_item_types` VALUES (738, 'Cyber Armor', 0); 
    360         INSERT IGNORE INTO `kb3_item_types` VALUES (740, 'Cyber Electronics', 0); 
    361         INSERT IGNORE INTO `kb3_item_types` VALUES (741, 'Cyber Engineering', 0); 
    362         INSERT IGNORE INTO `kb3_item_types` VALUES (742, 'Cyber Gunnery', 0); 
    363         INSERT IGNORE INTO `kb3_item_types` VALUES (743, 'Cyber Industry', 0); 
    364         INSERT IGNORE INTO `kb3_item_types` VALUES (744, 'Cyber Leadership', 0); 
    365         INSERT IGNORE INTO `kb3_item_types` VALUES (745, 'Cyber Learning', 0); 
    366         INSERT IGNORE INTO `kb3_item_types` VALUES (746, 'Cyber Missile', 0); 
    367         INSERT IGNORE INTO `kb3_item_types` VALUES (747, 'Cyber Navigation', 0); 
    368         INSERT IGNORE INTO `kb3_item_types` VALUES (748, 'Cyber Science', 0); 
    369         INSERT IGNORE INTO `kb3_item_types` VALUES (749, 'Cyber Shields', 0); 
    370         INSERT IGNORE INTO `kb3_item_types` VALUES (772, 'Assault Missile', 0); 
    371         INSERT IGNORE INTO `kb3_item_types` VALUES (773, 'Rig Armor', 5); 
    372         INSERT IGNORE INTO `kb3_item_types` VALUES (774, 'Rig Shield', 5); 
    373         INSERT IGNORE INTO `kb3_item_types` VALUES (775, 'Rig Energy Weapon', 5); 
    374         INSERT IGNORE INTO `kb3_item_types` VALUES (776, 'Rig Hybrid Weapon', 5); 
    375         INSERT IGNORE INTO `kb3_item_types` VALUES (777, 'Rig Projectile Weapon', 5); 
    376         INSERT IGNORE INTO `kb3_item_types` VALUES (778, 'Rig Drones', 5); 
    377         INSERT IGNORE INTO `kb3_item_types` VALUES (779, 'Rig Launcher', 5); 
    378         INSERT IGNORE INTO `kb3_item_types` VALUES (780, 'Rig Electronics', 5); 
    379         INSERT IGNORE INTO `kb3_item_types` VALUES (781, 'Rig Energy Grid', 5); 
    380         INSERT IGNORE INTO `kb3_item_types` VALUES (782, 'Rig Astronautic', 5); 
    381         INSERT IGNORE INTO `kb3_item_types` VALUES (783, 'Cyber X Specials', 0); 
    382         INSERT IGNORE INTO `kb3_item_types` VALUES (785, 'Script', 0); 
    383         INSERT IGNORE INTO `kb3_item_types` VALUES (786, 'Rig Electronics Superiority', 5); 
    384         INSERT IGNORE INTO `kb3_item_types` VALUES (722, 'Advanced Hybrid Ammo Blueprint', 0); 
    385         INSERT IGNORE INTO `kb3_item_types` VALUES (723, 'Tractor Beam Blueprint', 0); 
    386         INSERT IGNORE INTO `kb3_item_types` VALUES (724, 'Implant Blueprints', 0); 
    387         INSERT IGNORE INTO `kb3_item_types` VALUES (725, 'Advanced Projectile Ammo Blueprint', 0); 
    388         INSERT IGNORE INTO `kb3_item_types` VALUES (726, 'Advanced Frequency Crystal Blueprint', 0); 
    389         INSERT IGNORE INTO `kb3_item_types` VALUES (727, 'Mining Crystal Blueprint', 0); 
    390         INSERT IGNORE INTO `kb3_item_types` VALUES (728, 'Decryptors - Amarr', 0); 
    391         INSERT IGNORE INTO `kb3_item_types` VALUES (729, 'Decryptors - Minmatar', 0); 
    392         INSERT IGNORE INTO `kb3_item_types` VALUES (730, 'Decryptors - Gallente', 0); 
    393         INSERT IGNORE INTO `kb3_item_types` VALUES (731, 'Decryptors - Caldari', 0); 
    394         INSERT IGNORE INTO `kb3_item_types` VALUES (732, 'Decryptors - Sleepers', 0); 
    395         INSERT IGNORE INTO `kb3_item_types` VALUES (733, 'Decryptors - Yan Jung', 0); 
    396         INSERT IGNORE INTO `kb3_item_types` VALUES (734, 'Decryptors - Takmahl', 0); 
    397         INSERT IGNORE INTO `kb3_item_types` VALUES (735, 'Decryptors - Talocan', 0); 
    398         INSERT IGNORE INTO `kb3_item_types` VALUES (754, 'Salvaged Materials', 0); 
    399         INSERT IGNORE INTO `kb3_item_types` VALUES (784, 'Large Collidable Ship', 0); 
    400         INSERT IGNORE INTO `kb3_item_types` VALUES (787, 'Rig Blueprint', 0); 
    401         "; 
    402     $query = explode("\n", $queries); 
    403     foreach ($query as $querystring) 
    404     { 
    405         if ($string = trim(str_replace(');', ')', $querystring))) 
    406         { 
    407             $qry->execute($string); 
    408         } 
    409     } 
    410 } 
    411 function chk_kb3_items2() 
    412 { 
    413     $qry = new DBQuery(); 
    414     $query = 'select itm_externalid from kb3_items where itm_name = \'Repair Drone\''; 
    415     $result = mysql_query($query); 
    416     $result = mysql_fetch_array($result); 
    417     if ($result['itm_externalid'] == '9871') 
    418     { 
    419         return; 
    420     } 
    421     $queries = " 
    422             update kb3_items set itm_externalid='10246' where itm_name='Mining Drone I'; 
    423             update kb3_items set itm_externalid='10248' where itm_name='Mining Drone - Improved UNUSED'; 
    424             update kb3_items set itm_externalid='10250' where itm_name='Mining Drone II'; 
    425             update kb3_items set itm_externalid='1187' where itm_name='Mining Drone - Elite'; 
    426             update kb3_items set itm_externalid='1201' where itm_name='Proximity Drone'; 
    427             update kb3_items set itm_externalid='1202' where itm_name='Wasp I'; 
    428             update kb3_items set itm_externalid='15508' where itm_name='Civilian Mining Drone'; 
    429             update kb3_items set itm_externalid='15510' where itm_name='Vespa I'; 
    430             update kb3_items set itm_externalid='16206' where itm_name='Valkyrie I'; 
    431             update kb3_items set itm_externalid='17565' where itm_name='Hellhound I'; 
    432             update kb3_items set itm_externalid='21050' where itm_name='Unanchoring Drone'; 
    433             update kb3_items set itm_externalid='21638' where itm_name='Survey Drone'; 
    434             update kb3_items set itm_externalid='21640' where itm_name='Vespa II'; 
    435             update kb3_items set itm_externalid='2173' where itm_name='Valkyrie II'; 
    436             update kb3_items set itm_externalid='2175' where itm_name='Infiltrator I'; 
    437             update kb3_items set itm_externalid='2183' where itm_name='Infiltrator II'; 
    438             update kb3_items set itm_externalid='2185' where itm_name='Hammerhead I'; 
    439             update kb3_items set itm_externalid='2193' where itm_name='Hammerhead II'; 
    440             update kb3_items set itm_externalid='2195' where itm_name='Praetor I'; 
    441             update kb3_items set itm_externalid='2203' where itm_name='Praetor II'; 
    442             update kb3_items set itm_externalid='2205' where itm_name='Acolyte I'; 
    443             update kb3_items set itm_externalid='2205' where itm_name='Acolyte II'; 
    444             update kb3_items set itm_externalid='22572' where itm_name='Praetor EV-900'; 
    445             update kb3_items set itm_externalid='22574' where itm_name='Warp Scrambling Drone'; 
    446             update kb3_items set itm_externalid='22713' where itm_name='10mn webscramblifying Drone'; 
    447             update kb3_items set itm_externalid='22765' where itm_name='Heavy Shield Maintenance Bot I'; 
    448             update kb3_items set itm_externalid='22780' where itm_name='Fighter Uno'; 
    449             update kb3_items set itm_externalid='23055' where itm_name='Templar'; 
    450             update kb3_items set itm_externalid='23057' where itm_name='Dragonfly'; 
    451             update kb3_items set itm_externalid='23059' where itm_name='Firbolg'; 
    452             update kb3_items set itm_externalid='23061' where itm_name='Einherji'; 
    453             update kb3_items set itm_externalid='23473' where itm_name='Wasp EC-900'; 
    454             update kb3_items set itm_externalid='23506' where itm_name='Ogre SD-900'; 
    455             update kb3_items set itm_externalid='23510' where itm_name='Praetor TD-900'; 
    456             update kb3_items set itm_externalid='23512' where itm_name='Berserker TP-900'; 
    457             update kb3_items set itm_externalid='23523' where itm_name='Heavy Armor Maintenance Bot I'; 
    458             update kb3_items set itm_externalid='23525' where itm_name='Curator I'; 
    459             update kb3_items set itm_externalid='23559' where itm_name='Berserker SW-900'; 
    460             update kb3_items set itm_externalid='23559' where itm_name='Warden I'; 
    461             update kb3_items set itm_externalid='23561' where itm_name='Garde I'; 
    462             update kb3_items set itm_externalid='23563' where itm_name='Bouncer I'; 
    463             update kb3_items set itm_externalid='23659' where itm_name='Acolyte EV-300'; 
    464             update kb3_items set itm_externalid='23702' where itm_name='Infiltrator EV-600'; 
    465             update kb3_items set itm_externalid='23705' where itm_name='Vespa EC-600'; 
    466             update kb3_items set itm_externalid='23707' where itm_name='Hornet EC-300'; 
    467             update kb3_items set itm_externalid='23709' where itm_name='Medium Armor Maintenance Bot I'; 
    468             update kb3_items set itm_externalid='23711' where itm_name='Light Armor Maintenance Bot I'; 
    469             update kb3_items set itm_externalid='23713' where itm_name='Hammerhead SD-600'; 
    470             update kb3_items set itm_externalid='23715' where itm_name='Hobgoblin SD-300'; 
    471             update kb3_items set itm_externalid='23717' where itm_name='Medium Shield Maintenance Bot I'; 
    472             update kb3_items set itm_externalid='23719' where itm_name='Light Shield Maintenance Bot I'; 
    473             update kb3_items set itm_externalid='23721' where itm_name='Valkyrie TP-600'; 
    474             update kb3_items set itm_externalid='23723' where itm_name='Warrior TP-300'; 
    475             update kb3_items set itm_externalid='23725' where itm_name='Infiltrator TD-600'; 
    476             update kb3_items set itm_externalid='23727' where itm_name='Acolyte TD-300'; 
    477             update kb3_items set itm_externalid='23729' where itm_name='Valkyrie SW-600'; 
    478             update kb3_items set itm_externalid='23731' where itm_name='Warrior SW-300'; 
    479             update kb3_items set itm_externalid='23759' where itm_name='FA-14 Templar'; 
    480             update kb3_items set itm_externalid='2436' where itm_name='Wasp II'; 
    481             update kb3_items set itm_externalid='2444' where itm_name='Ogre I'; 
    482             update kb3_items set itm_externalid='2446' where itm_name='Ogre II'; 
    483             update kb3_items set itm_externalid='2454' where itm_name='Hobgoblin I'; 
    484             update kb3_items set itm_externalid='2456' where itm_name='Hobgoblin II'; 
    485             update kb3_items set itm_externalid='24618' where itm_name='horrible tracking drone'; 
    486             update kb3_items set itm_externalid='2464' where itm_name='Hornet I'; 
    487             update kb3_items set itm_externalid='2466' where itm_name='Hornet II'; 
    488             update kb3_items set itm_externalid='2476' where itm_name='Berserker I'; 
    489             update kb3_items set itm_externalid='2478' where itm_name='Berserker II'; 
    490             update kb3_items set itm_externalid='2486' where itm_name='Warrior I'; 
    491             update kb3_items set itm_externalid='2488' where itm_name='Warrior II'; 
    492             update kb3_items set itm_externalid='3218' where itm_name='Harvester Mining Drone'; 
    493             update kb3_items set itm_externalid='3549' where itm_name='Tutorial Attack Drone'; 
    494             update kb3_items set itm_externalid='9871' where itm_name='Repair Drone'; 
    495         "; 
    496     $query = explode("\n", $queries); 
    497     foreach ($query as $querystring) 
    498     { 
    499         if ($string = trim(str_replace(');', ')', $querystring))) 
    500         { 
    501             $qry->execute($string); 
    502         } 
    503     } 
    504 } 
    505 function check_tblstrct6() 
    506 { 
    507     $qry = new DBQuery(); 
    508     $query = 'select all_img from kb3_alliances limit 1'; 
    509     $result = mysql_query($query); 
    510     if (!$result) 
    511     { 
    512         return; 
    513     } 
    514     $query = 'ALTER TABLE `kb3_alliances` DROP `all_img`'; 
    515     $qry->execute($query); 
    516 } 
    5173?> 
  • dev/common/includes/class.navigation.php

    r237 r282  
    44 
    55class Navigation{ 
    6          
     6 
    77        function Navigation() 
    88        { 
    9                 require_once('common/includes/autoupgrade.php'); 
    10                 check_navigationtable(); 
    119        $this->sql_start = "SELECT * FROM kb3_navigation"; 
    1210        $this->sql_end = " AND KBSITE LIKE '" . KB_SITE . "' ORDER BY posnr"; 
    1311        $this->type_ = 'top'; 
    1412        } 
    15          
     13 
    1614        function execQuery() 
    1715        { 
     
    1917                $query = $this->sql_start; 
    2018                $query .= " WHERE nav_type LIKE '$this->type_'"; 
    21                  
     19 
    2220                if (killboard::hasContracts() == false){ 
    2321                        $query .= " AND url NOT LIKE '?a=contracts'"; 
     
    4240                $this->qry->execute($query); 
    4341        } 
    44          
     42 
    4543        function getRow(){ 
    4644                return $this->qry->getRow(); 
    4745        } 
    48          
     46 
    4947        function setNavType($type) 
    5048        { 
    5149                $this->type_ = $type; 
    5250        } 
    53          
     51 
    5452        function setSite($site){ 
    5553                $this->site_ = $site; 
    5654        } 
    57          
     55 
    5856        function generateMenu() 
    5957    { 
    6058        $this->site_ = $site; 
    6159        $this->execQuery(); 
    62          
     60 
    6361        $menu = new Menu(); 
    6462        while ($row = $this->getRow()) 
     
    6765                $url = $row['url'] .'" target="'.$row['target'].'"'; 
    6866                $menu->add($url , $row['descr']); 
    69         }    
     67        } 
    7068        return $menu; 
    7169    } 
    72      
     70 
    7371    function generateMenuBox() 
    7472    { 
    75         // TODO  
     73        // TODO 
    7674    } 
    7775} 
  • dev/common/includes/class.parser.php

    r277 r282  
    387387            if ($dmgtaken) 
    388388            { 
    389                 $endpos = strpos($this->killmail_, "Dropped items:") - $destroyedpos - 16; 
     389                $pos = strpos($this->killmail_, "Dropped items:"); 
     390                if ($pos === false) 
     391                { 
     392                    $pos = strlen($this->killmail_); 
     393                } 
     394                $endpos = $pos - $destroyedpos - 16; 
    390395            } 
    391396 
     
    404409            if ($startpos) 
    405410            { 
    406                 $endpos = strlen($this->killmail_) - $startpos + 16; 
    407  
    408                 $dropped = explode("\n", trim(substr($this->killmail_, $startpos + 16, $endpos))); 
     411                $endpos = strlen($this->killmail_) - $startpos + 14; 
     412 
     413                $dropped = explode("\n", trim(substr($this->killmail_, $startpos + 14, $endpos))); 
    409414                #var_dump($dropped); exit; 
    410415 
  • dev/common/index.php

    r254 r282  
    171171    } 
    172172} 
     173$none = ''; 
     174event::call('mods_initialised', $none); 
    173175if (!$settingsPage && !file_exists('common/'.$page.'.php') && !$modOverrides) 
    174176{ 
  • dev/common/kill_detail.php

    r254 r282  
    195195// Get Ship Value 
    196196$ShipValue = $ship->getPrice(); 
     197if (config::get('kd_droptototal')) 
     198{ 
     199    $TotalValue += $dropvalue; 
     200} 
    197201$TotalLoss = number_format($TotalValue + $ShipValue, 2); 
    198202$ShipValue = number_format($ShipValue, 2); 
    199203$dropvalue = number_format($dropvalue, 2); 
     204 
    200205 
    201206$smarty->assign_by_ref('destroyed', $dest_array);