Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         news
6
 * @author          WebsiteBaker Project
7
 * @copyright       2009-2011, Website Baker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id: modify_settings.php 1538 2011-12-10 15:06:15Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/news/modify_settings.php $
14
 * @lastmodified    $Date: 2011-12-10 16:06:15 +0100 (Sat, 10 Dec 2011) $
15
 *
16
 */
17

    
18
require('../../config.php');
19

    
20
// $admin_header = false;
21
// Tells script to update when this page was last updated
22
$update_when_modified = false;
23
// show the info banner
24
$print_info_banner = true;
25
// Include WB admin wrapper script
26
require(WB_PATH.'/modules/admin.php');
27

    
28
// include core functions of WB 2.7 to edit the optional module CSS files (frontend.css, backend.css)
29
@include_once(WB_PATH .'/framework/module.functions.php');
30

    
31
// check if module language file exists for the language set by the user (e.g. DE, EN)
32
if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php')) {
33
	// no module language file exists for the language set by the user, include default module language file EN.php
34
	require_once(WB_PATH .'/modules/news/languages/EN.php');
35
} else {
36
	// a module language file exists for the language defined by the user, load it
37
	require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php');
38
}
39

    
40
// Get header and footer
41
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '$section_id'");
42
$fetch_content = $query_content->fetchRow();
43

    
44
// Set raw html <'s and >'s to be replace by friendly html code
45
$raw = array('<', '>');
46
$friendly = array('&lt;', '&gt;');
47

    
48
// check if backend.css file needs to be included into the <body></body> of modify.php
49
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/form/backend.css")) {
50
	echo '<style type="text/css">';
51
	include(WB_PATH .'/modules/form/backend.css');
52
	echo "\n</style>\n";
53
}
54

    
55
?>
56
<h2><?php echo $MOD_NEWS['SETTINGS']; ?></h2>
57
<?php
58
// include the button to edit the optional module CSS files (function added with WB 2.7)
59
// Note: CSS styles for the button are defined in backend.css (div class="mod_moduledirectory_edit_css")
60
// Place this call outside of any <form></form> construct!!!
61
if(function_exists('edit_module_css'))
62
{
63
	edit_module_css('news');
64
}
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
	<?php echo $admin->getFTAN(); ?>
72
	<table class="row_a" cellpadding="2" cellspacing="0" width="100%">
73
		<tr>
74
			<td colspan="2"><strong><?php echo $HEADING['GENERAL_SETTINGS']; ?></strong></td>
75
		</tr>
76
		<tr>
77
			<td class="setting_name"><?php echo $TEXT['HEADER']; ?>:</td>
78
			<td class="setting_value">
79
				<textarea name="header" rows="10" cols="1" style="width: 98%; height: 80px;"><?php echo ($fetch_content['header']); ?></textarea>
80
			</td>
81
		</tr>
82
		<tr>
83
			<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
84
			<td class="setting_value">
85
				<textarea name="post_loop" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo ($fetch_content['post_loop']); ?></textarea>
86
			</td>
87
		</tr>
88
		<tr>
89
			<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
90
			<td class="setting_value">
91
				<textarea name="footer" rows="10" cols="1" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['footer'])); ?></textarea>
92
			</td>
93
		</tr>
94
		<tr>
95
			<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
96
			<td class="setting_value">
97
				<textarea name="post_header" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_header'])); ?></textarea>
98
			</td>
99
		</tr>
100
		<tr>
101
			<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
102
			<td class="setting_value">
103
				<textarea name="post_footer" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_footer'])); ?></textarea>
104
			</td>
105
		</tr>
106
		<tr>
107
			<td class="setting_name"><?php echo $TEXT['POSTS_PER_PAGE']; ?>:</td>
108
			<td class="setting_value">
109
				<select name="posts_per_page" style="width: 98%;">
110
					<option value=""><?php echo $TEXT['UNLIMITED']; ?></option>
111
					<?php
112
					for($i = 1; $i <= 20; $i++) {
113
						if($fetch_content['posts_per_page'] == ($i*5)) { $selected = ' selected="selected"'; } else { $selected = ''; }
114
						echo '<option value="'.($i*5).'"'.$selected.'>'.($i*5).'</option>';
115
					}
116
					?>
117
				</select>
118
			</td>
119
		</tr>
120
	</table>
121
	<table class="row_a" cellpadding="2" cellspacing="0" width="100%" style="margin-top: 3px;">
122
		<tr>
123
			<td colspan="2"><strong><?php echo $TEXT['COMMENTS']; ?></strong></td>
124
		</tr>
125
		<tr>
126
			<td class="setting_name"><?php echo $TEXT['COMMENTING']; ?>:</td>
127
			<td class="setting_value">
128
				<select name="commenting" style="width: 98%;">
129
					<option value="none"><?php echo $TEXT['DISABLED']; ?></option>
130
					<option value="public" <?php if($fetch_content['commenting'] == 'public') { echo ' selected="selected"'; } ?>><?php echo $TEXT['PUBLIC']; ?></option>
131
					<option value="private" <?php if($fetch_content['commenting'] == 'private') { echo 'selected="selected"'; } ?>><?php echo $TEXT['PRIVATE']; ?></option>
132
				</select>
133
			</td>
134
		</tr>
135
		<tr>
136
			<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
137
			<td>
138
				<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($fetch_content['use_captcha'] == true) { echo ' checked="checked"'; } ?> />
139
				<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
140
				<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($fetch_content['use_captcha'] == false) { echo ' checked="checked"'; } ?> />
141
				<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
142
			</td>
143
		</tr>
144
		<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
145
		<tr>
146
			<td class="setting_name"><?php echo $TEXT['RESIZE_IMAGE_TO']; ?>:</td>
147
			<td class="setting_value">
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="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_value">
168
				<textarea name="comments_header" rows="10" cols="1" 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_value">
174
				<textarea name="comments_loop" rows="10" cols="1" 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_value">
180
				<textarea name="comments_footer" rows="10" cols="1" 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_value">
186
				<textarea name="comments_page" rows="10" cols="1" 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 class="left">
193
				<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
194
			</td>
195
			<td class="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
</form>
201

    
202
<?php
203

    
204
// Print admin footer
205
$admin->print_footer();
(22-22/34)