Revision 1759
Added by Dietmar about 12 years ago
upgrade-script.php | ||
---|---|---|
446 | 446 |
/********************************************************** |
447 | 447 |
* - Adding page_extended to settings table |
448 | 448 |
*/ |
449 |
echo "Adding/updating ppage_extended to settings table";
|
|
449 |
echo "Adding/updating page_extended to settings table"; |
|
450 | 450 |
$cfg = array( |
451 | 451 |
'page_extended' => (defined('PAGE_EXTENDED') ? PAGE_EXTENDED : 'true'), |
452 | 452 |
); |
... | ... | |
654 | 654 |
ALTER TABLE `wb_pages` CHANGE `page_icon` `page_icon` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' |
655 | 655 |
*/ |
656 | 656 |
$dir = (WB_PATH.MEDIA_DIRECTORY); |
657 |
echo '<h4>Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files</h4><br />';
|
|
657 |
echo '<h4>Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files</h4>'; |
|
658 | 658 |
$array = rebuildFolderProtectFile($dir); |
659 | 659 |
if( sizeof( $array ) ){ |
660 |
print '<br /><strong>Upgrade '.sizeof( $array ).' '.MEDIA_DIRECTORY.'/ protect files</strong>'." $OK<br />";
|
|
660 |
print '<strong>Upgrade '.sizeof( $array ).' '.MEDIA_DIRECTORY.'/ protect files</strong>'." $OK<br />"; |
|
661 | 661 |
} else { |
662 |
print '<br /><strong>Upgrade '.MEDIA_DIRECTORY.'/ protect files</strong>'." $FAIL!<br />";
|
|
662 |
print '<<strong>Upgrade '.MEDIA_DIRECTORY.'/ protect files</strong>'." $FAIL!<br />"; |
|
663 | 663 |
print implode ('<br />',$array); |
664 | 664 |
} |
665 | 665 |
|
666 | 666 |
/********************************************************** |
667 | 667 |
* upgrade pages folder index access files |
668 | 668 |
*/ |
669 |
echo '<h4>Upgrade /pages/ index.php access files</h4><br />';
|
|
669 |
echo '<h4>Upgrade /pages/ index.php access files</h4>'; |
|
670 | 670 |
|
671 | 671 |
///********************************************************** |
672 | 672 |
// * - try to remove access files |
... | ... | |
674 | 674 |
$sTempDir = (defined('PAGES_DIRECTORY') && (PAGES_DIRECTORY != '') ? PAGES_DIRECTORY : ''); |
675 | 675 |
if(($sTempDir!='') && is_readable(WB_PATH.$sTempDir)==true) { |
676 | 676 |
if(rm_full_dir (WB_PATH.$sTempDir, true )==false) { |
677 |
$msg[] = '<strong>Could not delete existing access files</strong><br />';
|
|
677 |
$msg[] = '<strong>Could not delete existing access files</strong>'; |
|
678 | 678 |
} else { |
679 | 679 |
$msg[] = createFolderProtectFile(rtrim( WB_PATH.$sTempDir,'/') ); |
680 | 680 |
} |
... | ... | |
684 | 684 |
// * - Reformat/rebuild all existing access files |
685 | 685 |
// */ |
686 | 686 |
$msg[] = "All existing access files anew format"; |
687 |
$sql = 'SELECT `page_id`,`link`, `level` FROM `'.TABLE_PREFIX.'pages` ORDER BY `link`'; |
|
688 |
if (($res_pages = $database->query($sql)))
|
|
687 |
$sql = 'SELECT `page_id`,`root_parent`,`link`, `level` FROM `'.TABLE_PREFIX.'pages` ORDER BY `link`';
|
|
688 |
if (($oPage = $database->query($sql)))
|
|
689 | 689 |
{ |
690 | 690 |
$x = 0; |
691 |
while (($rec_page = $res_pages->fetchRow()))
|
|
691 |
while (($page = $oPage->fetchRow(MYSQL_ASSOC)))
|
|
692 | 692 |
{ |
693 |
$filename = WB_PATH.PAGES_DIRECTORY.$rec_page['link'].PAGE_EXTENSION; |
|
694 |
$msg = create_access_file($filename, $rec_page['page_id'], $rec_page['level']); |
|
693 |
$sql = 'UPDATE `'.TABLE_PREFIX.'pages` ' |
|
694 |
. 'SET `root_parent`='.$page['page_id'].' WHERE page_id = '.$page['page_id']; |
|
695 |
if(!$database->query($sql)) {} |
|
696 |
$filename = WB_PATH.PAGES_DIRECTORY.$page['link'].PAGE_EXTENSION; |
|
697 |
$msg = create_access_file($filename, $page['page_id'], $page['level']); |
|
695 | 698 |
$x++; |
696 | 699 |
} |
697 |
$msg[] = '<strong>Number of the anew formatted access files: '.$x.'</strong><br />';
|
|
700 |
$msg[] = '<strong>Number of new formatted access files: '.$x.'</strong>';
|
|
698 | 701 |
} |
699 | 702 |
|
700 | 703 |
print implode ('<br />',$msg); |
... | ... | |
712 | 715 |
* upgrade posts folder index protect files |
713 | 716 |
*/ |
714 | 717 |
$sPostsPath = WB_PATH.PAGES_DIRECTORY.'/posts'; |
715 |
echo '<h4>Upgrade /posts/ index.php protect files</h4><br />';
|
|
718 |
echo '<h4>Upgrade /posts/ index.php protect files</h4>'; |
|
716 | 719 |
$array = rebuildFolderProtectFile($sPostsPath); |
717 | 720 |
if( sizeof( $array ) ){ |
718 |
print '<br /><strong>Upgrade '.sizeof( $array ).' /posts/ protect files</strong>'." $OK<br />";
|
|
721 |
print '<strong>Upgrade '.sizeof( $array ).' /posts/ protect files</strong>'." $OK<br />"; |
|
719 | 722 |
} else { |
720 |
print '<br /><strong>Upgrade /posts/ protect files</strong>'." $FAIL!<br />";
|
|
723 |
print '<strong>Upgrade /posts/ protect files</strong>'." $FAIL!<br />"; |
|
721 | 724 |
print implode ('<br />',$array); |
722 | 725 |
} |
723 | 726 |
|
... | ... | |
851 | 854 |
} |
852 | 855 |
closedir($handle); |
853 | 856 |
} |
854 |
echo '<br />Modules reloaded<br />';
|
|
857 |
echo '<strong><br />Modules reloaded<br /></strong>';
|
|
855 | 858 |
|
856 | 859 |
////delete templates |
857 | 860 |
//$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'template'"); |
... | ... | |
864 | 867 |
} |
865 | 868 |
closedir($handle); |
866 | 869 |
} |
867 |
echo '<br />Templates reloaded<br />';
|
|
870 |
echo '<strong><br />Templates reloaded<br /></strong>';
|
|
868 | 871 |
|
869 | 872 |
////delete languages |
870 | 873 |
//$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'language'"); |
... | ... | |
877 | 880 |
} |
878 | 881 |
closedir($handle); |
879 | 882 |
} |
880 |
echo '<br />Languages reloaded<br />';
|
|
883 |
echo '<strong><br />Languages reloaded<br /></strong>';
|
|
881 | 884 |
|
882 | 885 |
/********************************************************** |
883 | 886 |
* - install new droplets |
Also available in: Unified diff
! during Reformat/rebuild all existing access files in upgrade-script
root_parent will be set to page_id
! change multi-dimensional arrays (variables) to similar arrays in framework/functions.php