Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 561)
+++ trunk/CHANGELOG	(revision 562)
@@ -13,6 +13,7 @@
 ------------------------------------- 2.7.0 -------------------------------------
 
 18-Jan-2008 Matthias Gallas
+!	Updated news modul with features from the advanced news modul
 !	Updated form modul with features from the advanced form modul
 #	Fixed hardcoded /pages issue in intro page feature
 +	Added example .htaccess to parse .html files, fixed bug in changeset 555
Index: trunk/wb/upgrade-script.php
===================================================================
--- trunk/wb/upgrade-script.php	(revision 561)
+++ trunk/wb/upgrade-script.php	(revision 562)
@@ -198,12 +198,12 @@
 }
 
 
+$database = new database(DB_URL);
+
 //******************************************************************************
-//The following lines upgrades the form modul from 2.6.x to the andvanced version from 2.7.x
+//Start of upgrade script for the form modul
 //******************************************************************************
 
-$database = new database(DB_URL);
-
 echo "<BR><B>Adding new field to database table mod_form_settings</B><BR>";
 
 if($database->query("ALTER TABLE `".TABLE_PREFIX."mod_form_settings` ADD `success_email_subject` VARCHAR(255) NOT NULL AFTER `success_message`")) {
@@ -296,9 +296,104 @@
 //End of upgrade script for the form modul
 //******************************************************************************
 
+//******************************************************************************
+//Start of upgrade script for the news modul
+//******************************************************************************
+
+echo "<BR><B>Adding new field to database table mod_news_posts</B><BR>";
+if($database->query("ALTER TABLE `".TABLE_PREFIX."mod_news_posts` ADD `published_when` INT NOT NULL AFTER `commenting`")) {
+	echo 'Database Field published_when added successfully<br />';
+}
+echo mysql_error().'<br />';
+
+// UPDATING DATA INTO FIELDS
+echo "<BR>";
+
+// These are the default setting
+$header = '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"98%\">';
+$post_loop = '<tr class=\"post_top\">
+<td class=\"post_title\"><a href=\"[LINK]\">[TITLE]</a></td>
+<td class=\"post_date\">[MODI_TIME], [MODI_DATE]</td>
+</tr>
+<tr>
+<td class=\"post_short\" colspan=\"2\">
+[SHORT] 
+<a href=\"[LINK]\">[TEXT_READ_MORE]</a>
+</td>
+</tr>';
+$post_header = addslashes('<table cellpadding="0" cellspacing="0" border="0" width="100%">
+<tr>
+<td height="30"><h1>[TITLE]</h1></td>
+<td rowspan="3" style="display: [DISPLAY_IMAGE]"><img src="[GROUP_IMAGE]" alt="[GROUP_TITLE]" /></td>
+</tr>
+<tr>
+<td valign="top"><b>Posted by [DISPLAY_NAME] ([USERNAME]) on [PUBL_DATE]</b></td>
+</tr>
+<tr style="display: [DISPLAY_GROUP]">
+<td valign="top"><a href="[BACK]">[PAGE_TITLE]</a> >> <a href="[BACK]?g=[GROUP_ID]">[GROUP_TITLE]</a></td>
+</tr>
+</table>
+<p style="text-align: justify;">');
+$post_footer = '</p><p>Last changed: [MODI_DATE] at [MODI_TIME]</p>
+<a href=\"[BACK]\">Back</a>';
+$comments_header = addslashes('<br /><br />
+<h2>Comments</h2>
+<table cellpadding="2" cellspacing="0" border="0" width="98%">');
+
+// Insert default settings into database
+$query_dates = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_settings where section_id != 0 and page_id != 0");
+while($result = $query_dates->fetchRow()) {
+	
+	echo "<B>Add default settings data to database for news section_id= ".$result['section_id']."</b><BR>";
+	$section_id = $result['section_id'];
+
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `header` = '$header' WHERE `section_id` = $section_id")) {
+		echo 'Database data header added successfully<br>';
+	}
+	echo mysql_error().'<br />';
+	
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `post_loop` = '$post_loop' WHERE `section_id` = $section_id")) {
+		echo 'Database data post_loop added successfully<br>';
+	}
+	echo mysql_error().'<br />';
+	
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `post_header` = '$post_header' WHERE `section_id` = $section_id")) {
+		echo 'Database data post_header added successfully<br>';
+	}
+	echo mysql_error().'<br />';
+	
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `post_footer` = '$post_footer' WHERE `section_id` = $section_id")) {
+		echo 'Database data post_footer added successfully<br>';
+	}
+	echo mysql_error().'<br />';
+	
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_settings` SET `comments_header` = '$comments_header' WHERE `section_id` = $section_id")) {
+		echo 'Database data comments_header added successfully<br>';
+	}
+	echo mysql_error().'<br />';
+
+}
+
+// MIGRATING FIELD DATES to POSTED_WHEN
+echo "<B>Copying field posted_when value to published_when</B><BR>";
+$query_dates = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts where section_id != 0 and page_id != 0");
+
+while($result = $query_dates->fetchRow()) {
+	$pid = $result['post_id'];
+	$NEW_DATE = $result['posted_when'];
+	if($database->query("UPDATE `".TABLE_PREFIX."mod_news_posts` SET `published_when` = '$NEW_DATE' WHERE `post_id` = $pid")) {
+		echo 'Copying posted_when value to published_when successfully<br>';
+	}
+	echo mysql_error().'<br />';
+}
+
+//******************************************************************************
+//End of upgrade script for the news modul
+//******************************************************************************
+
 echo "<br /><br />Done<br />";
 
 ?>
 
 </body>
-</html>
+</html>
\ No newline at end of file
Index: trunk/wb/modules/news/info.php
===================================================================
--- trunk/wb/modules/news/info.php	(revision 561)
+++ trunk/wb/modules/news/info.php	(revision 562)
@@ -26,9 +26,9 @@
 $module_directory = 'news';
 $module_name = 'News';
 $module_function = 'page';
-$module_version = '2.6';
+$module_version = '2.7';
 $module_platform = '2.6.x';
-$module_author = 'Ryan Djurovich';
+$module_author = 'Ryan Djurovich, Rob Smith';
 $module_license = 'GNU General Public License';
 $module_description = 'This page type is designed for making a news page.';
 

Property changes on: trunk/wb/modules/news/info.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/edit_css.php
===================================================================
--- trunk/wb/modules/news/edit_css.php	(nonexistent)
+++ trunk/wb/modules/news/edit_css.php	(revision 562)
@@ -0,0 +1,126 @@
+<?php
+
+// $Id$
+
+######################################################################################################################
+#
+#	PURPOSE OF THIS FILE:
+#	This file contains the routines required to edit the optional module files: frontend.css and backend.css.
+# Nothing needs to be changed in this file. Keep it as is.
+#
+#	INVOKED BY:
+#	This file should be invoked by clicking on a text link shown in modify.php.
+#
+######################################################################################################################
+
+/**
+  Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org)
+  Copyright (C) year, Authors name
+  Contact me: author(at)domain.xxx, http://authorwebsite.xxx
+
+  This module is free software. You can redistribute it and/or modify it 
+  under the terms of the GNU General Public License  - version 2 or later, 
+  as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html.
+
+  This module is distributed in the hope that it will be useful, 
+  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+  GNU General Public License for more details.
+**/
+
+// include configuration file and admin wrapper script
+require('../../config.php');
+require(WB_PATH.'/modules/admin.php');
+
+// include functions to edit the optional module CSS files (frontend.css, backend.css)
+require_once('css.functions.php');
+
+// check if action is: save or edit
+if(isset($_GET['action']) && $_GET['action'] == 'save' && isset($_POST['edit_file']) && mod_file_exists($_POST['edit_file'])) {
+	/** 
+	SAVE THE UPDATED CONTENTS TO THE CSS FILE
+	*/
+	$css_content = '';
+	if(isset($_POST['css_codepress']) && strlen($_POST['css_codepress']) > 0) {
+		// if Javascript is enabled, take contents from hidden field: css_codepress
+		$css_content = stripslashes($_POST['css_codepress']);
+	} elseif(isset($_POST['css_data']) && strlen($_POST['css_data']) > 0) {
+		// if Javascript is disabled, take contens from textarea: css_data
+		$css_content = stripslashes($_POST['css_data']);
+	}
+
+	$bytes = 0;
+	if ($css_content != '') {
+		// open the module CSS file for writting
+		$mod_file = @fopen(dirname(__FILE__) .'/' .$_POST['edit_file'], "wb");
+		// write new content to the module CSS file
+		$bytes = @fwrite($mod_file, $css_content);
+		// close the file
+		@fclose($mod_file);
+	}
+
+	// write out status message
+	if($bytes == 0 ) {
+		$admin->print_error($TEXT['ERROR'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
+	} else {
+		$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
+	}
+
+} else {
+	/** 
+	MODIFY CONTENTS OF THE CSS FILE VIA TEXT AREA 
+	*/
+	
+	// check which module file to edit (frontend.css, backend.css or '')
+	$css_file = '';
+	if(isset($_GET['edit_file'])) $css_file = edit_mod_file($_GET['edit_file']);
+
+	// display output
+	if($css_file == '') {
+		// no valid module file to edit; display error message and backlink to modify.php
+		echo "<h2>Nothing to edit</h2>";
+		echo "<p>No valid module file exists for this module.</p>";
+		$output  = "<a href=\"#\" onclick=\"javascript: window.location = '";
+		$output .= ADMIN_URL ."/pages/modify.php?page_id=" .$page_id ."'\">back</a>";
+		echo $output;
+	} else {
+		// store content of the module file in variable
+		$css_content = @file_get_contents(dirname(__FILE__) .'/' .$css_file);
+		// output content of module file to textareas
+		?>
+
+		<form name="edit_module_file" action="<?php echo $_SERVER['PHP_SELF'] .'?action=save';?>" method="post" style="margin: 0;">
+			<input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
+			<input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
+			<input type="hidden" name="css_codepress" value="" />
+			<input type="hidden" name="edit_file" value="<?php echo $css_file; ?>" />
+
+			<h2><?php echo $HEADING_CSS_FILE .'"' .$css_file; ?>"</h2>
+			<?php 
+				// include the toggle button to switch between frontend.css and backend.css (if both files exists)
+				toggle_css_file($css_file); 
+			?>
+			
+			<p><?php echo $TXT_EDIT_CSS_FILE; ?></p> 
+			
+			<textarea name="css_data" id="css_data" class="codepress css" cols="115" rows="25" wrap="VIRTUAL" style="margin:2px;"><?php echo $css_content; ?></textarea>
+			
+			<table cellpadding="0" cellspacing="0" border="0" width="100%">
+				<tr>
+					<td align="left">
+						<input name="save" type="submit" value="<?php echo $TEXT['SAVE'];?>" onclick="javascript: css_codepress.value = css_data.getCode();" style="width: 100px; margin-top: 5px;" />
+					</td>
+					<td align="right">
+						<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;" />
+					</td>
+				</tr>
+			</table>
+		</form>
+	<?php 
+	}
+}
+
+// Print admin footer
+$admin->print_footer();
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/news/edit_css.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/news/add_post.php
===================================================================
--- trunk/wb/modules/news/add_post.php	(revision 561)
+++ trunk/wb/modules/news/add_post.php	(revision 562)

Property changes on: trunk/wb/modules/news/add_post.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/css.functions.php
===================================================================
--- trunk/wb/modules/news/css.functions.php	(nonexistent)
+++ trunk/wb/modules/news/css.functions.php	(revision 562)
@@ -0,0 +1,118 @@
+<?php
+
+// $Id$
+
+######################################################################################################################
+#
+#	PURPOSE OF THIS FILE:
+#	This file contains functions to edit the module CSS files (frontend.css and backend.css)
+#
+#	INVOKED BY:
+# 	This file is invoked when a user clicks on the edit CSS button in the modify.php file
+#
+######################################################################################################################
+
+/**
+  Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org)
+  Copyright (C) year, Authors name
+  Contact me: author(at)domain.xxx, http://authorwebsite.xxx
+
+  This module is free software. You can redistribute it and/or modify it 
+  under the terms of the GNU General Public License  - version 2 or later, 
+  as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html.
+
+  This module is distributed in the hope that it will be useful, 
+  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+  GNU General Public License for more details.
+**/
+
+// prevent this file from being accesses directly
+if(defined('WB_PATH') == false) {
+	exit("Cannot access this file directly"); 
+}
+
+/**
+DEFINE LANGUAGE DEPENDING OUTPUTS FOR THE EDIT CSS PART
+*/
+$lang_dir = WB_PATH .'/modules/' .basename(dirname(__FILE__)) .'/languages/';
+if(file_exists($lang_dir .LANGUAGE .'.php')) {
+	// try to include custom language file if exists
+	require_once($lang_dir .LANGUAGE .'.php');
+} elseif(file_exists($lang_dir .'EN.php')) {
+	// try to include default module language file
+	require_once($lang_dir .'EN.php');
+}
+
+// set defaults if output varibles are not set in the languages files
+if(!isset($CAP_EDIT_CSS)) $CAP_EDIT_CSS	= 'Edit CSS';
+if(!isset($CAP_TOGGLE_CSS)) $CAP_TOGGLE_CSS	= 'Switch to ';
+if(!isset($HEADING_CSS_FILE))	$HEADING_CSS_FILE = 'Actual module file: ';
+if(!isset($TXT_EDIT_CSS_FILE)) $TXT_EDIT_CSS_FILE = 'Edit the CSS definitions in the textarea below.';
+
+// this function checks if the specified optional module file exists
+if (!function_exists('mod_file_exists')) {
+	function mod_file_exists($mod_file='frontend.css') {
+		// extract the module directory
+		$mod_dir = basename(dirname(__FILE__)) .'/' .$mod_file;
+		return file_exists(WB_PATH .'/modules/' .$mod_dir);
+	}
+}
+
+// this function displays a "Edit CSS" button in modify.php 
+// if the optional module files (module.css, module.js) if exists
+if (!function_exists('css_edit')) {
+	function css_edit() {
+		global $page_id, $section_id, $CAP_EDIT_CSS;
+		// extract the module directory
+		$mod_dir = basename(dirname(__FILE__));
+		$frontend_css = mod_file_exists('frontend.css');
+		$backend_css = mod_file_exists('backend.css');
+		if($frontend_css || $backend_css) {
+			// display link to edit the optional CSS module files
+			$file = $frontend_css ? 'frontend.css' : 'backend.css';
+			$output  = '<div class="mod_' .$mod_dir .'_edit_css"><a href="' .WB_URL .'/modules/' .$mod_dir .'/edit_css.php';
+			$output .= '?page_id=' .$page_id .'&section_id=' .$section_id .'&edit_file=' .$file .'">';
+			$output .= $CAP_EDIT_CSS .'</a></div>';
+			echo $output;
+		}
+	}
+}
+
+// this function returns a secure module file from $_GET['edit_file']
+if (!function_exists('edit_mod_file')) {
+	function edit_mod_file() {
+		$allowed_files = array('frontend.css', 'backend.css');
+		if(isset($_GET['edit_file']) && in_array($_GET['edit_file'], $allowed_files)) {
+			return $_GET['edit_file'];
+		} elseif(mod_file_exists('frontend.css')) {
+			return 'frontend.css';
+		} elseif(mod_file_exists('backend_css')) {
+			return 'backend.css';
+		} else {
+			return '';
+		}
+	}
+}	
+
+// this function displays a button to toggle between the optional module CSS files
+// function is invoked from edit_css.php file
+if (!function_exists('toggle_css_file')) {
+	function toggle_css_file($base_css_file = 'frontend.css') {
+		$allowed_mod_files = array('frontend.css', 'backend.css');
+		if(!in_array($base_css_file, $allowed_mod_files)) return;
+		global $page_id, $section_id, $CAP_TOGGLE_CSS;
+		// extract the module directory
+		$mod_dir = basename(dirname(__FILE__));
+		$toggle_file = ($base_css_file == 'frontend.css') ? 'backend.css' : 'frontend.css';
+		if(mod_file_exists($toggle_file)) {
+			// display button to toggle between the two CSS files: frontend.css, backend.css
+			$output  = '<div class="mod_' .$mod_dir .'_edit_css"><a href="' .WB_URL .'/modules/' .$mod_dir .'/edit_css.php';
+			$output .= '?page_id=' .$page_id .'&section_id=' .$section_id .'&edit_file=' .$toggle_file .'">';
+			$output .= $CAP_TOGGLE_CSS .$toggle_file .'</a></div>';
+			echo $output;
+		}
+	}
+}
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/news/css.functions.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/news/search.php
===================================================================
--- trunk/wb/modules/news/search.php	(revision 561)
+++ trunk/wb/modules/news/search.php	(revision 562)

Property changes on: trunk/wb/modules/news/search.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/delete_post.php
===================================================================
--- trunk/wb/modules/news/delete_post.php	(revision 561)
+++ trunk/wb/modules/news/delete_post.php	(revision 562)
@@ -46,12 +46,13 @@
 }
 
 // Unlink post access file
-if(is_writable(WB_PATH.PAGES_DIRECTORY.$get_details['link'].'.php')) {
-	unlink(WB_PATH.PAGES_DIRECTORY.$get_details['link'].'.php');
+if(is_writable(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION)) {
+	unlink(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION);
 }
 
 // Delete post
 $database->query("DELETE FROM ".TABLE_PREFIX."mod_news_posts WHERE post_id = '$post_id' LIMIT 1");
+$database->query("DELETE FROM ".TABLE_PREFIX."mod_news_comments WHERE post_id = '$post_id'");
 
 // Clean up ordering
 require(WB_PATH.'/framework/class.order.php');

Property changes on: trunk/wb/modules/news/delete_post.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/modify_settings.php
===================================================================
--- trunk/wb/modules/news/modify_settings.php	(revision 561)
+++ trunk/wb/modules/news/modify_settings.php	(revision 562)
@@ -28,6 +28,18 @@
 // Include WB admin wrapper script
 require(WB_PATH.'/modules/admin.php');
 
+// include functions to edit the optional module CSS files (frontend.css, backend.css)
+require_once('css.functions.php');
+
+// check if module language file exists for the language set by the user (e.g. DE, EN)
+if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php')) {
+	// no module language file exists for the language set by the user, include default module language file EN.php
+	require_once(WB_PATH .'/modules/news/languages/EN.php');
+} else {
+	// a module language file exists for the language defined by the user, load it
+	require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php');
+}
+
 // Get header and footer
 $query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '$section_id'");
 $fetch_content = $query_content->fetchRow();
@@ -36,142 +48,155 @@
 $raw = array('<', '>');
 $friendly = array('&lt;', '&gt;');
 
+// check if backend.css file needs to be included into the <body></body> of modify.php
+if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/form/backend.css")) {
+	echo '<style type="text/css">';
+	include(WB_PATH .'/modules/form/backend.css');
+	echo "\n</style>\n";
+}
+
 ?>
+<h2><?php echo $MOD_NEWS['SETTINGS']; ?></h2>
+<?php
+	// include the button to edit the optionla module CSS files
+	// Note: CSS styles for the button are defined in backend.css (div class="mod_moduledirectory_edit_css")
+	css_edit();
+?>
 
-<style type="text/css">
-.setting_name {
-	vertical-align: top;
-}
-</style>
-
 <form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_settings.php" method="post" style="margin: 0;">
 
-<input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
-<input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
+	<input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
+	<input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
 
-<table cellpadding="2" cellspacing="0" border="0" width="100%">
-<tr>
-	<td class="setting_name" width="100"><?php echo $TEXT['HEADER']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="header" style="width: 100%; height: 80px;"><?php echo ($fetch_content['header']); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="post_loop" style="width: 100%; height: 60px;"><?php echo ($fetch_content['post_loop']); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="footer" style="width: 100%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['footer'])); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="post_header" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_header'])); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="post_footer" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_footer'])); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['POSTS_PER_PAGE']; ?>:</td>
-	<td class="setting_name">
-		<select name="posts_per_page" style="width: 100%;">
-			<option value=""><?php echo $TEXT['UNLIMITED']; ?></option>
-			<?php
-			for($i = 1; $i <= 20; $i++) {
-				if($fetch_content['posts_per_page'] == ($i*5)) { $selected = ' selected'; } else { $selected = ''; }
-				echo '<option value="'.($i*5).'"'.$selected.'>'.($i*5).'</option>';
-			}
-			?>
-		</select>
-	</td>
-</tr>
-<tr>
-	<td><?php echo $TEXT['COMMENTING']; ?>:</td>
-	<td>
-		<select name="commenting" style="width: 100%;">
-			<option value="none"><?php echo $TEXT['DISABLED']; ?></option>
-			<option value="public" <?php if($fetch_content['commenting'] == 'public') { echo 'selected'; } ?>><?php echo $TEXT['PUBLIC']; ?></option>
-			<option value="private" <?php if($fetch_content['commenting'] == 'private') { echo 'selected'; } ?>><?php echo $TEXT['PRIVATE']; ?></option>
-		</select>
-	</td>
-</tr>
-<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
-	<td>
-		<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($fetch_content['use_captcha'] == true) { echo ' checked'; } ?> />
-		<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
-		<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($fetch_content['use_captcha'] == false) { echo ' checked'; } ?> />
-		<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
-	</td>
-</tr>
-<tr>
-	<td>
-		<?php echo $TEXT['RESIZE_IMAGE_TO']; ?>:
-	</td>
-	<td>
-		<select name="resize" style="width: 100%;">
-			<option value=""><?php echo $TEXT['NONE']; ?></option>
-			<?php
-			$SIZES['50'] = '50x50px';
-			$SIZES['75'] = '75x75px';
-			$SIZES['100'] = '100x100px';
-			$SIZES['125'] = '125x125px';
-			$SIZES['150'] = '150x150px';
-			foreach($SIZES AS $size => $size_name) {
-				if($fetch_content['resize'] == $size) { $selected = ' selected'; } else { $selected = ''; }
-				echo '<option value="'.$size.'"'.$selected.'>'.$size_name.'</option>';
-			}
-			?>
-		</select>
-	</td>
-</tr>
-<?php } ?>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['HEADER']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="comments_header" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_header'])); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['LOOP']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="comments_loop" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_loop'])); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['FOOTER']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="comments_footer" style="width: 100%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_footer'])); ?></textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['PAGE']; ?>:</td>
-	<td class="setting_name">
-		<textarea name="comments_page" style="width: 100%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_page'])); ?></textarea>
-	</td>
-</tr>
-</table>
-<table cellpadding="0" cellspacing="0" border="0" width="100%">
-<tr>
-	<td width="105">&nbsp;</td>
-	<td align="left">
-		<input name="save" type="submit" value="<?php echo $TEXT['SAVE'].' '.$TEXT['SETTINGS']; ?>" style="width: 200px; margin-top: 5px;"></form>
-	</td>
-	<td align="right">
-		<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;" />
-	</td>
-</tr>
-</table>
+	<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
+		<tr>
+			<td colspan="2"><strong><?php echo $HEADING['GENERAL_SETTINGS']; ?></strong></td>
+		<tr>
+			<td class="setting_name" width="20%"><?php echo $TEXT['HEADER']; ?>:</td>
+			<td class="setting_name">
+				<textarea name="header" style="width: 98%; height: 80px;"><?php echo ($fetch_content['header']); ?></textarea>
+			</td>
+		</tr>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['POST'].' '.$TEXT['LOOP']; ?>:</td>
+			<td class="setting_name">
+				<textarea name="post_loop" style="width: 98%; height: 60px;"><?php echo ($fetch_content['post_loop']); ?></textarea>
+			</td>
+		</tr>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['FOOTER']; ?>:</td>
+			<td class="setting_name">
+				<textarea name="footer" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['footer'])); ?></textarea>
+			</td>
+		</tr>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['POST_HEADER']; ?>:</td>
+			<td class="setting_name">
+				<textarea name="post_header" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_header'])); ?></textarea>
+			</td>
+		</tr>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['POST_FOOTER']; ?>:</td>
+			<td class="setting_name">
+				<textarea name="post_footer" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['post_footer'])); ?></textarea>
+			</td>
+		</tr>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['POSTS_PER_PAGE']; ?>:</td>
+			<td class="setting_name">
+				<select name="posts_per_page" style="width: 98%;">
+					<option value=""><?php echo $TEXT['UNLIMITED']; ?></option>
+					<?php
+					for($i = 1; $i <= 20; $i++) {
+						if($fetch_content['posts_per_page'] == ($i*5)) { $selected = ' selected'; } else { $selected = ''; }
+						echo '<option value="'.($i*5).'"'.$selected.'>'.($i*5).'</option>';
+					}
+					?>
+				</select>
+			</td>
+		</tr>
+	</table>
+	<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-top: 3px;">
+		<tr>
+			<td colspan="2"><strong><?php echo $TEXT['COMMENTS']; ?></strong></td>
+		</tr>
+		<tr>
+			<td  width="20%"><?php echo $TEXT['COMMENTING']; ?>:</td>
+			<td>
+				<select name="commenting" style="width: 98%;">
+					<option value="none"><?php echo $TEXT['DISABLED']; ?></option>
+					<option value="public" <?php if($fetch_content['commenting'] == 'public') { echo 'selected'; } ?>><?php echo $TEXT['PUBLIC']; ?></option>
+					<option value="private" <?php if($fetch_content['commenting'] == 'private') { echo 'selected'; } ?>><?php echo $TEXT['PRIVATE']; ?></option>
+				</select>
+			</td>
+		</tr>
+		<?php if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */ ?>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['CAPTCHA_VERIFICATION']; ?>:</td>
+			<td>
+				<input type="radio" name="use_captcha" id="use_captcha_true" value="1"<?php if($fetch_content['use_captcha'] == true) { echo ' checked'; } ?> />
+				<label for="use_captcha_true"><?php echo $TEXT['ENABLED']; ?></label>
+				<input type="radio" name="use_captcha" id="use_captcha_false" value="0"<?php if($fetch_content['use_captcha'] == false) { echo ' checked'; } ?> />
+				<label for="use_captcha_false"><?php echo $TEXT['DISABLED']; ?></label>
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<?php echo $TEXT['RESIZE_IMAGE_TO']; ?>:
+			</td>
+			<td>
+				<select name="resize" style="width: 98%;">
+					<option value=""><?php echo $TEXT['NONE']; ?></option>
+					<?php
+					$SIZES['50'] = '50x50px';
+					$SIZES['75'] = '75x75px';
+					$SIZES['100'] = '100x100px';
+					$SIZES['125'] = '125x125px';
+					$SIZES['150'] = '150x150px';
+					foreach($SIZES AS $size => $size_name) {
+						if($fetch_content['resize'] == $size) { $selected = ' selected'; } else { $selected = ''; }
+						echo '<option value="'.$size.'"'.$selected.'>'.$size_name.'</option>';
+					}
+					?>
+				</select>
+			</td>
+		</tr>
+		<?php } ?>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['HEADER']; ?>:</td>
+			<td class="setting_name">
+				<textarea name="comments_header" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_header'])); ?></textarea>
+			</td>
+		</tr>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['LOOP']; ?>:</td>
+			<td class="setting_name">
+				<textarea name="comments_loop" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_loop'])); ?></textarea>
+			</td>
+		</tr>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['FOOTER']; ?>:</td>
+			<td class="setting_name">
+				<textarea name="comments_footer" style="width: 98%; height: 60px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_footer'])); ?></textarea>
+			</td>
+		</tr>
+		<tr>
+			<td class="setting_name"><?php echo $TEXT['COMMENTS'].' '.$TEXT['PAGE']; ?>:</td>
+			<td class="setting_name">
+				<textarea name="comments_page" style="width: 98%; height: 80px;"><?php echo str_replace($raw, $friendly, ($fetch_content['comments_page'])); ?></textarea>
+			</td>
+		</tr>
+	</table>
+	<table cellpadding="0" cellspacing="0" border="0" width="100%">
+		<tr>
+			<td align="left">
+				<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
+			</td>
+			<td align="right">
+				<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;" />
+			</td>
+		</tr>
+	</table>
 
 
 <?php

Property changes on: trunk/wb/modules/news/modify_settings.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/modify_comment.php
===================================================================
--- trunk/wb/modules/news/modify_comment.php	(revision 561)
+++ trunk/wb/modules/news/modify_comment.php	(revision 562)
@@ -42,6 +42,8 @@
 
 ?>
 
+<h2><?php echo $TEXT['MODIFY'].' '.$TEXT['COMMENT']; ?></h2>
+
 <form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_comment.php" method="post" style="margin: 0;">
 
 <input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
@@ -49,27 +51,25 @@
 <input type="hidden" name="post_id" value="<?php echo $fetch_content['post_id']; ?>">
 <input type="hidden" name="comment_id" value="<?php echo $comment_id; ?>">
 
-<table cellpadding="0" cellspacing="0" border="0" width="100%">
+<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
 <tr>
 	<td width="80"><?php echo $TEXT['TITLE']; ?>:</td>
 	<td>
-		<input type="text" name="title" value="<?php echo (htmlspecialchars($fetch_content['title'])); ?>" style="width: 100%;" maxlength="255" />
+		<input type="text" name="title" value="<?php echo (htmlspecialchars($fetch_content['title'])); ?>" style="width: 98%;" maxlength="255" />
 	</td>
 </tr>
 <tr>
 	<td valign="top"><?php echo $TEXT['COMMENT']; ?>:</td>
 	<td>
-		<textarea name="comment" style="width: 100%; height: 150px;"><?php echo (htmlspecialchars($fetch_content['comment'])); ?></textarea>
+		<textarea name="comment" style="width: 98%; height: 150px;"><?php echo (htmlspecialchars($fetch_content['comment'])); ?></textarea>
 	</td>
 </tr>
 </table>
 
-<br />
-
 <table cellpadding="0" cellspacing="0" border="0" width="100%">
 <tr>
 	<td align="left">
-		<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 200px; margin-top: 5px;"></form>
+		<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
 	</td>
 	<td align="right">
 		<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = '<?php echo WB_URL; ?>/modules/news/modify_post.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>&post_id=<?php echo $fetch_content['post_id']; ?>';" style="width: 100px; margin-top: 5px;" />

Property changes on: trunk/wb/modules/news/modify_comment.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/uninstall.php
===================================================================
--- trunk/wb/modules/news/uninstall.php	(revision 561)
+++ trunk/wb/modules/news/uninstall.php	(revision 562)

Property changes on: trunk/wb/modules/news/uninstall.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/move_up.php
===================================================================
--- trunk/wb/modules/news/move_up.php	(revision 561)
+++ trunk/wb/modules/news/move_up.php	(revision 562)

Property changes on: trunk/wb/modules/news/move_up.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/save_group.php
===================================================================
--- trunk/wb/modules/news/save_group.php	(revision 561)
+++ trunk/wb/modules/news/save_group.php	(revision 562)

Property changes on: trunk/wb/modules/news/save_group.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/view.php
===================================================================
--- trunk/wb/modules/news/view.php	(revision 561)
+++ trunk/wb/modules/news/view.php	(revision 562)
@@ -26,6 +26,13 @@
 // Must include code to stop this file being access directly
 if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
 
+// check if frontend.css file needs to be included into the <body></body> of view.php
+if((!function_exists('register_frontend_modfiles') || !defined('MOD_FRONTEND_CSS_REGISTERED')) &&  file_exists(WB_PATH .'/modules/news/frontend.css')) {
+   echo '<style type="text/css">';
+   include(WB_PATH .'/modules/news/frontend.css');
+   echo "\n</style>\n";
+} 
+
 // Check if there is a start point defined
 if(isset($_GET['p']) AND is_numeric($_GET['p']) AND $_GET['p'] >= 0) {
 	$position = $_GET['p'];
@@ -71,9 +78,6 @@
 	// Check if we should only list posts from a certain group
 	if(isset($_GET['g']) AND is_numeric($_GET['g'])) {
 		$query_extra = " AND group_id = '".$_GET['g']."'";
-		?>
-		<style type="text/css">.selected_group_title { font-size: 14px; text-align: center; }</style>
-		<?php
 	} else {
 		$query_extra = '';
 	}
@@ -169,6 +173,7 @@
 				// Workout date and time of last modified post
 				$post_date = gmdate(DATE_FORMAT, $post['posted_when']+TIMEZONE);
 				$post_time = gmdate(TIME_FORMAT, $post['posted_when']+TIMEZONE);
+				$publ_date = date(DATE_FORMAT,$post['published_when']);
 				// Work-out the post link
 				$post_link = page_link($post['link']);
 				if(isset($_GET['p']) AND $position > 0) {
@@ -189,18 +194,18 @@
 				$wb->preprocess($short);
 				// Replace vars with values
 				$post_long_len = strlen($post['content_long']);
-				$vars = array('[PAGE_TITLE]', '[GROUP_ID]', '[GROUP_TITLE]', '[GROUP_IMAGE]', '[DISPLAY_GROUP]', '[DISPLAY_IMAGE]', '[TITLE]', '[SHORT]', '[LINK]', '[DATE]', '[TIME]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]', '[TEXT_READ_MORE]');
+				$vars = array('[PAGE_TITLE]', '[GROUP_ID]', '[GROUP_TITLE]', '[GROUP_IMAGE]', '[DISPLAY_GROUP]', '[DISPLAY_IMAGE]', '[TITLE]', '[SHORT]', '[LINK]', '[MODI_DATE]', '[MODI_TIME]', '[PUBLISHED_DATE]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]', '[TEXT_READ_MORE]');
 				if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') {
 					if($post_long_len < 9) {
-						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], '');
+						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], '');
 					} else {
-						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $TEXT['READ_MORE']);
+						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $TEXT['READ_MORE']);
 					}
 				} else {
 					if($post_long_len < 9) {
-						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, '', '', '', '', '');
+						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, '', '', '', '', '');
 					} else {
-						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, '', '', '', '', $TEXT['READ_MORE']);
+						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, '', '', '', '', $TEXT['READ_MORE']);
 					}
 				}
 				echo str_replace($vars, $values, $setting_post_loop);
@@ -259,6 +264,7 @@
 			// Workout date and time of last modified post
 			$post_date = gmdate(DATE_FORMAT, $post['posted_when']+TIMEZONE);
 			$post_time = gmdate(TIME_FORMAT, $post['posted_when']+TIMEZONE);
+			$publ_date = date(DATE_FORMAT,$post['published_when']);
 			// Get group id, title, and image
 			$group_id = $post['group_id'];
 			$group_title = $groups[$group_id]['title'];
@@ -265,18 +271,18 @@
 			$group_image = $groups[$group_id]['image'];
 			if($group_image == '') { $display_image = 'none'; } else { $display_image = ''; }
 			if($group_id == 0) { $display_group = 'none'; } else { $display_group = ''; }
-			$vars = array('[PAGE_TITLE]', '[GROUP_ID]', '[GROUP_TITLE]', '[GROUP_IMAGE]', '[DISPLAY_GROUP]', '[DISPLAY_IMAGE]', '[TITLE]', '[SHORT]', '[BACK]', '[DATE]', '[TIME]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]');
+			$vars = array('[PAGE_TITLE]', '[GROUP_ID]', '[GROUP_TITLE]', '[GROUP_IMAGE]', '[DISPLAY_GROUP]', '[DISPLAY_IMAGE]', '[TITLE]', '[SHORT]', '[BACK]', '[MODI_DATE]', '[MODI_TIME]', '[PUBL_DATE]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]');
 			$post_short=$post['content_short'];
 			$wb->preprocess($post_short);
 			if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') {
-				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $post_date, $post_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email']);
+				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $post_date, $post_time, $publ_date, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email']);
 			} else {
-				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $post_date, $post_time, '', '', '', '');
+				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $post_date, $post_time, $publ_date, '', '', '', '');
 			}
 			$post_long = ($post['content_long']);
 		}
 	} else {
-		header('Location: '.WB_URL.'/pages/');
+		header("Location: ".WB_URL.PAGES_DIRECTORY."");
 		exit(0);
 	}
 	

Property changes on: trunk/wb/modules/news/view.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/save_settings.php
===================================================================
--- trunk/wb/modules/news/save_settings.php	(revision 561)
+++ trunk/wb/modules/news/save_settings.php	(revision 562)

Property changes on: trunk/wb/modules/news/save_settings.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/frontend.css
===================================================================
--- trunk/wb/modules/news/frontend.css	(nonexistent)
+++ trunk/wb/modules/news/frontend.css	(revision 562)
@@ -0,0 +1,49 @@
+.post_title, .post_date {
+	border-bottom: 1px solid #DDDDDD;
+}
+
+.post_title {
+	font-weight: bold;
+	font-size: 12px;
+	color: #000000;
+}
+
+.post_date {
+	text-align: right;
+	font-weight: bold;
+}
+
+.post_short {
+	text-align: justify;
+	padding-bottom: 5px;
+}
+
+.comment_title {
+	font-weight: bold;
+}
+
+.comment_text {
+	font-weight: bold;
+	background-color: #FDFDFD;
+	border-bottom: 1px solid #DDDDDD;
+	padding-bottom: 15px;
+}
+
+.comment_title, .comment_text {
+	border-left: 1px solid #DDDDDD;
+}
+
+.comment_info {
+	text-align: right;
+	border-right: 1px solid #DDDDDD;
+}
+
+.comment_title, .comment_info {
+	border-top: 1px solid #DDDDDD;
+	background-color: #EEEEEE;
+}
+
+.selected_group_title { 
+	font-size: 14px;
+	text-align: center;
+}
\ No newline at end of file

Property changes on: trunk/wb/modules/news/frontend.css
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/news/delete_comment.php
===================================================================
--- trunk/wb/modules/news/delete_comment.php	(revision 561)
+++ trunk/wb/modules/news/delete_comment.php	(revision 562)

Property changes on: trunk/wb/modules/news/delete_comment.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/modify.php
===================================================================
--- trunk/wb/modules/news/modify.php	(revision 561)
+++ trunk/wb/modules/news/modify.php	(revision 562)

Property changes on: trunk/wb/modules/news/modify.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/add.php
===================================================================
--- trunk/wb/modules/news/add.php	(revision 561)
+++ trunk/wb/modules/news/add.php	(revision 562)
@@ -26,16 +26,10 @@
 // Must include code to stop this file being access directly
 if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
 
-$header = '<style type=\"text/css\">
-.post_title, .post_date { border-bottom: 1px solid #DDDDDD; }
-.post_title { font-weight: bold; font-size: 12px; color: #000000; }
-.post_date { text-align: right; font-weight: bold; }
-.post_short { text-align: justify; padding-bottom: 5px; }
-</style>
-<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"98%\">';
+$header = '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"98%\">';
 $post_loop = '<tr class=\"post_top\">
 <td class=\"post_title\"><a href=\"[LINK]\">[TITLE]</a></td>
-<td class=\"post_date\">[TIME], [DATE]</td>
+<td class=\"post_date\">[MODI_TIME], [MODI_DATE]</td>
 </tr>
 <tr>
 <td class=\"post_short\" colspan=\"2\">
@@ -57,7 +51,7 @@
 <td rowspan="3" style="display: [DISPLAY_IMAGE]"><img src="[GROUP_IMAGE]" alt="[GROUP_TITLE]" /></td>
 </tr>
 <tr>
-<td valign="top"><b>Posted by [DISPLAY_NAME] ([USERNAME]) on [DATE] at [TIME]</b></td>
+<td valign="top"><b>Posted by [DISPLAY_NAME] ([USERNAME]) on [PUBL_DATE]</b></td>
 </tr>
 <tr style="display: [DISPLAY_GROUP]">
 <td valign="top"><a href="[BACK]">[PAGE_TITLE]</a> >> <a href="[BACK]?g=[GROUP_ID]">[GROUP_TITLE]</a></td>
@@ -64,16 +58,9 @@
 </tr>
 </table>
 <p style="text-align: justify;">');
-$post_footer = '</p>
+$post_footer = '</p><p>Last changed: [MODI_DATE] at [MODI_TIME]</p>
 <a href=\"[BACK]\">Back</a>';
 $comments_header = addslashes('<br /><br />
-<style type="text/css">
-.comment_title { font-weight: bold; }
-.comment_text { font-weight: bold; background-color: #FDFDFD; border-bottom: 1px solid #DDDDDD; padding-bottom: 15px; }
-.comment_title, .comment_text { border-left: 1px solid #DDDDDD; }
-.comment_info { text-align: right; border-right: 1px solid #DDDDDD; }
-.comment_title, .comment_info { border-top: 1px solid #DDDDDD; background-color: #EEEEEE; }
-</style>
 <h2>Comments</h2>
 <table cellpadding="2" cellspacing="0" border="0" width="98%">');
 $comments_loop = addslashes('<tr>

Property changes on: trunk/wb/modules/news/add.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/backend.css
===================================================================
--- trunk/wb/modules/news/backend.css	(nonexistent)
+++ trunk/wb/modules/news/backend.css	(revision 562)
@@ -0,0 +1,17 @@
+.setting_name {
+	vertical-align: top;
+}
+
+div.mod_news_edit_css {
+	width: 100%;
+	margin-top: -20px;
+	margin-bottom: 15px;
+	text-align: right;
+}
+
+div.mod_news_edit_css a {
+	width: 100px;
+	padding: 5px;
+	border: 1px solid;
+	background-color: #F0F0F0;
+}
\ No newline at end of file

Property changes on: trunk/wb/modules/news/backend.css
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/news/modify_post.php
===================================================================
--- trunk/wb/modules/news/modify_post.php	(revision 561)
+++ trunk/wb/modules/news/modify_post.php	(revision 562)
@@ -50,6 +50,10 @@
 }
 
 ?>
+<script type="text/javascript" src="calendar/calendarDateInput.js"></script>
+
+<h2><?php echo $TEXT['ADD'].'/'.$TEXT['MODIFY'].' '.$TEXT['POST']; ?></h2>
+
 <form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_post.php" method="post" style="margin: 0;">
 
 <input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
@@ -57,11 +61,11 @@
 <input type="hidden" name="post_id" value="<?php echo $post_id; ?>">
 <input type="hidden" name="link" value="<?php echo $fetch_content['link']; ?>">
 
-<table cellpadding="4" cellspacing="0" border="0" width="100%">
+<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
 <tr>
-	<td width="80"><?php echo $TEXT['TITLE']; ?>:</td>
-	<td width="100%">
-		<input type="text" name="title" value="<?php echo (htmlspecialchars($fetch_content['title'])); ?>" style="width: 100%;" maxlength="255" />
+	<td><?php echo $TEXT['TITLE']; ?>:</td>
+	<td width="80%">
+		<input type="text" name="title" value="<?php echo (htmlspecialchars($fetch_content['title'])); ?>" style="width: 98%;" maxlength="255" />
 	</td>
 </tr>
 <tr>
@@ -108,7 +112,16 @@
 	</td>
 </tr>
 <tr>
+	<td><?php echo $TEXT['DATE']; ?>:</td>
+	<td><script>DateInput('publishdate', true, 'YYYY-MM-DD'<?php if($fetch_content['published_when'] != 0) { echo ",'" . date("Y-m-d",$fetch_content['published_when']) . "'"; } ?>)</script></td>
+</tr>
+</table>
+
+<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
+<tr>
 	<td valign="top"><?php echo $TEXT['SHORT']; ?>:</td>
+</tr>
+<tr>
 	<td>
 	<?php
 	show_wysiwyg_editor("short","short",htmlspecialchars($fetch_content['content_short']),"100%","135px");
@@ -117,6 +130,8 @@
 </tr>
 <tr>
 	<td valign="top"><?php echo $TEXT['LONG']; ?>:</td>
+</tr>
+<tr>
 	<td>
 	<?php
 	show_wysiwyg_editor("long","long",htmlspecialchars($fetch_content['content_long']),"100%","300px");
@@ -125,13 +140,10 @@
 </tr>
 </table>
 
-<table cellpadding="0" cellspacing="0" border="0" width="100%">
+<table cellpadding="2" cellspacing="0" border="0" width="100%">
 <tr>
-	<td width="90">
-		&nbsp;
-	</td>
 	<td align="left">
-		<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 200px; margin-top: 5px;"></form>
+		<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
 	</td>
 	<td align="right">
 		<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;" />

Property changes on: trunk/wb/modules/news/modify_post.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/move_down.php
===================================================================
--- trunk/wb/modules/news/move_down.php	(revision 561)
+++ trunk/wb/modules/news/move_down.php	(revision 562)

Property changes on: trunk/wb/modules/news/move_down.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/comment_page.php
===================================================================
--- trunk/wb/modules/news/comment_page.php	(revision 561)
+++ trunk/wb/modules/news/comment_page.php	(revision 562)
@@ -32,7 +32,7 @@
 // Get comments page template details from db
 $query_settings = $database->query("SELECT comments_page,use_captcha FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '".SECTION_ID."'");
 if($query_settings->numRows() == 0) {
-	header('Location: '.WB_URL.'/pages/');
+	header("Location: ".WB_URL.PAGES_DIRECTORY."");
 	exit(0);
 } else {
 	$settings = $query_settings->fetchRow();

Property changes on: trunk/wb/modules/news/comment_page.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/comment.php
===================================================================
--- trunk/wb/modules/news/comment.php	(revision 561)
+++ trunk/wb/modules/news/comment.php	(revision 562)
@@ -29,7 +29,7 @@
 // Check if there is a post id
 if(!isset($_GET['id']) OR !is_numeric($_GET['id'])) {
 	if(!isset($_POST['post_id']) OR !is_numeric($_POST['post_id'])) {
-		header('Location: '.WB_URL.'/pages/');
+		header("Location: ".WB_URL.PAGES_DIRECTORY."");
 		exit(0);
 	} else {
 		$post_id = $_POST['post_id'];
@@ -54,7 +54,7 @@
 // Query post for page id
 $query_post = $database->query("SELECT post_id,title,section_id,page_id FROM ".TABLE_PREFIX."mod_news_posts WHERE post_id = '$post_id'");
 if($query_post->numRows() == 0) {
-	header('Location: '.WB_URL.'/pages/');
+	header("Location: ".WB_URL.PAGES_DIRECTORY."");
 	exit(0);
 } else {
 	$fetch_post = $query_post->fetchRow();
@@ -68,7 +68,7 @@
 	// Get page details
 	$query_page = $database->query("SELECT parent,page_title,menu_title,keywords,description,visibility FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'");
 	if($query_page->numRows() == 0) {
-		header('Location: '.WB_URL.'/pages/');
+		header("Location: ".WB_URL.PAGES_DIRECTORY."");
 		exit(0);
 	} else {
 		$page = $query_page->fetchRow();

Property changes on: trunk/wb/modules/news/comment.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/delete.php
===================================================================
--- trunk/wb/modules/news/delete.php	(revision 561)
+++ trunk/wb/modules/news/delete.php	(revision 562)
@@ -26,6 +26,25 @@
 // Must include code to stop this file being access directly
 if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
 
+//get and remove all php files created for the news section
+$query_details = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE section_id = '$section_id'");
+if($query_details->numRows() > 0) {
+	while($link = $query_details->fetchRow()) {
+		if(is_writable(WB_PATH.PAGES_DIRECTORY.$link['link'].PAGE_EXTENSION)) {
+		unlink(WB_PATH.PAGES_DIRECTORY.$link['link'].PAGE_EXTENSION);
+		}
+	}
+}
+//check to see if any other sections are part of the news page, if only 1 news is there delete it
+$query_details = $database->query("SELECT * FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id'");
+if($query_details->numRows() == 1) {
+	$query_details2 = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'");
+	$link = $query_details2->fetchRow();
+	if(is_writable(WB_PATH.PAGES_DIRECTORY.$link['link'].PAGE_EXTENSION)) {
+		unlink(WB_PATH.PAGES_DIRECTORY.$link['link'].PAGE_EXTENSION);
+	}
+}
+
 $database->query("DELETE FROM ".TABLE_PREFIX."mod_news_posts WHERE section_id = '$section_id'");
 $database->query("DELETE FROM ".TABLE_PREFIX."mod_news_groups WHERE section_id = '$section_id'");
 $database->query("DELETE FROM ".TABLE_PREFIX."mod_news_comments WHERE section_id = '$section_id'");

Property changes on: trunk/wb/modules/news/delete.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/save_post.php
===================================================================
--- trunk/wb/modules/news/save_post.php	(revision 561)
+++ trunk/wb/modules/news/save_post.php	(revision 562)
@@ -45,6 +45,7 @@
 	$title = $admin->add_slashes($admin->get_post('title'));
 	$short = $admin->add_slashes($admin->get_post('short'));
 	$long = $admin->add_slashes($admin->get_post('long'));
+	$publishedwhen = strtotime($admin->get_post('publishdate'));	
 	$commenting = $admin->get_post('commenting');
 	$active = $admin->get_post('active');
 	$old_link = $admin->get_post('link');
@@ -68,14 +69,14 @@
 make_dir(WB_PATH.PAGES_DIRECTORY.'/posts/');
 if(!is_writable(WB_PATH.PAGES_DIRECTORY.'/posts/')) {
 	$admin->print_error($MESSAGE['PAGES']['CANNOT_CREATE_ACCESS_FILE']);
-} elseif($old_link != $post_link OR !file_exists(WB_PATH.PAGES_DIRECTORY.$post_link.'.php')) {
+} elseif($old_link != $post_link OR !file_exists(WB_PATH.PAGES_DIRECTORY.$post_link.PAGE_EXTENSION)) {
 	// We need to create a new file
 	// First, delete old file if it exists
-	if(file_exists(WB_PATH.$old_link.'.php')) {
-		unlink(WB_PATH.$old_link.'.php');
+	if(file_exists(WB_PATH.$old_link.PAGE_EXTENSION)) {
+		unlink(WB_PATH.$old_link.PAGE_EXTENSION);
 	}
 	// Specify the filename
-	$filename = WB_PATH.PAGES_DIRECTORY.'/'.$post_link.'.php';
+	$filename = WB_PATH.PAGES_DIRECTORY.'/'.$post_link.PAGE_EXTENSION;
 	// The depth of the page directory in the directory hierarchy
 	// '/pages' is at depth 1
 	$pages_dir_depth=count(explode('/',PAGES_DIRECTORY))-1;
@@ -101,7 +102,7 @@
 }
 
 // Update row
-$database->query("UPDATE ".TABLE_PREFIX."mod_news_posts SET group_id = '$group_id', title = '$title', link = '$post_link', content_short = '$short', content_long = '$long', commenting = '$commenting', active = '$active', posted_when = '".mktime()."', posted_by = '".$admin->get_user_id()."' WHERE post_id = '$post_id'");
+$database->query("UPDATE ".TABLE_PREFIX."mod_news_posts SET group_id = '$group_id', title = '$title', link = '$post_link', content_short = '$short', content_long = '$long', commenting = '$commenting', active = '$active', published_when = '$publishedwhen', posted_when = '".mktime()."', posted_by = '".$admin->get_user_id()."' WHERE post_id = '$post_id'");
 
 // Check if there is a db error, otherwise say successful
 if($database->is_error()) {

Property changes on: trunk/wb/modules/news/save_post.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/modify_group.php
===================================================================
--- trunk/wb/modules/news/modify_group.php	(revision 561)
+++ trunk/wb/modules/news/modify_group.php	(revision 562)
@@ -42,6 +42,8 @@
 
 ?>
 
+<h2><?php echo $TEXT['ADD'].'/'.$TEXT['MODIFY'].' '.$TEXT['GROUP']; ?></h2>
+
 <form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_group.php" method="post" enctype="multipart/form-data" style="margin: 0;">
 
 <input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
@@ -48,11 +50,11 @@
 <input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
 <input type="hidden" name="group_id" value="<?php echo $group_id; ?>">
 
-<table cellpadding="4" cellspacing="0" border="0" width="100%">
+<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
 <tr>
 	<td width="80"><?php echo $TEXT['TITLE']; ?>:</td>
 	<td>
-		<input type="text" name="title" value="<?php echo (htmlspecialchars($fetch_content['title'])); ?>" style="width: 100%;" maxlength="255" />
+		<input type="text" name="title" value="<?php echo (htmlspecialchars($fetch_content['title'])); ?>" style="width: 98%;" maxlength="255" />
 	</td>
 </tr>
 <tr>
@@ -89,7 +91,7 @@
 <table cellpadding="0" cellspacing="0" border="0" width="100%">
 <tr>
 	<td align="left">
-		<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 200px; margin-top: 5px;"></form>
+		<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
 	</td>
 	<td align="right">
 		<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;" />

Property changes on: trunk/wb/modules/news/modify_group.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/add_group.php
===================================================================
--- trunk/wb/modules/news/add_group.php	(revision 561)
+++ trunk/wb/modules/news/add_group.php	(revision 562)

Property changes on: trunk/wb/modules/news/add_group.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/install.php
===================================================================
--- trunk/wb/modules/news/install.php	(revision 561)
+++ trunk/wb/modules/news/install.php	(revision 562)
@@ -27,68 +27,69 @@
 	
 	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_news_posts`");
 	$mod_news = 'CREATE TABLE `'.TABLE_PREFIX.'mod_news_posts` ( '
