Index: trunk/wb/admin/pages/index.php
===================================================================
--- trunk/wb/admin/pages/index.php	(revision 241)
+++ trunk/wb/admin/pages/index.php	(revision 242)
@@ -223,7 +223,7 @@
 				</td>
 				<td width="20">
 					<?php if($page['visibility'] != 'deleted' AND $page['visibility'] != 'none') { ?>
-					<a href="<?php echo page_link($page['link']); ?>" target="_blank">
+					<a href="<?php echo $admin->page_link($page['link']); ?>" target="_blank">
 						<img src="<?php echo ADMIN_URL; ?>/images/view_16.png" border="0" alt="<?php echo $TEXT['VIEW']; ?>" />
 					</a>
 					<?php } ?>
Index: trunk/wb/modules/news/submit_comment.php
===================================================================
--- trunk/wb/modules/news/submit_comment.php	(revision 241)
+++ trunk/wb/modules/news/submit_comment.php	(revision 242)
@@ -26,15 +26,6 @@
 // Include config file
 require('../../config.php');
 
-// Include admin class
-require_once(WB_PATH.'/framework/class.admin.php');
-$admin = new admin('Start', 'start', false, false);
-
-// Include WB functions file
-if(!defined('FUNCTIONS_CLASS_LOADED')) {
-	require(WB_PATH.'/framework/functions.php');
-}
-
 // Check if we should show the form or add a comment
 if(is_numeric($_GET['page_id']) AND is_numeric($_GET['section_id']) AND isset($_GET['post_id']) AND is_numeric($_GET['post_id']) AND isset($_POST['comment']) AND $_POST['comment'] != '') {
 	
@@ -42,11 +33,11 @@
 	$page_id = $_GET['page_id'];
 	$section_id = $_GET['section_id'];
 	$post_id = $_GET['post_id'];
-	$title = $admin->add_slashes(strip_tags($_POST['title']));
-	$comment = $admin->add_slashes(strip_tags($_POST['comment']));
+	$title = $wb->add_slashes(strip_tags($_POST['title']));
+	$comment = $wb->add_slashes(strip_tags($_POST['comment']));
 	$commented_when = mktime();
-	if(isset($admin) AND $admin->is_authenticated() == true) {
-		$commented_by = $admin->get_user_id();
+	if($wb->is_authenticated() == true) {
+		$commented_by = $wb->get_user_id();
 	} else {
 		$commented_by = '';
 	}
@@ -54,7 +45,7 @@
 	// Get page link
 	$query_page = $database->query("SELECT link FROM ".TABLE_PREFIX."mod_news_posts WHERE post_id = '$post_id'");
 	$page = $query_page->fetchRow();
-	header('Location: '.page_link($page['link']).'?id='.$post_id);
+	header('Location: '.$wb->page_link($page['link']).'?id='.$post_id);
 	
 } else {
 	header('Location: '.WB_URL.'/pages/');
Index: trunk/wb/framework/class.wb.php
===================================================================
--- trunk/wb/framework/class.wb.php	(revision 241)
+++ trunk/wb/framework/class.wb.php	(revision 242)
@@ -95,6 +95,15 @@
 		return str_replace("\\","\\\\",$input);
 	}
 
+	function page_link($link){
+		// Check for :// in the link (used in URL's) as well as mailto:
+		if(strstr($link, '://') == '' AND substr($link, 0, 7) != 'mailto:') {
+			return WB_URL.PAGES_DIRECTORY.$link.PAGE_EXTENSION;
+		} else {
+			return $link;
+		}
+	}
+	
 	// Get POST data
 	function get_post($field) {
 		if(isset($_POST[$field])) {
@@ -186,4 +195,4 @@
 
 	
 }
-?>
+?>
\ No newline at end of file
Index: trunk/wb/framework/class.frontend.php
===================================================================
--- trunk/wb/framework/class.frontend.php	(revision 241)
+++ trunk/wb/framework/class.frontend.php	(revision 242)
@@ -131,7 +131,6 @@
 			$this->page = $get_page->fetchRow();
 			// Check if the page language is also the selected language. If not, send headers again.
 			if ($this->page['language']!=LANGUAGE) {
-				require_once(WB_PATH.'/framework/functions.php');
 				header('Location: '.$this->page_link($this->page['link']).'?lang='.$this->page['language']);
 				exit();
 			}
@@ -249,15 +248,6 @@
 		}
 	}
 	
-	function page_link($link){
-		// Check for :// in the link (used in URL's) as well as mailto:
-		if(strstr($link, '://') == '' AND substr($link, 0, 7) != 'mailto:') {
-			return WB_URL.PAGES_DIRECTORY.$link.PAGE_EXTENSION;
-		} else {
-			return $link;
-		}
-	}
-	
 	function preprocess(&$content) {
 		global $database;
 		// Replace [wblink--PAGE_ID--] with real link
Index: trunk/wb/framework/functions.php
===================================================================
--- trunk/wb/framework/functions.php	(revision 241)
+++ trunk/wb/framework/functions.php	(revision 242)
@@ -405,12 +405,8 @@
 // Function to work out a page link
 if(!function_exists('page_link')) {
 	function page_link($link) {
-		// Check for :// in the link (used in URL's) as well as mailto:
-		if(strstr($link, '://') == '' AND substr($link, 0, 7) != 'mailto:') {
-			return WB_URL.PAGES_DIRECTORY.$link.PAGE_EXTENSION;
-		} else {
-			return $link;
-		}
+		global $admin;
+		return $admin->page_link($link);
 	}
 }
 
