1
|
<?php
|
2
|
|
3
|
// $Id$
|
4
|
|
5
|
/*
|
6
|
|
7
|
Website Baker Project <http://www.websitebaker.org/>
|
8
|
Copyright (C) 2004-2008, 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 functions to edit the optional module CSS files (frontend.css, backend.css)
|
32
|
require_once('css.functions.php');
|
33
|
|
34
|
// check if module language file exists for the language set by the user (e.g. DE, EN)
|
35
|
if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php')) {
|
36
|
// no module language file exists for the language set by the user, include default module language file EN.php
|
37
|
require_once(WB_PATH .'/modules/news/languages/EN.php');
|
38
|
} else {
|
39
|
// a module language file exists for the language defined by the user, load it
|
40
|
require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php');
|
41
|
}
|
42
|
|
43
|
// Get header and footer
|
44
|
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '$section_id'");
|
45
|
$fetch_content = $query_content->fetchRow();
|
46
|
|
47
|
// Set raw html <'s and >'s to be replace by friendly html code
|
48
|
$raw = array('<', '>');
|
49
|
$friendly = array('<', '>');
|
50
|
|
51
|
// check if backend.css file needs to be included into the <body></body> of modify.php
|
52
|
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/form/backend.css")) {
|
53
|
echo '<style type="text/css">';
|
54
|
include(WB_PATH .'/modules/form/backend.css');
|
55
|
echo "\n</style>\n";
|
56
|
}
|
57
|
|
58
|
?>
|
59
|
<h2><?php echo $MOD_NEWS['SETTINGS']; ?></h2>
|
60
|
<?php
|
61
|
// include the button to edit the optionla module CSS files
|
62
|
// Note: CSS styles for the button are defined in backend.css (div class="mod_moduledirectory_edit_css")
|
63
|
css_edit();
|
64
|
?>
|
65
|
|
66
|
<form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_settings.php" method="post" style="margin: 0;">
|
67
|
|
68
|
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
|
69
|
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
|
70
|
|
71
|
<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
|
72
|
<tr>
|
73
|
<td colspan="2"><strong><?php echo $HEADING['GENERAL_SETTINGS']; ?></strong></td>
|
74
|
<tr>
|
75
|
<td class="setting_name" width="20%"><?php echo $TEXT['HEADER']; ?>:</td>
|
76
|
<td class="setting_name">
|
77
|
<textarea name="header" style="width: 98%; height: 80px;"><?php echo ($fetch_content['header']); ?></textarea>
|
78
|
</td>
|
79
|
</tr>
|
80
|
<tr>
|
81
|
<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
|
82
|
<td class="setting_name">
|
83
|
<textarea name="post_loop" style="width: 98%; height: 60px;"><?php echo ($fetch_content['post_loop']); ?></textarea>
|
84
|
</td>
|
85
|
</tr>
|
86
|
<tr>
|
87
|
<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
|
88
|
<td class="setting_name">
|
89
|
<textarea name="footer" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['footer'])); ?></textarea>
|
90
|
</td>
|
91
|
</tr>
|
92
|
<tr>
|
93
|
<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
|
94
|
<td class="setting_name">
|
95
|
<textarea name="post_header" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_header'])); ?></textarea>
|
96
|
</td>
|
97
|
</tr>
|
98
|
<tr>
|
99
|
<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
|
100
|
<td class="setting_name">
|
101
|
<textarea name="post_footer" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_footer'])); ?></textarea>
|
102
|
</td>
|
103
|
</tr>
|
104
|
<tr>
|
105
|
<td class="setting_name"><?php echo $TEXT['POSTS_PER_PAGE']; ?>:</td>
|
106
|
<td class="setting_name">
|
107
|
<select name="posts_per_page" style="width: 98%;">
|
108
|
<option value=""><?php echo $TEXT['UNLIMITED']; ?></option>
|
109
|
<?php
|
110
|
for($i = 1; $i <= 20; $i++) {
|
111
|
if($fetch_content['posts_per_page'] == ($i*5)) { $selected = ' selected'; } else { $selected = ''; }
|
112
|
echo '<option value="'.($i*5).'"'.$selected.'>'.($i*5).'</option>';
|
113
|
}
|
114
|
?>
|
115
|
</select>
|
116
|
</td>
|
117
|
</tr>
|
118
|
</table>
|
119
|
<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-top: 3px;">
|
120
|
<tr>
|
121
|
<td colspan="2"><strong><?php echo $TEXT['COMMENTS']; ?></strong></td>
|
122
|
</tr>
|
123
|
<tr>
|
124
|
<td width="20%"><?php echo $TEXT['COMMENTING']; ?>:</td>
|
125
|
<td>
|
126
|
<select name="commenting" style="width: 98%;">
|
127
|
<option value="none"><?php echo $TEXT['DISABLED']; ?></option>
|
128
|
<option value="public" <?php if($fetch_content['commenting'] == 'public') { echo 'selected'; } ?>><?php echo $TEXT['PUBLIC']; ?></option>
|
129
|
<option value="private" <?php if($fetch_content['commenting'] == 'private') { echo 'selected'; } ?>><?php echo $TEXT['PRIVATE']; ?></option>
|
130
|
</select>
|
131
|
</td>
|
132
|
</tr>
|
133
|
<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
|
134
|
<tr>
|
135
|
<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
|
136
|
<td>
|
137
|
<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($fetch_content['use_captcha'] == true) { echo ' checked'; } ?> />
|
138
|
<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
|
139
|
<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($fetch_content['use_captcha'] == false) { echo ' checked'; } ?> />
|
140
|
<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
|
141
|
</td>
|
142
|
</tr>
|
143
|
<tr>
|
144
|
<td>
|
145
|
<?php echo $TEXT['RESIZE_IMAGE_TO']; ?>:
|
146
|
</td>
|
147
|
<td>
|
148
|
<select name="resize" style="width: 98%;">
|
149
|
<option value=""><?php echo $TEXT['NONE']; ?></option>
|
150
|
<?php
|
151
|
$SIZES['50'] = '50x50px';
|
152
|
$SIZES['75'] = '75x75px';
|
153
|
$SIZES['100'] = '100x100px';
|
154
|
$SIZES['125'] = '125x125px';
|
155
|
$SIZES['150'] = '150x150px';
|
156
|
foreach($SIZES AS $size => $size_name) {
|
157
|
if($fetch_content['resize'] == $size) { $selected = ' selected'; } else { $selected = ''; }
|
158
|
echo '<option value="'.$size.'"'.$selected.'>'.$size_name.'</option>';
|
159
|
}
|
160
|
?>
|
161
|
</select>
|
162
|
</td>
|
163
|
</tr>
|
164
|
<?php } ?>
|
165
|
<tr>
|
166
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['HEADER']; ?>:</td>
|
167
|
<td class="setting_name">
|
168
|
<textarea name="comments_header" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_header'])); ?></textarea>
|
169
|
</td>
|
170
|
</tr>
|
171
|
<tr>
|
172
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['LOOP']; ?>:</td>
|
173
|
<td class="setting_name">
|
174
|
<textarea name="comments_loop" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_loop'])); ?></textarea>
|
175
|
</td>
|
176
|
</tr>
|
177
|
<tr>
|
178
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['FOOTER']; ?>:</td>
|
179
|
<td class="setting_name">
|
180
|
<textarea name="comments_footer" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_footer'])); ?></textarea>
|
181
|
</td>
|
182
|
</tr>
|
183
|
<tr>
|
184
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['PAGE']; ?>:</td>
|
185
|
<td class="setting_name">
|
186
|
<textarea name="comments_page" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_page'])); ?></textarea>
|
187
|
</td>
|
188
|
</tr>
|
189
|
</table>
|
190
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
191
|
<tr>
|
192
|
<td align="left">
|
193
|
<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
|
194
|
</td>
|
195
|
<td align="right">
|
196
|
<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = '<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>';" style="width: 100px; margin-top: 5px;" />
|
197
|
</td>
|
198
|
</tr>
|
199
|
</table>
|
200
|
|
201
|
|
202
|
<?php
|
203
|
|
204
|
// Print admin footer
|
205
|
$admin->print_footer();
|
206
|
|
207
|
?>
|