Index: trunk/wb/search/search.php
===================================================================
--- trunk/wb/search/search.php	(revision 105)
+++ trunk/wb/search/search.php	(revision 106)
@@ -42,9 +42,9 @@
 			$string=$_REQUEST['string'];
 		}
 		// reverse potential magic_quotes action
-		$original_string=$this->strip_slashes($string);
+		$original_string=$wb->strip_slashes($string);
 		// Double backslashes (mySQL needs doubly escaped backslashes in LIKE comparisons)
-		$string = addslashes($this->escape_backslashes($original_string));
+		$string = addslashes($wb->escape_backslashes($original_string));
 		// then escape for mySQL query
 		$search_string = htmlspecialchars($original_string,ENT_QUOTES);
 	} else {
@@ -105,13 +105,13 @@
 	// Replace vars in search settings with values
 	$vars = array('[SEARCH_STRING]', '[WB_URL]', '[PAGE_EXTENSION]', '[TEXT_RESULTS_FOR]');
 	$values = array($search_string, WB_URL, PAGE_EXTENSION, $TEXT['RESULTS_FOR']);
-	$search_footer = str_replace($vars, $values, $this->strip_slashes_dummy($fetch_footer['value']));
-	$search_results_header = str_replace($vars, $values, $this->strip_slashes_dummy($fetch_results_header['value']));
-	$search_results_footer = str_replace($vars, $values, $this->strip_slashes_dummy($fetch_results_footer['value']));
+	$search_footer = str_replace($vars, $values, ($fetch_footer['value']));
+	$search_results_header = str_replace($vars, $values, ($fetch_results_header['value']));
+	$search_results_footer = str_replace($vars, $values, ($fetch_results_footer['value']));
 	// Do extra vars/values replacement
 	$vars = array('[SEARCH_STRING]', '[WB_URL]', '[PAGE_EXTENSION]', '[TEXT_SEARCH]', '[TEXT_ALL_WORDS]', '[TEXT_ANY_WORDS]', '[TEXT_EXACT_MATCH]', '[TEXT_MATCH]', '[TEXT_MATCHING]', '[ALL_CHECKED]', '[ANY_CHECKED]', '[EXACT_CHECKED]');
 	$values = array($search_string, WB_URL, PAGE_EXTENSION, $TEXT['SEARCH'], $TEXT['ALL_WORDS'], $TEXT['ANY_WORDS'], $TEXT['EXACT_MATCH'], $TEXT['MATCH'], $TEXT['MATCHING'], $all_checked, $any_checked, $exact_checked);
-	$search_header = str_replace($vars, $values, $this->strip_slashes_dummy($fetch_header['value']));
+	$search_header = str_replace($vars, $values, ($fetch_header['value']));
 	
 	// Insert js code
 	?>
@@ -160,10 +160,10 @@
 					$date = $TEXT['UNKNOWN'].' '.$TEXT['DATE'];
 					$time = $TEXT['UNKNOWN'].' '.$TEXT['TIME'];
 				}
-				$values = array($link, $this->strip_slashes_dummy($page['page_title']),$this->strip_slashes_dummy($page['description']), $users[$page['modified_by']]['username'], $users[$page['modified_by']]['display_name'], $date, $time, $TEXT['LAST_UPDATED_BY'], strtolower($TEXT['ON']));
+				$values = array($link, ($page['page_title']),($page['description']), $users[$page['modified_by']]['username'], $users[$page['modified_by']]['display_name'], $date, $time, $TEXT['LAST_UPDATED_BY'], strtolower($TEXT['ON']));
 				// Show loop code with vars replaced by values
 				if($values != array()) {
-					echo str_replace($vars, $values, $this->strip_slashes_dummy($fetch_results_loop['value']));
+					echo str_replace($vars, $values, ($fetch_results_loop['value']));
 				}
 				// Say that we have already listed this page id
 				$pages_listed[$page['page_id']] = true;
@@ -186,7 +186,7 @@
 					// Fetch query start
 					$fetch_query_start = $get_query_start->fetchRow();
 					// Prepare query start for execution by replacing {TP} with the TABLE_PREFIX
