Project

General

Profile

1 982 Ruebenwurz
<?php
2 1289 kweitzel
/**
3
 *
4
 * @category        modules
5
 * @package         news
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18 982 Ruebenwurz
19
require('../../config.php');
20
21
// Include WB admin wrapper script
22
require(WB_PATH.'/modules/admin.php');
23
24
// include core functions of WB 2.7 to edit the optional module CSS files (frontend.css, backend.css)
25
@include_once(WB_PATH .'/framework/module.functions.php');
26
27
// check if module language file exists for the language set by the user (e.g. DE, EN)
28
if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php')) {
29
	// no module language file exists for the language set by the user, include default module language file EN.php
30
	require_once(WB_PATH .'/modules/news/languages/EN.php');
31
} else {
32
	// a module language file exists for the language defined by the user, load it
33
	require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php');
34
}
35
36
// Get header and footer
37
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '$section_id'");
38
$fetch_content = $query_content->fetchRow();
39
40
// Set raw html <'s and >'s to be replace by friendly html code
41
$raw = array('<', '>');
42
$friendly = array('&lt;', '&gt;');
43
44
// check if backend.css file needs to be included into the <body></body> of modify.php
45
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/form/backend.css")) {
46
	echo '<style type="text/css">';
47
	include(WB_PATH .'/modules/form/backend.css');
48
	echo "\n</style>\n";
49
}
50
51
?>
52
<h2><?php echo $MOD_NEWS['SETTINGS']; ?></h2>
53
<?php
54
// include the button to edit the optional module CSS files (function added with WB 2.7)
55
// Note: CSS styles for the button are defined in backend.css (div class="mod_moduledirectory_edit_css")
56
// Place this call outside of any <form></form> construct!!!
57 1289 kweitzel
if(function_exists('edit_module_css'))
58
{
59 982 Ruebenwurz
	edit_module_css('news');
60
}
61
?>
62
63
<form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_settings.php" method="post" style="margin: 0;">
64
65 1289 kweitzel
	<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
66
	<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
67 982 Ruebenwurz
68 1289 kweitzel
	<table class="row_a" cellpadding="2" cellspacing="0" width="100%">
69 982 Ruebenwurz
		<tr>
70
			<td colspan="2"><strong><?php echo $HEADING['GENERAL_SETTINGS']; ?></strong></td>
71 1289 kweitzel
		</tr>
72 982 Ruebenwurz
		<tr>
73
			<td class="setting_name"><?php echo $TEXT['HEADER']; ?>:</td>
74
			<td class="setting_value">
75 1108 Ruebenwurz
				<textarea name="header" rows="10" cols="1" style="width: 98%; height: 80px;"><?php echo ($fetch_content['header']); ?></textarea>
76 982 Ruebenwurz
			</td>
77
		</tr>
78
		<tr>
79
			<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
80
			<td class="setting_value">
81 1108 Ruebenwurz
				<textarea name="post_loop" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo ($fetch_content['post_loop']); ?></textarea>
82 982 Ruebenwurz
			</td>
83
		</tr>
84
		<tr>
85
			<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
86
			<td class="setting_value">
87 1108 Ruebenwurz
				<textarea name="footer" rows="10" cols="1" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['footer'])); ?></textarea>
88 982 Ruebenwurz
			</td>
89
		</tr>
90
		<tr>
91
			<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
92
			<td class="setting_value">
93 1108 Ruebenwurz
				<textarea name="post_header" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_header'])); ?></textarea>
94 982 Ruebenwurz
			</td>
95
		</tr>
96
		<tr>
97
			<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
98
			<td class="setting_value">
99 1108 Ruebenwurz
				<textarea name="post_footer" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_footer'])); ?></textarea>
100 982 Ruebenwurz
			</td>
101
		</tr>
102
		<tr>
103
			<td class="setting_name"><?php echo $TEXT['POSTS_PER_PAGE']; ?>:</td>
104
			<td class="setting_value">
105
				<select name="posts_per_page" style="width: 98%;">
106
					<option value=""><?php echo $TEXT['UNLIMITED']; ?></option>
107
					<?php
108
					for($i = 1; $i <= 20; $i++) {
109 1289 kweitzel
						if($fetch_content['posts_per_page'] == ($i*5)) { $selected = ' selected="selected"'; } else { $selected = ''; }
110 982 Ruebenwurz
						echo '<option value="'.($i*5).'"'.$selected.'>'.($i*5).'</option>';
111
					}
112
					?>
113
				</select>
114
			</td>
115
		</tr>
116
	</table>
117 1289 kweitzel
	<table class="row_a" cellpadding="2" cellspacing="0" width="100%" style="margin-top: 3px;">
118 982 Ruebenwurz
		<tr>
119
			<td colspan="2"><strong><?php echo $TEXT['COMMENTS']; ?></strong></td>
120
		</tr>
121
		<tr>
122
			<td class="setting_name"><?php echo $TEXT['COMMENTING']; ?>:</td>
123
			<td class="setting_value">
124
				<select name="commenting" style="width: 98%;">
125
					<option value="none"><?php echo $TEXT['DISABLED']; ?></option>
126 1289 kweitzel
					<option value="public" <?php if($fetch_content['commenting'] == 'public') { echo ' selected="selected"'; } ?>><?php echo $TEXT['PUBLIC']; ?></option>
127
					<option value="private" <?php if($fetch_content['commenting'] == 'private') { echo 'selected="selected"'; } ?>><?php echo $TEXT['PRIVATE']; ?></option>
128 982 Ruebenwurz
				</select>
129
			</td>
130
		</tr>
131
		<tr>
132
			<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
133 983 Ruebenwurz
			<td>
134 1069 Ruebenwurz
				<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($fetch_content['use_captcha'] == true) { echo ' checked="checked"'; } ?> />
135 982 Ruebenwurz
				<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
136 1069 Ruebenwurz
				<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($fetch_content['use_captcha'] == false) { echo ' checked="checked"'; } ?> />
137 982 Ruebenwurz
				<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
138
			</td>
139
		</tr>
140
		<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
141
		<tr>
142
			<td class="setting_name"><?php echo $TEXT['RESIZE_IMAGE_TO']; ?>:</td>
143
			<td class="setting_value">
144
				<select name="resize" style="width: 98%;">
145
					<option value=""><?php echo $TEXT['NONE']; ?></option>
146
					<?php
147
					$SIZES['50'] = '50x50px';
148
					$SIZES['75'] = '75x75px';
149
					$SIZES['100'] = '100x100px';
150
					$SIZES['125'] = '125x125px';
151
					$SIZES['150'] = '150x150px';
152
					foreach($SIZES AS $size => $size_name) {
153 1289 kweitzel
						if($fetch_content['resize'] == $size) { $selected = ' selected="selected"'; } else { $selected = ''; }
154 982 Ruebenwurz
						echo '<option value="'.$size.'"'.$selected.'>'.$size_name.'</option>';
155
					}
156
					?>
157
				</select>
158
			</td>
159
		</tr>
160
		<?php } ?>
161
		<tr>
162
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['HEADER']; ?>:</td>
163
			<td class="setting_value">
164 1108 Ruebenwurz
				<textarea name="comments_header" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_header'])); ?></textarea>
165 982 Ruebenwurz
			</td>
166
		</tr>
167
		<tr>
168
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['LOOP']; ?>:</td>
169
			<td class="setting_value">
170 1108 Ruebenwurz
				<textarea name="comments_loop" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_loop'])); ?></textarea>
171 982 Ruebenwurz
			</td>
172
		</tr>
173
		<tr>
174
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['FOOTER']; ?>:</td>
175
			<td class="setting_value">
176 1108 Ruebenwurz
				<textarea name="comments_footer" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_footer'])); ?></textarea>
177 982 Ruebenwurz
			</td>
178
		</tr>
179
		<tr>
180
			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['PAGE']; ?>:</td>
181
			<td class="setting_value">
182 1108 Ruebenwurz
				<textarea name="comments_page" rows="10" cols="1" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_page'])); ?></textarea>
183 982 Ruebenwurz
			</td>
184
		</tr>
185
	</table>
186
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
187
		<tr>
188 1289 kweitzel
			<td class="left">
189 1108 Ruebenwurz
				<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
190 982 Ruebenwurz
			</td>
191 1289 kweitzel
			<td class="right">
192 982 Ruebenwurz
				<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;" />
193
			</td>
194
		</tr>
195
	</table>
196 1079 Ruebenwurz
</form>
197 982 Ruebenwurz
198
<?php
199
200
// Print admin footer
201
$admin->print_footer();
202
203 562 Ruebenwurz
?>