-		. '`post_id` INT NOT NULL AUTO_INCREMENT,'
-		. '`section_id` INT NOT NULL DEFAULT \'0\' ,'
-		. '`page_id` INT NOT NULL DEFAULT \'0\' ,'
-		. '`group_id` INT NOT NULL DEFAULT \'0\' ,'
-		. '`active` INT NOT NULL DEFAULT \'0\' ,'
-		. '`position` INT NOT NULL DEFAULT \'0\','
-		. '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
-		. '`link` TEXT NOT NULL ,'
-		. '`content_short` TEXT NOT NULL ,'
-		. '`content_long` TEXT NOT NULL ,'
-		. '`commenting` VARCHAR(7) NOT NULL DEFAULT \'\','
-		. '`posted_when` INT NOT NULL DEFAULT \'0\' ,'
-		. '`posted_by` INT NOT NULL DEFAULT \'0\','
-		. 'PRIMARY KEY (post_id)'
-		. ' )';
+					 . '`post_id` INT NOT NULL AUTO_INCREMENT,'
+					 . '`section_id` INT NOT NULL DEFAULT \'0\','
+					 . '`page_id` INT NOT NULL DEFAULT \'0\','
+					 . '`group_id` INT NOT NULL DEFAULT \'0\','
+					 . '`active` INT NOT NULL DEFAULT \'0\','
+					 . '`position` INT NOT NULL DEFAULT \'0\','
+					 . '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
+					 . '`link` TEXT NOT NULL ,'
+					 . '`content_short` TEXT NOT NULL ,'
+					 . '`content_long` TEXT NOT NULL ,'
+					 . '`commenting` VARCHAR(7) NOT NULL DEFAULT \'\','
+					. '`published_when` INT NOT NULL DEFAULT \'0\','
+		   	    	 . '`posted_when` INT NOT NULL DEFAULT \'0\','
+					 . '`posted_by` INT NOT NULL DEFAULT \'0\','
+					 . 'PRIMARY KEY (post_id)'
+                . ' )';
 	$database->query($mod_news);
 	
 	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_news_groups`");
 	$mod_news = 'CREATE TABLE `'.TABLE_PREFIX.'mod_news_groups` ( '
-		. '`group_id` INT NOT NULL AUTO_INCREMENT,'
-		. '`section_id` INT NOT NULL DEFAULT \'0\' ,'
-		. '`page_id` INT NOT NULL DEFAULT \'0\','
-		. '`active` INT NOT NULL DEFAULT \'0\','
-		. '`position` INT NOT NULL DEFAULT \'0\','
-		. '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
-		. 'PRIMARY KEY (group_id)'
-		. ' )';
+					 . '`group_id` INT NOT NULL AUTO_INCREMENT,'
+					 . '`section_id` INT NOT NULL DEFAULT \'0\','
+					 . '`page_id` INT NOT NULL DEFAULT \'0\','
+					 . '`active` INT NOT NULL DEFAULT \'0\','
+					 . '`position` INT NOT NULL DEFAULT \'0\','
+					 . '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
+					 . 'PRIMARY KEY (group_id)'
+                . ' )';
 	$database->query($mod_news);
 	
 	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_news_comments`");
 	$mod_news = 'CREATE TABLE `'.TABLE_PREFIX.'mod_news_comments` ( '
