Revision 1258
Added by Dietmar almost 15 years ago
branches/2.8.x/CHANGELOG | ||
---|---|---|
12 | 12 |
|
13 | 13 |
------------------------------------- 2.8.1 ------------------------------------- |
14 | 14 |
21-Jan-2010 Dietmar Woellbrink (Luisehahne) |
15 |
! update header info |
|
16 |
21-Jan-2010 Dietmar Woellbrink (Luisehahne) |
|
15 | 17 |
! update info.php fckeditor |
16 | 18 |
21-Jan-2010 Dietmar Woellbrink (Luisehahne) |
17 | 19 |
# fix wrong settings in image browser dialog |
branches/2.8.x/wb/admin/interface/version.php | ||
---|---|---|
55 | 55 |
|
56 | 56 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
57 | 57 |
if(!defined('VERSION')) define('VERSION', '2.8.1'); |
58 |
if(!defined('REVISION')) define('REVISION', '1257');
|
|
58 |
if(!defined('REVISION')) define('REVISION', '1258');
|
|
59 | 59 |
|
60 | 60 |
?> |
branches/2.8.x/wb/modules/news/info.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 |
$module_directory = 'news'; |
62 |
$module_name = 'News v3.2';
|
|
54 |
$module_name = 'News v3.4';
|
|
63 | 55 |
$module_function = 'page'; |
64 |
$module_version = '3.3';
|
|
56 |
$module_version = '3.4';
|
|
65 | 57 |
$module_platform = '2.8.x'; |
66 | 58 |
$module_author = 'Ryan Djurovich, Rob Smith'; |
67 | 59 |
$module_license = 'GNU General Public License'; |
68 | 60 |
branches/2.8.x/wb/modules/news/view.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, 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 |
// Must include code to stop this file being access directly |
... | ... | |
66 | 58 |
require_once(!file_exists($lang) ? (dirname(__FILE__)) . '/languages/EN.php' : $lang ); |
67 | 59 |
|
68 | 60 |
//overwrite php.ini on Apache servers for valid SESSION ID Separator |
69 |
if(function_exists('ini_set')) { |
|
61 |
if(function_exists('ini_set')) |
|
62 |
{ |
|
70 | 63 |
ini_set('arg_separator.output', '&'); |
71 | 64 |
} |
72 | 65 |
|
... | ... | |
74 | 67 |
if(isset($_GET['p']) AND is_numeric($_GET['p']) AND $_GET['p'] >= 0) |
75 | 68 |
{ |
76 | 69 |
$position = $_GET['p']; |
77 |
} |
|
78 |
else |
|
79 |
{ |
|
70 |
} else { |
|
80 | 71 |
$position = 0; |
81 | 72 |
} |
82 | 73 |
|
... | ... | |
85 | 76 |
$query_users = $database->query("SELECT user_id,username,display_name,email FROM ".TABLE_PREFIX."users"); |
86 | 77 |
if($query_users->numRows() > 0) |
87 | 78 |
{ |
88 |
while($user = $query_users->fetchRow())
|
|
79 |
while( false != ($user = $query_users->fetchRow()) )
|
|
89 | 80 |
{ |
90 | 81 |
// Insert user info into users array |
91 | 82 |
$user_id = $user['user_id']; |
... | ... | |
107 | 98 |
$query_users = $database->query("SELECT group_id,title,active FROM ".TABLE_PREFIX."mod_news_groups WHERE section_id = '$section_id' ORDER BY position ASC"); |
108 | 99 |
if($query_users->numRows() > 0) |
109 | 100 |
{ |
110 |
while($group = $query_users->fetchRow())
|
|
101 |
while( false != ($group = $query_users->fetchRow()) )
|
|
111 | 102 |
{ |
112 | 103 |
// Insert user info into users array |
113 | 104 |
$group_id = $group['group_id']; |
... | ... | |
116 | 107 |
if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/.news/image'.$group_id.'.jpg')) |
117 | 108 |
{ |
118 | 109 |
$groups[$group_id]['image'] = WB_URL.MEDIA_DIRECTORY.'/.news/image'.$group_id.'.jpg'; |
119 |
} |
|
120 |
else |
|
121 |
{ |
|
110 |
} else { |
|
122 | 111 |
$groups[$group_id]['image'] = ''; |
123 | 112 |
} |
124 | 113 |
} |
... | ... | |
134 | 123 |
if(isset($_GET['g']) AND is_numeric($_GET['g'])) |
135 | 124 |
{ |
136 | 125 |
$query_extra = " AND group_id = '".$_GET['g']."'"; |
137 |
} |
|
138 |
else |
|
139 |
{ |
|
126 |
} else { |
|
140 | 127 |
$query_extra = ''; |
141 | 128 |
} |
142 | 129 |
|
... | ... | |
144 | 131 |
if(isset($_GET['g']) AND is_numeric($_GET['g'])) |
145 | 132 |
{ |
146 | 133 |
$query_extra = " AND group_id = '".$_GET['g']."'"; |
147 |
} |
|
148 |
else |
|
149 |
{ |
|
134 |
} else { |
|
150 | 135 |
$query_extra = ''; |
151 | 136 |
} |
152 | 137 |
|
... | ... | |
159 | 144 |
$setting_post_loop = ($fetch_settings['post_loop']); |
160 | 145 |
$setting_footer = ($fetch_settings['footer']); |
161 | 146 |
$setting_posts_per_page = $fetch_settings['posts_per_page']; |
162 |
} |
|
163 |
else |
|
164 |
{ |
|
147 |
} else { |
|
165 | 148 |
$setting_header = ''; |
166 | 149 |
$setting_post_loop = ''; |
167 | 150 |
$setting_footer = ''; |
... | ... | |
179 | 162 |
if($setting_posts_per_page != 0) |
180 | 163 |
{ |
181 | 164 |
$limit_sql = " LIMIT $position, $setting_posts_per_page"; |
182 |
} |
|
183 |
else |
|
184 |
{ |
|
165 |
} else { |
|
185 | 166 |
$limit_sql = ""; |
186 | 167 |
} |
187 | 168 |
|
... | ... | |
200 | 181 |
if(isset($_GET['g']) AND is_numeric($_GET['g'])) |
201 | 182 |
{ |
202 | 183 |
$pl_prepend = '<a href="?p='.($position-$setting_posts_per_page).'&g='.$_GET['g'].'"><< '; |
203 |
} |
|
204 |
else |
|
205 |
{ |
|
184 |
} else { |
|
206 | 185 |
$pl_prepend = '<a href="?p='.($position-$setting_posts_per_page).'"><< '; |
207 | 186 |
} |
208 | 187 |
$pl_append = '</a>'; |
209 | 188 |
$previous_link = $pl_prepend.$TEXT['PREVIOUS'].$pl_append; |
210 | 189 |
$previous_page_link = $pl_prepend.$TEXT['PREVIOUS_PAGE'].$pl_append; |
211 |
} |
|
212 |
else |
|
213 |
{ |
|
190 |
} else { |
|
214 | 191 |
$previous_link = ''; |
215 | 192 |
$previous_page_link = ''; |
216 | 193 |
} |
... | ... | |
218 | 195 |
{ |
219 | 196 |
$next_link = ''; |
220 | 197 |
$next_page_link = ''; |
221 |
} |
|
222 |
else |
|
223 |
{ |
|
198 |
} else { |
|
224 | 199 |
if(isset($_GET['g']) AND is_numeric($_GET['g'])) |
225 | 200 |
{ |
226 | 201 |
$nl_prepend = '<a href="?p='.($position+$setting_posts_per_page).'&g='.$_GET['g'].'"> '; |
227 |
} |
|
228 |
else |
|
229 |
{ |
|
202 |
} else { |
|
230 | 203 |
$nl_prepend = '<a href="?p='.($position+$setting_posts_per_page).'"> '; |
231 | 204 |
} |
232 | 205 |
$nl_append = ' >></a>'; |
... | ... | |
236 | 209 |
if($position+$setting_posts_per_page > $total_num) |
237 | 210 |
{ |
238 | 211 |
$num_of = $position+$num_posts; |
239 |
} |
|
240 |
else |
|
241 |
{ |
|
212 |
} else { |
|
242 | 213 |
$num_of = $position+$setting_posts_per_page; |
243 | 214 |
} |
244 | 215 |
|
245 | 216 |
$out_of = ($position+1).'-'.$num_of.' '.strtolower($TEXT['OUT_OF']).' '.$total_num; |
246 | 217 |
$of = ($position+1).'-'.$num_of.' '.strtolower($TEXT['OF']).' '.$total_num; |
247 | 218 |
$display_previous_next_links = ''; |
248 |
} |
|
249 |
else |
|
250 |
{ |
|
219 |
} else { |
|
251 | 220 |
$display_previous_next_links = 'none'; |
252 | 221 |
} |
253 | 222 |
|
... | ... | |
264 | 233 |
{ |
265 | 234 |
print str_replace( array('[NEXT_PAGE_LINK]','[NEXT_LINK]','[PREVIOUS_PAGE_LINK]','[PREVIOUS_LINK]','[OUT_OF]','[OF]','[DISPLAY_PREVIOUS_NEXT_LINKS]'), |
266 | 235 |
array('','','','','','', $display_previous_next_links), $setting_header); |
267 |
} |
|
268 |
else |
|
269 |
{ |
|
236 |
} else { |
|
270 | 237 |
print str_replace( array('[NEXT_PAGE_LINK]','[NEXT_LINK]','[PREVIOUS_PAGE_LINK]','[PREVIOUS_LINK]','[OUT_OF]','[OF]','[DISPLAY_PREVIOUS_NEXT_LINKS]'), |
271 | 238 |
array($next_page_link, $next_link, $previous_page_link, $previous_link, $out_of, $of, $display_previous_next_links), $setting_header); |
272 | 239 |
} |
... | ... | |
280 | 247 |
</div> |
281 | 248 |
<?php |
282 | 249 |
} |
283 |
while($post = $query_posts->fetchRow())
|
|
250 |
while( false != ($post = $query_posts->fetchRow()) )
|
|
284 | 251 |
{ |
285 | 252 |
if(isset($groups[$post['group_id']]['active']) AND $groups[$post['group_id']]['active'] != false) |
286 | 253 |
{ // Make sure parent group is active |
... | ... | |
291 | 258 |
{ |
292 | 259 |
$post_date = gmdate(DATE_FORMAT, $post['published_when']+TIMEZONE); |
293 | 260 |
$post_time = gmdate(TIME_FORMAT, $post['published_when']+TIMEZONE); |
294 |
} |
|
295 |
else |
|
296 |
{ |
|
261 |
} else { |
|
297 | 262 |
$post_date = gmdate(DATE_FORMAT, $post['posted_when']+TIMEZONE); |
298 | 263 |
$post_time = gmdate(TIME_FORMAT, $post['posted_when']+TIMEZONE); |
299 | 264 |
} |
... | ... | |
307 | 272 |
$post_link_path = str_replace(WB_URL, WB_PATH,$post_link); |
308 | 273 |
if(file_exists($post_link_path)) |
309 | 274 |
{ |
310 |
$create_date = date(DATE_FORMAT, filectime ( $post_link_path )); |
|
311 |
$create_time = date(TIME_FORMAT, filectime ( $post_link_path )); |
|
312 |
} |
|
313 |
else |
|
314 |
{ |
|
275 |
$create_date = date(DATE_FORMAT, filemtime ( $post_link_path )); |
|
276 |
$create_time = date(TIME_FORMAT, filemtime ( $post_link_path )); |
|
277 |
} else { |
|
315 | 278 |
$create_date = $publ_date; |
316 | 279 |
$create_time = $publ_time; |
317 | 280 |
} |
... | ... | |
349 | 312 |
if($post_long_len < 9) |
350 | 313 |
{ |
351 | 314 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, '#" onclick="javascript:void(0);return false;" style="cursor:no-drop;', $post_date, $post_time, $create_date, $create_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], '', 'hidden'); |
352 |
} |
|
353 |
else |
|
354 |
{ |
|
315 |
} else { |
|
355 | 316 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $create_date, $create_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $MOD_NEWS['TEXT_READ_MORE'], 'visible'); |
356 | 317 |
} |
357 |
} |
|
358 |
else |
|
359 |
{ |
|
318 |
} else { |
|
360 | 319 |
if($post_long_len < 9) |
361 | 320 |
{ |
362 | 321 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, '#" onclick="javascript:void(0);return false;" style="cursor:no-drop;', $post_date, $post_time, $create_date, $create_time, $publ_date, $publ_time, '', '', '', '', '','hidden'); |
363 |
} |
|
364 |
else |
|
365 |
{ |
|
322 |
} else { |
|
366 | 323 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $create_date, $create_time, $publ_date, $publ_time, '', '', '', '', $MOD_NEWS['TEXT_READ_MORE'],'visible'); |
367 | 324 |
} |
368 | 325 |
} |
... | ... | |
397 | 354 |
$setting_comments_header = ($fetch_settings['comments_header']); |
398 | 355 |
$setting_comments_loop = ($fetch_settings['comments_loop']); |
399 | 356 |
$setting_comments_footer = ($fetch_settings['comments_footer']); |
400 |
} else |
|
401 |
{ |
|
357 |
} else { |
|
402 | 358 |
$setting_post_header = ''; |
403 | 359 |
$setting_post_footer = ''; |
404 | 360 |
$setting_comments_header = ''; |
... | ... | |
420 | 376 |
if(isset($_GET['p']) AND $position > 0) { $page_link .= '&'; } else { $page_link .= '?'; } |
421 | 377 |
$page_link .= 'g='.$_GET['g']; |
422 | 378 |
} |
423 |
} |
|
424 |
else |
|
425 |
{ |
|
379 |
} else { |
|
426 | 380 |
exit($MESSAGE['PAGES']['NOT_FOUND']); |
427 | 381 |
} |
428 | 382 |
|
... | ... | |
430 | 384 |
$t = time(); |
431 | 385 |
$query_post = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts |
432 | 386 |
WHERE post_id = '".POST_ID."' AND active = '1' |
433 |
AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t) |
|
434 |
"); |
|
387 |
AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t)"); |
|
435 | 388 |
|
436 | 389 |
if($query_post->numRows() > 0) |
437 | 390 |
{ |
... | ... | |
461 | 414 |
$post_link_path = str_replace(WB_URL, WB_PATH,$post_link); |
462 | 415 |
if(file_exists($post_link_path)) |
463 | 416 |
{ |
464 |
$create_date = date(DATE_FORMAT, filectime ( $post_link_path )); |
|
465 |
$create_time = date(TIME_FORMAT, filectime ( $post_link_path )); |
|
466 |
} |
|
467 |
else |
|
468 |
{ |
|
417 |
$create_date = date(DATE_FORMAT, filemtime ( $post_link_path )); |
|
418 |
$create_time = date(TIME_FORMAT, filemtime ( $post_link_path )); |
|
419 |
} else { |
|
469 | 420 |
$create_date = $publ_date; |
470 | 421 |
$create_time = $publ_time; |
471 | 422 |
} |
... | ... | |
484 | 435 |
if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') |
485 | 436 |
{ |
486 | 437 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $MOD_NEWS['TEXT_BACK'], $MOD_NEWS['TEXT_LAST_CHANGED'],$post_date, $MOD_NEWS['TEXT_AT'], $post_time, $create_date, $create_time, $publ_date, $publ_time, $MOD_NEWS['TEXT_POSTED_BY'], $MOD_NEWS['TEXT_ON'], $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email']); |
487 |
} |
|
488 |
else |
|
489 |
{ |
|
438 |
} else { |
|
490 | 439 |
$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $MOD_NEWS['TEXT_BACK'], $MOD_NEWS['TEXT_LAST_CHANGED'], $post_date, $MOD_NEWS['TEXT_AT'], $post_time, $create_date, $create_time, $publ_date, $publ_time, $MOD_NEWS['TEXT_POSTED_BY'], $MOD_NEWS['TEXT_ON'], '', '', '', ''); |
491 | 440 |
} |
492 | 441 |
|
493 | 442 |
$post_long = ($post['content_long']); |
494 | 443 |
} |
495 |
} |
|
496 |
else |
|
497 |
{ |
|
444 |
} else { |
|
498 | 445 |
$wb->print_error($MESSAGE['FRONTEND']['SORRY_NO_ACTIVE_SECTIONS'], "javascript: history.go(-1);", false); |
499 | 446 |
exit(0); |
500 | 447 |
} |
... | ... | |
520 | 467 |
|
521 | 468 |
// Query for comments |
522 | 469 |
$query_comments = $database->query("SELECT title,comment,commented_when,commented_by FROM ".TABLE_PREFIX."mod_news_comments WHERE post_id = '".POST_ID."' ORDER BY commented_when ASC"); |
523 |
if($query_comments->numRows() > 0) { |
|
524 |
while($comment = $query_comments->fetchRow()) { |
|
470 |
if($query_comments->numRows() > 0) |
|
471 |
{ |
|
472 |
while( false != ($comment = $query_comments->fetchRow()) ) |
|
473 |
{ |
|
525 | 474 |
// Display Comments without slashes, but with new-line characters |
526 | 475 |
$comment['comment'] = nl2br($wb->strip_slashes($comment['comment'])); |
527 | 476 |
$comment['title'] = $wb->strip_slashes($comment['title']); |
... | ... | |
530 | 479 |
$commented_time = gmdate(TIME_FORMAT, $comment['commented_when']+TIMEZONE); |
531 | 480 |
$uid = $comment['commented_by']; |
532 | 481 |
$vars = array('[TITLE]','[COMMENT]','[TEXT_ON]','[DATE]','[TEXT_AT]','[TIME]','[TEXT_BY]','[USER_ID]','[USERNAME]','[DISPLAY_NAME]', '[EMAIL]'); |
533 |
if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') { |
|
482 |
if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') |
|
483 |
{ |
|
534 | 484 |
$values = array(($comment['title']), ($comment['comment']), $MOD_NEWS['TEXT_ON'], $commented_date, $MOD_NEWS['TEXT_AT'], $commented_time, $MOD_NEWS['TEXT_BY'], $uid, ($users[$uid]['username']), ($users[$uid]['display_name']), ($users[$uid]['email'])); |
535 | 485 |
} else { |
536 | 486 |
$values = array(($comment['title']), ($comment['comment']), $MOD_NEWS['TEXT_ON'], $commented_date, $MOD_NEWS['TEXT_AT'], $commented_time, $MOD_NEWS['TEXT_BY'], '0', strtolower($TEXT['UNKNOWN']), $TEXT['UNKNOWN'], ''); |
... | ... | |
542 | 492 |
$content = ''; |
543 | 493 |
if(isset($TEXT['NONE_FOUND'])) { |
544 | 494 |
$content .= '<tr><td>'.$TEXT['NONE_FOUND'].'<br /></td></tr>'; |
545 |
} |
|
546 |
else |
|
547 |
{ |
|
495 |
} else { |
|
548 | 496 |
$content .= '<tr><td>None Found<br /></td></tr>'; |
549 | 497 |
} |
550 | 498 |
print $content; |
... | ... | |
557 | 505 |
|
558 | 506 |
} |
559 | 507 |
|
560 |
} |
|
508 |
}
|
|
561 | 509 |
|
562 |
if(ENABLED_ASP) { |
|
510 |
if(ENABLED_ASP) |
|
511 |
{ |
|
563 | 512 |
$_SESSION['comes_from_view'] = POST_ID; |
564 | 513 |
$_SESSION['comes_from_view_time'] = time(); |
565 | 514 |
} |
566 | 515 |
branches/2.8.x/wb/modules/news/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 |
branches/2.8.x/wb/modules/news/modify_post.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 | 2 |
/* |
6 |
|
|
7 |
Website Baker Project <http://www.websitebaker.org/> |
|
8 |
Copyright (C) 2004-2009, Ryan Djurovich |
|
9 |
|
|
10 |
Website Baker is free software; you can redistribute it and/or modify |
|
11 |
it under the terms of the GNU General Public License as published by |
|
12 |
the Free Software Foundation; either version 2 of the License, or |
|
13 |
(at your option) any later version. |
|
14 |
|
|
15 |
Website Baker is distributed in the hope that it will be useful, |
|
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
18 |
GNU General Public License for more details. |
|
19 |
|
|
20 |
You should have received a copy of the GNU General Public License |
|
21 |
along with Website Baker; if not, write to the Free Software |
|
22 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
23 |
|
|
3 |
* |
|
4 |
* About WebsiteBaker |
|
5 |
* |
|
6 |
* Website Baker is a PHP-based Content Management System (CMS) |
|
7 |
* designed with one goal in mind: to enable its users to produce websites |
|
8 |
* with ease. |
|
9 |
* |
|
10 |
* LICENSE INFORMATION |
|
11 |
* |
|
12 |
* WebsiteBaker is free software; you can redistribute it and/or |
|
13 |
* modify it under the terms of the GNU General Public License |
|
14 |
* as published by the Free Software Foundation; either version 2 |
|
15 |
* of the License, or (at your option) any later version. |
|
16 |
* |
|
17 |
* WebsiteBaker is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
20 |
* See the GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25 |
* |
|
26 |
* WebsiteBaker Extra Information |
|
27 |
* |
|
28 |
* |
|
24 | 29 |
*/ |
30 |
/** |
|
31 |
* |
|
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 |
|
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 |
* |
|
51 |
*/ |
|
25 | 52 |
|
26 | 53 |
require('../../config.php'); |
27 | 54 |
|
... | ... | |
137 | 164 |
<tr> |
138 | 165 |
<td> |
139 | 166 |
<?php |
140 |
show_wysiwyg_editor("short","short",htmlspecialchars($fetch_content['content_short']),"100%","150px");
|
|
167 |
show_wysiwyg_editor("short","short",htmlspecialchars($fetch_content['content_short']),"100%","200px");
|
|
141 | 168 |
?> |
142 | 169 |
</td> |
143 | 170 |
</tr> |
... | ... | |
147 | 174 |
<tr> |
148 | 175 |
<td> |
149 | 176 |
<?php |
150 |
show_wysiwyg_editor("long","long",htmlspecialchars($fetch_content['content_long']),"100%","350px");
|
|
177 |
show_wysiwyg_editor("long","long",htmlspecialchars($fetch_content['content_long']),"100%","650px");
|
|
151 | 178 |
?> |
152 | 179 |
</td> |
153 | 180 |
</tr> |
154 | 181 |
branches/2.8.x/wb/modules/news/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