Changeset 413
- Timestamp:
- 07/09/09 20:10:26 (14 years ago)
- Location:
- dev
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/includes/globals.php
r411 r413 7 7 else 8 8 { 9 $svn_rev = '41 1';9 $svn_rev = '413'; 10 10 } 11 11 define('SVN_REV', $svn_rev); -
dev/upgrade.php
r412 r413 13 13 $config = new Config(KB_SITE); 14 14 session::init(); 15 $url= $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];15 $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; 16 16 if($_SERVER['QUERY_STRING'] != "") $url .= '?'.$_SERVER['QUERY_STRING']; 17 17 18 $header = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 19 <html> 20 <head> 21 <meta http-equiv="refresh" content="5;url='.$url.'" > 22 <meta http-equiv="content-type" content="text/html; charset=UTF8"> 23 <title>EVE Development Network Killboard Upgrade Script</title> 24 <link rel="stylesheet" type="text/css" href="install/common.css"> 25 <link rel="stylesheet" type="text/css" href="install/style.css"> 26 </head> 27 <body bgcolor="#222222" style="height: 100%"> 28 <table class="main-table" height="100%" align="center" bgcolor="#111111" border="0" cellspacing="1" style="height: 100%"> 29 <tr style="height: 100%"> 30 <td valign="top" height="100%" style="height: 100%"> 31 <div id="header"> 32 <img src="install/quantum_rise.jpg" border="0"> 33 </div> 34 <div id="page-title">Upgrade</div> 35 <table cellpadding="0" cellspacing="0" width="100%" border="0"> 36 <tr><td valign="top"><div id="content">'; 37 38 39 $footer = '</div></td> 40 </tr></table> 41 <div class="counter"><font style="font-size: 9px;">©2006-2009 <a href="http://www.eve-dev.net/" target="_blank">EVE Development Network</a></font></div> 42 </td></tr></table> 43 </body> 44 </html>'; 18 45 19 46 if (!session::isAdmin()) … … 52 79 if (CURRENT_DB_UPDATE >= LASTEST_DB_UPDATE ) 53 80 { 54 echo "<html><head>"; 55 echo "<meta http-equiv='refresh' content='5;url=http://".$url."' >"; 56 echo"</head><body>Board is up to date.<br><a href='".config::get('cfg_kbhost')."'>Return to your board</a></body>"; 81 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 82 <html> 83 <head> 84 <meta http-equiv="content-type" content="text/html; charset=UTF8"> 85 <title>EVE Development Network Killboard Upgrade Script</title> 86 <link rel="stylesheet" type="text/css" href="install/common.css"> 87 <link rel="stylesheet" type="text/css" href="install/style.css"> 88 </head> 89 <body bgcolor="#222222" style="height: 100%"> 90 <table class="main-table" height="100%" align="center" bgcolor="#111111" border="0" cellspacing="1" style="height: 100%"> 91 <tr style="height: 100%"> 92 <td valign="top" height="100%" style="height: 100%"> 93 <div id="header"> 94 <img src="install/quantum_rise.jpg" border="0"> 95 </div> 96 <div id="page-title">Upgrade</div> 97 <table cellpadding="0" cellspacing="0" width="100%" border="0"> 98 <tr><td valign="top"><div id="content">'; 99 echo"Board is up to date.<br><a href='".config::get('cfg_kbhost')."'>Return to your board</a>"; 100 echo $footer; 57 101 die(); 58 102 } 59 103 updateDB(); 60 104 touch ('install/install.lock'); 61 echo "<html><head>"; 62 echo "<meta http-equiv='refresh' content='5;url=http://".$url."' >"; 63 echo"</head><body>Upgrade complete.<br><a href='".config::get('cfg_kbhost')."'>Return to your board</a></body>"; 105 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 106 <html> 107 <head> 108 <meta http-equiv="content-type" content="text/html; charset=UTF8"> 109 <title>EVE Development Network Killboard Upgrade Script</title> 110 <link rel="stylesheet" type="text/css" href="install/common.css"> 111 <link rel="stylesheet" type="text/css" href="install/style.css"> 112 </head> 113 <body bgcolor="#222222" style="height: 100%"> 114 <table class="main-table" height="100%" align="center" bgcolor="#111111" border="0" cellspacing="1" style="height: 100%"> 115 <tr style="height: 100%"> 116 <td valign="top" height="100%" style="height: 100%"> 117 <div id="header"> 118 <img src="install/quantum_rise.jpg" border="0"> 119 </div> 120 <div id="page-title">Upgrade</div> 121 <table cellpadding="0" cellspacing="0" width="100%" border="0"> 122 <tr><td valign="top"><div id="content">'; 123 echo "Upgrade complete.<br><a href='".config::get('cfg_kbhost')."'>Return to your board</a>"; 124 echo $footer; 64 125 die(); 65 126 … … 232 293 function update007() 233 294 { 234 global $url ;295 global $url, $header, $footer; 235 296 //Checking if this Update already done 236 297 if (CURRENT_DB_UPDATE < "007" ) … … 268 329 } 269 330 config::set('007updatestatus',1); 270 echo "<html><head>";271 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";272 echo "</head><body>7. External ID columns added</body>";331 echo $header; 332 echo "7. External ID columns added"; 333 echo $footer; 273 334 die(); 274 335 } … … 308 369 $qry->execute($sql); 309 370 config::set('007updatestatus',3); 310 echo "<html><head>";311 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";312 echo "</head><body>7. Kill values: Ship prices calculated</body>";371 echo $header; 372 echo "7. Kill values: Ship prices calculated"; 373 echo $footer; 313 374 die(); 314 375 } … … 325 386 $qry->execute($sql); 326 387 config::set('007updatestatus',4); 327 echo "<html><head>";328 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";329 echo "</head><body>7. Kill values: Destroyed item prices calculated</body>";388 echo $header; 389 echo "7. Kill values: Destroyed item prices calculated"; 390 echo $footer; 330 391 die(); 331 392 } … … 347 408 else $action = "ignored"; 348 409 config::set('007updatestatus',5); 349 echo "<html><head>";350 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";351 echo "</head><body>7. Kill values: Dropped item prices $action</body>";410 echo $header; 411 echo "7. Kill values: Dropped item prices $action"; 412 echo $footer; 352 413 die(); 353 414 } … … 359 420 $qry->execute("ALTER TABLE `kb3_kills` ADD `kll_isk_loss` FLOAT NOT NULL DEFAULT '0'"); 360 421 config::set('007updatestatus',7); 361 echo "<html><head>";362 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";363 echo"</head><body>7. Kill values: ISK column created</body>";422 echo $header; 423 echo "7. Kill values: ISK column created"; 424 echo $footer; 364 425 die(); 365 426 } 366 427 config::set('007updatestatus',7); 367 echo "<html><head>";368 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";369 echo "</head><body>7. Kill values: ISK column already exists.</body>";428 echo $header; 429 echo "7. Kill values: ISK column already exists."; 430 echo $footer; 370 431 die(); 371 432 } … … 393 454 $sql .= 'SET kb3_kills.kll_isk_loss = tmp_price_ship.value + ifnull(tmp_price_destroyed.value,0) '; 394 455 if(config::get(kd_droptototal)) $sql .= ' + ifnull(tmp_price_dropped.value,0) '; 395 $sql .= ' WHERE k ll_id >= '.config::get('007.8status').' ANDkll_id < '.456 $sql .= ' WHERE kb3_kills.kll_id >= '.config::get('007.8status').' AND kb3_kills.kll_id < '. 396 457 (intval(config::get('007.8status')) + intval(config::get('007.8step'))); 397 458 $qry->execute ($sql); … … 405 466 $qry->execute('DROP TABLE tmp_price_dropped'); 406 467 config::set('007updatestatus',8); 407 echo "<html><head>";408 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";409 echo "</head><body>7. Kill values: Totals updated</body>";468 echo $header; 469 echo "7. Kill values: Totals updated"; 470 echo $footer; 410 471 die(); 411 472 } … … 416 477 if($qry->recordCount()) $qry->execute("ALTER TABLE `kb3_kills` DROP `kll_fb_crp_id`"); 417 478 config::set('007updatestatus',9); 418 echo "<html><head>";419 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";420 echo"</head><body>7. kll_fb_crp_id column dropped</body>";479 echo $header; 480 echo "7. kll_fb_crp_id column dropped"; 481 echo $footer; 421 482 die(); 422 483 } … … 426 487 if($qry->recordCount()) $qry->execute("ALTER TABLE `kb3_kills` DROP `kll_fb_all_id`"); 427 488 config::set('007updatestatus',10); 428 echo "<html><head>";429 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";430 echo"</head><body>7. kll_fb_all_id column dropped</body>";489 echo $header; 490 echo "7. kll_fb_all_id column dropped"; 491 echo $footer; 431 492 die(); 432 493 } … … 441 502 if($qry->recordCount()) $qry->execute("ALTER TABLE kb3_pilots DROP plt_losspoints"); 442 503 config::set('007updatestatus',11); 443 echo "<html><head>";444 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";445 echo"</head><body>7. Unused crp and plt columns dropped</body>";504 echo $header; 505 echo "7. Unused crp and plt columns dropped"; 506 echo $footer; 446 507 die(); 447 508 } … … 462 523 $qry->execute("ALTER TABLE `kb3_inv_detail` ADD INDEX ( `ind_crp_id` ) "); 463 524 config::set('007updatestatus',12); 464 echo "<html><head>";465 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";466 echo"</head><body>7. kb3_inv_detail ind_crp_id index added</body>";525 echo $header; 526 echo "7. kb3_inv_detail ind_crp_id index added"; 527 echo $footer; 467 528 die(); 468 529 } … … 472 533 $qry->execute("ALTER TABLE `kb3_inv_detail` ADD INDEX ( `ind_all_id` ) "); 473 534 config::set('007updatestatus',13); 474 echo "<html><head>";475 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";476 echo"</head><body>7. kb3_inv_detail ind_all_id index added</body>";535 echo $header; 536 echo "7. kb3_inv_detail ind_all_id index added"; 537 echo $footer; 477 538 die(); 478 539 } … … 503 564 config::set('API_DBUpdate', '1'); 504 565 config::set('007updatestatus',14); 505 echo "<html><head>";506 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";507 echo"</head><body>7. API tables added</body>";566 echo $header; 567 echo "7. API tables added"; 568 echo $footer; 508 569 die(); 509 570 } … … 523 584 } 524 585 config::set('007updatestatus',15); 525 echo "<html><head>";526 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";527 echo"</head><body>7. Subsystem slots added</body>";586 echo $header; 587 echo "7. Subsystem slots added"; 588 echo $footer; 528 589 die(); 529 590 } … … 543 604 $qry->execute("UPDATE kb3_config SET cfg_value = '007' WHERE cfg_key = 'DBUpdate'"); 544 605 config::del('007updatestatus'); 545 echo "<html><head>";546 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";547 echo "</head><body>7. Empty tables truncated.<br>Update 007 completed.</body>";606 echo $header; 607 echo "7. Empty tables truncated.<br>Update 007 completed."; 608 echo $footer; 548 609 die(); 549 610 } … … 554 615 function update008() 555 616 { 556 global $url ;617 global $url, $header, $footer; 557 618 //Checking if this Update already done 558 619 if (CURRENT_DB_UPDATE < "008" ) … … 586 647 { 587 648 $qry->execute("ALTER TABLE `kb3_inv_detail` ADD INDEX ( `ind_kll_id`, `ind_order` ) "); 588 echo "<html><head>";589 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";590 echo "</head><body>8. kb3_inv_detail index id_order added</body>";649 echo $header; 650 echo "8. kb3_inv_detail index id_order added"; 651 echo $footer; 591 652 die(); 592 653 } … … 594 655 { 595 656 $qry->execute("ALTER TABLE `kb3_inv_detail` ADD INDEX ( `ind_crp_id` ) "); 596 echo "<html><head>";597 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";598 echo "</head><body>8. kb3_inv_detail index id_order added</body>";657 echo $header; 658 echo "8. kb3_inv_detail index id_order added"; 659 echo $footer; 599 660 die(); 600 661 } … … 602 663 { 603 664 $qry->execute("ALTER TABLE `kb3_inv_detail` ADD INDEX ( `ind_all_id` ) "); 604 echo "<html><head>";605 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";606 echo "</head><body>8. kb3_inv_detail index id_order added</body>";665 echo $header; 666 echo "8. kb3_inv_detail index id_order added"; 667 echo $footer; 607 668 die(); 608 669 } … … 610 671 { 611 672 $qry->execute("ALTER TABLE `kb3_inv_detail` ADD INDEX ( `ind_plt_id` ) "); 612 echo "<html><head>";613 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";614 echo "</head><body>8. kb3_inv_detail index id_order added</body>";673 echo $header; 674 echo "8. kb3_inv_detail index id_order added"; 675 echo $footer; 615 676 die(); 616 677 } … … 633 694 $qry->execute('update kb3_inv_detail join ('.$sqlcrp.') c on c.oldid = ind_crp_id set ind_crp_id = c.newid'); 634 695 config::set('008updatestatus', 2); 635 echo "<html><head>";636 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";637 echo "</head><body>8. Unique corp names: updated kb3_inv_detail</body>";696 echo $header; 697 echo "8. Unique corp names: updated kb3_inv_detail"; 698 echo $footer; 638 699 die(); 639 700 } … … 642 703 $qry->execute('update kb3_pilots join ('.$sqlcrp.') c on (c.oldid = plt_crp_id) set plt_crp_id = c.newid'); 643 704 config::set('008updatestatus', 3); 644 echo "<html><head>";645 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";646 echo "</head><body>8. Unique corp names: updated kb3_pilots</body>";705 echo $header; 706 echo "8. Unique corp names: updated kb3_pilots"; 707 echo $footer; 647 708 die(); 648 709 } … … 651 712 $qry->execute('update kb3_kills join ('.$sqlcrp.') c on (c.oldid = kll_crp_id) set kll_crp_id = c.newid'); 652 713 config::set('008updatestatus', 4); 653 echo "<html><head>";654 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";655 echo "</head><body>8. Unique corp names: updated kb3_kills</body>";714 echo $header; 715 echo "8. Unique corp names: updated kb3_kills"; 716 echo $footer; 656 717 die(); 657 718 } … … 660 721 $qry->execute('delete b from kb3_corps a, kb3_corps b where a.crp_name = b.crp_name and a.crp_id < b.crp_id'); 661 722 config::set('008updatestatus', 6); 662 echo "<html><head>";663 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";664 echo "</head><body>8. Unique corp names: updated kb3_corps</body>";723 echo $header; 724 echo "8. Unique corp names: updated kb3_corps"; 725 echo $footer; 665 726 die(); 666 727 } … … 685 746 686 747 config::set('008updatestatus', 7); 687 echo "<html><head>";688 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";689 echo "</head><body>8. Unique corp names: unique index added to kb3_corps</body>";748 echo $header; 749 echo "8. Unique corp names: unique index added to kb3_corps"; 750 echo $footer; 690 751 die(); 691 752 } … … 706 767 $qry->execute('update kb3_inv_detail join ('.$sqlall.') c on c.oldid = ind_all_id set ind_all_id = c.newid'); 707 768 config::set('008updatestatus', 8); 708 echo "<html><head>";709 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";710 echo "</head><body>8. Unique all names: updated kb3_inv_detail</body>";769 echo $header; 770 echo "8. Unique all names: updated kb3_inv_detail"; 771 echo $footer; 711 772 die(); 712 773 } … … 715 776 $qry->execute('update kb3_corps join ('.$sqlall.') c on (c.oldid = crp_all_id) set crp_all_id = c.newid'); 716 777 config::set('008updatestatus', 9); 717 echo "<html><head>";718 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";719 echo "</head><body>8. Unique all names: updated kb3_corps</body>";778 echo $header; 779 echo "8. Unique all names: updated kb3_corps"; 780 echo $footer; 720 781 die(); 721 782 } … … 724 785 $qry->execute('update kb3_kills join ('.$sqlall.') c on (c.oldid = kll_all_id) set kll_all_id = c.newid'); 725 786 config::set('008updatestatus', 10); 726 echo "<html><head>";727 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";728 echo "</head><body>8. Unique all names: updated kb3_kills</body>";787 echo $header; 788 echo "8. Unique all names: updated kb3_kills"; 789 echo $footer; 729 790 die(); 730 791 } … … 734 795 $qry->execute('delete b from kb3_alliances a, kb3_alliances b where a.all_name = b.all_name and a.all_id < b.all_id'); 735 796 config::set('008updatestatus', 12); 736 echo "<html><head>";737 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";738 echo "</head><body>8. Unique all names: updated kb3_alliances</body>";797 echo $header; 798 echo "8. Unique all names: updated kb3_alliances"; 799 echo $footer; 739 800 die(); 740 801 } … … 757 818 $qry->execute("ALTER TABLE `kb3_alliances` ADD UNIQUE INDEX ( `all_name` ) "); 758 819 config::set('008updatestatus', 13); 759 echo "<html><head>";760 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";761 echo "</head><body>8. Unique all names: unique index applied to kb3_alliances</body>";820 echo $header; 821 echo "8. Unique all names: unique index applied to kb3_alliances"; 822 echo $footer; 762 823 die(); 763 824 } … … 779 840 $qry->execute('update kb3_inv_detail join ('.$sqlplt.') c on c.oldid = ind_plt_id set ind_plt_id = c.newid'); 780 841 config::set('008updatestatus', 14); 781 echo "<html><head>";782 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";783 echo "</head><body>8. Unique plt names: updated kb3_inv_detail</body>";842 echo $header; 843 echo "8. Unique plt names: updated kb3_inv_detail"; 844 echo $footer; 784 845 die(); 785 846 } … … 788 849 $qry->execute('update kb3_kills join ('.$sqlplt.') c on (c.oldid = kll_victim_id) set kll_victim_id = c.newid'); 789 850 config::set('008updatestatus', 15); 790 echo "<html><head>";791 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";792 echo "</head><body>8. Unique plt names: updated kb3_kills victim</body>";851 echo $header; 852 echo "8. Unique plt names: updated kb3_kills victim"; 853 echo $footer; 793 854 die(); 794 855 } … … 797 858 $qry->execute('update kb3_kills join ('.$sqlplt.') c on (c.oldid = kll_fb_plt_id) set kll_fb_plt_id = c.newid'); 798 859 config::set('008updatestatus', 16); 799 echo "<html><head>";800 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";801 echo "</head><body>8. Unique plt names: updated kb3_kills killer</body>";860 echo $header; 861 echo "8. Unique plt names: updated kb3_kills killer"; 862 echo $footer; 802 863 die(); 803 864 } … … 806 867 $qry->execute('delete b from kb3_pilots a, kb3_pilots b where a.plt_name = b.plt_name and a.plt_id < b.plt_id'); 807 868 config::set('008updatestatus', 17); 808 echo "<html><head>";809 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";810 echo "</head><body>8. Unique plt names: updated kb3_pilots</body>";869 echo $header; 870 echo "8. Unique plt names: updated kb3_pilots"; 871 echo $footer; 811 872 die(); 812 873 } … … 829 890 $qry->execute("ALTER TABLE `kb3_pilots` ADD UNIQUE INDEX ( `plt_name` ) "); 830 891 config::set('008updatestatus', 18); 831 echo "<html><head>";832 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";833 echo "</head><body>8. Unique plt names: unique index applied to kb3_pilots.</body>";892 echo $header; 893 echo "8. Unique plt names: unique index applied to kb3_pilots."; 894 echo $footer; 834 895 die(); 835 896 } … … 842 903 $qry->execute("UPDATE kb3_config SET cfg_value = '008' WHERE cfg_key = 'DBUpdate'"); 843 904 config::del("008updatestatus"); 844 echo "<html><head>";845 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";846 echo"</head><body>Update 008 completed.</body>";905 echo $header; 906 echo "Update 008 completed."; 907 echo $footer; 847 908 die(); 848 909 } … … 852 913 function update009() 853 914 { 854 global $url ;915 global $url, $header, $footer; 855 916 //Checking if this Update already done 856 917 if (CURRENT_DB_UPDATE < "009" ) … … 879 940 config::set("DBUpdate", "009"); 880 941 $qry->execute("UPDATE kb3_config SET cfg_value = '009' WHERE cfg_key = 'DBUpdate'"); 881 echo "<html><head>";882 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";883 echo "</head><body>Update 009 completed.</body>";942 echo $header; 943 echo "Update 009 completed."; 944 echo $footer; 884 945 die(); 885 946 } … … 889 950 function update010() 890 951 { 891 global $url ;952 global $url, $header, $footer; 892 953 //Checking if this Update already done 893 954 if (CURRENT_DB_UPDATE < "010" ) … … 906 967 907 968 config::set("DBUpdate", "010"); 908 echo "<html><head>";909 echo " <meta http-equiv='refresh' content='5;url=http://".$url."' >";910 echo "</head><body>Update 010 completed.</body>";969 echo $header; 970 echo "Update 010 completed."; 971 echo $footer; 911 972 die(); 912 973 }