Revision 1258
Added by Dietmar over 14 years ago
save_post.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 |
*/ |
52 |
|
|
60 | 53 |
require('../../config.php'); |
61 | 54 |
|
62 | 55 |
require_once(WB_PATH."/include/jscalendar/jscalendar-functions.php"); |
... | ... | |
81 | 74 |
// First, delete old file if it exists |
82 | 75 |
if(file_exists(WB_PATH.PAGES_DIRECTORY.$filename.PAGE_EXTENSION)) |
83 | 76 |
{ |
84 |
$filetime = isset($filetime) ? $filetime : filectime($filename);
|
|
77 |
$filetime = isset($filetime) ? $filetime : filemtime($filename);
|
|
85 | 78 |
unlink(WB_PATH.PAGES_DIRECTORY.$filename.PAGE_EXTENSION); |
86 | 79 |
} |
87 | 80 |
else { |
... | ... | |
161 | 154 |
{ |
162 | 155 |
$admin->print_error($MESSAGE['PAGES']['CANNOT_CREATE_ACCESS_FILE']); |
163 | 156 |
} |
164 |
elseif($old_link != $post_link OR !file_exists(WB_PATH.PAGES_DIRECTORY.$post_link.PAGE_EXTENSION))
|
|
157 |
elseif(($old_link != $post_link) OR !file_exists(WB_PATH.PAGES_DIRECTORY.$post_link.PAGE_EXTENSION))
|
|
165 | 158 |
{ |
166 | 159 |
// We need to create a new file |
167 | 160 |
// First, delete old file if it exists |
168 | 161 |
if(file_exists(WB_PATH.PAGES_DIRECTORY.$old_link.PAGE_EXTENSION)) |
169 | 162 |
{ |
170 |
$file_create_time = filectime($old_link.PAGE_EXTENSION);
|
|
163 |
$file_create_time = filemtime($old_link.PAGE_EXTENSION);
|
|
171 | 164 |
unlink(WB_PATH.PAGES_DIRECTORY.$old_link.PAGE_EXTENSION); |
172 | 165 |
} |
173 | 166 |
|
174 | 167 |
Also available in: Unified diff
update few header info