Project

General

Profile

1 562 Ruebenwurz
<?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 801 doc
// include core functions of WB 2.7 to edit the optional module CSS files (frontend.css, backend.css)
32
@include_once(WB_PATH .'/framework/module.functions.php');
33 562 Ruebenwurz
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('&lt;', '&gt;');
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 801 doc
// include the button to edit the optional module CSS files (function added with WB 2.7)
62
// Note: CSS styles for the button are defined in backend.css (div class="mod_moduledirectory_edit_css")
63
// Place this call outside of any <form></form> construct!!!
64
if(function_exists('edit_module_css')) {
65
	edit_module_css('news');
66
}
67 562 Ruebenwurz
?>
68
69
<form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_settings.php" method="post" style="margin: 0;">
70
71
	<input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
72
	<input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
73
74
	<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
75
		<tr>
76
			<td colspan="2"><strong><?php echo $HEADING['GENERAL_SETTINGS']; ?></strong></td>
77
		<tr>
78
			<td class="setting_name" width="20%"><?php echo $TEXT['HEADER']; ?>:</td>
79
			<td class="setting_name">
80
				<textarea name="header" style="width: 98%; height: 80px;"><?php echo ($fetch_content['header']); ?></textarea>
81
			</td>
82
		</tr>
83
		<tr>
84
			<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
85
			<td class="setting_name">
86
				<textarea name="post_loop" style="width: 98%; height: 60px;"><?php echo ($fetch_content['post_loop']); ?></textarea>
87
			</td>
88
		</tr>
89
		<tr>
90
			<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
91
			<td class="setting_name">
92
				<textarea name="footer" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['footer'])); ?></textarea>
93
			</td>
94
		</tr>
95
		<tr>
96
			<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
97
			<td class="setting_name">
98
				<textarea name="post_header" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_header'])); ?></textarea>
99
			</td>
100
		</tr>
101
		<tr>
102
			<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
103
			<td class="setting_name">
104
				<textarea name="post_footer" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_footer'])); ?></textarea>
105
			</td>
106
		</tr>
107
		<tr>
108
			<td class="setting_name"><?php echo $TEXT['POSTS_PER_PAGE']; ?>:</td>
109
			<td class="setting_name">
110
				<select name="posts_per_page" style="width: 98%;">
111
					<option value=""><?php echo $TEXT['UNLIMITED']; ?></option>
112
					<?php
113
					for($i = 1; $i <= 20; $i++) {
114
						if($fetch_content['posts_per_page'] == ($i*5)) { $selected = ' selected'; } else { $selected = ''; }
115
						echo '<option value="'.($i*5).'"'.$selected.'>'.($i*5).'</option>';
116
					}
117
					?>
118
				</select>
119
			</td>
120
		</tr>
121
	</table>
122
	<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-top: 3px;">
123
		<tr>
124
			<td colspan="2"><strong><?php echo $TEXT['COMMENTS']; ?></strong></td>
125
		</tr>
126
		<tr>
127
			<td  width="20%"><?php echo $TEXT['COMMENTING']; ?>:</td>
128
			<td>
129
				<select name="commenting" style="width: 98%;">
130
					<option value="none"><?php echo $TEXT['DISABLED']; ?></option>
131
					<option value="public" <?php if($fetch_content['commenting'] == 'public') { echo 'selected'; } ?>><?php echo $TEXT['PUBLIC']; ?></option>
132
					<option value="private" <?php if($fetch_content['commenting'] == 'private') { echo 'selected'; } ?>><?php echo $TEXT['PRIVATE']; ?></option>
133
				</select>
134
			</td>
135
		</tr>
136
		<tr>
137
			<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
138
			<td>
139
				<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($fetch_content['use_captcha'] == true) { echo ' checked'; } ?> />
140
				<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
141
				<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($fetch_content['use_captcha'] == false) { echo ' checked'; } ?> />
142
				<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
143
			</td>
144
		</tr>
145 605 thorn
		<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
146 562 Ruebenwurz
		<tr>
147
			<td>
148
				<?php echo $TEXT['RESIZE_IMAGE_TO']; ?>:
149
			</td>
150
			<td>
151
				<select name="resize" style="width: 98%;">
152
					<option value=""><?php echo $TEXT['NONE']; ?></option>
153
					<?php
154
					$SIZES['50'] = '50x50px';
155
					$SIZES['75'] = '75x75px';
156
					$SIZES['100'] = '100x100px';
157
					$SIZES['125'] = '125x125px';
158
					$SIZES['150'] = '150x150px';
159
					foreach($SIZES AS $size => $size_name) {
160
						if($fetch_content['resize'] == $size) { $selected = ' selected'; } else { $selected = ''; }
161
						echo '<option value="'.$size.'"'.$selected.'>'.$size_name.'</option>';
162
					}
163
					?>
164
				</select>
165
			</td>
166
		</tr>
167
		<?php } ?>
168
		<tr>
169
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['HEADER']; ?>:</td>
170
			<td class="setting_name">
171
				<textarea name="comments_header" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_header'])); ?></textarea>
172
			</td>
173
		</tr>
174
		<tr>
175
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['LOOP']; ?>:</td>
176
			<td class="setting_name">
177
				<textarea name="comments_loop" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_loop'])); ?></textarea>
178
			</td>
179
		</tr>
180
		<tr>
181
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['FOOTER']; ?>:</td>
182
			<td class="setting_name">
183
				<textarea name="comments_footer" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_footer'])); ?></textarea>
184
			</td>
185
		</tr>
186
		<tr>
187
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['PAGE']; ?>:</td>
188
			<td class="setting_name">
189
				<textarea name="comments_page" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_page'])); ?></textarea>
190
			</td>
191
		</tr>
192
	</table>
193
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
194
		<tr>
195
			<td align="left">
196
				<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
197
			</td>
198
			<td align="right">
199
				<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;" />
200
			</td>
201
		</tr>
202
	</table>
203
204
205
<?php
206
207
// Print admin footer
208
$admin->print_footer();
209
210
?>