1 |
4
|
ryan
|
<?php
|
2 |
|
|
|
3 |
36
|
stefan
|
// $Id$
|
4 |
4
|
ryan
|
|
5 |
|
|
/*
|
6 |
|
|
|
7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
8 |
|
|
Copyright (C) 2004-2005, 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 |
36
|
stefan
|
<textarea name="header" style="width: 100%; height: 80px;"><?php echo $admin->stripslashes($fetch_content['header']); ?></textarea>
|
57 |
4
|
ryan
|
</td>
|
58 |
|
|
</tr>
|
59 |
|
|
<tr>
|
60 |
|
|
<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
|
61 |
|
|
<td class="setting_name">
|
62 |
36
|
stefan
|
<textarea name="post_loop" style="width: 100%; height: 60px;"><?php echo $admin->stripslashes($fetch_content['post_loop']); ?></textarea>
|
63 |
4
|
ryan
|
</td>
|
64 |
|
|
</tr>
|
65 |
|
|
<tr>
|
66 |
|
|
<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
|
67 |
|
|
<td class="setting_name">
|
68 |
36
|
stefan
|
<textarea name="footer" style="width: 100%; height: 80px;"><?php echo str_replace($raw, $friendly, $admin->stripslashes($fetch_content['footer'])); ?></textarea>
|
69 |
4
|
ryan
|
</td>
|
70 |
|
|
</tr>
|
71 |
|
|
<tr>
|
72 |
|
|
<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
|
73 |
|
|
<td class="setting_name">
|
74 |
36
|
stefan
|
<textarea name="post_header" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, $admin->stripslashes($fetch_content['post_header'])); ?></textarea>
|
75 |
4
|
ryan
|
</td>
|
76 |
|
|
</tr>
|
77 |
|
|
<tr>
|
78 |
|
|
<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
|
79 |
|
|
<td class="setting_name">
|
80 |
36
|
stefan
|
<textarea name="post_footer" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, $admin->stripslashes($fetch_content['post_footer'])); ?></textarea>
|
81 |
4
|
ryan
|
</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>
|
110 |
|
|
<?php echo $TEXT['RESIZE_IMAGE_TO']; ?>:
|
111 |
|
|
</td>
|
112 |
|
|
<td>
|
113 |
|
|
<select name="resize" style="width: 100%;">
|
114 |
|
|
<option value=""><?php echo $TEXT['NONE']; ?></option>
|
115 |
|
|
<?php
|
116 |
|
|
$SIZES['50'] = '50x50px';
|
117 |
|
|
$SIZES['75'] = '75x75px';
|
118 |
|
|
$SIZES['100'] = '100x100px';
|
119 |
|
|
$SIZES['125'] = '125x125px';
|
120 |
|
|
$SIZES['150'] = '150x150px';
|
121 |
|
|
foreach($SIZES AS $size => $size_name) {
|
122 |
|
|
if($fetch_content['resize'] == $size) { $selected = ' selected'; } else { $selected = ''; }
|
123 |
|
|
echo '<option value="'.$size.'"'.$selected.'>'.$size_name.'</option>';
|
124 |
|
|
}
|
125 |
|
|
?>
|
126 |
|
|
</select>
|
127 |
|
|
</td>
|
128 |
|
|
</tr>
|
129 |
|
|
<?php } ?>
|
130 |
|
|
<tr>
|
131 |
|
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['HEADER']; ?>:</td>
|
132 |
|
|
<td class="setting_name">
|
133 |
36
|
stefan
|
<textarea name="comments_header" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, $admin->stripslashes($fetch_content['comments_header'])); ?></textarea>
|
134 |
4
|
ryan
|
</td>
|
135 |
|
|
</tr>
|
136 |
|
|
<tr>
|
137 |
|
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['LOOP']; ?>:</td>
|
138 |
|
|
<td class="setting_name">
|
139 |
36
|
stefan
|
<textarea name="comments_loop" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, $admin->stripslashes($fetch_content['comments_loop'])); ?></textarea>
|
140 |
4
|
ryan
|
</td>
|
141 |
|
|
</tr>
|
142 |
|
|
<tr>
|
143 |
|
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['FOOTER']; ?>:</td>
|
144 |
|
|
<td class="setting_name">
|
145 |
36
|
stefan
|
<textarea name="comments_footer" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, $admin->stripslashes($fetch_content['comments_footer'])); ?></textarea>
|
146 |
4
|
ryan
|
</td>
|
147 |
|
|
</tr>
|
148 |
|
|
<tr>
|
149 |
|
|
<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['PAGE']; ?>:</td>
|
150 |
|
|
<td class="setting_name">
|
151 |
36
|
stefan
|
<textarea name="comments_page" style="width: 100%; height: 80px;"><?php echo str_replace($raw, $friendly, $admin->stripslashes($fetch_content['comments_page'])); ?></textarea>
|
152 |
4
|
ryan
|
</td>
|
153 |
|
|
</tr>
|
154 |
|
|
</table>
|
155 |
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
156 |
|
|
<tr>
|
157 |
|
|
<td width="105"> </td>
|
158 |
|
|
<td align="left">
|
159 |
|
|
<input name="save" type="submit" value="<?php echo $TEXT['SAVE'].' '.$TEXT['SETTINGS']; ?>" style="width: 200px; margin-top: 5px;"></form>
|
160 |
|
|
</td>
|
161 |
|
|
<td align="right">
|
162 |
|
|
<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;" />
|
163 |
|
|
</td>
|
164 |
|
|
</tr>
|
165 |
|
|
</table>
|
166 |
|
|
|
167 |
|
|
|
168 |
|
|
<?php
|
169 |
|
|
|
170 |
|
|
// Print admin footer
|
171 |
|
|
$admin->print_footer();
|
172 |
|
|
|
173 |
|
|
?>
|