Revision 1280
Added by Dietmar almost 15 years ago
branches/2.8.x/CHANGELOG | ||
---|---|---|
11 | 11 |
! = Update/Change |
12 | 12 |
|
13 | 13 |
------------------------------------- 2.8.1 ------------------------------------- |
14 |
29-Jan-2010 Dietmar Woellbrink (Luisehahne) |
|
15 |
! continue update headertext |
|
14 | 16 |
28-Jan-2010 Dietmar Woellbrink (Luisehahne) |
15 | 17 |
+ Ticket #927 news module language file in swedish |
16 | 18 |
! update headertext |
branches/2.8.x/wb/upgrade-script.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
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 |
* |
|
29 |
*/ |
|
30 | 2 |
/** |
31 | 3 |
* |
32 | 4 |
* @category backend |
branches/2.8.x/wb/include/editarea/reg_syntax/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
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 |
* Website Baker wrapper functions for the Javascript code editor: "EditArea" |
|
29 |
* |
|
30 |
*/ |
|
31 | 2 |
/** |
32 | 3 |
* |
33 | 4 |
* @category framework |
branches/2.8.x/wb/include/editarea/langs/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
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 |
* Website Baker wrapper functions for the Javascript code editor: "EditArea" |
|
29 |
* |
|
30 |
*/ |
|
31 | 2 |
/** |
32 | 3 |
* |
33 | 4 |
* @category framework |
branches/2.8.x/wb/include/editarea/images/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
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 |
* Website Baker wrapper functions for the Javascript code editor: "EditArea" |
|
29 |
* |
|
30 |
*/ |
|
31 | 2 |
/** |
32 | 3 |
* |
33 | 4 |
* @category framework |
branches/2.8.x/wb/include/editarea/wb_wrapper_edit_area.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
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 |
* Website Baker wrapper functions for the Javascript code editor: "EditArea" |
|
29 |
* |
|
30 |
*/ |
|
31 | 2 |
/** |
32 | 3 |
* |
33 | 4 |
* @category framework |
branches/2.8.x/wb/include/editarea/index.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
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 |
* Website Baker wrapper functions for the Javascript code editor: "EditArea" |
|
29 |
* |
|
30 |
*/ |
|
31 | 2 |
/** |
32 | 3 |
* |
33 | 4 |
* @category framework |
branches/2.8.x/wb/admin/pages/settings2.php | ||
---|---|---|
11 | 11 |
* @platform WebsiteBaker 2.8.x |
12 | 12 |
* @requirements PHP 4.3.4 and higher |
13 | 13 |
* @version $Id$ |
14 |
* @filesource $HeadURL: $
|
|
15 |
* @lastmodified $Date: $
|
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 | 16 |
* |
17 | 17 |
*/ |
18 | 18 |
|
19 | 19 |
branches/2.8.x/wb/admin/interface/version.php | ||
---|---|---|
52 | 52 |
|
53 | 53 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
54 | 54 |
if(!defined('VERSION')) define('VERSION', '2.8.1'); |
55 |
if(!defined('REVISION')) define('REVISION', '1279');
|
|
55 |
if(!defined('REVISION')) define('REVISION', '1280');
|
|
56 | 56 |
|
57 | 57 |
?> |
branches/2.8.x/wb/modules/news/info.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/* |
|
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 |
* |
|
29 |
*/ |
|
30 | 2 |
/** |
31 | 3 |
* |
32 | 4 |
* @category modules |
branches/2.8.x/wb/modules/news/add_post.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 |
require('../../config.php'); |
|
27 |
|
|
28 |
// Include WB admin wrapper script |
|
29 |
require(WB_PATH.'/modules/admin.php'); |
|
30 |
|
|
31 |
// Include the ordering class |
|
32 |
require(WB_PATH.'/framework/class.order.php'); |
|
33 |
// Get new order |
|
34 |
$order = new order(TABLE_PREFIX.'mod_news_posts', 'position', 'post_id', 'section_id'); |
|
35 |
$position = $order->get_new($section_id); |
|
36 |
|
|
37 |
// Get default commenting |
|
38 |
$query_settings = $database->query("SELECT commenting FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '$section_id'"); |
|
39 |
$fetch_settings = $query_settings->fetchRow(); |
|
40 |
$commenting = $fetch_settings['commenting']; |
|
41 |
|
|
42 |
// Insert new row into database |
|
43 |
$database->query("INSERT INTO ".TABLE_PREFIX."mod_news_posts (section_id,page_id,position,commenting,active) VALUES ('$section_id','$page_id','$position','$commenting','1')"); |
|
44 |
|
|
45 |
// Get the id |
|
46 |
$post_id = $database->get_one("SELECT LAST_INSERT_ID()"); |
|
47 |
|
|
48 |
// Say that a new record has been added, then redirect to modify page |
|
49 |
if($database->is_error()) { |
|
50 |
$admin->print_error($database->get_error(), WB_URL.'/modules/news/modify_post.php?page_id='.$page_id.'§ion_id='.$section_id.'&post_id='.$post_id); |
|
51 |
} else { |
|
52 |
$admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/news/modify_post.php?page_id='.$page_id.'§ion_id='.$section_id.'&post_id='.$post_id); |
|
53 |
} |
|
54 |
|
|
55 |
// Print admin footer |
|
56 |
$admin->print_footer(); |
|
57 |
|
|
1 |
<?php |
|
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
18 |
|
|
19 |
require('../../config.php'); |
|
20 |
|
|
21 |
// Include WB admin wrapper script |
|
22 |
require(WB_PATH.'/modules/admin.php'); |
|
23 |
|
|
24 |
// Include the ordering class |
|
25 |
require(WB_PATH.'/framework/class.order.php'); |
|
26 |
// Get new order |
|
27 |
$order = new order(TABLE_PREFIX.'mod_news_posts', 'position', 'post_id', 'section_id'); |
|
28 |
$position = $order->get_new($section_id); |
|
29 |
|
|
30 |
// Get default commenting |
|
31 |
$query_settings = $database->query("SELECT commenting FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '$section_id'"); |
|
32 |
$fetch_settings = $query_settings->fetchRow(); |
|
33 |
$commenting = $fetch_settings['commenting']; |
|
34 |
|
|
35 |
// Insert new row into database |
|
36 |
$database->query("INSERT INTO ".TABLE_PREFIX."mod_news_posts (section_id,page_id,position,commenting,active) VALUES ('$section_id','$page_id','$position','$commenting','1')"); |
|
37 |
|
|
38 |
// Get the id |
|
39 |
$post_id = $database->get_one("SELECT LAST_INSERT_ID()"); |
|
40 |
|
|
41 |
// Say that a new record has been added, then redirect to modify page |
|
42 |
if($database->is_error()) { |
|
43 |
$admin->print_error($database->get_error(), WB_URL.'/modules/news/modify_post.php?page_id='.$page_id.'§ion_id='.$section_id.'&post_id='.$post_id); |
|
44 |
} else { |
|
45 |
$admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/news/modify_post.php?page_id='.$page_id.'§ion_id='.$section_id.'&post_id='.$post_id); |
|
46 |
} |
|
47 |
|
|
48 |
// Print admin footer |
|
49 |
$admin->print_footer(); |
|
50 |
|
|
58 | 51 |
?> |
59 | 52 |
branches/2.8.x/wb/modules/news/search.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 |
function news_search($func_vars) { |
|
27 |
extract($func_vars, EXTR_PREFIX_ALL, 'func'); |
|
28 |
|
|
29 |
// how many lines of excerpt we want to have at most |
|
30 |
$max_excerpt_num = $func_default_max_excerpt; |
|
31 |
// do we want excerpt from comments? |
|
32 |
$excerpt_from_comments = true; // TODO: make this configurable |
|
33 |
$divider = "."; |
|
34 |
$result = false; |
|
35 |
|
|
36 |
// fetch all active news-posts (from active groups) in this section. |
|
37 |
$t = time(); |
|
38 |
$table_posts = TABLE_PREFIX."mod_news_posts"; |
|
39 |
$table_groups = TABLE_PREFIX."mod_news_groups"; |
|
40 |
$query = $func_database->query(" |
|
41 |
SELECT p.post_id, p.title, p.content_short, p.content_long, p.link, p.posted_when, p.posted_by |
|
42 |
FROM $table_posts AS p LEFT OUTER JOIN $table_groups AS g ON p.group_id = g.group_id |
|
43 |
WHERE p.section_id='$func_section_id' AND p.active = '1' AND ( g.active IS NULL OR g.active = '1' ) |
|
44 |
AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t) |
|
45 |
ORDER BY p.post_id DESC |
|
46 |
"); |
|
47 |
// now call print_excerpt() for every single post |
|
48 |
if($query->numRows() > 0) { |
|
49 |
while($res = $query->fetchRow()) { |
|
50 |
$text = $res['title'].$divider.$res['content_short'].$divider.$res['content_long'].$divider; |
|
51 |
// fetch comments and add to $text |
|
52 |
if($excerpt_from_comments) { |
|
53 |
$table = TABLE_PREFIX."mod_news_comments"; |
|
54 |
$commentquery = $func_database->query(" |
|
55 |
SELECT title, comment |
|
56 |
FROM $table |
|
57 |
WHERE post_id='{$res['post_id']}' |
|
58 |
ORDER BY commented_when ASC |
|
59 |
"); |
|
60 |
if($commentquery->numRows() > 0) { |
|
61 |
while($c_res = $commentquery->fetchRow()) { |
|
62 |
$text .= $c_res['title'].$divider.$c_res['comment'].$divider; |
|
63 |
} |
|
64 |
} |
|
65 |
} |
|
66 |
$mod_vars = array( |
|
67 |
'page_link' => $res['link'], // use direct link to news-item |
|
68 |
'page_link_target' => "", |
|
69 |
'page_title' => $func_page_title, |
|
70 |
'page_description' => $res['title'], // use news-title as description |
|
71 |
'page_modified_when' => $res['posted_when'], |
|
72 |
'page_modified_by' => $res['posted_by'], |
|
73 |
'text' => $text, |
|
74 |
'max_excerpt_num' => $max_excerpt_num |
|
75 |
); |
|
76 |
if(print_excerpt2($mod_vars, $func_vars)) { |
|
77 |
$result = true; |
|
78 |
} |
|
79 |
} |
|
80 |
} |
|
81 |
|
|
82 |
// now fetch group-titles - ignore those without (active) postings |
|
83 |
$table_groups = TABLE_PREFIX."mod_news_groups"; |
|
84 |
$table_posts = TABLE_PREFIX."mod_news_posts"; |
|
85 |
$query = $func_database->query(" |
|
86 |
SELECT DISTINCT g.title, g.group_id |
|
87 |
FROM $table_groups AS g INNER JOIN $table_posts AS p ON g.group_id = p.group_id |
|
88 |
WHERE g.section_id='$func_section_id' AND g.active = '1' AND p.active = '1' |
|
89 |
"); |
|
90 |
// now call print_excerpt() for every single group, too |
|
91 |
if($query->numRows() > 0) { |
|
92 |
while($res = $query->fetchRow()) { |
|
93 |
$mod_vars = array( |
|
94 |
'page_link' => $func_page_link, |
|
95 |
'page_link_target' => "&g=".$res['group_id'], |
|
96 |
'page_title' => $func_page_title, |
|
97 |
'page_description' => $func_page_description, |
|
98 |
'page_modified_when' => $func_page_modified_when, |
|
99 |
'page_modified_by' => $func_page_modified_by, |
|
100 |
'text' => $res['title'].$divider, |
|
101 |
'max_excerpt_num' => $max_excerpt_num |
|
102 |
); |
|
103 |
if(print_excerpt2($mod_vars, $func_vars)) { |
|
104 |
$result = true; |
|
105 |
} |
|
106 |
} |
|
107 |
} |
|
108 |
return $result; |
|
109 |
} |
|
110 |
|
|
111 |
?> |
|
1 |
<?php |
|
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
18 |
|
|
19 |
function news_search($func_vars) { |
|
20 |
extract($func_vars, EXTR_PREFIX_ALL, 'func'); |
|
21 |
|
|
22 |
// how many lines of excerpt we want to have at most |
|
23 |
$max_excerpt_num = $func_default_max_excerpt; |
|
24 |
// do we want excerpt from comments? |
|
25 |
$excerpt_from_comments = true; // TODO: make this configurable |
|
26 |
$divider = "."; |
|
27 |
$result = false; |
|
28 |
|
|
29 |
// fetch all active news-posts (from active groups) in this section. |
|
30 |
$t = time(); |
|
31 |
$table_posts = TABLE_PREFIX."mod_news_posts"; |
|
32 |
$table_groups = TABLE_PREFIX."mod_news_groups"; |
|
33 |
$query = $func_database->query(" |
|
34 |
SELECT p.post_id, p.title, p.content_short, p.content_long, p.link, p.posted_when, p.posted_by |
|
35 |
FROM $table_posts AS p LEFT OUTER JOIN $table_groups AS g ON p.group_id = g.group_id |
|
36 |
WHERE p.section_id='$func_section_id' AND p.active = '1' AND ( g.active IS NULL OR g.active = '1' ) |
|
37 |
AND (published_when = '0' OR published_when <= $t) AND (published_until = 0 OR published_until >= $t) |
|
38 |
ORDER BY p.post_id DESC |
|
39 |
"); |
|
40 |
// now call print_excerpt() for every single post |
|
41 |
if($query->numRows() > 0) { |
|
42 |
while($res = $query->fetchRow()) { |
|
43 |
$text = $res['title'].$divider.$res['content_short'].$divider.$res['content_long'].$divider; |
|
44 |
// fetch comments and add to $text |
|
45 |
if($excerpt_from_comments) { |
|
46 |
$table = TABLE_PREFIX."mod_news_comments"; |
|
47 |
$commentquery = $func_database->query(" |
|
48 |
SELECT title, comment |
|
49 |
FROM $table |
|
50 |
WHERE post_id='{$res['post_id']}' |
|
51 |
ORDER BY commented_when ASC |
|
52 |
"); |
|
53 |
if($commentquery->numRows() > 0) { |
|
54 |
while($c_res = $commentquery->fetchRow()) { |
|
55 |
$text .= $c_res['title'].$divider.$c_res['comment'].$divider; |
|
56 |
} |
|
57 |
} |
|
58 |
} |
|
59 |
$mod_vars = array( |
|
60 |
'page_link' => $res['link'], // use direct link to news-item |
|
61 |
'page_link_target' => "", |
|
62 |
'page_title' => $func_page_title, |
|
63 |
'page_description' => $res['title'], // use news-title as description |
|
64 |
'page_modified_when' => $res['posted_when'], |
|
65 |
'page_modified_by' => $res['posted_by'], |
|
66 |
'text' => $text, |
|
67 |
'max_excerpt_num' => $max_excerpt_num |
|
68 |
); |
|
69 |
if(print_excerpt2($mod_vars, $func_vars)) { |
|
70 |
$result = true; |
|
71 |
} |
|
72 |
} |
|
73 |
} |
|
74 |
|
|
75 |
// now fetch group-titles - ignore those without (active) postings |
|
76 |
$table_groups = TABLE_PREFIX."mod_news_groups"; |
|
77 |
$table_posts = TABLE_PREFIX."mod_news_posts"; |
|
78 |
$query = $func_database->query(" |
|
79 |
SELECT DISTINCT g.title, g.group_id |
|
80 |
FROM $table_groups AS g INNER JOIN $table_posts AS p ON g.group_id = p.group_id |
|
81 |
WHERE g.section_id='$func_section_id' AND g.active = '1' AND p.active = '1' |
|
82 |
"); |
|
83 |
// now call print_excerpt() for every single group, too |
|
84 |
if($query->numRows() > 0) { |
|
85 |
while($res = $query->fetchRow()) { |
|
86 |
$mod_vars = array( |
|
87 |
'page_link' => $func_page_link, |
|
88 |
'page_link_target' => "&g=".$res['group_id'], |
|
89 |
'page_title' => $func_page_title, |
|
90 |
'page_description' => $func_page_description, |
|
91 |
'page_modified_when' => $func_page_modified_when, |
|
92 |
'page_modified_by' => $func_page_modified_by, |
|
93 |
'text' => $res['title'].$divider, |
|
94 |
'max_excerpt_num' => $max_excerpt_num |
|
95 |
); |
|
96 |
if(print_excerpt2($mod_vars, $func_vars)) { |
|
97 |
$result = true; |
|
98 |
} |
|
99 |
} |
|
100 |
} |
|
101 |
return $result; |
|
102 |
} |
|
103 |
|
|
104 |
?> |
|
112 | 105 |
branches/2.8.x/wb/modules/news/modify_settings.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
2 | 18 |
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 | 19 |
require('../../config.php'); |
27 | 20 |
|
28 | 21 |
// Include WB admin wrapper script |
branches/2.8.x/wb/modules/news/delete_post.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 |
require('../../config.php'); |
|
27 |
|
|
28 |
// Get id |
|
29 |
if(!isset($_GET['post_id']) OR !is_numeric($_GET['post_id'])) { |
|
30 |
header("Location: ".ADMIN_URL."/pages/index.php"); |
|
31 |
exit(0); |
|
32 |
} else { |
|
33 |
$post_id = $_GET['post_id']; |
|
34 |
} |
|
35 |
|
|
36 |
// Include WB admin wrapper script |
|
37 |
$update_when_modified = true; // Tells script to update when this page was last updated |
|
38 |
require(WB_PATH.'/modules/admin.php'); |
|
39 |
|
|
40 |
// Get post details |
|
41 |
$query_details = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE post_id = '$post_id'"); |
|
42 |
if($query_details->numRows() > 0) { |
|
43 |
$get_details = $query_details->fetchRow(); |
|
44 |
} else { |
|
45 |
$admin->print_error($TEXT['NOT_FOUND'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
|
46 |
} |
|
47 |
|
|
48 |
// Unlink post access file |
|
49 |
if(is_writable(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION)) { |
|
50 |
unlink(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION); |
|
51 |
} |
|
52 |
|
|
53 |
// Delete post |
|
54 |
$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_posts WHERE post_id = '$post_id' LIMIT 1"); |
|
55 |
$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_comments WHERE post_id = '$post_id'"); |
|
56 |
|
|
57 |
// Clean up ordering |
|
58 |
require(WB_PATH.'/framework/class.order.php'); |
|
59 |
$order = new order(TABLE_PREFIX.'mod_news_posts', 'position', 'post_id', 'section_id'); |
|
60 |
$order->clean($section_id); |
|
61 |
|
|
62 |
// Check if there is a db error, otherwise say successful |
|
63 |
if($database->is_error()) { |
|
64 |
$admin->print_error($database->get_error(), WB_URL.'/modules/news/modify_post.php?page_id='.$page_id.'&post_id='.$post_id); |
|
65 |
} else { |
|
66 |
$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
|
67 |
} |
|
68 |
|
|
69 |
// Print admin footer |
|
70 |
$admin->print_footer(); |
|
71 |
|
|
1 |
<?php |
|
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
18 |
|
|
19 |
require('../../config.php'); |
|
20 |
|
|
21 |
// Get id |
|
22 |
if(!isset($_GET['post_id']) OR !is_numeric($_GET['post_id'])) { |
|
23 |
header("Location: ".ADMIN_URL."/pages/index.php"); |
|
24 |
exit(0); |
|
25 |
} else { |
|
26 |
$post_id = $_GET['post_id']; |
|
27 |
} |
|
28 |
|
|
29 |
// Include WB admin wrapper script |
|
30 |
$update_when_modified = true; // Tells script to update when this page was last updated |
|
31 |
require(WB_PATH.'/modules/admin.php'); |
|
32 |
|
|
33 |
// Get post details |
|
34 |
$query_details = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE post_id = '$post_id'"); |
|
35 |
if($query_details->numRows() > 0) { |
|
36 |
$get_details = $query_details->fetchRow(); |
|
37 |
} else { |
|
38 |
$admin->print_error($TEXT['NOT_FOUND'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
|
39 |
} |
|
40 |
|
|
41 |
// Unlink post access file |
|
42 |
if(is_writable(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION)) { |
|
43 |
unlink(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION); |
|
44 |
} |
|
45 |
|
|
46 |
// Delete post |
|
47 |
$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_posts WHERE post_id = '$post_id' LIMIT 1"); |
|
48 |
$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_comments WHERE post_id = '$post_id'"); |
|
49 |
|
|
50 |
// Clean up ordering |
|
51 |
require(WB_PATH.'/framework/class.order.php'); |
|
52 |
$order = new order(TABLE_PREFIX.'mod_news_posts', 'position', 'post_id', 'section_id'); |
|
53 |
$order->clean($section_id); |
|
54 |
|
|
55 |
// Check if there is a db error, otherwise say successful |
|
56 |
if($database->is_error()) { |
|
57 |
$admin->print_error($database->get_error(), WB_URL.'/modules/news/modify_post.php?page_id='.$page_id.'&post_id='.$post_id); |
|
58 |
} else { |
|
59 |
$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
|
60 |
} |
|
61 |
|
|
62 |
// Print admin footer |
|
63 |
$admin->print_footer(); |
|
64 |
|
|
72 | 65 |
?> |
73 | 66 |
branches/2.8.x/wb/modules/news/uninstall.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 |
// Must include code to stop this file being access directly |
|
27 |
if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); } |
|
28 |
|
|
29 |
$database->query("DELETE FROM ".TABLE_PREFIX."search WHERE name = 'module' AND value = 'news'"); |
|
30 |
$database->query("DELETE FROM ".TABLE_PREFIX."search WHERE extra = 'news'"); |
|
31 |
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_posts"); |
|
32 |
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_groups"); |
|
33 |
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_comments"); |
|
34 |
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_settings"); |
|
35 |
|
|
36 |
require_once(WB_PATH.'/framework/functions.php'); |
|
37 |
rm_full_dir(WB_PATH.PAGES_DIRECTORY.'/posts'); |
|
38 |
rm_full_dir(WB_PATH.MEDIA_DIRECTORY.'/.news'); |
|
39 |
|
|
1 |
<?php |
|
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
18 |
|
|
19 |
// Must include code to stop this file being access directly |
|
20 |
if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); } |
|
21 |
|
|
22 |
$database->query("DELETE FROM ".TABLE_PREFIX."search WHERE name = 'module' AND value = 'news'"); |
|
23 |
$database->query("DELETE FROM ".TABLE_PREFIX."search WHERE extra = 'news'"); |
|
24 |
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_posts"); |
|
25 |
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_groups"); |
|
26 |
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_comments"); |
|
27 |
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_settings"); |
|
28 |
|
|
29 |
require_once(WB_PATH.'/framework/functions.php'); |
|
30 |
rm_full_dir(WB_PATH.PAGES_DIRECTORY.'/posts'); |
|
31 |
rm_full_dir(WB_PATH.MEDIA_DIRECTORY.'/.news'); |
|
32 |
|
|
40 | 33 |
?> |
41 | 34 |
branches/2.8.x/wb/modules/news/modify_comment.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
2 | 18 |
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 | 19 |
require('../../config.php'); |
27 | 20 |
|
28 | 21 |
// Get id |
29 | 22 |
branches/2.8.x/wb/modules/news/save_group.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
2 | 18 |
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 | 19 |
require('../../config.php'); |
27 | 20 |
|
28 | 21 |
// Get id |
29 | 22 |
branches/2.8.x/wb/modules/news/move_up.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
2 | 18 |
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 | 19 |
require('../../config.php'); |
27 | 20 |
|
28 | 21 |
// Get id |
29 | 22 |
branches/2.8.x/wb/modules/news/save_settings.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 |
require('../../config.php'); |
|
27 |
|
|
28 |
// Include WB admin wrapper script |
|
29 |
$update_when_modified = true; // Tells script to update when this page was last updated |
|
30 |
require(WB_PATH.'/modules/admin.php'); |
|
31 |
|
|
32 |
// This code removes any <?php tags and adds slashes |
|
33 |
$friendly = array('<', '>', '?php'); |
|
34 |
$raw = array('<', '>', ''); |
|
35 |
$header = $admin->add_slashes(str_replace($friendly, $raw, $_POST['header'])); |
|
36 |
$post_loop = $admin->add_slashes(str_replace($friendly, $raw, $_POST['post_loop'])); |
|
37 |
$footer = $admin->add_slashes(str_replace($friendly, $raw, $_POST['footer'])); |
|
38 |
$post_header = $admin->add_slashes(str_replace($friendly, $raw, $_POST['post_header'])); |
|
39 |
$post_footer = $admin->add_slashes(str_replace($friendly, $raw, $_POST['post_footer'])); |
|
40 |
$comments_header = $admin->add_slashes(str_replace($friendly, $raw, $_POST['comments_header'])); |
|
41 |
$comments_loop = $admin->add_slashes(str_replace($friendly, $raw, $_POST['comments_loop'])); |
|
42 |
$comments_footer = $admin->add_slashes(str_replace($friendly, $raw, $_POST['comments_footer'])); |
|
43 |
$comments_page = $admin->add_slashes(str_replace($friendly, $raw, $_POST['comments_page'])); |
|
44 |
$commenting = $admin->add_slashes($_POST['commenting']); |
|
45 |
$posts_per_page = $admin->add_slashes($_POST['posts_per_page']); |
|
46 |
$use_captcha = $admin->add_slashes($_POST['use_captcha']); |
|
47 |
if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { |
|
48 |
$resize = $_POST['resize']; |
|
49 |
} else { |
|
50 |
$resize = ''; |
|
51 |
} |
|
52 |
|
|
53 |
// Update settings |
|
54 |
$database->query("UPDATE ".TABLE_PREFIX."mod_news_settings SET header = '$header', post_loop = '$post_loop', footer = '$footer', posts_per_page = '$posts_per_page', post_header = '$post_header', post_footer = '$post_footer', comments_header = '$comments_header', comments_loop = '$comments_loop', comments_footer = '$comments_footer', comments_page = '$comments_page', commenting = '$commenting', resize = '$resize', use_captcha = '$use_captcha' WHERE section_id = '$section_id'"); |
|
55 |
|
|
56 |
// Check if there is a db error, otherwise say successful |
|
57 |
if($database->is_error()) { |
|
58 |
$admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
|
59 |
} else { |
|
60 |
$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
|
61 |
} |
|
62 |
|
|
63 |
// Print admin footer |
|
64 |
$admin->print_footer(); |
|
65 |
|
|
1 |
<?php |
|
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
18 |
|
|
19 |
require('../../config.php'); |
|
20 |
|
|
21 |
// Include WB admin wrapper script |
|
22 |
$update_when_modified = true; // Tells script to update when this page was last updated |
|
23 |
require(WB_PATH.'/modules/admin.php'); |
|
24 |
|
|
25 |
// This code removes any <?php tags and adds slashes |
|
26 |
$friendly = array('<', '>', '?php'); |
|
27 |
$raw = array('<', '>', ''); |
|
28 |
$header = $admin->add_slashes(str_replace($friendly, $raw, $_POST['header'])); |
|
29 |
$post_loop = $admin->add_slashes(str_replace($friendly, $raw, $_POST['post_loop'])); |
|
30 |
$footer = $admin->add_slashes(str_replace($friendly, $raw, $_POST['footer'])); |
|
31 |
$post_header = $admin->add_slashes(str_replace($friendly, $raw, $_POST['post_header'])); |
|
32 |
$post_footer = $admin->add_slashes(str_replace($friendly, $raw, $_POST['post_footer'])); |
|
33 |
$comments_header = $admin->add_slashes(str_replace($friendly, $raw, $_POST['comments_header'])); |
|
34 |
$comments_loop = $admin->add_slashes(str_replace($friendly, $raw, $_POST['comments_loop'])); |
|
35 |
$comments_footer = $admin->add_slashes(str_replace($friendly, $raw, $_POST['comments_footer'])); |
|
36 |
$comments_page = $admin->add_slashes(str_replace($friendly, $raw, $_POST['comments_page'])); |
|
37 |
$commenting = $admin->add_slashes($_POST['commenting']); |
|
38 |
$posts_per_page = $admin->add_slashes($_POST['posts_per_page']); |
|
39 |
$use_captcha = $admin->add_slashes($_POST['use_captcha']); |
|
40 |
if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { |
|
41 |
$resize = $_POST['resize']; |
|
42 |
} else { |
|
43 |
$resize = ''; |
|
44 |
} |
|
45 |
|
|
46 |
// Update settings |
|
47 |
$database->query("UPDATE ".TABLE_PREFIX."mod_news_settings SET header = '$header', post_loop = '$post_loop', footer = '$footer', posts_per_page = '$posts_per_page', post_header = '$post_header', post_footer = '$post_footer', comments_header = '$comments_header', comments_loop = '$comments_loop', comments_footer = '$comments_footer', comments_page = '$comments_page', commenting = '$commenting', resize = '$resize', use_captcha = '$use_captcha' WHERE section_id = '$section_id'"); |
|
48 |
|
|
49 |
// Check if there is a db error, otherwise say successful |
|
50 |
if($database->is_error()) { |
|
51 |
$admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
|
52 |
} else { |
|
53 |
$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
|
54 |
} |
|
55 |
|
|
56 |
// Print admin footer |
|
57 |
$admin->print_footer(); |
|
58 |
|
|
66 | 59 |
?> |
67 | 60 |
branches/2.8.x/wb/modules/news/delete_comment.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
2 | 18 |
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 | 19 |
require('../../config.php'); |
27 | 20 |
|
28 | 21 |
// Get id |
29 | 22 |
branches/2.8.x/wb/modules/news/modify.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
2 | 18 |
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 | 19 |
// Must include code to stop this file being access directly |
27 | 20 |
if(!defined('WB_PATH')) { exit("Cannot access this file directly"); } |
28 | 21 |
$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_posts WHERE page_id = '$page_id' and section_id = '$section_id' and title=''"); |
29 | 22 |
branches/2.8.x/wb/modules/news/add.php | ||
---|---|---|
1 | 1 |
<?php |
2 |
/** |
|
3 |
* |
|
4 |
* @category modules |
|
5 |
* @package news |
|
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2010, Website Baker Org. e.V. |
|
9 |
* @link http://www.websitebaker2.org/ |
|
10 |
* @license http://www.gnu.org/licenses/gpl.html |
|
11 |
* @platform WebsiteBaker 2.8.x |
|
12 |
* @requirements PHP 4.3.4 and higher |
|
13 |
* @version $Id$ |
|
14 |
* @filesource $HeadURL$ |
|
15 |
* @lastmodified $Date$ |
|
16 |
* |
|
17 |
*/ |
|
2 | 18 |
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
|
|
24 |
*/ |
|
25 |
|
|
26 | 19 |
// Must include code to stop this file being access directly |
27 | 20 |
if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); } |
28 | 21 |
|
29 | 22 |
branches/2.8.x/wb/modules/news/move_down.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
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 |
Also available in: Unified diff
continue update headertext