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

Revision 235, 24.9 KB (checked in by ralle030583, 15 years ago)

buxfix in autoupgrade.php

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