root/dev/common/includes/autoupgrade.php @ 233

Revision 233, 24.8 KB (checked in by ralle030583, 15 years ago)

- changed summarytable format to 5 rows each cause of cap. industrial
- bugfix in autoupgrade of navigation table (Kills were linked to Home :-/)
- added chk_cap_industrial to autoupgrade
- added Capital Industrial to sql install files

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