Revision 317
Added by stefan over 18 years ago
save_settings.php | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 | 3 |
// $Id$ |
4 |
|
|
4 |
|
|
5 | 5 |
/* |
6 | 6 |
|
7 | 7 |
Website Baker Project <http://www.websitebaker.org/> |
... | ... | |
22 | 22 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 | 23 |
|
24 | 24 |
*/ |
25 |
|
|
26 |
require('../../config.php'); |
|
27 | 25 |
|
26 |
require('../../config.php'); |
|
27 |
|
|
28 | 28 |
// Include WB admin wrapper script |
29 | 29 |
$update_when_modified = true; // Tells script to update when this page was last updated |
30 |
require(WB_PATH.'/modules/admin.php');
|
|
31 |
|
|
30 |
require(WB_PATH.'/modules/admin.php'); |
|
31 |
|
|
32 | 32 |
// This code removes any <?php tags and adds slashes |
33 | 33 |
$friendly = array('<', '>', '?php'); |
34 |
$raw = array('<', '>', '');
|
|
35 |
$header = $admin->add_slashes(str_replace($friendly, $raw, $_POST['header']));
|
|
34 |
$raw = array('<', '>', ''); |
|
35 |
$header = $admin->add_slashes(str_replace($friendly, $raw, $_POST['header'])); |
|
36 | 36 |
$post_loop = $admin->add_slashes(str_replace($friendly, $raw, $_POST['post_loop'])); |
37 | 37 |
$footer = $admin->add_slashes(str_replace($friendly, $raw, $_POST['footer'])); |
38 | 38 |
$post_header = $admin->add_slashes(str_replace($friendly, $raw, $_POST['post_header'])); |
... | ... | |
51 | 51 |
$use_captcha = false; |
52 | 52 |
} |
53 | 53 |
|
54 |
// Update settings
|
|
55 |
$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'");
|
|
54 |
// Update settings |
|
55 |
$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'"); |
|
56 | 56 |
|
57 | 57 |
// Check if there is a db error, otherwise say successful |
58 | 58 |
if($database->is_error()) { |
... | ... | |
63 | 63 |
|
64 | 64 |
// Print admin footer |
65 | 65 |
$admin->print_footer(); |
66 |
|
|
66 |
|
|
67 | 67 |
?> |
Also available in: Unified diff
Changed all line endings to Unix stlye