Project

General

Profile

1
<?php
2

    
3
// $Id: modify_settings.php 785 2008-04-01 15:41:41Z doc $
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('&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
	// include the button to edit the optional module CSS files
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
	css_edit('news');
65
?>
66

    
67
<form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_settings.php" method="post" style="margin: 0;">
68

    
69
	<input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
70
	<input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
71

    
72
	<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
73
		<tr>
74
			<td colspan="2"><strong><?php echo $HEADING['GENERAL_SETTINGS']; ?></strong></td>
75
		<tr>
76
			<td class="setting_name" width="20%"><?php echo $TEXT['HEADER']; ?>:</td>
77
			<td class="setting_name">
78
				<textarea name="header" style="width: 98%; height: 80px;"><?php echo ($fetch_content['header']); ?></textarea>
79
			</td>
80
		</tr>
81
		<tr>
82
			<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
83
			<td class="setting_name">
84
				<textarea name="post_loop" style="width: 98%; height: 60px;"><?php echo ($fetch_content['post_loop']); ?></textarea>
85
			</td>
86
		</tr>
87
		<tr>
88
			<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
89
			<td class="setting_name">
90
				<textarea name="footer" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['footer'])); ?></textarea>
91
			</td>
92
		</tr>
93
		<tr>
94
			<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
95
			<td class="setting_name">
96
				<textarea name="post_header" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_header'])); ?></textarea>
97
			</td>
98
		</tr>
99
		<tr>
100
			<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
101
			<td class="setting_name">
102
				<textarea name="post_footer" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_footer'])); ?></textarea>
103
			</td>
104
		</tr>
105
		<tr>
106
			<td class="setting_name"><?php echo $TEXT['POSTS_PER_PAGE']; ?>:</td>
107
			<td class="setting_name">
108
				<select name="posts_per_page" style="width: 98%;">
109
					<option value=""><?php echo $TEXT['UNLIMITED']; ?></option>
110
					<?php
111
					for($i = 1; $i <= 20; $i++) {
112
						if($fetch_content['posts_per_page'] == ($i*5)) { $selected = ' selected'; } else { $selected = ''; }
113
						echo '<option value="'.($i*5).'"'.$selected.'>'.($i*5).'</option>';
114
					}
115
					?>
116
				</select>
117
			</td>
118
		</tr>
119
	</table>
120
	<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-top: 3px;">
121
		<tr>
122
			<td colspan="2"><strong><?php echo $TEXT['COMMENTS']; ?></strong></td>
123
		</tr>
124
		<tr>
125
			<td  width="20%"><?php echo $TEXT['COMMENTING']; ?>:</td>
126
			<td>
127
				<select name="commenting" style="width: 98%;">
128
					<option value="none"><?php echo $TEXT['DISABLED']; ?></option>
129
					<option value="public" <?php if($fetch_content['commenting'] == 'public') { echo 'selected'; } ?>><?php echo $TEXT['PUBLIC']; ?></option>
130
					<option value="private" <?php if($fetch_content['commenting'] == 'private') { echo 'selected'; } ?>><?php echo $TEXT['PRIVATE']; ?></option>
131
				</select>
132
			</td>
133
		</tr>
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
		<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
144
		<tr>
145
			<td>
146
				<?php echo $TEXT['RESIZE_IMAGE_TO']; ?>:
147
			</td>
148
			<td>
149
				<select name="resize" style="width: 98%;">
150
					<option value=""><?php echo $TEXT['NONE']; ?></option>
151
					<?php
152
					$SIZES['50'] = '50x50px';
153
					$SIZES['75'] = '75x75px';
154
					$SIZES['100'] = '100x100px';
155
					$SIZES['125'] = '125x125px';
156
					$SIZES['150'] = '150x150px';
157
					foreach($SIZES AS $size => $size_name) {
158
						if($fetch_content['resize'] == $size) { $selected = ' selected'; } else { $selected = ''; }
159
						echo '<option value="'.$size.'"'.$selected.'>'.$size_name.'</option>';
160
					}
161
					?>
162
				</select>
163
			</td>
164
		</tr>
165
		<?php } ?>
166
		<tr>
167
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['HEADER']; ?>:</td>
168
			<td class="setting_name">
169
				<textarea name="comments_header" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_header'])); ?></textarea>
170
			</td>
171
		</tr>
172
		<tr>
173
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['LOOP']; ?>:</td>
174
			<td class="setting_name">
175
				<textarea name="comments_loop" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_loop'])); ?></textarea>
176
			</td>
177
		</tr>
178
		<tr>
179
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['FOOTER']; ?>:</td>
180
			<td class="setting_name">
181
				<textarea name="comments_footer" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_footer'])); ?></textarea>
182
			</td>
183
		</tr>
184
		<tr>
185
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['PAGE']; ?>:</td>
186
			<td class="setting_name">
187
				<textarea name="comments_page" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_page'])); ?></textarea>
188
			</td>
189
		</tr>
190
	</table>
191
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
192
		<tr>
193
			<td align="left">
194
				<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
195
			</td>
196
			<td align="right">
197
				<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;" />
198
			</td>
199
		</tr>
200
	</table>
201

    
202

    
203
<?php
204

    
205
// Print admin footer
206
$admin->print_footer();
207

    
208
?>
(21-21/32)