1
|
<?php
|
2
|
|
3
|
// $Id: modify_settings.php 317 2006-03-01 14:18:22Z stefan $
|
4
|
|
5
|
/*
|
6
|
|
7
|
Website Baker Project <http://www.websitebaker.org/>
|
8
|
Copyright (C) 2004-2006, 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
|
// Get header and footer
|
32
|
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '$section_id'");
|
33
|
$fetch_content = $query_content->fetchRow();
|
34
|
|
35
|
// Set raw html <'s and >'s to be replace by friendly html code
|
36
|
$raw = array('<', '>');
|
37
|
$friendly = array('<', '>');
|
38
|
|
39
|
?>
|
40
|
|
41
|
<style type="text/css">
|
42
|
.setting_name {
|
43
|
vertical-align: top;
|
44
|
}
|
45
|
</style>
|
46
|
|
47
|
<form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_settings.php" method="post" style="margin: 0;">
|
48
|
|
49
|
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
|
50
|
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
|
51
|
|
52
|
<table cellpadding="2" cellspacing="0" border="0" width="100%">
|
53
|
<tr>
|
54
|
<td class="setting_name" width="100"><?php echo $TEXT['HEADER']; ?>:</td>
|
55
|
<td class="setting_name">
|
56
|
<textarea name="header" style="width: 100%; height: 80px;"><?php echo ($fetch_content['header']); ?></textarea>
|
57
|
</td>
|
58
|
</tr>
|
59
|
<tr>
|
60
|
<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
|
61
|
<td class="setting_name">
|
62
|
<textarea name="post_loop" style="width: 100%; height: 60px;"><?php echo ($fetch_content['post_loop']); ?></textarea>
|
63
|
</td>
|
64
|
</tr>
|
65
|
<tr>
|
66
|
<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
|
67
|
<td class="setting_name">
|
68
|
<textarea name="footer" style="width: 100%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['footer'])); ?></textarea>
|
69
|
</td>
|
70
|
</tr>
|
71
|
<tr>
|
72
|
<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
|
73
|
<td class="setting_name">
|
74
|
<textarea name="post_header" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_header'])); ?></textarea>
|
75
|
</td>
|
76
|
</tr>
|
77
|
<tr>
|
78
|
<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
|
79
|
<td class="setting_name">
|
80
|
<textarea name="post_footer" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_footer'])); ?></textarea>
|
81
|
</td>
|
82
|
</tr>
|
83
|
<tr>
|
84
|
<td class="setting_name"><?php echo $TEXT['POSTS_PER_PAGE']; ?>:</td>
|
85
|
<td class="setting_name">
|
86
|
<select name="posts_per_page" style="width: 100%;">
|
87
|
<option value=""><?php echo $TEXT['UNLIMITED']; ?></option>
|
88
|
<?php
|
89
|
for($i = 1; $i <= 20; $i++) {
|
90
|
if($fetch_content['posts_per_page'] == ($i*5)) { $selected = ' selected'; } else { $selected = ''; }
|
91
|
echo '<option value="'.($i*5).'"'.$selected.'>'.($i*5).'</option>';
|
92
|
}
|
93
|
?>
|
94
|
</select>
|
95
|
</td>
|
96
|
</tr>
|
97
|
<tr>
|
98
|
<td><?php echo $TEXT['COMMENTING']; ?>:</td>
|
99
|
<td>
|
100
|
<select name="commenting" style="width: 100%;">
|
101
|
<option value="none"><?php echo $TEXT['DISABLED']; ?></option>
|
102
|
<option value="public" <?php if($fetch_content['commenting'] == 'public') { echo 'selected'; } ?>><?php echo $TEXT['PUBLIC']; ?></option>
|
103
|
<option value="private" <?php if($fetch_content['commenting'] == 'private') { echo 'selected'; } ?>><?php echo $TEXT['PRIVATE']; ?></option>
|
104
|
</select>
|
105
|
</td>
|
106
|
</tr>
|
107
|
<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
|
108
|
<tr>
|
109
|
<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
|
110
|
<td>
|
111
|
<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($fetch_content['use_captcha'] == true) { echo ' checked'; } ?> />
|
112
|
<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
|
113
|
<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($fetch_content['use_captcha'] == false) { echo ' checked'; } ?> />
|
114
|
<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
|
115
|
</td>
|
116
|
</tr>
|
117
|
<tr>
|
118
|
<td>
|
119
|
<?php echo $TEXT['RESIZE_IMAGE_TO']; ?>:
|
120
|
</td>
|
121
|
<td>
|
122
|
<select name="resize" style="width: 100%;">
|
123
|
<option value=""><?php echo $TEXT['NONE']; ?></option>
|
124
|
<?php
|
125
|
$SIZES['50'] = '50x50px';
|
126
|
$SIZES['75'] = '75x75px';
|
127
|
$SIZES['100'] = '100x100px';
|
128
|
$SIZES['125'] = '125x125px';
|
129
|
$SIZES['150'] = '150x150px';
|
130
|
foreach($SIZES AS $size => $size_name) {
|
131
|
if($fetch_content['resize'] == $size) { $selected = ' selected'; } else { $selected = ''; }
|
132
|
echo '<option value="'.$size.'"'.$selected.'>'.$size_name.'</option>';
|
133
|
}
|
134
|
?>
|
135
|
</select>
|
136
|
</td>
|
137
|
</tr>
|
138
|
<?php } ?>
|
139
|
<tr>
|
140
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['HEADER']; ?>:</td>
|
141
|
<td class="setting_name">
|
142
|
<textarea name="comments_header" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_header'])); ?></textarea>
|
143
|
</td>
|
144
|
</tr>
|
145
|
<tr>
|
146
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['LOOP']; ?>:</td>
|
147
|
<td class="setting_name">
|
148
|
<textarea name="comments_loop" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_loop'])); ?></textarea>
|
149
|
</td>
|
150
|
</tr>
|
151
|
<tr>
|
152
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['FOOTER']; ?>:</td>
|
153
|
<td class="setting_name">
|
154
|
<textarea name="comments_footer" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_footer'])); ?></textarea>
|
155
|
</td>
|
156
|
</tr>
|
157
|
<tr>
|
158
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['PAGE']; ?>:</td>
|
159
|
<td class="setting_name">
|
160
|
<textarea name="comments_page" style="width: 100%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_page'])); ?></textarea>
|
161
|
</td>
|
162
|
</tr>
|
163
|
</table>
|
164
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
165
|
<tr>
|
166
|
<td width="105"> </td>
|
167
|
<td align="left">
|
168
|
<input name="save" type="submit" value="<?php echo $TEXT['SAVE'].' '.$TEXT['SETTINGS']; ?>" style="width: 200px; margin-top: 5px;"></form>
|
169
|
</td>
|
170
|
<td align="right">
|
171
|
<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;" />
|
172
|
</td>
|
173
|
</tr>
|
174
|
</table>
|
175
|
|
176
|
|
177
|
<?php
|
178
|
|
179
|
// Print admin footer
|
180
|
$admin->print_footer();
|
181
|
|
182
|
?>
|