-					$query_start = str_replace('[TP]', TABLE_PREFIX, $this->strip_slashes_dummy($fetch_query_start['value']));
+					$query_start = str_replace('[TP]', TABLE_PREFIX, ($fetch_query_start['value']));
 					// Get query end
 					$get_query_end = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'query_end' AND extra = '$module_name' LIMIT 1");
 					if($get_query_end->numRows() > 0) {
@@ -193,7 +193,7 @@
 						// Fetch query start
 						$fetch_query_end = $get_query_end->fetchRow();
 						// Set query end
-						$query_end = $this->strip_slashes_dummy($fetch_query_end['value']);
+						$query_end = ($fetch_query_end['value']);
 						// Get query body
 						$get_query_body = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'query_body' AND extra = '$module_name' LIMIT 1");
 						if($get_query_body->numRows() > 0) {
@@ -200,7 +200,7 @@
 							// Fetch query start
 							$fetch_query_body = $get_query_body->fetchRow();
 							// Prepare query body for execution by replacing {STRING} with the correct one
-							$query_body = str_replace(array('[TP]','[O]','[W]'), array(TABLE_PREFIX,'LIKE','%'), $this->strip_slashes_dummy($fetch_query_body['value']));
+							$query_body = str_replace(array('[TP]','[O]','[W]'), array(TABLE_PREFIX,'LIKE','%'), ($fetch_query_body['value']));
 							// Loop through query body for each string, then combine with start and end
 							$prepared_query = $query_start;
 							$count = 0;
@@ -228,9 +228,9 @@
 											$date = $TEXT['UNKNOWN'].' '.$TEXT['DATE'];
 											$time = $TEXT['UNKNOWN'].' '.$TEXT['TIME'];
 										}
-										$values = array($link, $this->strip_slashes_dummy($page[$fields['title']]), $this->strip_slashes_dummy($page[$fields['description']]), $users[$page[$fields['modified_by']]]['username'], $users[$page[$fields['modified_by']]]['display_name'], $date, $time, $TEXT['LAST_UPDATED_BY'], strtolower($TEXT['ON']));
+										$values = array($link, ($page[$fields['title']]), ($page[$fields['description']]), $users[$page[$fields['modified_by']]]['username'], $users[$page[$fields['modified_by']]]['display_name'], $date, $time, $TEXT['LAST_UPDATED_BY'], strtolower($TEXT['ON']));
 										// Show loop code with vars replaced by values
-										echo str_replace($vars, $values, $this->strip_slashes_dummy($fetch_results_loop['value']));
+										echo str_replace($vars, $values, ($fetch_results_loop['value']));
 										// Say that this page or item has been listed if we can
 										if(isset($fields['page_id'])) {
 											$pages_listed[$page[$fields['page_id']]] = true;
Index: trunk/wb/search/index.php
===================================================================
--- trunk/wb/search/index.php	(revision 105)
+++ trunk/wb/search/index.php	(revision 106)
@@ -1,6 +1,6 @@
 <?php
 
-// $Id: index.php,v 1.3 2005/04/02 06:27:52 rdjurovich Exp $
+// $Id$
 
 /*
 
@@ -23,6 +23,12 @@
 
 */
 
+// Include the config file
+require('../config.php');
+require_once(WB_PATH."/framework/class.frontend.php");
+$wb = new frontend();
+
+
 // Required page details
 $page_id = 0;
 $page_description = '';
@@ -37,8 +43,6 @@
 define('VISIBILITY', 'public');
 define('PAGE_CONTENT', 'search.php');
 
-// Include the config file
-require('../config.php');
 
 // Include database class file
 require_once(WB_PATH.'/framework/class.database.php');
Index: trunk/wb/install/save.php
===================================================================
--- trunk/wb/install/save.php	(revision 105)
+++ trunk/wb/install/save.php	(revision 106)
@@ -280,6 +280,7 @@
 "define('ADMIN_PATH', '$wb_path/admin');\n".
 "define('ADMIN_URL', '$wb_url/admin');\n".
 "\n".
+"require_once(WB_PATH.'/framework/initialize.php');\n".
 "?>";
 
 $config_filename = '../config.php';
@@ -300,8 +301,19 @@
 }
 
 // Include configuration file
-require('../config.php');
+define('DB_TYPE', 'mysql');
+define('DB_HOST', $database_host);
+define('DB_USERNAME', $database_username);
+define('DB_PASSWORD', $database_password);
+define('DB_NAME', $database_name);
+define('TABLE_PREFIX', $table_prefix);
+define('WB_PATH', $wb_path);
+define('WB_URL', $wb_url);
+define('ADMIN_PATH', $wb_path.'/admin');
+define('ADMIN_URL', $wb_url.'/admin');
 
+//require('../config.php');
+
 // Check if the user has entered a correct path
 if(!file_exists(WB_PATH.'/framework/class.admin.php')) {
 	set_error('It appears the Absolute path that you entered is incorrect');
@@ -548,7 +560,8 @@
 	// Search template
 	$database->query("INSERT INTO `".TABLE_PREFIX."search` (name) VALUES ('template')");
 	
-	$wb=new wb();
+	require_once(WB_PATH.'/framework/initialize.php');
+	$wb = new wb();
 	
 	// Include the pre-installed module install scripts
 	require(WB_PATH.'/modules/wysiwyg/install.php');
Index: trunk/wb/modules/wrapper/view.php
===================================================================
--- trunk/wb/modules/wrapper/view.php	(revision 105)
+++ trunk/wb/modules/wrapper/view.php	(revision 106)
@@ -26,7 +26,7 @@
 // Get url
 $get_settings = $database->query("SELECT url,height FROM ".TABLE_PREFIX."mod_wrapper WHERE section_id = '$section_id'");
 $fetch_settings = $get_settings->fetchRow();
-$url = $this->strip_slashes_dummy($fetch_settings['url']);
+$url = ($fetch_settings['url']);
 
 ?>
 <iframe src="<?php echo $url; ?>" width="100%" height="<?php echo $fetch_settings['height']; ?>px" frameborder="0" scrolling="auto">
Index: trunk/wb/modules/wysiwyg/view.php
===================================================================
--- trunk/wb/modules/wysiwyg/view.php	(revision 105)
+++ trunk/wb/modules/wysiwyg/view.php	(revision 106)
@@ -26,9 +26,9 @@
 // Get content
 $get_content = $database->query("SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg WHERE section_id = '$section_id'");
 $fetch_content = $get_content->fetchRow();
-$content = $this->strip_slashes_dummy($fetch_content['content']);
+$content = ($fetch_content['content']);
 
-$this->preprocess($content);
+$wb->preprocess($content);
 
 echo $content;
 
Index: trunk/wb/modules/form/view.php
===================================================================
--- trunk/wb/modules/form/view.php	(revision 105)
+++ trunk/wb/modules/form/view.php	(revision 106)
@@ -113,9 +113,9 @@
 $query_settings = $database->query("SELECT header,field_loop,footer FROM ".TABLE_PREFIX."mod_form_settings WHERE section_id = '$section_id'");
 if($query_settings->numRows() > 0) {
 	$fetch_settings = $query_settings->fetchRow();
-	$header = $this->strip_slashes_dummy($fetch_settings['header']);
-	$field_loop = $this->strip_slashes_dummy($fetch_settings['field_loop']);
-	$footer = $this->strip_slashes_dummy($fetch_settings['footer']);
+	$header = $fetch_settings['header'];
+	$field_loop = $fetch_settings['field_loop'];
+	$footer = $fetch_settings['footer'];
 } else {
 	$header = '';
 	$field_loop = '';
@@ -136,7 +136,7 @@
 	while($field = $query_fields->fetchRow()) {
 		// Set field values
 		$field_id = $field['field_id'];
-		$value = $this->strip_slashes_dummy($field['value']);
+		$value = $field['value'];
 		// Print field_loop after replacing vars with values
 		$vars = array('{TITLE}', '{REQUIRED}');
 		$values = array($field['title']);
@@ -198,16 +198,16 @@
 	$query_settings = $database->query("SELECT email_to,email_from,email_subject,success_message,max_submissions,stored_submissions FROM ".TABLE_PREFIX."mod_form_settings WHERE section_id = '$section_id'");
 	if($query_settings->numRows() > 0) {
 		$fetch_settings = $query_settings->fetchRow();
-		$email_to = $this->strip_slashes_dummy($fetch_settings['email_to']);
-		$email_from = $this->strip_slashes_dummy($fetch_settings['email_from']);
+		$email_to = $fetch_settings['email_to'];
+		$email_from = $fetch_settings['email_from'];
 		if(substr($email_from, 0, 5) == 'field') {
 			// Set the email from field to what the user entered in the specified field
-			$email_from = $this->add_slashes($_POST[$email_from]);
+			$email_from = $wb->add_slashes($_POST[$email_from]);
 		}
-		$email_subject = $this->strip_slashes_dummy($fetch_settings['email_subject']);
-		$success_message = $this->strip_slashes_dummy($fetch_settings['success_message']);
-		$max_submissions = $this->strip_slashes_dummy($fetch_settings['max_submissions']);
-		$stored_submissions = $this->strip_slashes_dummy($fetch_settings['stored_submissions']);
+		$email_subject = $fetch_settings['email_subject'];
+		$success_message = $fetch_settings['success_message'];
+		$max_submissions = $fetch_settings['max_submissions'];
+		$stored_submissions = $fetch_settings['stored_submissions'];
 	} else {
 		exit($TEXT['UNDER_CONSTRUCTION']);
 	}
@@ -231,11 +231,11 @@
 					} elseif (!is_array($_POST['field'.$field['field_id']])) {
 					$email_body .= '
 					
-	'.$this->strip_slashes_dummy($field['title']).': '.$_POST['field'.$field['field_id']]."\n";
+	'.$field['title'].': '.$_POST['field'.$field['field_id']]."\n";
 					} else {
 						$email_body .= '
 					
-	'.$this->strip_slashes_dummy($field['title']).": \n";
+	'.$field['title'].": \n";
 						foreach ($_POST['field'.$field['field_id']] as $k=>$v) {
 							$email_body .= '
 					
@@ -243,7 +243,7 @@
 						}
 					}
 				} elseif($field['required'] == 1) {
-				$required[] = $this->strip_slashes_dummy($field['title']);
+				$required[] = $field['title'];
 				}
 			}
 		}
