| 1 | <?php
 | 
  
    | 2 | /**
 | 
  
    | 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: modify_settings.php 1289 2010-02-10 15:13:21Z kweitzel $
 | 
  
    | 14 |  * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/trunk/wb/modules/news/modify_settings.php $
 | 
  
    | 15 |  * @lastmodified    $Date: 2010-02-10 16:13:21 +0100 (Wed, 10 Feb 2010) $
 | 
  
    | 16 |  *
 | 
  
    | 17 |  */
 | 
  
    | 18 | 
 | 
  
    | 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('<', '>');
 | 
  
    | 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 | if(function_exists('edit_module_css'))
 | 
  
    | 58 | {
 | 
  
    | 59 | 	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 | 	<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
 | 
  
    | 66 | 	<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
 | 
  
    | 67 | 
 | 
  
    | 68 | 	<table class="row_a" cellpadding="2" cellspacing="0" width="100%">
 | 
  
    | 69 | 		<tr>
 | 
  
    | 70 | 			<td colspan="2"><strong><?php echo $HEADING['GENERAL_SETTINGS']; ?></strong></td>
 | 
  
    | 71 | 		</tr>
 | 
  
    | 72 | 		<tr>
 | 
  
    | 73 | 			<td class="setting_name"><?php echo $TEXT['HEADER']; ?>:</td>
 | 
  
    | 74 | 			<td class="setting_value">
 | 
  
    | 75 | 				<textarea name="header" rows="10" cols="1" style="width: 98%; height: 80px;"><?php echo ($fetch_content['header']); ?></textarea>
 | 
  
    | 76 | 			</td>
 | 
  
    | 77 | 		</tr>
 | 
  
    | 78 | 		<tr>
 | 
  
    | 79 | 			<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
 | 
  
    | 80 | 			<td class="setting_value">
 | 
  
    | 81 | 				<textarea name="post_loop" rows="10" cols="1" style="width: 98%; height: 60px;"><?php echo ($fetch_content['post_loop']); ?></textarea>
 | 
  
    | 82 | 			</td>
 | 
  
    | 83 | 		</tr>
 | 
  
    | 84 | 		<tr>
 | 
  
    | 85 | 			<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
 | 
  
    | 86 | 			<td class="setting_value">
 | 
  
    | 87 | 				<textarea name="footer" rows="10" cols="1" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['footer'])); ?></textarea>
 | 
  
    | 88 | 			</td>
 | 
  
    | 89 | 		</tr>
 | 
  
    | 90 | 		<tr>
 | 
  
    | 91 | 			<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
 | 
  
    | 92 | 			<td class="setting_value">
 | 
  
    | 93 | 				<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 | 			</td>
 | 
  
    | 95 | 		</tr>
 | 
  
    | 96 | 		<tr>
 | 
  
    | 97 | 			<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
 | 
  
    | 98 | 			<td class="setting_value">
 | 
  
    | 99 | 				<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 | 			</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 | 						if($fetch_content['posts_per_page'] == ($i*5)) { $selected = ' selected="selected"'; } else { $selected = ''; }
 | 
  
    | 110 | 						echo '<option value="'.($i*5).'"'.$selected.'>'.($i*5).'</option>';
 | 
  
    | 111 | 					}
 | 
  
    | 112 | 					?>
 | 
  
    | 113 | 				</select>
 | 
  
    | 114 | 			</td>
 | 
  
    | 115 | 		</tr>
 | 
  
    | 116 | 	</table>
 | 
  
    | 117 | 	<table class="row_a" cellpadding="2" cellspacing="0" width="100%" style="margin-top: 3px;">
 | 
  
    | 118 | 		<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 | 					<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 | 				</select>
 | 
  
    | 129 | 			</td>
 | 
  
    | 130 | 		</tr>
 | 
  
    | 131 | 		<tr>
 | 
  
    | 132 | 			<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
 | 
  
    | 133 | 			<td>
 | 
  
    | 134 | 				<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($fetch_content['use_captcha'] == true) { echo ' checked="checked"'; } ?> />
 | 
  
    | 135 | 				<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
 | 
  
    | 136 | 				<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($fetch_content['use_captcha'] == false) { echo ' checked="checked"'; } ?> />
 | 
  
    | 137 | 				<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 | 						if($fetch_content['resize'] == $size) { $selected = ' selected="selected"'; } else { $selected = ''; }
 | 
  
    | 154 | 						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 | 				<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 | 			</td>
 | 
  
    | 166 | 		</tr>
 | 
  
    | 167 | 		<tr>
 | 
  
    | 168 | 			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['LOOP']; ?>:</td>
 | 
  
    | 169 | 			<td class="setting_value">
 | 
  
    | 170 | 				<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 | 			</td>
 | 
  
    | 172 | 		</tr>
 | 
  
    | 173 | 		<tr>
 | 
  
    | 174 | 			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['FOOTER']; ?>:</td>
 | 
  
    | 175 | 			<td class="setting_value">
 | 
  
    | 176 | 				<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 | 			</td>
 | 
  
    | 178 | 		</tr>
 | 
  
    | 179 | 		<tr>
 | 
  
    | 180 | 			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['PAGE']; ?>:</td>
 | 
  
    | 181 | 			<td class="setting_value">
 | 
  
    | 182 | 				<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 | 			</td>
 | 
  
    | 184 | 		</tr>
 | 
  
    | 185 | 	</table>
 | 
  
    | 186 | 	<table cellpadding="0" cellspacing="0" border="0" width="100%">
 | 
  
    | 187 | 		<tr>
 | 
  
    | 188 | 			<td class="left">
 | 
  
    | 189 | 				<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
 | 
  
    | 190 | 			</td>
 | 
  
    | 191 | 			<td class="right">
 | 
  
    | 192 | 				<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 | </form>
 | 
  
    | 197 | 
 | 
  
    | 198 | <?php
 | 
  
    | 199 | 
 | 
  
    | 200 | // Print admin footer
 | 
  
    | 201 | $admin->print_footer();
 | 
  
    | 202 | 
 | 
  
    | 203 | ?>
 |