Revision 1258
Added by Luisehahne almost 16 years ago
| upgrade.php | ||
|---|---|---|
| 1 | 1 |
<?php |
| 2 |
/**************************************************************************** |
|
| 3 |
* SVN Version information: |
|
| 2 |
/* |
|
| 4 | 3 |
* |
| 5 |
* $Id$
|
|
| 4 |
* About WebsiteBaker
|
|
| 6 | 5 |
* |
| 7 |
***************************************************************************** |
|
| 8 |
* WebsiteBaker |
|
| 9 |
* |
|
| 10 |
* WebsiteBaker Project <http://www.websitebaker2.org/> |
|
| 11 |
* Copyright (C) 2009, Website Baker Org. e.V. |
|
| 12 |
* http://start.websitebaker2.org/impressum-datenschutz.php |
|
| 13 |
* Copyright (C) 2004-2009, Ryan Djurovich |
|
| 14 |
* |
|
| 15 |
* About WebsiteBaker |
|
| 16 |
* |
|
| 17 | 6 |
* Website Baker is a PHP-based Content Management System (CMS) |
| 18 | 7 |
* designed with one goal in mind: to enable its users to produce websites |
| 19 | 8 |
* with ease. |
| 20 | 9 |
* |
| 21 |
*****************************************************************************
|
|
| 10 |
* LICENSE INFORMATION
|
|
| 22 | 11 |
* |
| 23 |
***************************************************************************** |
|
| 24 |
* LICENSE INFORMATION |
|
| 25 |
* |
|
| 26 | 12 |
* WebsiteBaker is free software; you can redistribute it and/or |
| 27 | 13 |
* modify it under the terms of the GNU General Public License |
| 28 | 14 |
* as published by the Free Software Foundation; either version 2 |
| ... | ... | |
| 36 | 22 |
* You should have received a copy of the GNU General Public License |
| 37 | 23 |
* along with this program; if not, write to the Free Software |
| 38 | 24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 39 |
**************************************************************************** |
|
| 40 | 25 |
* |
| 41 | 26 |
* WebsiteBaker Extra Information |
| 42 | 27 |
* |
| 43 | 28 |
* |
| 44 |
* |
|
| 45 |
* |
|
| 46 |
*****************************************************************************/ |
|
| 29 |
*/ |
|
| 47 | 30 |
/** |
| 48 | 31 |
* |
| 49 |
* @category modules |
|
| 50 |
* @package news |
|
| 51 |
* @author Ryan Djurovich |
|
| 52 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 53 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
| 54 |
* @version $Id$ |
|
| 55 |
* @platform WebsiteBaker 2.8.x |
|
| 56 |
* @requirements >= PHP 4.3.4 |
|
| 57 |
* @license http://www.gnu.org/licenses/gpl.html |
|
| 32 |
* @category modules |
|
| 33 |
* @package news |
|
| 34 |
* @author Ryan Djurovich |
|
| 35 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 36 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
| 37 |
* @filesource $HeadURL$ |
|
| 38 |
* @author Ryan Djurovich |
|
| 39 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 58 | 40 |
* |
| 41 |
* @author WebsiteBaker Project |
|
| 42 |
* @link http://www.websitebaker2.org/ |
|
| 43 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
| 44 |
* @link http://start.websitebaker2.org/impressum-datenschutz.php |
|
| 45 |
* @license http://www.gnu.org/licenses/gpl.html |
|
| 46 |
* @version $Id$ |
|
| 47 |
* @platform WebsiteBaker 2.8.x |
|
| 48 |
* @requirements PHP 4.3.4 and higher |
|
| 49 |
* @lastmodified $Date$ |
|
| 50 |
* |
|
| 59 | 51 |
*/ |
| 60 | 52 |
|
| 61 | 53 |
if(defined('WB_URL')) {
|
| ... | ... | |
| 80 | 72 |
require("'.$index_location.'config.php");
|
| 81 | 73 |
require(WB_PATH."/index.php"); |
| 82 | 74 |
?>'; |
| 83 |
if($handle = fopen($filename, 'w+')) |
|
| 84 |
{
|
|
| 85 |
fwrite($handle, $content); |
|
| 86 |
fclose($handle); |
|
| 87 |
if($filetime) |
|
| 75 |
if($handle = fopen($filename, 'w+')) |
|
| 88 | 76 |
{
|
| 89 |
touch($filename, $filetime); |
|
| 77 |
fwrite($handle, $content); |
|
| 78 |
fclose($handle); |
|
| 79 |
if($filetime) |
|
| 80 |
{
|
|
| 81 |
touch($filename, $filetime); |
|
| 82 |
} |
|
| 83 |
change_mode($filename); |
|
| 90 | 84 |
} |
| 91 |
change_mode($filename); |
|
| 92 | 85 |
} |
| 93 |
} |
|
| 94 | 86 |
|
| 95 | 87 |
// read files from /pages/posts/ |
| 96 |
if( !function_exists('scandir') ) {
|
|
| 97 |
function scandir($directory, $sorting_order = 0) {
|
|
| 88 |
if( !function_exists('scandir') )
|
|
| 89 |
{
|
|
| 90 |
function scandir($directory, $sorting_order = 0) |
|
| 91 |
{
|
|
| 98 | 92 |
$dh = opendir($directory); |
| 99 |
while( false !== ($filename = readdir($dh)) ) {
|
|
| 93 |
while( false !== ($filename = readdir($dh)) ) |
|
| 94 |
{
|
|
| 100 | 95 |
$files[] = $filename; |
| 101 | 96 |
} |
| 102 |
if( $sorting_order == 0 ) {
|
|
| 97 |
if( $sorting_order == 0 ) |
|
| 98 |
{
|
|
| 103 | 99 |
sort($files); |
| 104 |
} else {
|
|
| 100 |
} else |
|
| 101 |
{
|
|
| 105 | 102 |
rsort($files); |
| 106 | 103 |
} |
| 107 | 104 |
return($files); |
| ... | ... | |
| 115 | 112 |
// All files in /pages/posts/ |
| 116 | 113 |
foreach( $files as $file ) |
| 117 | 114 |
{
|
| 118 |
if( file_exists($target_dir.$file) && $file != '.' && $file != '..' && $file != 'index.php') |
|
| 115 |
if( file_exists($target_dir.$file) |
|
| 116 |
AND ($file != '.') |
|
| 117 |
AND ($file != '..') |
|
| 118 |
AND ($file != 'index.php') ) |
|
| 119 | 119 |
{
|
| 120 | 120 |
clearstatcache(); |
| 121 |
$timestamp = filectime ( $target_dir.$file );
|
|
| 121 |
$timestamp = filemtime ( $target_dir.$file );
|
|
| 122 | 122 |
$lines = file($target_dir.$file); |
| 123 | 123 |
$content = ''; |
| 124 | 124 |
// read lines until first define |
| 125 | 125 | |
Also available in: Unified diff
update few header info