@@ -250,7 +250,7 @@
 	}
 	
 	// Addslashes to email body - proposed by Icheb in topic=1170.0
-	// $email_body = $this->add_slashes($email_body);
+	// $email_body = $wb->add_slashes($email_body);
 	
 	// Check if the user forgot to enter values into all the required fields
 	if($required != array()) {
@@ -288,7 +288,7 @@
 			} else {
 				$submitted_by = 0;
 			}
-			$email_body = $this->add_slashes($email_body);
+			$email_body = $wb->add_slashes($email_body);
 			$database->query("INSERT INTO ".TABLE_PREFIX."mod_form_submissions (page_id,section_id,submitted_when,submitted_by,body) VALUES ('".PAGE_ID."','$section_id','".mktime()."','$submitted_by','$email_body')");
 			// Make sure submissions table isn't too full
 			$query_submissions = $database->query("SELECT submission_id FROM ".TABLE_PREFIX."mod_form_submissions ORDER BY submitted_when");
Index: trunk/wb/modules/code/view.php
===================================================================
--- trunk/wb/modules/code/view.php	(revision 105)
+++ trunk/wb/modules/code/view.php	(revision 106)
@@ -26,7 +26,7 @@
 // Get content
 $get_content = $database->query("SELECT content FROM ".TABLE_PREFIX."mod_code WHERE section_id = '$section_id'");
 $fetch_content = $get_content->fetchRow();
-$content = $this->strip_slashes_dummy($fetch_content['content']);
+$content = $fetch_content['content'];
 eval($content);
 
 ?>
\ No newline at end of file
Index: trunk/wb/modules/news/comment_page.php
===================================================================
--- trunk/wb/modules/news/comment_page.php	(revision 105)
+++ trunk/wb/modules/news/comment_page.php	(revision 106)
@@ -35,7 +35,7 @@
 	// Print comments page
 	$vars = array('[POST_TITLE]', '[ACTION_URL]');
 	$values = array(POST_TITLE, WB_URL.'/modules/news/submit_comment.php?page_id='.PAGE_ID.'&section_id='.SECTION_ID.'&post_id='.POST_ID);
-	echo str_replace($vars, $values, $this->strip_slashes_dummy($settings['comments_page']));
+	echo str_replace($vars, $values, ($settings['comments_page']));
 }
 
 ?>
\ No newline at end of file
Index: trunk/wb/modules/news/view.php
===================================================================
--- trunk/wb/modules/news/view.php	(revision 105)
+++ trunk/wb/modules/news/view.php	(revision 106)
@@ -55,7 +55,7 @@
 	while($group = $query_users->fetchRow()) {
 		// Insert user info into users array
 		$group_id = $group['group_id'];
-		$groups[$group_id]['title'] = $this->strip_slashes_dummy($group['title']);
+		$groups[$group_id]['title'] = ($group['title']);
 		$groups[$group_id]['active'] = $group['active'];
 		if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/.news/image'.$group_id.'.jpg')) {
 			$groups[$group_id]['image'] = WB_URL.MEDIA_DIRECTORY.'/.news/image'.$group_id.'.jpg';
@@ -82,9 +82,9 @@
 	$query_settings = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '$section_id'");
 	if($query_settings->numRows() > 0) {
 		$fetch_settings = $query_settings->fetchRow();
-		$setting_header = $this->strip_slashes_dummy($fetch_settings['header']);
-		$setting_post_loop = $this->strip_slashes_dummy($fetch_settings['post_loop']);
-		$setting_footer = $this->strip_slashes_dummy($fetch_settings['footer']);
+		$setting_header = ($fetch_settings['header']);
+		$setting_post_loop = ($fetch_settings['post_loop']);
+		$setting_footer = ($fetch_settings['footer']);
 		$setting_posts_per_page = $fetch_settings['posts_per_page'];
 	} else {
 		$setting_header = '';
@@ -185,14 +185,14 @@
 				if($group_image == '') { $display_image = 'none'; } else { $display_image = ''; }
 				if($group_id == 0) { $display_group = 'none'; } else { $display_group = ''; }
 				// Replace [wblink--PAGE_ID--] with real link
-				$short = $this->strip_slashes_dummy($post['content_short']);
-				$this->preprocess($short);
+				$short = ($post['content_short']);
+				$wb->preprocess($short);
 				// Replace vars with values
 				$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]');
 				if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') {
-					$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $this->strip_slashes_dummy($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, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $TEXT['READ_MORE']);
 				} else {
-					$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $this->strip_slashes_dummy($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, '', '', '', '', $TEXT['READ_MORE']);
 				}
 				echo str_replace($vars, $values, $setting_post_loop);
 			}
@@ -212,11 +212,11 @@
 	$query_settings = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '$section_id'");
 	if($query_settings->numRows() > 0) {
 		$fetch_settings = $query_settings->fetchRow();
-		$setting_post_header = $this->strip_slashes_dummy($fetch_settings['post_header']);
-		$setting_post_footer = $this->strip_slashes_dummy($fetch_settings['post_footer']);
-		$setting_comments_header = $this->strip_slashes_dummy($fetch_settings['comments_header']);
-		$setting_comments_loop = $this->strip_slashes_dummy($fetch_settings['comments_loop']);
-		$setting_comments_footer = $this->strip_slashes_dummy($fetch_settings['comments_footer']);
+		$setting_post_header = ($fetch_settings['post_header']);
+		$setting_post_footer = ($fetch_settings['post_footer']);
+		$setting_comments_header = ($fetch_settings['comments_header']);
+		$setting_comments_loop = ($fetch_settings['comments_loop']);
+		$setting_comments_footer = ($fetch_settings['comments_footer']);
 	} else {
 		$setting_post_header = '';
 		$setting_post_footer = '';
@@ -258,11 +258,11 @@
 			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]');
 			if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') {
-				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $this->strip_slashes_dummy($post['title']), $this->strip_slashes_dummy($post['content_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['content_short']), $page_link, $post_date, $post_time, $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, $this->strip_slashes_dummy($post['title']), $this->strip_slashes_dummy($post['content_short']), $page_link, $post_date, $post_time, '', '', '', '');
+				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, ($post['title']), ($post['content_short']), $page_link, $post_date, $post_time, '', '', '', '');
 			}