-		. '`comment_id` INT NOT NULL AUTO_INCREMENT,'
-		. '`section_id` INT NOT NULL DEFAULT \'0\' ,'
-		. '`page_id` INT NOT NULL DEFAULT \'0\' ,'
-		. '`post_id` INT NOT NULL DEFAULT \'0\','
-		. '`title` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
-		. '`comment` TEXT NOT NULL ,'
-		. '`commented_when` INT NOT NULL DEFAULT \'0\' ,'
-		. '`commented_by` INT NOT NULL DEFAULT \'0\' ,'
-		. 'PRIMARY KEY (comment_id)'
-		. ' )';
+					 . '`comment_id` INT NOT NULL AUTO_INCREMENT,'
+					 . '`section_id` INT NOT NULL DEFAULT \'0\','
+					 . '`page_id` INT NOT NULL DEFAULT \'0\','
+					 . '`post_id` INT NOT NULL DEFAULT \'0\','
+					 . '`title` VARCHAR(255) NOT NULL DEFAULT \'\','
+					 . '`comment` TEXT NOT NULL ,'
+		   	    . '`commented_when` INT NOT NULL DEFAULT \'0\','
+					 . '`commented_by` INT NOT NULL DEFAULT \'0\','
+					 . 'PRIMARY KEY (comment_id)'
+                . ' )';
 	$database->query($mod_news);
 	
 	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_news_settings`");
 	$mod_news = 'CREATE TABLE `'.TABLE_PREFIX.'mod_news_settings` ( '
-		. '`section_id` INT NOT NULL DEFAULT \'0\' ,'
-		. '`page_id` INT NOT NULL DEFAULT \'0\','
-		. '`header` TEXT NOT NULL ,'
-		. '`post_loop` TEXT NOT NULL ,'
-		. '`footer` TEXT NOT NULL ,'
-		. '`posts_per_page` INT NOT NULL DEFAULT \'0\','
-		. '`post_header` TEXT NOT NULL ,'
-		. '`post_footer` TEXT NOT NULL ,'
-		. '`comments_header` TEXT NOT NULL ,'
-		. '`comments_loop` TEXT NOT NULL ,'
-		. '`comments_footer` TEXT NOT NULL ,'
-		. '`comments_page` TEXT NOT NULL ,'
-		. '`commenting` VARCHAR(7) NOT NULL DEFAULT \'\' ,'
-		. '`resize` INT NOT NULL DEFAULT \'0\' ,'
-		. ' `use_captcha` INT NOT NULL DEFAULT \'0\' ,'
-		. 'PRIMARY KEY (section_id)'
-		. ' )';
+					 . '`section_id` INT NOT NULL DEFAULT \'0\','
+					 . '`page_id` INT NOT NULL DEFAULT \'0\','
+					 . '`header` TEXT NOT NULL ,'
+					 . '`post_loop` TEXT NOT NULL ,'
+					 . '`footer` TEXT NOT NULL ,'
+					 . '`posts_per_page` INT NOT NULL DEFAULT \'0\','
+					 . '`post_header` TEXT NOT NULL,'
+					 . '`post_footer` TEXT NOT NULL,'
+					 . '`comments_header` TEXT NOT NULL,'
+					 . '`comments_loop` TEXT NOT NULL,'
+					 . '`comments_footer` TEXT NOT NULL,'
+					 . '`comments_page` TEXT NOT NULL,'
+					 . '`commenting` VARCHAR(7) NOT NULL DEFAULT \'\','
+					 . '`resize` INT NOT NULL DEFAULT \'0\','
+					 . ' `use_captcha` INT NOT NULL DEFAULT \'0\','
+					 . 'PRIMARY KEY (section_id)'
+                . ' )';
 	$database->query($mod_news);
 		
 	// Insert info into the search table

Property changes on: trunk/wb/modules/news/install.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/rss.php
===================================================================
--- trunk/wb/modules/news/rss.php	(revision 561)
+++ trunk/wb/modules/news/rss.php	(revision 562)
@@ -91,8 +91,8 @@
 <item>
 <title><![CDATA[<?php echo stripslashes($item["title"]); ?>]]></title>
 <description><![CDATA[<?php echo stripslashes($item["content_short"]); ?>]]></description>
-<guid><?php echo WB_URL."/pages".$item["link"].PAGE_EXTENSION; ?></guid>
-<link><?php echo WB_URL."/pages".$item["link"].PAGE_EXTENSION; ?></link>
+<guid><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></guid>
+<link><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></link>
 </item>
 
 <?php } ?>

Property changes on: trunk/wb/modules/news/rss.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/index.php
===================================================================
--- trunk/wb/modules/news/index.php	(revision 561)
+++ trunk/wb/modules/news/index.php	(revision 562)

Property changes on: trunk/wb/modules/news/index.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/delete_group.php
===================================================================
--- trunk/wb/modules/news/delete_group.php	(revision 561)
+++ trunk/wb/modules/news/delete_group.php	(revision 562)
@@ -37,9 +37,9 @@
 $update_when_modified = true; // Tells script to update when this page was last updated
 require(WB_PATH.'/modules/admin.php');
 
+$database->query("UPDATE ".TABLE_PREFIX."mod_news_posts SET group_id = '0' where group_id='$group_id'");
 // Update row
 $database->query("DELETE FROM ".TABLE_PREFIX."mod_news_groups WHERE group_id = '$group_id'");
-
 // Check if there is a db error, otherwise say successful
 if($database->is_error()) {
 	$admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$page_id);

Property changes on: trunk/wb/modules/news/delete_group.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/save_comment.php
===================================================================
--- trunk/wb/modules/news/save_comment.php	(revision 561)
+++ trunk/wb/modules/news/save_comment.php	(revision 562)

Property changes on: trunk/wb/modules/news/save_comment.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/modules/news/languages/NL.php
===================================================================
--- trunk/wb/modules/news/languages/NL.php	(nonexistent)
+++ trunk/wb/modules/news/languages/NL.php	(revision 562)
@@ -0,0 +1,38 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+//Modul Description
+$module_description = 'This page type is designed for making a news page.';
+
+//Variables for the  backend
+$MOD_NEWS['SETTINGS'] = 'News Settings';
+
+// Variables for the module CSS edit outputs
+$CAP_EDIT_CSS = 'Wijzig CSS';
+$CAP_TOGGLE_CSS = 'Wijzig ';
+$HEADING_CSS_FILE = 'Actuele module bestand: ';
+$TXT_EDIT_CSS_FILE = 'Wijzig de CSS definities in het textveld hieronder.';
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/news/languages/NL.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/news/languages/EN.php
===================================================================
--- trunk/wb/modules/news/languages/EN.php	(nonexistent)
+++ trunk/wb/modules/news/languages/EN.php	(revision 562)
@@ -0,0 +1,38 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+//Modul Description
+$module_description = 'This page type is designed for making a news page.';
+
+//Variables for the  backend
+$MOD_NEWS['SETTINGS'] = 'News Settings';
+
+// Variables for the module CSS edit outputs
+$CAP_EDIT_CSS = 'Edit CSS';
+$CAP_TOGGLE_CSS = 'Edit ';
+$HEADING_CSS_FILE = 'Actual module file: ';
+$TXT_EDIT_CSS_FILE = 'Edit the CSS definitions in the textarea below.';
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/news/languages/EN.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/news/languages/DE.php
===================================================================
--- trunk/wb/modules/news/languages/DE.php	(nonexistent)
+++ trunk/wb/modules/news/languages/DE.php	(revision 562)
@@ -0,0 +1,38 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+//Modulbeschreibung
+$module_description = 'Mit diesem Modul k&ouml;nnen sie eine News Seite ihrer Seite hinzuf&uuml;gen.';
+
+//Variablen für backend Texte
+$MOD_NEWS['SETTINGS'] = 'News Einstellungen';
+
+// Variablen für Textausgabe der frontend.css/backend.css Bearbeitung
+$CAP_EDIT_CSS = 'Bearbeite CSS';
+$CAP_TOGGLE_CSS = 'Wechsle zu ';
+$HEADING_CSS_FILE = 'Aktuelle Moduldatei: ';
+$TXT_EDIT_CSS_FILE = 'Bearbeite die CSS Definitionen im nachfolgenden Textfeld.';
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/modules/news/languages/DE.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/modules/news/calendar/prev.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/modules/news/calendar/prev.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/modules/news/calendar/calendarDateInput.js
===================================================================
--- trunk/wb/modules/news/calendar/calendarDateInput.js	(nonexistent)
+++ trunk/wb/modules/news/calendar/calendarDateInput.js	(revision 562)
@@ -0,0 +1,591 @@
+/***********************************************
+ Fool-Proof Date Input Script with DHTML Calendar
+ by Jason Moon - calendar@moonscript.com
+ ************************************************/
+
+// Customizable variables
+var DefaultDateFormat = 'MM/DD/YYYY'; // If no date format is supplied, this will be used instead
+var HideWait = 3; // Number of seconds before the calendar will disappear
+var Y2kPivotPoint = 76; // 2-digit years before this point will be created in the 21st century
+var UnselectedMonthText = ''; // Text to display in the 1st month list item when the date isn't required
+var FontSize = 11; // In pixels
+var FontFamily = 'Tahoma';
+var CellWidth = 18;
+var CellHeight = 16;
+var ImageURL = 'calendar/calendar.jpg';
+var NextURL = 'calendar/next.gif';
+var PrevURL = 'calendar/prev.gif';
+var CalBGColor = 'white';
+var TopRowBGColor = 'buttonface';
+var DayBGColor = 'lightgrey';
+
+// Global variables
+var ZCounter = 100;
+var Today = new Date();
+var WeekDays = new Array('S','M','T','W','T','F','S');
+var MonthDays = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+var MonthNames = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
+
+// Write out the stylesheet definition for the calendar
+with (document) {
+   writeln('<style>');
+   writeln('td.calendarDateInput {letter-spacing:normal;line-height:normal;font-family:' + FontFamily + ',Sans-Serif;font-size:' + FontSize + 'px;}');
+   writeln('select.calendarDateInput {letter-spacing:.06em;font-family:Verdana,Sans-Serif;font-size:11px;}');
+   writeln('input.calendarDateInput {letter-spacing:.06em;font-family:Verdana,Sans-Serif;font-size:11px;}');
+   writeln('</style>');
+}
+
+// Only allows certain keys to be used in the date field
+function YearDigitsOnly(e) {
+   var KeyCode = (e.keyCode) ? e.keyCode : e.which;
+   return ((KeyCode == 8) // backspace
+        || (KeyCode == 9) // tab
+        || (KeyCode == 37) // left arrow
+        || (KeyCode == 39) // right arrow
+        || (KeyCode == 46) // delete
+        || ((KeyCode > 47) && (KeyCode < 58)) // 0 - 9
+   );
+}
+
+// Gets the absolute pixel position of the supplied element
+function GetTagPixels(StartTag, Direction) {
+   var PixelAmt = (Direction == 'LEFT') ? StartTag.offsetLeft : StartTag.offsetTop;
+   while ((StartTag.tagName != 'BODY') && (StartTag.tagName != 'HTML')) {
+      StartTag = StartTag.offsetParent;
+      PixelAmt += (Direction == 'LEFT') ? StartTag.offsetLeft : StartTag.offsetTop;
+   }
+   return PixelAmt;
+}
+
+// Is the specified select-list behind the calendar?
+function BehindCal(SelectList, CalLeftX, CalRightX, CalTopY, CalBottomY, ListTopY) {
+   var ListLeftX = GetTagPixels(SelectList, 'LEFT');
+   var ListRightX = ListLeftX + SelectList.offsetWidth;
+   var ListBottomY = ListTopY + SelectList.offsetHeight;
+   return (((ListTopY < CalBottomY) && (ListBottomY > CalTopY)) && ((ListLeftX < CalRightX) && (ListRightX > CalLeftX)));
+}
+
+// For IE, hides any select-lists that are behind the calendar
+function FixSelectLists(Over) {
+   if (navigator.appName == 'Microsoft Internet Explorer') {
+      var CalDiv = this.getCalendar();
+      var CalLeftX = CalDiv.offsetLeft;
+      var CalRightX = CalLeftX + CalDiv.offsetWidth;
+      var CalTopY = CalDiv.offsetTop;
+      var CalBottomY = CalTopY + (CellHeight * 9);
+      var FoundCalInput = false;
+      formLoop :
+      for (var j=this.formNumber;j<document.forms.length;j++) {
+         for (var i=0;i<document.forms[j].elements.length;i++) {
+            if (typeof document.forms[j].elements[i].type == 'string') {
+               if ((document.forms[j].elements[i].type == 'hidden') && (document.forms[j].elements[i].name == this.hiddenFieldName)) {
+                  FoundCalInput = true;
+                  i += 3; // 3 elements between the 1st hidden field and the last year input field
+               }
+               if (FoundCalInput) {
+                  if (document.forms[j].elements[i].type.substr(0,6) == 'select') {
+                     ListTopY = GetTagPixels(document.forms[j].elements[i], 'TOP');
+                     if (ListTopY < CalBottomY) {
+                        if (BehindCal(document.forms[j].elements[i], CalLeftX, CalRightX, CalTopY, CalBottomY, ListTopY)) {
+                           document.forms[j].elements[i].style.visibility = (Over) ? 'hidden' : 'visible';
+                        }
+                     }
+                     else break formLoop;
+                  }
+               }
+            }
+         }
+      }
+   }
+}
+
+// Displays a message in the status bar when hovering over the calendar days
+function DayCellHover(Cell, Over, Color, HoveredDay) {
+   Cell.style.backgroundColor = (Over) ? DayBGColor : Color;
+   if (Over) {
+      if ((this.yearValue == Today.getFullYear()) && (this.monthIndex == Today.getMonth()) && (HoveredDay == Today.getDate())) self.status = 'Click to select today';
+      else {
+         var Suffix = HoveredDay.toString();
+         switch (Suffix.substr(Suffix.length - 1, 1)) {
+            case '1' : Suffix += (HoveredDay == 11) ? 'th' : 'st'; break;
+            case '2' : Suffix += (HoveredDay == 12) ? 'th' : 'nd'; break;
+            case '3' : Suffix += (HoveredDay == 13) ? 'th' : 'rd'; break;
+            default : Suffix += 'th'; break;
+         }
+         self.status = 'Click to select ' + this.monthName + ' ' + Suffix;
+      }
+   }
+   else self.status = '';
+   return true;
+}
+
+// Sets the form elements after a day has been picked from the calendar
+function PickDisplayDay(ClickedDay) {
+   this.show();
+   var MonthList = this.getMonthList();
+   var DayList = this.getDayList();
+   var YearField = this.getYearField();
+   FixDayList(DayList, GetDayCount(this.displayed.yearValue, this.displayed.monthIndex));
+   // Select the month and day in the lists
+   for (var i=0;i<MonthList.length;i++) {
+      if (MonthList.options[i].value == this.displayed.monthIndex) MonthList.options[i].selected = true;
+   }
+   for (var j=1;j<=DayList.length;j++) {
+      if (j == ClickedDay) DayList.options[j-1].selected = true;
+   }
+   this.setPicked(this.displayed.yearValue, this.displayed.monthIndex, ClickedDay);
+   // Change the year, if necessary
+   YearField.value = this.picked.yearPad;
+   YearField.defaultValue = YearField.value;
+}
+
+// Builds the HTML for the calendar days
+function BuildCalendarDays() {
+   var Rows = 5;
+   if (((this.displayed.dayCount == 31) && (this.displayed.firstDay > 4)) || ((this.displayed.dayCount == 30) && (this.displayed.firstDay == 6))) Rows = 6;
+   else if ((this.displayed.dayCount == 28) && (this.displayed.firstDay == 0)) Rows = 4;
+   var HTML = '<table width="' + (CellWidth * 7) + '" cellspacing="0" cellpadding="1" style="cursor:default">';
+   for (var j=0;j<Rows;j++) {
+      HTML += '<tr>';
+      for (var i=1;i<=7;i++) {
+         Day = (j * 7) + (i - this.displayed.firstDay);
+         if ((Day >= 1) && (Day <= this.displayed.dayCount)) {
+            if ((this.displayed.yearValue == this.picked.yearValue) && (this.displayed.monthIndex == this.picked.monthIndex) && (Day == this.picked.day)) {
+               TextStyle = 'color:white;font-weight:bold;'
+               BackColor = DayBGColor;
+            }
+            else {
+               TextStyle = 'color:black;'
+               BackColor = CalBGColor;
+            }
+            if ((this.displayed.yearValue == Today.getFullYear()) && (this.displayed.monthIndex == Today.getMonth()) && (Day == Today.getDate())) TextStyle += 'border:1px solid darkred;padding:0px;';
+            HTML += '<td align="center" class="calendarDateInput" style="cursor:default;height:' + CellHeight + ';width:' + CellWidth + ';' + TextStyle + ';background-color:' + BackColor + '" onClick="' + this.objName + '.pickDay(' + Day + ')" onMouseOver="return ' + this.objName + '.displayed.dayHover(this,true,\'' + BackColor + '\',' + Day + ')" onMouseOut="return ' + this.objName + '.displayed.dayHover(this,false,\'' + BackColor + '\')">' + Day + '</td>';
+         }
+         else HTML += '<td class="calendarDateInput" style="height:' + CellHeight + '">&nbsp;</td>';
+      }
+      HTML += '</tr>';
+   }
+   return HTML += '</table>';
+}
+
+// Determines which century to use (20th or 21st) when dealing with 2-digit years
+function GetGoodYear(YearDigits) {
+   if (YearDigits.length == 4) return YearDigits;
+   else {
+      var Millennium = (YearDigits < Y2kPivotPoint) ? 2000 : 1900;
+      return Millennium + parseInt(YearDigits,10);
+   }
+}
+
+// Returns the number of days in a month (handles leap-years)
+function GetDayCount(SomeYear, SomeMonth) {
+   return ((SomeMonth == 1) && ((SomeYear % 400 == 0) || ((SomeYear % 4 == 0) && (SomeYear % 100 != 0)))) ? 29 : MonthDays[SomeMonth];
+}
+
+// Highlights the buttons
+function VirtualButton(Cell, ButtonDown) {
+   if (ButtonDown) {
+      Cell.style.borderLeft = 'buttonshadow 1px solid';
+      Cell.style.borderTop = 'buttonshadow 1px solid';
+      Cell.style.borderBottom = 'buttonhighlight 1px solid';
+      Cell.style.borderRight = 'buttonhighlight 1px solid';
+   }
+   else {
+      Cell.style.borderLeft = 'buttonhighlight 1px solid';
+      Cell.style.borderTop = 'buttonhighlight 1px solid';
+      Cell.style.borderBottom = 'buttonshadow 1px solid';
+      Cell.style.borderRight = 'buttonshadow 1px solid';
+   }
+}
+
+// Mouse-over for the previous/next month buttons
+function NeighborHover(Cell, Over, DateObj) {
+   if (Over) {
+      VirtualButton(Cell, false);
+      self.status = 'Click to view ' + DateObj.fullName;
+   }
+   else {
+      Cell.style.border = 'buttonface 1px solid';
+      self.status = '';
+   }
+   return true;
+}
+
+// Adds/removes days from the day list, depending on the month/year
+function FixDayList(DayList, NewDays) {
+   var DayPick = DayList.selectedIndex + 1;
+   if (NewDays != DayList.length) {
+      var OldSize = DayList.length;
+      for (var k=Math.min(NewDays,OldSize);k<Math.max(NewDays,OldSize);k++) {
+         (k >= NewDays) ? DayList.options[NewDays] = null : DayList.options[k] = new Option(k+1, k+1);
+      }
+      DayPick = Math.min(DayPick, NewDays);
+      DayList.options[DayPick-1].selected = true;
+   }
+   return DayPick;
+}
+
+// Resets the year to its previous valid value when something invalid is entered
+function FixYearInput(YearField) {
+   var YearRE = new RegExp('\\d{' + YearField.defaultValue.length + '}');
+   if (!YearRE.test(YearField.value)) YearField.value = YearField.defaultValue;
+}
+
+// Displays a message in the status bar when hovering over the calendar icon
+function CalIconHover(Over) {
+   var Message = (this.isShowing()) ? 'hide' : 'show';
+   self.status = (Over) ? 'Click to ' + Message + ' the calendar' : '';
+   return true;
+}
+
+// Starts the timer over from scratch
+function CalTimerReset() {
+   eval('clearTimeout(' + this.timerID + ')');
+   eval(this.timerID + '=setTimeout(\'' + this.objName + '.show()\',' + (HideWait * 1000) + ')');
+}
+
+// The timer for the calendar
+function DoTimer(CancelTimer) {
+   if (CancelTimer) eval('clearTimeout(' + this.timerID + ')');
+   else {
+      eval(this.timerID + '=null');
+      this.resetTimer();
+   }
+}
+
+// Show or hide the calendar
+function ShowCalendar() {
+   if (this.isShowing()) {
+      var StopTimer = true;
+      this.getCalendar().style.zIndex = --ZCounter;
+      this.getCalendar().style.visibility = 'hidden';
+      this.fixSelects(false);
+   }
+   else {
+      var StopTimer = false;
+      this.fixSelects(true);
+      this.getCalendar().style.zIndex = ++ZCounter;
+      this.getCalendar().style.visibility = 'visible';
+   }
+   this.handleTimer(StopTimer);
+   self.status = '';
+}
+
+// Hides the input elements when the "blank" month is selected
+function SetElementStatus(Hide) {
+   this.getDayList().style.visibility = (Hide) ? 'hidden' : 'visible';
+   this.getYearField().style.visibility = (Hide) ? 'hidden' : 'visible';
+   this.getCalendarLink().style.visibility = (Hide) ? 'hidden' : 'visible';
+}
+
+// Sets the date, based on the month selected
+function CheckMonthChange(MonthList) {
+   var DayList = this.getDayList();
+   if (MonthList.options[MonthList.selectedIndex].value == '') {
+      DayList.selectedIndex = 0;
+      this.hideElements(true);
+      this.setHidden('');
+   }
+   else {
+      this.hideElements(false);
+      if (this.isShowing()) {
+         this.resetTimer(); // Gives the user more time to view the calendar with the newly-selected month
+         this.getCalendar().style.zIndex = ++ZCounter; // Make sure this calendar is on top of any other calendars
+      }
+      var DayPick = FixDayList(DayList, GetDayCount(this.picked.yearValue, MonthList.options[MonthList.selectedIndex].value));
+      this.setPicked(this.picked.yearValue, MonthList.options[MonthList.selectedIndex].value, DayPick);
+   }
+}
+
+// Sets the date, based on the day selected
+function CheckDayChange(DayList) {
+   if (this.isShowing()) this.show();
+   this.setPicked(this.picked.yearValue, this.picked.monthIndex, DayList.selectedIndex+1);
+}
+
+// Changes the date when a valid year has been entered
+function CheckYearInput(YearField) {
+   if ((YearField.value.length == YearField.defaultValue.length) && (YearField.defaultValue != YearField.value)) {
+      if (this.isShowing()) {
+         this.resetTimer(); // Gives the user more time to view the calendar with the newly-entered year
+         this.getCalendar().style.zIndex = ++ZCounter; // Make sure this calendar is on top of any other calendars
+      }
+      var NewYear = GetGoodYear(YearField.value);
+      var MonthList = this.getMonthList();
+      var NewDay = FixDayList(this.getDayList(), GetDayCount(NewYear, this.picked.monthIndex));
+      this.setPicked(NewYear, this.picked.monthIndex, NewDay);
+      YearField.defaultValue = YearField.value;
+   }
+}
+
+// Holds characteristics about a date
+function dateObject() {
+   if (Function.call) { // Used when 'call' method of the Function object is supported
+      var ParentObject = this;
+      var ArgumentStart = 0;
+   }
+   else { // Used with 'call' method of the Function object is NOT supported
+      var ParentObject = arguments[0];
+      var ArgumentStart = 1;
+   }
+   ParentObject.date = (arguments.length == (ArgumentStart+1)) ? new Date(arguments[ArgumentStart+0]) : new Date(arguments[ArgumentStart+0], arguments[ArgumentStart+1], arguments[ArgumentStart+2]);
+   ParentObject.yearValue = ParentObject.date.getFullYear();
+   ParentObject.monthIndex = ParentObject.date.getMonth();
+   ParentObject.monthName = MonthNames[ParentObject.monthIndex];
+   ParentObject.fullName = ParentObject.monthName + ' ' + ParentObject.yearValue;
+   ParentObject.day = ParentObject.date.getDate();
+   ParentObject.dayCount = GetDayCount(ParentObject.yearValue, ParentObject.monthIndex);
+   var FirstDate = new Date(ParentObject.yearValue, ParentObject.monthIndex, 1);
+   ParentObject.firstDay = FirstDate.getDay();
+}
+
+// Keeps track of the date that goes into the hidden field
+function storedMonthObject(DateFormat, DateYear, DateMonth, DateDay) {
+   (Function.call) ? dateObject.call(this, DateYear, DateMonth, DateDay) : dateObject(this, DateYear, DateMonth, DateDay);
+   this.yearPad = this.yearValue.toString();
+   this.monthPad = (this.monthIndex < 9) ? '0' + String(this.monthIndex + 1) : this.monthIndex + 1;
+   this.dayPad = (this.day < 10) ? '0' + this.day.toString() : this.day;
+   this.monthShort = this.monthName.substr(0,3).toUpperCase();
+   // Formats the year with 2 digits instead of 4
+   if (DateFormat.indexOf('YYYY') == -1) this.yearPad = this.yearPad.substr(2);
+   // Define the date-part delimiter
+   if (DateFormat.indexOf('/') >= 0) var Delimiter = '/';
+   else if (DateFormat.indexOf('-') >= 0) var Delimiter = '-';
+   else var Delimiter = '';
+   // Determine the order of the months and days
+   if (/DD?.?((MON)|(MM?M?))/.test(DateFormat)) {
+      this.formatted = this.dayPad + Delimiter;
+      this.formatted += (RegExp.$1.length == 3) ? this.monthShort : this.monthPad;
+   }
+   else if (/((MON)|(MM?M?))?.?DD?/.test(DateFormat)) {
+      this.formatted = (RegExp.$1.length == 3) ? this.monthShort : this.monthPad;
+      this.formatted += Delimiter + this.dayPad;
+   }
+   // Either prepend or append the year to the formatted date
+   this.formatted = (DateFormat.substr(0,2) == 'YY') ? this.yearPad + Delimiter + this.formatted : this.formatted + Delimiter + this.yearPad;
+}
+
+// Object for the current displayed month
+function displayMonthObject(ParentObject, DateYear, DateMonth, DateDay) {
+   (Function.call) ? dateObject.call(this, DateYear, DateMonth, DateDay) : dateObject(this, DateYear, DateMonth, DateDay);
+   this.displayID = ParentObject.hiddenFieldName + '_Current_ID';
+   this.getDisplay = new Function('return document.getElementById(this.displayID)');
+   this.dayHover = DayCellHover;
+   this.goCurrent = new Function(ParentObject.objName + '.getCalendar().style.zIndex=++ZCounter;' + ParentObject.objName + '.setDisplayed(Today.getFullYear(),Today.getMonth());');
+   if (ParentObject.formNumber >= 0) this.getDisplay().innerHTML = this.fullName;
+}
+
+// Object for the previous/next buttons
+function neighborMonthObject(ParentObject, IDText, DateMS) {
+   (Function.call) ? dateObject.call(this, DateMS) : dateObject(this, DateMS);
+   this.buttonID = ParentObject.hiddenFieldName + '_' + IDText + '_ID';
+   this.hover = new Function('C','O','NeighborHover(C,O,this)');
+   this.getButton = new Function('return document.getElementById(this.buttonID)');
+   this.go = new Function(ParentObject.objName + '.getCalendar().style.zIndex=++ZCounter;' + ParentObject.objName + '.setDisplayed(this.yearValue,this.monthIndex);');
+   if (ParentObject.formNumber >= 0) this.getButton().title = this.monthName;
+}
+
+// Sets the currently-displayed month object
+function SetDisplayedMonth(DispYear, DispMonth) {
+   this.displayed = new displayMonthObject(this, DispYear, DispMonth, 1);
+   // Creates the previous and next month objects
+   this.previous = new neighborMonthObject(this, 'Previous', this.displayed.date.getTime() - 86400000);
+   this.next = new neighborMonthObject(this, 'Next', this.displayed.date.getTime() + (86400000 * (this.displayed.dayCount + 1)));
+   // Creates the HTML for the calendar
+   if (this.formNumber >= 0) this.getDayTable().innerHTML = this.buildCalendar();
+}
+
+// Sets the current selected date
+function SetPickedMonth(PickedYear, PickedMonth, PickedDay) {
+   this.picked = new storedMonthObject(this.format, PickedYear, PickedMonth, PickedDay);
+   this.setHidden(this.picked.formatted);
+   this.setDisplayed(PickedYear, PickedMonth);
+}
+
+// The calendar object
+function calendarObject(DateName, DateFormat, DefaultDate) {
+
+   /* Properties */
+   this.hiddenFieldName = DateName;
+   this.monthListID = DateName + '_Month_ID';
+   this.dayListID = DateName + '_Day_ID';
+   this.yearFieldID = DateName + '_Year_ID';
+   this.monthDisplayID = DateName + '_Current_ID';
+   this.calendarID = DateName + '_ID';
+   this.dayTableID = DateName + '_DayTable_ID';
+   this.calendarLinkID = this.calendarID + '_Link';
+   this.timerID = this.calendarID + '_Timer';
+   this.objName = DateName + '_Object';
+   this.format = DateFormat;
+   this.formNumber = -1;
+   this.picked = null;
+   this.displayed = null;
+   this.previous = null;
+   this.next = null;
+
+   /* Methods */
+   this.setPicked = SetPickedMonth;
+   this.setDisplayed = SetDisplayedMonth;
+   this.checkYear = CheckYearInput;
+   this.fixYear = FixYearInput;
+   this.changeMonth = CheckMonthChange;
+   this.changeDay = CheckDayChange;
+   this.resetTimer = CalTimerReset;
+   this.hideElements = SetElementStatus;
+   this.show = ShowCalendar;
+   this.handleTimer = DoTimer;
+   this.iconHover = CalIconHover;
+   this.buildCalendar = BuildCalendarDays;
+   this.pickDay = PickDisplayDay;
+   this.fixSelects = FixSelectLists;
+   this.setHidden = new Function('D','if (this.formNumber >= 0) this.getHiddenField().value=D');
+   // Returns a reference to these elements
+   this.getHiddenField = new Function('return document.forms[this.formNumber].elements[this.hiddenFieldName]');
+   this.getMonthList = new Function('return document.getElementById(this.monthListID)');
+   this.getDayList = new Function('return document.getElementById(this.dayListID)');
+   this.getYearField = new Function('return document.getElementById(this.yearFieldID)');
+   this.getCalendar = new Function('return document.getElementById(this.calendarID)');
+   this.getDayTable = new Function('return document.getElementById(this.dayTableID)');
+   this.getCalendarLink = new Function('return document.getElementById(this.calendarLinkID)');
+   this.getMonthDisplay = new Function('return document.getElementById(this.monthDisplayID)');
+   this.isShowing = new Function('return !(this.getCalendar().style.visibility != \'visible\')');
+
+   /* Constructor */
+   // Functions used only by the constructor
+   function getMonthIndex(MonthAbbr) { // Returns the index (0-11) of the supplied month abbreviation
+      for (var MonPos=0;MonPos<MonthNames.length;MonPos++) {
+         if (MonthNames[MonPos].substr(0,3).toUpperCase() == MonthAbbr.toUpperCase()) break;
+      }
+      return MonPos;
+   }
+   function SetGoodDate(CalObj, Notify) { // Notifies the user about their bad default date, and sets the current system date
+      CalObj.setPicked(Today.getFullYear(), Today.getMonth(), Today.getDate());
+      if (Notify) alert('WARNING: The supplied date is not in valid \'' + DateFormat + '\' format: ' + DefaultDate + '.\nTherefore, the current system date will be used instead: ' + CalObj.picked.formatted);
+   }
+   // Main part of the constructor
+   if (DefaultDate != '') {
+      if ((this.format == 'YYYYMMDD') && (/^(\d{4})(\d{2})(\d{2})$/.test(DefaultDate))) this.setPicked(RegExp.$1, parseInt(RegExp.$2,10)-1, RegExp.$3);
+      else {
+         // Get the year
+         if ((this.format.substr(0,2) == 'YY') && (/^(\d{2,4})(-|\/)/.test(DefaultDate))) { // Year is at the beginning
+            var YearPart = GetGoodYear(RegExp.$1);
+            // Determine the order of the months and days
+            if (/(-|\/)(\w{1,3})(-|\/)(\w{1,3})$/.test(DefaultDate)) {
+               var MidPart = RegExp.$2;
+               var EndPart = RegExp.$4;
+               if (/D$/.test(this.format)) { // Ends with days
+                  var DayPart = EndPart;
+                  var MonthPart = MidPart;
+               }
+               else {
+                  var DayPart = MidPart;
+                  var MonthPart = EndPart;
+               }
+               MonthPart = (/\d{1,2}/i.test(MonthPart)) ? parseInt(MonthPart,10)-1 : getMonthIndex(MonthPart);
+               this.setPicked(YearPart, MonthPart, DayPart);
+            }
+            else SetGoodDate(this, true);
+         }
+         else if (/(-|\/)(\d{2,4})$/.test(DefaultDate)) { // Year is at the end
+            var YearPart = GetGoodYear(RegExp.$2);
+            // Determine the order of the months and days
+            if (/^(\w{1,3})(-|\/)(\w{1,3})(-|\/)/.test(DefaultDate)) {
+               if (this.format.substr(0,1) == 'D') { // Starts with days
+                  var DayPart = RegExp.$1;
+                  var MonthPart = RegExp.$3;
+               }
+               else { // Starts with months
+                  var MonthPart = RegExp.$1;
+                  var DayPart = RegExp.$3;
+               }
+               MonthPart = (/\d{1,2}/i.test(MonthPart)) ? parseInt(MonthPart,10)-1 : getMonthIndex(MonthPart);
+               this.setPicked(YearPart, MonthPart, DayPart);
+            }
+            else SetGoodDate(this, true);
+         }
+         else SetGoodDate(this, true);
+      }
+   }
+}
+
+// Main function that creates the form elements
+function DateInput(DateName, Required, DateFormat, DefaultDate) {
+   if (arguments.length == 0) document.writeln('<span style="color:red;font-size:' + FontSize + 'px;font-family:' + FontFamily + ';">ERROR: Missing required parameter in call to \'DateInput\': [name of hidden date field].</span>');
+   else {
+      // Handle DateFormat
+      if (arguments.length < 3) { // The format wasn't passed in, so use default
+         DateFormat = DefaultDateFormat;
+         if (arguments.length < 2) Required = false;
+      }
+      else if (/^(Y{2,4}(-|\/)?)?((MON)|(MM?M?)|(DD?))(-|\/)?((MON)|(MM?M?)|(DD?))((-|\/)Y{2,4})?$/i.test(DateFormat)) DateFormat = DateFormat.toUpperCase();
+      else { // Passed-in DateFormat was invalid, use default format instead
+         var AlertMessage = 'WARNING: The supplied date format for the \'' + DateName + '\' field is not valid: ' + DateFormat + '\nTherefore, the default date format will be used instead: ' + DefaultDateFormat;
+         DateFormat = DefaultDateFormat;
+         if (arguments.length == 4) { // DefaultDate was passed in with an invalid date format
+            var CurrentDate = new storedMonthObject(DateFormat, Today.getFullYear(), Today.getMonth(), Today.getDate());
+            AlertMessage += '\n\nThe supplied date (' + DefaultDate + ') cannot be interpreted with the invalid format.\nTherefore, the current system date will be used instead: ' + CurrentDate.formatted;
+            DefaultDate = CurrentDate.formatted;
+         }
+         alert(AlertMessage);
+      }
+      // Define the current date if it wasn't set already
+      if (!CurrentDate) var CurrentDate = new storedMonthObject(DateFormat, Today.getFullYear(), Today.getMonth(), Today.getDate());
+      // Handle DefaultDate
+      if (arguments.length < 4) { // The date wasn't passed in
+         DefaultDate = (Required) ? CurrentDate.formatted : ''; // If required, use today's date
+      }
+      // Creates the calendar object!
+      eval(DateName + '_Object=new calendarObject(\'' + DateName + '\',\'' + DateFormat + '\',\'' + DefaultDate + '\')');
+      // Determine initial viewable state of day, year, and calendar icon
+      if ((Required) || (arguments.length == 4)) {
+         var InitialStatus = '';
+         var InitialDate = eval(DateName + '_Object.picked.formatted');
+      }
+      else {
+         var InitialStatus = ' style="visibility:hidden"';
+         var InitialDate = '';
+         eval(DateName + '_Object.setPicked(' + Today.getFullYear() + ',' + Today.getMonth() + ',' + Today.getDate() + ')');
+      }
+      // Create the form elements
+      with (document) {
+         writeln('<input type="hidden" name="' + DateName + '" value="' + InitialDate + '">');
+         // Find this form number
+         for (var f=0;f<forms.length;f++) {
+            for (var e=0;e<forms[f].elements.length;e++) {
+               if (typeof forms[f].elements[e].type == 'string') {
+                  if ((forms[f].elements[e].type == 'hidden') && (forms[f].elements[e].name == DateName)) {
+                     eval(DateName + '_Object.formNumber='+f);
+                     break;
+                  }
+               }
+            }
+         }
+         writeln('<table cellpadding="0" cellspacing="2"><tr>' + String.fromCharCode(13) + '<td valign="middle">');
+         writeln('<select' + InitialStatus + ' class="calendarDateInput" id="' + DateName + '_Day_ID" onChange="' + DateName + '_Object.changeDay(this)">');
+         for (var j=1;j<=eval(DateName + '_Object.picked.dayCount');j++) {
+            DaySelected = ((DefaultDate != '') && (eval(DateName + '_Object.picked.day') == j)) ? ' selected' : '';
+            writeln('<option' + DaySelected + '>' + j + '</option>');
+         }
+         writeln('</select>' + String.fromCharCode(13) + '</td>' + String.fromCharCode(13) + '<td valign="middle">');
+         writeln('<select class="calendarDateInput" id="' + DateName + '_Month_ID" onChange="' + DateName + '_Object.changeMonth(this)">');
+         if (!Required) {
+            var NoneSelected = (DefaultDate == '') ? ' selected' : '';
+            writeln('<option value=""' + NoneSelected + '>' + UnselectedMonthText + '</option>');
+         }
+         for (var i=0;i<12;i++) {
+            MonthSelected = ((DefaultDate != '') && (eval(DateName + '_Object.picked.monthIndex') == i)) ? ' selected' : '';
+            writeln('<option value="' + i + '"' + MonthSelected + '>' + MonthNames[i].substr(0,3) + '</option>');
+         }
+         writeln('</select>' + String.fromCharCode(13) + '</td>' + String.fromCharCode(13) + '<td valign="middle">');
+         writeln('<input' + InitialStatus + ' class="calendarDateInput" type="text" id="' + DateName + '_Year_ID" size="' + eval(DateName + '_Object.picked.yearPad.length') + '" maxlength="' + eval(DateName + '_Object.picked.yearPad.length') + '" title="Year" value="' + eval(DateName + '_Object.picked.yearPad') + '" onKeyPress="return YearDigitsOnly(window.event)" onKeyUp="' + DateName + '_Object.checkYear(this)" onBlur="' + DateName + '_Object.fixYear(this)">');
+         write('<td valign="middle">' + String.fromCharCode(13) + '<a' + InitialStatus + ' id="' + DateName + '_ID_Link" href="javascript:' + DateName + '_Object.show()" onMouseOver="return ' + DateName + '_Object.iconHover(true)" onMouseOut="return ' + DateName + '_Object.iconHover(false)"><img src="' + ImageURL + '" align="baseline" title="Calendar" border="0"></a>&nbsp;');
+         writeln('<span id="' + DateName + '_ID" style="position:absolute;visibility:hidden;width:' + (CellWidth * 7) + 'px;background-color:' + CalBGColor + ';border:1px solid dimgray;" onMouseOver="' + DateName + '_Object.handleTimer(true)" onMouseOut="' + DateName + '_Object.handleTimer(false)">');
+         writeln('<table width="' + (CellWidth * 7) + '" cellspacing="0" cellpadding="1">' + String.fromCharCode(13) + '<tr style="background-color:' + TopRowBGColor + ';">');
+         writeln('<td id="' + DateName + '_Previous_ID" style="cursor:default" align="center" class="calendarDateInput" style="height:' + CellHeight + '" onClick="' + DateName + '_Object.previous.go()" onMouseDown="VirtualButton(this,true)" onMouseUp="VirtualButton(this,false)" onMouseOver="return ' + DateName + '_Object.previous.hover(this,true)" onMouseOut="return ' + DateName + '_Object.previous.hover(this,false)" title="' + eval(DateName + '_Object.previous.monthName') + '"><img src="' + PrevURL + '"></td>');
+         writeln('<td id="' + DateName + '_Current_ID" style="cursor:pointer" align="center" class="calendarDateInput" style="height:' + CellHeight + '" colspan="5" onClick="' + DateName + '_Object.displayed.goCurrent()" onMouseOver="self.status=\'Click to view ' + CurrentDate.fullName + '\';return true;" onMouseOut="self.status=\'\';return true;" title="Show Current Month">' + eval(DateName + '_Object.displayed.fullName') + '</td>');
+         writeln('<td id="' + DateName + '_Next_ID" style="cursor:default" align="center" class="calendarDateInput" style="height:' + CellHeight + '" onClick="' + DateName + '_Object.next.go()" onMouseDown="VirtualButton(this,true)" onMouseUp="VirtualButton(this,false)" onMouseOver="return ' + DateName + '_Object.next.hover(this,true)" onMouseOut="return ' + DateName + '_Object.next.hover(this,false)" title="' + eval(DateName + '_Object.next.monthName') + '"><img src="' + NextURL + '"></td></tr>' + String.fromCharCode(13) + '<tr>');
+         for (var w=0;w<7;w++) writeln('<td width="' + CellWidth + '" align="center" class="calendarDateInput" style="height:' + CellHeight + ';width:' + CellWidth + ';font-weight:bold;border-top:1px solid dimgray;border-bottom:1px solid dimgray;">' + WeekDays[w] + '</td>');
+         writeln('</tr>' + String.fromCharCode(13) + '</table>' + String.fromCharCode(13) + '<span id="' + DateName + '_DayTable_ID">' + eval(DateName + '_Object.buildCalendar()') + '</span>' + String.fromCharCode(13) + '</span>' + String.fromCharCode(13) + '</td>' + String.fromCharCode(13) + '</tr>' + String.fromCharCode(13) + '</table>');
+      }
+   }
+}
\ No newline at end of file
Index: trunk/wb/modules/news/calendar/next.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/modules/news/calendar/next.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/modules/news/calendar/calendar.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/modules/news/calendar/calendar.jpg
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/modules/news/submit_comment.php
===================================================================
--- trunk/wb/modules/news/submit_comment.php	(revision 561)
+++ trunk/wb/modules/news/submit_comment.php	(revision 562)
@@ -35,7 +35,7 @@
 	// Check captcha
 	$query_settings = $database->query("SELECT use_captcha FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '".$_GET['section_id']."'");
 	if($query_settings->numRows() == 0) { 
-		exit(header('Location: '.WB_URL.'/pages/'));
+		exit(header("Location: ".WB_URL.PAGES_DIRECTORY.""));
 	} else {
 		$settings = $query_settings->fetchRow();
 		if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg') AND $settings['use_captcha']) { /* Make's sure GD library is installed */

Property changes on: trunk/wb/modules/news/submit_comment.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