-			$post_long = $this->strip_slashes_dummy($post['content_long']);
+			$post_long = ($post['content_long']);
 		}
 	} else {
 		header('Location: '.WB_URL.'/pages/');
@@ -272,7 +272,7 @@
 	echo str_replace($vars, $values, $setting_post_header);
 	
 	// Replace [wblink--PAGE_ID--] with real link
-  	$this->preprocess($postlong);
+  	$wb->preprocess($postlong);
 	// Print long
 	echo $post_long;
 	
@@ -290,8 +290,8 @@
 		if($query_comments->numRows() > 0) {
 			while($comment = $query_comments->fetchRow()) {
 				// Display Comments without slashes, but with new-line characters
-				$comment['comment'] = nl2br($this->strip_slashes_dummy($comment['comment']));
-				$comment['title'] = $this->strip_slashes_dummy($comment['title']);
+				$comment['comment'] = nl2br(($comment['comment']));
+				$comment['title'] = ($comment['title']);
 				// Print comments loop
 				$commented_date = gmdate(DATE_FORMAT, $comment['commented_when']+TIMEZONE);
 				$commented_time = gmdate(TIME_FORMAT, $comment['commented_when']+TIMEZONE);
@@ -298,9 +298,9 @@
 				$uid = $comment['commented_by'];
 				$vars = array('[TITLE]','[COMMENT]','[DATE]','[TIME]','[USER_ID]','[USERNAME]','[DISPLAY_NAME]', '[EMAIL]');
 				if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') {
-					$values = array($this->strip_slashes_dummy($comment['title']), $this->strip_slashes_dummy($comment['comment']), $commented_date, $commented_time, $uid, $this->strip_slashes_dummy($users[$uid]['username']), $this->strip_slashes_dummy($users[$uid]['display_name']), $this->strip_slashes_dummy($users[$uid]['email']));
+					$values = array(($comment['title']), ($comment['comment']), $commented_date, $commented_time, $uid, ($users[$uid]['username']), ($users[$uid]['display_name']), ($users[$uid]['email']));
 				} else {
-					$values = array($this->strip_slashes_dummy($comment['title']), $this->strip_slashes_dummy($comment['comment']), $commented_date, $commented_time, '0', strtolower($TEXT['UNKNOWN']), $TEXT['UNKNOWN'], '');
+					$values = array(($comment['title']), ($comment['comment']), $commented_date, $commented_time, '0', strtolower($TEXT['UNKNOWN']), $TEXT['UNKNOWN'], '');
 				}
 				echo str_replace($vars, $values, $setting_comments_loop);
 			}
Index: trunk/wb/account/logout.php
===================================================================
--- trunk/wb/account/logout.php	(revision 105)
+++ trunk/wb/account/logout.php	(revision 106)
@@ -1,6 +1,6 @@
 <?php
 
-// $Id: logout.php,v 1.4 2005/04/16 01:12:40 rdjurovich Exp $
+// $Id$
 
 /*
 
@@ -25,13 +25,6 @@
 
 require("../config.php");
 
-// Start a session
-if(!defined('SESSION_STARTED')) {
-	session_name(APP_NAME.'_session_id');
-	session_start();
-	define('SESSION_STARTED', true);
-}
-
 $_SESSION['USER_ID'] = null;
 $_SESSION['GROUP_ID'] = null;
 $_SESSION['USERNAME'] = null;
Index: trunk/wb/account/forgot_form.php
===================================================================
--- trunk/wb/account/forgot_form.php	(revision 105)
+++ trunk/wb/account/forgot_form.php	(revision 106)
@@ -36,7 +36,7 @@
 	$email = $_POST['email'];
 	
 	// Check if the email exists in the database
-	$query = "SELECT user_id,username,display_name,email FROM ".TABLE_PREFIX."users WHERE email = '".$this->add_slashes($_POST['email'])."'";
+	$query = "SELECT user_id,username,display_name,email FROM ".TABLE_PREFIX."users WHERE email = '".$wb->add_slashes($_POST['email'])."'";
 	$results = $database->query($query);
 	if($results->numRows() > 0) {
 		// Get the id, username, and email from the above db query
Index: trunk/wb/account/signup2.php
===================================================================
--- trunk/wb/account/signup2.php	(revision 105)
+++ trunk/wb/account/signup2.php	(revision 106)
@@ -75,7 +75,7 @@
 }
 
 // Check if the email already exists
-$results = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE email = '".$this->add_slashes($_POST['email'])."'");
+$results = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE email = '".$wb->add_slashes($_POST['email'])."'");
 if($results->numRows() > 0) {
 	if(isset($MESSAGE['USERS']['EMAIL_TAKEN'])) {
 		$admin->print_error($MESSAGE['USERS']['EMAIL_TAKEN'], $js_back);
Index: trunk/wb/framework/compatibility.php
===================================================================
--- trunk/wb/framework/compatibility.php	(revision 105)
+++ trunk/wb/framework/compatibility.php	(nonexistent)
@@ -1,120 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2005, 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
-
-*/
-
-/*
-	This file is purely for ensuring compatibility with 3rd party
-	contributions made for WB version 2.5.2 or below
-*/
-if(!defined('WB_URL')) {
-	header('Location: ../index.php');
-}
-
-function page_link($link) {
-	global $wb;
-	return $wb->page_link($link);
-}
-
-
-function page_content($block=1) {
-	global $wb;
-	$wb->content($block);
-}
-
-// Old menu call invokes new menu function
-function page_menu($parent = 0, $menu_number = 1, $item_template = '<li><span[class]>[a][menu_title][/a]</span>', $menu_header = '<ul>', $menu_footer = '</ul>', $default_class = ' class="menu_default"', $current_class = ' class="menu_current"', $recurse = LEVEL) {
-	global $wb;
-	$wb->menu_number=$menu_number;
-	$wb->menu_item_template=$item_template;
-	$wb->menu_parent = $parent;
-	$wb->menu_header = $menu_header; 
-	$wb->menu_footer = $menu_footer;
-	$wb->menu_default_class = $default_class;
-	$wb->menu_current_class = $current_class;
-	$wb->menu_recurse = $recurse+2; 	
-	$wb->menu();
-}
-
-// Function for page title
-function page_title($spacer = ' - ', $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]') {
-	global $wb;
-	$wb->page_title($spacer,$template);
-}
-
-// Function for page description
-function page_description() {
-	global $wb;
-	$wb->page_description();
-}
-// Function for page keywords
-function page_keywords() {
-	global $wb;
-	$wb->page_keywords();
-}
-// Function for page header
-function page_header($date_format = 'Y') {
-	global $wb;
-	$wb->page_header($date_format);
-}
-// Function for page footer
-function page_footer($date_format = 'Y') {
-	global $wb;
-	$wb->page_footer($date_format);
-}
-
-// references to objects and variables that changed their names
-
-$admin = &$wb;
-
-$default_link=&$wb->default_link;
-
-$page_trail=&$wb->page_trail;
-$page_description=&$wb->page_description;
-$page_keywords=&$wb->page_keywords;
-$page_link=&$wb->link;
-
-// extra_sql is not used anymore - this is basically a register_globals exploit prevention...
-$extra_sql=&$wb->extra_sql;
-$extra_where_sql=&$wb->extra_where_sql;
-
-
-// Begin WB < 2.4.x template compatibility code
-	// Make extra_sql accessable through private_sql
-	$private_sql = $extra_sql;
-	$private_where_sql = $extra_where_sql;
-	// Query pages for menu
-	$menu1 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '0' AND $extra_where_sql ORDER BY position ASC");
-	// Check if current pages is a parent page and if we need its submenu
-	if(PARENT == 0) {
-		// Get the pages submenu
-		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PAGE_ID."' AND $extra_where_sql ORDER BY position ASC");
-	} else {
-		// Get the pages submenu
-		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PARENT."' AND $extra_where_sql ORDER BY position ASC");
-	}
-// End WB < 2.4.x template compatibility code
-// Include template file
-
-
-?>

Property changes on: trunk/wb/framework/compatibility.php
___________________________________________________________________
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/framework/class.admin.php
===================================================================
--- trunk/wb/framework/class.admin.php	(revision 105)
+++ trunk/wb/framework/class.admin.php	(revision 106)
@@ -38,8 +38,6 @@
 
 require_once(WB_PATH.'/framework/class.wb.php');
 
-//require_once(WB_PATH.'/framework/initialize.php');
-
 // Include PHPLIB template class
 require_once(WB_PATH."/include/phplib/template.inc");
 
@@ -94,7 +92,7 @@
 													'SECTION_NAME' => $MENU[strtoupper($this->section_name)],
 													'INTERFACE_DIR' => ADMIN_URL.'/interface',
 													'BODY_TAGS' => $body_tags,
-													'WEBSITE_TITLE' => $this->strip_slashes_dummy($title['value']),
+													'WEBSITE_TITLE' => ($title['value']),
 													'TEXT_ADMINISTRATION' => $TEXT['ADMINISTRATION'],
 													'VERSION' => VERSION
 													)
Index: trunk/wb/framework/class.wb.php
===================================================================
--- trunk/wb/framework/class.wb.php	(revision 105)
+++ trunk/wb/framework/class.wb.php	(revision 106)
@@ -30,89 +30,14 @@
 This class is the basis for admin and frontend classes.
 
 */
-if (file_exists(WB_PATH.'/framework/class.database.php'))
-	require_once(WB_PATH.'/framework/class.database.php');
-		
 
+require_once(WB_PATH.'/framework/class.database.php');
+
 class wb
 {
 	// General initialization function 
 	// performed when frontend or backend is loaded.
 	function wb() {
-		// set global database variable
-		global $database;
-		// Create database class
-		$this->database = new database();
-		$database=$this->database;
-
-		// Start a session
-		if(!defined('SESSION_STARTED')) {
-			session_name(APP_NAME.'_session_id');
-			session_start();
-			define('SESSION_STARTED', true);
-		}
-
-		set_magic_quotes_runtime(0);
-		
-		// Get website settings (title, keywords, description, header, and footer)
-		$query_settings = "SELECT name,value FROM ".TABLE_PREFIX."settings";
-		$get_settings = $database->query($query_settings);
-		while($setting = $get_settings->fetchRow()) {
-			$setting_name=strtoupper($setting['name']);
-			$setting_value=$setting['value'];
-			if ($setting_value=='false')
-				$setting_value=false;
-			if ($setting_value=='true')
-				$setting_value=true;
-			define($setting_name,$setting_value);
-		}
-		$string_file_mode = STRING_FILE_MODE;
-		define('OCTAL_FILE_MODE',(int) $string_file_mode);
-		$string_dir_mode = STRING_DIR_MODE;
-		define('OCTAL_DIR_MODE',(int) $string_dir_mode);
-		
-		// Get users language
-		if(isset($_GET['lang']) AND $_GET['lang'] != '' AND !is_numeric($_GET['lang']) AND strlen($_GET['lang']) == 2) {
-		  	define('LANGUAGE', strtoupper($_GET['lang']));
-			$_SESSION['LANGUAGE']=LANGUAGE;
-		} else {
-			if(isset($_SESSION['LANGUAGE']) AND $_SESSION['LANGUAGE'] != '') {
-				define('LANGUAGE', $_SESSION['LANGUAGE']);
-			} else {
-				define('LANGUAGE', DEFAULT_LANGUAGE);
-			}
-		}
-
-		// make language variables globally accessible
-		global $language_code, $language_name, $language_author, $language_version, $language_designed_for;
-		global $MENU, $OVERVIEW, $TEXT, $HEADING, $MESSAGE;
-		// Load Language file
-		if(!defined('LANGUAGE_LOADED')) {
-			if(!file_exists(WB_PATH.'/languages/'.LANGUAGE.'.php')) {
-				exit('Error loading language file '.LANGUAGE.', please check configuration');
-			} else {
-				require_once(WB_PATH.'/languages/'.LANGUAGE.'.php');
-			}
-		}
-		
-		// Get users timezone
-		if(isset($_SESSION['TIMEZONE'])) {
-			define('TIMEZONE', $_SESSION['TIMEZONE']);
-		} else {
-			define('TIMEZONE', DEFAULT_TIMEZONE);
-		}
-		// Get users date format
-		if(isset($_SESSION['DATE_FORMAT'])) {
-			define('DATE_FORMAT', $_SESSION['DATE_FORMAT']);
-		} else {
-			define('DATE_FORMAT', DEFAULT_DATE_FORMAT);
-		}
-		// Get users time format
-		if(isset($_SESSION['TIME_FORMAT'])) {
-			define('TIME_FORMAT', $_SESSION['TIME_FORMAT']);
-		} else {
-			define('TIME_FORMAT', DEFAULT_TIME_FORMAT);
-		}
 	}
 
 	// Check whether we should show a page or not (for front-end)
@@ -233,7 +158,7 @@
 
 	// Get the current users display name
 	function get_display_name() {
-		return $this->strip_slashes_dummy($_SESSION['DISPLAY_NAME']);
+		return ($_SESSION['DISPLAY_NAME']);
 	}
 
 	// Get the current users email address
Index: trunk/wb/framework/initialize.php
===================================================================
--- trunk/wb/framework/initialize.php	(nonexistent)
+++ trunk/wb/framework/initialize.php	(revision 106)
@@ -0,0 +1,102 @@
+<?php
+
+// $Id$
+
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2005, 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
+
+*/
+ 
+if (file_exists(WB_PATH.'/framework/class.database.php'))
+{
+	require_once(WB_PATH.'/framework/class.database.php');
+		
+	// Create database class
+	$database = new database();
+	
+	// Start a session
+	if(!defined('SESSION_STARTED')) {
+		session_name(APP_NAME.'_session_id');
+		session_start();
+		define('SESSION_STARTED', true);
+	}
+	
+	set_magic_quotes_runtime(0);
+	
+	// Get website settings (title, keywords, description, header, and footer)
+	$query_settings = "SELECT name,value FROM ".TABLE_PREFIX."settings";
+	$get_settings = $database->query($query_settings);
+	while($setting = $get_settings->fetchRow()) {
+		$setting_name=strtoupper($setting['name']);
+		$setting_value=$setting['value'];
+		if ($setting_value=='false')
+			$setting_value=false;
+		if ($setting_value=='true')
+			$setting_value=true;
+		define($setting_name,$setting_value);
+	}
+	$string_file_mode = STRING_FILE_MODE;
+	define('OCTAL_FILE_MODE',(int) $string_file_mode);
+	$string_dir_mode = STRING_DIR_MODE;
+	define('OCTAL_DIR_MODE',(int) $string_dir_mode);
+	
+	// Get users language
+	if(isset($_GET['lang']) AND $_GET['lang'] != '' AND !is_numeric($_GET['lang']) AND strlen($_GET['lang']) == 2) {
+	  	define('LANGUAGE', strtoupper($_GET['lang']));
+		$_SESSION['LANGUAGE']=LANGUAGE;
+	} else {
+		if(isset($_SESSION['LANGUAGE']) AND $_SESSION['LANGUAGE'] != '') {
+			define('LANGUAGE', $_SESSION['LANGUAGE']);
+		} else {
+			define('LANGUAGE', DEFAULT_LANGUAGE);
+		}
+	}
+	
+	// Load Language file
+	if(!defined('LANGUAGE_LOADED')) {
+		if(!file_exists(WB_PATH.'/languages/'.LANGUAGE.'.php')) {
+			exit('Error loading language file '.LANGUAGE.', please check configuration');
+		} else {
+			require_once(WB_PATH.'/languages/'.LANGUAGE.'.php');
+		}
+	}
+	
+	// Get users timezone
+	if(isset($_SESSION['TIMEZONE'])) {
+		define('TIMEZONE', $_SESSION['TIMEZONE']);
+	} else {
+		define('TIMEZONE', DEFAULT_TIMEZONE);
+	}
+	// Get users date format
+	if(isset($_SESSION['DATE_FORMAT'])) {
+		define('DATE_FORMAT', $_SESSION['DATE_FORMAT']);
+	} else {
+		define('DATE_FORMAT', DEFAULT_DATE_FORMAT);
+	}
+	// Get users time format
+	if(isset($_SESSION['TIME_FORMAT'])) {
+		define('TIME_FORMAT', $_SESSION['TIME_FORMAT']);
+	} else {
+		define('TIME_FORMAT', DEFAULT_TIME_FORMAT);
+	}
+	
+	
+}
+?>

Property changes on: trunk/wb/framework/initialize.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/framework/class.frontend.php
===================================================================
--- trunk/wb/framework/class.frontend.php	(revision 105)
+++ trunk/wb/framework/class.frontend.php	(revision 106)
@@ -75,7 +75,7 @@
 				$content = fread($handle, filesize($filename));
 				fclose($handle);
 				$this->preprocess($content);
-				echo $this->strip_slashes_dummy($content);
+				echo ($content);
 				return false;
 			}
 		}
@@ -143,10 +143,10 @@
 			// Page ID
 			define('PAGE_ID', $this->page['page_id']);
 			// Page Title
-			define('PAGE_TITLE', $this->strip_slashes_dummy($this->page['page_title']));
+			define('PAGE_TITLE', ($this->page['page_title']));
 			$this->page_title=PAGE_TITLE;
 			// Menu Title
-			$menu_title = $this->strip_slashes_dummy($this->page['menu_title']);
+			$menu_title = ($this->page['menu_title']);
 			if($menu_title != '') {
 				define('MENU_TITLE', $menu_title);
 			} else {
@@ -278,47 +278,48 @@
 	}
 	
 	function menu() {
-	   if (!isset($this->menu_number)) {
-	   	$this->menu_number = 1;
+		global $wb;
+	   if (!isset($wb->menu_number)) {
+	   	$wb->menu_number = 1;
 	   }
-	   if (!isset($this->menu_start_level)) {
-	   	$this->menu_start_level = 0;
+	   if (!isset($wb->menu_start_level)) {
+	   	$wb->menu_start_level = 0;
 	   }
-	   if (!isset($this->menu_recurse)) {
-	   	$this->menu_recurse = -1;
+	   if (!isset($wb->menu_recurse)) {
+	   	$wb->menu_recurse = -1;
 	   }
-	   if (!isset($this->menu_collapse)) {
-	   	$this->menu_collapse = true;
+	   if (!isset($wb->menu_collapse)) {
+	   	$wb->menu_collapse = true;
 	   }
-	   if (!isset($this->menu_item_template)) {
-	   	$this->menu_item_template = '<li><span[class]>[a][menu_title][/a]</span>';
+	   if (!isset($wb->menu_item_template)) {
+	   	$wb->menu_item_template = '<li><span[class]>[a][menu_title][/a]</span>';
 	   }
-	   if (!isset($this->menu_item_footer)) {
-	   	$this->menu_item_footer = '</li>';
+	   if (!isset($wb->menu_item_footer)) {
+	   	$wb->menu_item_footer = '</li>';
 	   }
-	   if (!isset($this->menu_header)) {
-	   	$this->menu_header = '<ul>';
+	   if (!isset($wb->menu_header)) {
+	   	$wb->menu_header = '<ul>';
 	   }
-	   if (!isset($this->menu_footer)) {
-	   	$this->menu_footer = '<ul>';
+	   if (!isset($wb->menu_footer)) {
+	   	$wb->menu_footer = '<ul>';
 	   }
-	   if (!isset($this->menu_default_class)) {
-	   	$this->menu_default_class = ' class="menu_default"';
+	   if (!isset($wb->menu_default_class)) {
+	   	$wb->menu_default_class = ' class="menu_default"';
 	   }
-	   if (!isset($this->menu_current_class)) {
-	   	$this->menu_current_class = ' class="menu_current"';
+	   if (!isset($wb->menu_current_class)) {
+	   	$wb->menu_current_class = ' class="menu_current"';
 	   }
-       if (!isset($this->menu_parent)) {
-     	$this->menu_parent = 0;
+       if (!isset($wb->menu_parent)) {
+     	$wb->menu_parent = 0;
 	   }
-	   $this->show_menu();
+	   $wb->show_menu();
 	   if ($start_level>0) {
-	       $key_array=array_keys($this->page_trail);
+	       $key_array=array_keys($wb->page_trail);
 	       $real_start=$key_array[$start_level-1];
 	       if (isset($real_start))
 	       {
-	       		$this->menu_parent=$real_start;
-	          $this->show_menu();
+	       	$wb->menu_parent=$real_start;
+	        $wb->show_menu();
 	       }
 	       return;
 	   }
@@ -327,21 +328,22 @@
 	
 	function show_menu() {
 	   global $database;
-	   if ($this->menu_recurse==0)
+	   global $wb;
+	   if ($wb->menu_recurse==0)
 	       return;
 	   // Check if we should add menu number check to query
 	   if($menu_parent == 0) {
-	       $menu_number = "menu = '$this->menu_number'";
+	       $menu_number = "menu = '$wb->menu_number'";
 	   } else {
 	      $menu_number = '1';
 	   }
 	   // Query pages
 	   $query_menu = $database->query("SELECT page_id,menu_title,page_title,link,target,level,visibility FROM ".
-	TABLE_PREFIX."pages WHERE parent = '$this->menu_parent' AND $menu_number AND $this->extra_where_sql ORDER BY position ASC");
+	TABLE_PREFIX."pages WHERE parent = '$wb->menu_parent' AND $menu_number AND $wb->extra_where_sql ORDER BY position ASC");
 	   // Check if there are any pages to show
 	   if($query_menu->numRows() > 0) {
 	   	  // Print menu header
-	   	  echo "\n".$this->menu_header;
+	   	  echo "\n".$wb->menu_header;
 	      // Loop through pages
 	      while($page = $query_menu->fetchRow()) {
 	      	 // Check if this page should be shown
@@ -349,130 +351,34 @@
 	         $vars = array('[class]','[a]', '[/a]', '[menu_title]', '[page_title]');
 	         // Work-out class
 	         if($page['page_id'] == PAGE_ID) {
-	            $class = $this->menu_current_class;
+	            $class = $wb->menu_current_class;
 	         } else {
-	            $class = $this->menu_default_class;
+	            $class = $wb->menu_default_class;
 	         }
 	         // Check if link is same as first page link, and if so change to WB URL
-	         if($page['link'] == $this->default_link AND !INTRO_PAGE) {
+	         if($page['link'] == $wb->default_link AND !INTRO_PAGE) {
 	            $link = WB_URL;
 	         } else {
-	            $link = $this->page_link($page['link']);
+	            $link = $wb->page_link($page['link']);
 	         }
 	         // Create values
-	         $values = array($class,'<a href="'.$link.'" target="'.$page['target'].'" '.$class.'>', '</a>', $this->strip_slashes_dummy($page['menu_title']), $this->strip_slashes_dummy($page['page_title']));
+	         $values = array($class,'<a href="'.$link.'" target="'.$page['target'].'" '.$class.'>', '</a>', ($page['menu_title']), ($page['page_title']));
 	         // Replace vars with value and print
-	         echo "\n".str_replace($vars, $values, $this->menu_item_template);
+	         echo "\n".str_replace($vars, $values, $wb->menu_item_template);
 	         // Generate sub-menu
-	         if($this->menu_collapse==false OR ($this->menu_collapse==true AND isset($this->page_trail[$page['page_id']]))) {
-	            $this->menu_recurse--;
-	            $this->menu_parent=$page['page_id'];
-	            $this->show_menu();
+	         if($wb->menu_collapse==false OR ($wb->menu_collapse==true AND isset($wb->page_trail[$page['page_id']]))) {
+	            $wb->menu_recurse--;
+	            $wb->menu_parent=$page['page_id'];
+	            $wb->show_menu();
 	         }
-	         echo "\n".$this->menu_item_footer;
+	         echo "\n".$wb->menu_item_footer;
 	      }
 	      // Print menu footer
-	      echo "\n".$this->menu_footer;
+	      echo "\n".$wb->menu_footer;
 	   }
 	}
 
-	function content($block = 1) {
-		// Get outside objects
-		global $TEXT,$MENU,$HEADING,$MESSAGE;
-		global $globals;
-		global $database;
-		$admin = & $this;
-		if ($this->page_access_denied==true) {
-            echo $MESSAGE['FRONTEND']['SORRY_NO_VIEWING_PERMISSIONS'];
-			exit();
-		}
-		if(isset($globals) AND is_array($globals)) { foreach($globals AS $global_name) { global $$global_name; } }
-		// Make sure block is numeric
-		if(!is_numeric($block)) { $block = 1; }
-		// Include page content
-		if(!defined('PAGE_CONTENT') OR $block!=1) {
-			if ($this->page_id==0) {
-				if ($this->default_block_content=='none') {
-					return;
-				}
-				if (is_numeric($this->default_block_content)) {
-					$page_id=$this->default_block_content;
-				} else {
-					$page_id=$this->default_page-id;
-				}				
-			} else {
-				$page_id=$this->page_id;
-			}
-			// First get all sections for this page
-			$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '".$page_id."' AND block = '$block' ORDER BY position");
-			if($query_sections->numRows() > 0) {
-				// Loop through them and include there modules file
-				while($section = $query_sections->fetchRow()) {
-					$section_id = $section['section_id'];
-					$module = $section['module'];
-					require(WB_PATH.'/modules/'.$module.'/view.php');
-				}
-			}
-		} else {
-			require(PAGE_CONTENT);
-		}
-	}
 
-	function breadcrumbs($sep=' > ',$tier=1,$links=true) {
-		$page_id=&$this->page_id;
-		if ($page_id!=0)
-		{
-	 		global $database;
-			$bca=&$this->page_trail;
-			if (sizeof($bca)==0)
-			        create_breadcrumbs($page_id);
-			$counter=0;
-			foreach ($bca as $temp)
-			{
-		        if ($counter>=(tier-1));
-		        {
-					if ($counter>=$tier) echo $sep;
-					$query_menu=$database->query("SELECT menu_title,link FROM ".TABLE_PREFIX."pages WHERE page_id=$temp");
-					$page=$query_menu->fetchRow();
-					if ($links==true AND $temp!=$page_id)
-						echo '<a href="'.page_link($page['link']).'">'.$page['menu_title'].'</a>';
-					else
-					        echo stripslashes($page['menu_title']);
-		        }
-                $counter++;
-			}
-		}
-	}
-
-	// Function for page title
-	function page_title($spacer = ' - ', $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]') {
-		$vars = array('[WEBSITE_TITLE]', '[PAGE_TITLE]', '[MENU_TITLE]', '[SPACER]');
-		$values = array(WEBSITE_TITLE, PAGE_TITLE, MENU_TITLE, $spacer);
-		echo str_replace($vars, $values, $template);
-	}
-
-	// Function for page description
-	function page_description() {
-		echo WEBSITE_DESCRIPTION;
-	}
-	// Function for page keywords
-	function page_keywords() {
-		echo WEBSITE_KEYWORDS;
-	}
-	// Function for page header
-	function page_header($date_format = 'Y') {
-		echo WEBSITE_HEADER;
-	}
-
-	// Function for page footer
-	function page_footer($date_format = 'Y') {
-		global $starttime;
-   		$vars = array('[YEAR]', '[PROCESSTIME]');
-   		$processtime=(microtime()>$starttime)?microtime()-$starttime:microtime()-$starttime+1;
-		$values = array(date($date_format),$processtime);
-		echo str_replace($vars, $values, WEBSITE_FOOTER);
-	}
-
 	// Function to show the "Under Construction" page
 	function print_under_construction() {
 		global $MESSAGE;
Index: trunk/wb/framework/frontend.functions.php
===================================================================
--- trunk/wb/framework/frontend.functions.php	(nonexistent)
+++ trunk/wb/framework/frontend.functions.php	(revision 106)
@@ -0,0 +1,189 @@
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2005, 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
+
+*/
+
+/*
+	This file is purely for ensuring compatibility with 3rd party
+	contributions made for WB version 2.5.2 or below
+*/
+if(!defined('WB_URL')) {
+	header('Location: ../index.php');
+}
+
+// references to objects and variables that changed their names
+
+$admin = &$wb;
+
+$default_link=&$wb->default_link;
+
+$page_trail=&$wb->page_trail;
+$page_description=&$wb->page_description;
+$page_keywords=&$wb->page_keywords;
+$page_link=&$wb->link;
+
+// extra_sql is not used anymore - this is basically a register_globals exploit prevention...
+$extra_sql=&$wb->extra_sql;
+$extra_where_sql=&$wb->extra_where_sql;
+
+// compatibility code
+function page_link($link) {
+	global $wb;
+	return $wb->page_link($link);
+}
+
+// Old menu call invokes new menu function
+function page_menu($parent = 0, $menu_number = 1, $item_template = '<li><span[class]>[a][menu_title][/a]</span>', $menu_header = '<ul>', $menu_footer = '</ul>', $default_class = ' class="menu_default"', $current_class = ' class="menu_current"', $recurse = LEVEL) {
+	global $wb;
+	$wb->menu_number=$menu_number;
+	$wb->menu_item_template=$item_template;
+	$wb->menu_parent = $parent;
+	$wb->menu_header = $menu_header; 
+	$wb->menu_footer = $menu_footer;
+	$wb->menu_default_class = $default_class;
+	$wb->menu_current_class = $current_class;
+	$wb->menu_recurse = $recurse+2; 	
+	$wb->menu();
+}
+
+function page_content($block = 1) {
+	// Get outside objects
+	global $TEXT,$MENU,$HEADING,$MESSAGE;
+	global $globals;
+	global $database;
+	$admin = & $this;
+	global $wb;
+	if ($wb->page_access_denied==true) {
+        echo $MESSAGE['FRONTEND']['SORRY_NO_VIEWING_PERMISSIONS'];
+		exit();
+	}
+	if(isset($globals) AND is_array($globals)) { foreach($globals AS $global_name) { global $$global_name; } }
+	// Make sure block is numeric
+	if(!is_numeric($block)) { $block = 1; }
+	// Include page content
+	if(!defined('PAGE_CONTENT') OR $block!=1) {
+		if ($wb->page_id==0) {
+			if ($wb->default_block_content=='none') {
+				return;
+			}
+			if (is_numeric($wb->default_block_content)) {
+				$page_id=$wb->default_block_content;
+			} else {
+				$page_id=$wb->default_page-id;
+			}				
+		} else {
+			$page_id=$wb->page_id;
+		}
+		// First get all sections for this page
+		$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '".$page_id."' AND block = '$block' ORDER BY position");
+		if($query_sections->numRows() > 0) {
+			// Loop through them and include there modules file
+			while($section = $query_sections->fetchRow()) {
+				$section_id = $section['section_id'];
+				$module = $section['module'];
+				require(WB_PATH.'/modules/'.$module.'/view.php');
+			}
+		}
+	} else {
+		require(PAGE_CONTENT);
+	}
+}
+
+function show_content($block=1) {
+	page_content($block);
+}
+
+function show_breadcrumbs($sep=' > ',$tier=1,$links=true) {
+	$page_id=&$wb->page_id;
+	if ($page_id!=0)
+	{
+ 		global $database;
+		$bca=&$wb->page_trail;
+		if (sizeof($bca)==0)
+		        create_breadcrumbs($page_id);
+		$counter=0;
+		foreach ($bca as $temp)
+		{
+	        if ($counter>=(tier-1));
+	        {
+				if ($counter>=$tier) echo $sep;
+				$query_menu=$database->query("SELECT menu_title,link FROM ".TABLE_PREFIX."pages WHERE page_id=$temp");
+				$page=$query_menu->fetchRow();
+				if ($links==true AND $temp!=$page_id)
+					echo '<a href="'.page_link($page['link']).'">'.$page['menu_title'].'</a>';
+				else
+				        echo stripslashes($page['menu_title']);
+	        }
+            $counter++;
+		}
+	}
+}
+
+// Function for page title
+function page_title($spacer = ' - ', $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]') {
+	$vars = array('[WEBSITE_TITLE]', '[PAGE_TITLE]', '[MENU_TITLE]', '[SPACER]');
+	$values = array(WEBSITE_TITLE, PAGE_TITLE, MENU_TITLE, $spacer);
+	echo str_replace($vars, $values, $template);
+}
+
+// Function for page description
+function page_description() {
+	echo WEBSITE_DESCRIPTION;
+}
+// Function for page keywords
+function page_keywords() {
+	echo WEBSITE_KEYWORDS;
+}
+// Function for page header
+function page_header($date_format = 'Y') {
+	echo WEBSITE_HEADER;
+}
+
+// Function for page footer
+function page_footer($date_format = 'Y') {
+	global $starttime;
+	$vars = array('[YEAR]', '[PROCESSTIME]');
+	$processtime=(microtime()>$starttime)?microtime()-$starttime:microtime()-$starttime+1;
+	$values = array(date($date_format),$processtime);
+	echo str_replace($vars, $values, WEBSITE_FOOTER);
+}
+
+// Begin WB < 2.4.x template compatibility code
+	// Make extra_sql accessable through private_sql
+	$private_sql = $extra_sql;
+	$private_where_sql = $extra_where_sql;
+	// Query pages for menu
+	$menu1 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '0' AND $extra_where_sql ORDER BY position ASC");
+	// Check if current pages is a parent page and if we need its submenu
+	if(PARENT == 0) {
+		// Get the pages submenu
+		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PAGE_ID."' AND $extra_where_sql ORDER BY position ASC");
+	} else {
+		// Get the pages submenu
+		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PARENT."' AND $extra_where_sql ORDER BY position ASC");
+	}
+// End WB < 2.4.x template compatibility code
+// Include template file
+
+
+?>

Property changes on: trunk/wb/framework/frontend.functions.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/wb/index.php
===================================================================
--- trunk/wb/index.php	(revision 105)
+++ trunk/wb/index.php	(revision 106)
@@ -36,7 +36,7 @@
 require_once(WB_PATH.'/framework/class.frontend.php');
 // Create new frontend object
 // Perform general initializations
-$wb = & new frontend();
+if (!isset($wb)) $wb = new frontend();
 
 // Figure out which page to display
 // Stop processing if intro page was shown
@@ -49,8 +49,9 @@
 // Collect general website settings
 $wb->get_website_settings();
 
-// Load some ugly compatibility code
-require(WB_PATH.'/framework/compatibility.php');
+// Load functions available to templates, modules and code sections
+// also, set some aliases for backward compatibility
+require(WB_PATH.'/framework/frontend.functions.php');
 
 // Display the template
 require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
